Timer Interface

Overview

Timer Interface. Moreā€¦

// typedefs

typedef struct _snd_timer_id snd_timer_id_t;
typedef struct _snd_timer_ginfo snd_timer_ginfo_t;
typedef struct _snd_timer_gparams snd_timer_gparams_t;
typedef struct _snd_timer_gstatus snd_timer_gstatus_t;
typedef struct _snd_timer_info snd_timer_info_t;
typedef struct _snd_timer_params snd_timer_params_t;
typedef struct _snd_timer_status snd_timer_status_t;
typedef struct _snd_timer_query snd_timer_query_t;
typedef struct _snd_timer snd_timer_t;

// enums

enum snd_timer_class_t;
enum snd_timer_event_t;
enum snd_timer_slave_class_t;
enum snd_timer_type_t;

// structs

struct snd_timer_read_t;
struct snd_timer_tread_t;

// global functions

int
snd_timer_query_open(
    snd_timer_query_t** handle,
    const char* name,
    int mode
);

int
snd_timer_query_open_lconf(
    snd_timer_query_t** handle,
    const char* name,
    int mode,
    snd_config_t* lconf
);

int
snd_timer_query_close(snd_timer_query_t* handle);

int
snd_timer_query_next_device(
    snd_timer_query_t* handle,
    snd_timer_id_t* tid
);

int
snd_timer_query_info(
    snd_timer_query_t* handle,
    snd_timer_ginfo_t* info
);

int
snd_timer_query_params(
    snd_timer_query_t* handle,
    snd_timer_gparams_t* params
);

int
snd_timer_query_status(
    snd_timer_query_t* handle,
    snd_timer_gstatus_t* status
);

int
snd_timer_open(
    snd_timer_t** handle,
    const char* name,
    int mode
);

int
snd_timer_open_lconf(
    snd_timer_t** handle,
    const char* name,
    int mode,
    snd_config_t* lconf
);

int
snd_timer_close(snd_timer_t* handle);

int
snd_async_add_timer_handler(
    snd_async_handler_t** handler,
    snd_timer_t* timer,
    snd_async_callback_t callback,
    void* private_data
);

snd_timer_t*
snd_async_handler_get_timer(snd_async_handler_t* handler);

int
snd_timer_poll_descriptors_count(snd_timer_t* handle);

int
snd_timer_poll_descriptors(
    snd_timer_t* handle,
    struct pollfd* pfds,
    unsigned int space
);

int
snd_timer_poll_descriptors_revents(
    snd_timer_t* timer,
    struct pollfd* pfds,
    unsigned int nfds,
    unsigned short* revents
);

int
snd_timer_info(
    snd_timer_t* handle,
    snd_timer_info_t* timer
);

int
snd_timer_params(
    snd_timer_t* handle,
    snd_timer_params_t* params
);

int
snd_timer_status(
    snd_timer_t* handle,
    snd_timer_status_t* status
);

int
snd_timer_start(snd_timer_t* handle);

int
snd_timer_stop(snd_timer_t* handle);

int
snd_timer_continue(snd_timer_t* handle);

ssize_t
snd_timer_read(
    snd_timer_t* handle,
    void* buffer,
    size_t size
);

size_t
snd_timer_id_sizeof(void);

int
snd_timer_id_malloc(snd_timer_id_t** ptr);

void
snd_timer_id_free(snd_timer_id_t* obj);

void
snd_timer_id_copy(
    snd_timer_id_t* dst,
    const snd_timer_id_t* src
);

void
snd_timer_id_set_class(
    snd_timer_id_t* id,
    int dev_class
);

int
snd_timer_id_get_class(snd_timer_id_t* id);

void
snd_timer_id_set_sclass(
    snd_timer_id_t* id,
    int dev_sclass
);

int
snd_timer_id_get_sclass(snd_timer_id_t* id);

void
snd_timer_id_set_card(
    snd_timer_id_t* id,
    int card
);

int
snd_timer_id_get_card(snd_timer_id_t* id);

void
snd_timer_id_set_device(
    snd_timer_id_t* id,
    int device
);

int
snd_timer_id_get_device(snd_timer_id_t* id);

void
snd_timer_id_set_subdevice(
    snd_timer_id_t* id,
    int subdevice
);

int
snd_timer_id_get_subdevice(snd_timer_id_t* id);

size_t
snd_timer_ginfo_sizeof(void);

int
snd_timer_ginfo_malloc(snd_timer_ginfo_t** ptr);

void
snd_timer_ginfo_free(snd_timer_ginfo_t* obj);

void
snd_timer_ginfo_copy(
    snd_timer_ginfo_t* dst,
    const snd_timer_ginfo_t* src
);

int
snd_timer_ginfo_set_tid(
    snd_timer_ginfo_t* obj,
    snd_timer_id_t* tid
);

snd_timer_id_t*
snd_timer_ginfo_get_tid(snd_timer_ginfo_t* obj);

unsigned int
snd_timer_ginfo_get_flags(snd_timer_ginfo_t* obj);

int
snd_timer_ginfo_get_card(snd_timer_ginfo_t* obj);

char*
snd_timer_ginfo_get_id(snd_timer_ginfo_t* obj);

char*
snd_timer_ginfo_get_name(snd_timer_ginfo_t* obj);

unsigned long
snd_timer_ginfo_get_resolution(snd_timer_ginfo_t* obj);

unsigned long
snd_timer_ginfo_get_resolution_min(snd_timer_ginfo_t* obj);

unsigned long
snd_timer_ginfo_get_resolution_max(snd_timer_ginfo_t* obj);

unsigned int
snd_timer_ginfo_get_clients(snd_timer_ginfo_t* obj);

size_t
snd_timer_info_sizeof(void);

int
snd_timer_info_malloc(snd_timer_info_t** ptr);

void
snd_timer_info_free(snd_timer_info_t* obj);

void
snd_timer_info_copy(
    snd_timer_info_t* dst,
    const snd_timer_info_t* src
);

int
snd_timer_info_is_slave(snd_timer_info_t* info);

int
snd_timer_info_get_card(snd_timer_info_t* info);

const char*
snd_timer_info_get_id(snd_timer_info_t* info);

const char*
snd_timer_info_get_name(snd_timer_info_t* info);

long
snd_timer_info_get_resolution(snd_timer_info_t* info);

size_t
snd_timer_params_sizeof(void);

int
snd_timer_params_malloc(snd_timer_params_t** ptr);

void
snd_timer_params_free(snd_timer_params_t* obj);

void
snd_timer_params_copy(
    snd_timer_params_t* dst,
    const snd_timer_params_t* src
);

int
snd_timer_params_set_auto_start(
    snd_timer_params_t* params,
    int auto_start
);

int
snd_timer_params_get_auto_start(snd_timer_params_t* params);

int
snd_timer_params_set_exclusive(
    snd_timer_params_t* params,
    int exclusive
);

int
snd_timer_params_get_exclusive(snd_timer_params_t* params);

int
snd_timer_params_set_early_event(
    snd_timer_params_t* params,
    int early_event
);

int
snd_timer_params_get_early_event(snd_timer_params_t* params);

void
snd_timer_params_set_ticks(
    snd_timer_params_t* params,
    long ticks
);

long
snd_timer_params_get_ticks(snd_timer_params_t* params);

void
snd_timer_params_set_queue_size(
    snd_timer_params_t* params,
    long queue_size
);

long
snd_timer_params_get_queue_size(snd_timer_params_t* params);

void
snd_timer_params_set_filter(
    snd_timer_params_t* params,
    unsigned int filter
);

unsigned int
snd_timer_params_get_filter(snd_timer_params_t* params);

size_t
snd_timer_status_sizeof(void);

int
snd_timer_status_malloc(snd_timer_status_t** ptr);

void
snd_timer_status_free(snd_timer_status_t* obj);

void
snd_timer_status_copy(
    snd_timer_status_t* dst,
    const snd_timer_status_t* src
);

snd_htimestamp_t
snd_timer_status_get_timestamp(snd_timer_status_t* status);

long
snd_timer_status_get_resolution(snd_timer_status_t* status);

long
snd_timer_status_get_lost(snd_timer_status_t* status);

long
snd_timer_status_get_overrun(snd_timer_status_t* status);

long
snd_timer_status_get_queue(snd_timer_status_t* status);

long
snd_timer_info_get_ticks(snd_timer_info_t* info);

// macros

#define SND_TIMER_DLSYM_VERSION
#define SND_TIMER_GLOBAL_HPET
#define SND_TIMER_GLOBAL_HRTIMER
#define SND_TIMER_GLOBAL_RTC
#define SND_TIMER_GLOBAL_SYSTEM
#define SND_TIMER_OPEN_NONBLOCK
#define SND_TIMER_OPEN_TREAD
#define SND_TIMER_QUERY_DLSYM_VERSION
#define snd_timer_ginfo_alloca(ptr)
#define snd_timer_id_alloca(ptr)
#define snd_timer_info_alloca(ptr)
#define snd_timer_params_alloca(ptr)
#define snd_timer_status_alloca(ptr)

Detailed Documentation

Timer Interface. See Timer interface page for more details.

Typedefs

typedef struct _snd_timer_id snd_timer_id_t

timer identification structure

typedef struct _snd_timer_ginfo snd_timer_ginfo_t

timer global info structure

typedef struct _snd_timer_gparams snd_timer_gparams_t

timer global params structure

typedef struct _snd_timer_gstatus snd_timer_gstatus_t

timer global status structure

typedef struct _snd_timer_info snd_timer_info_t

timer info structure

typedef struct _snd_timer_params snd_timer_params_t

timer params structure

typedef struct _snd_timer_status snd_timer_status_t

timer status structure

typedef struct _snd_timer_query snd_timer_query_t

timer query handle

typedef struct _snd_timer snd_timer_t

timer handle

Global Functions

int
snd_timer_query_open(
    snd_timer_query_t** handle,
    const char* name,
    int mode
)

Opens a new connection to the timer query interface.

Opens a new connection to the RawMidi interface specified with an ASCII identifier and mode.

Parameters:

timer Returned handle (NULL if not wanted)
name ASCII identifier of the RawMidi handle
mode Open mode

Returns:

0 on success otherwise a negative error code

int
snd_timer_query_open_lconf(
    snd_timer_query_t** handle,
    const char* name,
    int mode,
    snd_config_t* lconf
)

Opens a new connection to the timer query interface using local configuration.

Opens a new connection to the RawMidi interface specified with an ASCII identifier and mode.

Parameters:

timer Returned handle (NULL if not wanted)
name ASCII identifier of the RawMidi handle
mode Open mode
lconf Local configuration

Returns:

0 on success otherwise a negative error code

int
snd_timer_query_close(snd_timer_query_t* handle)

close timer query handle

Closes the specified timer handle and frees all associated resources.

Parameters:

timer timer handle

Returns:

0 on success otherwise a negative error code

int
snd_timer_query_next_device(
    snd_timer_query_t* handle,
    snd_timer_id_t* tid
)

obtain the next timer identification

if tid->dev_class is -1, then the first device is returned if result tid->dev_class is -1, no more devices are left

Parameters:

timer timer handle
tid timer identification

Returns:

0 on success otherwise a negative error code

int
snd_timer_query_info(
    snd_timer_query_t* handle,
    snd_timer_ginfo_t* info
)

obtain the timer global information

Parameters:

timer timer handle
info timer information

Returns:

0 on success otherwise a negative error code

int
snd_timer_query_params(
    snd_timer_query_t* handle,
    snd_timer_gparams_t* params
)

set the timer global parameters

Parameters:

timer timer handle
params timer parameters

Returns:

0 on success otherwise a negative error code

int
snd_timer_query_status(
    snd_timer_query_t* handle,
    snd_timer_gstatus_t* status
)

get the timer global status

Parameters:

timer timer handle
status timer status

Returns:

0 on success otherwise a negative error code

int
snd_timer_open(
    snd_timer_t** handle,
    const char* name,
    int mode
)

Opens a new connection to the timer interface.

Opens a new connection to the timer interface specified with an ASCII identifier and mode.

Parameters:

timer Returned handle (NULL if not wanted)
name ASCII identifier of the timer handle
mode Open mode

Returns:

0 on success otherwise a negative error code

int
snd_timer_open_lconf(
    snd_timer_t** handle,
    const char* name,
    int mode,
    snd_config_t* lconf
)

Opens a new connection to the timer interface using local configuration.

Opens a new connection to the timer interface specified with an ASCII identifier and mode.

Parameters:

timer Returned handle (NULL if not wanted)
name ASCII identifier of the timer handle
mode Open mode
lconf Local configuration

Returns:

0 on success otherwise a negative error code

int
snd_timer_close(snd_timer_t* handle)

close timer handle

Closes the specified timer handle and frees all associated resources.

Parameters:

timer timer handle

Returns:

0 on success otherwise a negative error code

int
snd_async_add_timer_handler(
    snd_async_handler_t** handler,
    snd_timer_t* timer,
    snd_async_callback_t callback,
    void* private_data
)

Add an async handler for a timer.

The asynchronous callback is called when new timer event occurs.

Parameters:

handler Returned handler handle
timer timer handle
callback Callback function
private_data Callback private data

Returns:

0 otherwise a negative error code on failure

snd_timer_t*
snd_async_handler_get_timer(snd_async_handler_t* handler)

Return timer handle related to an async handler.

Parameters:

handler Async handler handle

Returns:

timer handle

int
snd_timer_poll_descriptors_count(snd_timer_t* handle)

get count of poll descriptors for timer handle

Parameters:

timer timer handle

Returns:

count of poll descriptors

int
snd_timer_poll_descriptors(
    snd_timer_t* handle,
    struct pollfd* pfds,
    unsigned int space
)

get poll descriptors

Parameters:

timer timer handle
pfds array of poll descriptors
space space in the poll descriptor array

Returns:

count of filled descriptors

int
snd_timer_poll_descriptors_revents(
    snd_timer_t* timer,
    struct pollfd* pfds,
    unsigned int nfds,
    unsigned short* revents
)

get returned events from poll descriptors

Parameters:

timer timer handle
pfds array of poll descriptors
nfds count of poll descriptors
revents returned events

Returns:

zero if success, otherwise a negative error code

int
snd_timer_info(
    snd_timer_t* handle,
    snd_timer_info_t* timer
)

get information about timer handle

Parameters:

timer timer handle
info pointer to a snd_timer_info_t structure to be filled

Returns:

0 on success otherwise a negative error code

int
snd_timer_params(
    snd_timer_t* handle,
    snd_timer_params_t* params
)

set parameters for timer handle

Parameters:

timer timer handle
params pointer to a snd_timer_params_t structure

Returns:

0 on success otherwise a negative error code

int
snd_timer_status(
    snd_timer_t* handle,
    snd_timer_status_t* status
)

get status from timer handle

Parameters:

timer timer handle
status pointer to a snd_timer_status_t structure to be filled

Returns:

0 on success otherwise a negative error code

int
snd_timer_start(snd_timer_t* handle)

start the timer

Parameters:

timer timer handle

Returns:

0 on success otherwise a negative error code

int
snd_timer_stop(snd_timer_t* handle)

stop the timer

Parameters:

timer timer handle

Returns:

0 on success otherwise a negative error code

int
snd_timer_continue(snd_timer_t* handle)

continue the timer

Parameters:

timer timer handle

Returns:

0 on success otherwise a negative error code

ssize_t
snd_timer_read(
    snd_timer_t* handle,
    void* buffer,
    size_t size
)

read bytes using timer handle

Parameters:

timer timer handle
buffer buffer to store the input bytes
size input buffer size in bytes
size_t
snd_timer_id_sizeof(void)

get size of the snd_timer_id_t structure in bytes

Returns:

size of the snd_timer_id_t structure in bytes

int
snd_timer_id_malloc(snd_timer_id_t** ptr)

allocate a new snd_timer_id_t structure

Allocates a new snd_timer_id_t structure using the standard malloc C library function.

Parameters:

info returned pointer

Returns:

0 on success otherwise a negative error code if fails

void
snd_timer_id_free(snd_timer_id_t* obj)

frees the snd_timer_id_t structure

Frees the given snd_timer_id_t structure using the standard free C library function.

Parameters:

info pointer to the snd_timer_id_t structure to free
void
snd_timer_id_copy(
    snd_timer_id_t* dst,
    const snd_timer_id_t* src
)

copy one snd_timer_id_t structure to another

Parameters:

dst destination snd_timer_id_t structure
src source snd_timer_id_t structure
void
snd_timer_id_set_class(
    snd_timer_id_t* id,
    int dev_class
)

set timer class

Parameters:

tid pointer to snd_timer_id_t structure
dev_class class of timer device
int
snd_timer_id_get_class(snd_timer_id_t* id)

get timer class

Parameters:

tid pointer to snd_timer_id_t structure

Returns:

timer class

void
snd_timer_id_set_sclass(
    snd_timer_id_t* id,
    int dev_sclass
)

set timer sub-class

Parameters:

tid pointer to snd_timer_id_t structure
dev_sclass sub-class of timer device
int
snd_timer_id_get_sclass(snd_timer_id_t* id)

get timer sub-class

Parameters:

tid pointer to snd_timer_id_t structure

Returns:

timer sub-class

void
snd_timer_id_set_card(
    snd_timer_id_t* id,
    int card
)

set timer card

Parameters:

tid pointer to snd_timer_id_t structure
card card number
int
snd_timer_id_get_card(snd_timer_id_t* id)

get timer card

Parameters:

tid pointer to snd_timer_id_t structure

Returns:

timer card number

void
snd_timer_id_set_device(
    snd_timer_id_t* id,
    int device
)

set timer device

Parameters:

tid pointer to snd_timer_id_t structure
device device number
int
snd_timer_id_get_device(snd_timer_id_t* id)

get timer device

Parameters:

tid pointer to snd_timer_id_t structure

Returns:

timer device number

void
snd_timer_id_set_subdevice(
    snd_timer_id_t* id,
    int subdevice
)

set timer subdevice

Parameters:

tid pointer to snd_timer_id_t structure
subdevice subdevice number
int
snd_timer_id_get_subdevice(snd_timer_id_t* id)

get timer subdevice

Parameters:

tid pointer to snd_timer_id_t structure

Returns:

timer subdevice number

size_t
snd_timer_ginfo_sizeof(void)

get size of the snd_timer_ginfo_t structure in bytes

Returns:

size of the snd_timer_ginfo_t structure in bytes

int
snd_timer_ginfo_malloc(snd_timer_ginfo_t** ptr)

allocate a new snd_timer_ginfo_t structure

Allocates a new snd_timer_info_t structure using the standard malloc C library function.

Parameters:

info returned pointer

Returns:

0 on success otherwise a negative error code if fails

void
snd_timer_ginfo_free(snd_timer_ginfo_t* obj)

frees the snd_timer_ginfo_t structure

Frees the given snd_timer_info_t structure using the standard free C library function.

Parameters:

info pointer to the snd_timer_ginfo_t structure to free
void
snd_timer_ginfo_copy(
    snd_timer_ginfo_t* dst,
    const snd_timer_ginfo_t* src
)

copy one snd_timer_info_t structure to another

Parameters:

dst destination snd_timer_info_t structure
src source snd_timer_info_t structure
int
snd_timer_ginfo_set_tid(
    snd_timer_ginfo_t* obj,
    snd_timer_id_t* tid
)

set timer identification

Parameters:

obj pointer to snd_timer_ginfo_t structure
tid pointer to snd_timer_id_t structure

Returns:

zero on success otherwise a negative error number

snd_timer_id_t*
snd_timer_ginfo_get_tid(snd_timer_ginfo_t* obj)

get timer identification

Parameters:

obj pointer to snd_timer_ginfo_t structure

Returns:

pointer to snd_timer_id_t

unsigned int
snd_timer_ginfo_get_flags(snd_timer_ginfo_t* obj)

get timer flags

Parameters:

obj pointer to snd_timer_ginfo_t structure

Returns:

timer flags

int
snd_timer_ginfo_get_card(snd_timer_ginfo_t* obj)

get associated card with timer

Parameters:

obj pointer to snd_timer_ginfo_t structure

Returns:

associated card

char*
snd_timer_ginfo_get_id(snd_timer_ginfo_t* obj)

get timer identification

Parameters:

obj pointer to snd_timer_ginfo_t structure

Returns:

timer identification

char*
snd_timer_ginfo_get_name(snd_timer_ginfo_t* obj)

get timer name

Parameters:

obj pointer to snd_timer_ginfo_t structure

Returns:

timer name

unsigned long
snd_timer_ginfo_get_resolution(snd_timer_ginfo_t* obj)

get timer resolution in ns

Parameters:

obj pointer to snd_timer_ginfo_t structure

Returns:

timer resolution in ns

unsigned long
snd_timer_ginfo_get_resolution_min(snd_timer_ginfo_t* obj)

get timer minimal resolution in ns

Parameters:

obj pointer to snd_timer_ginfo_t structure

Returns:

timer minimal resolution in ns

unsigned long
snd_timer_ginfo_get_resolution_max(snd_timer_ginfo_t* obj)

get timer maximal resolution in ns

Parameters:

obj pointer to snd_timer_ginfo_t structure

Returns:

timer maximal resolution in ns

unsigned int
snd_timer_ginfo_get_clients(snd_timer_ginfo_t* obj)

get current timer clients

Parameters:

obj pointer to snd_timer_ginfo_t structure

Returns:

current timer clients

size_t
snd_timer_info_sizeof(void)

get size of the snd_timer_info_t structure in bytes

Returns:

size of the snd_timer_info_t structure in bytes

int
snd_timer_info_malloc(snd_timer_info_t** ptr)

allocate a new snd_timer_info_t structure

Allocates a new snd_timer_info_t structure using the standard malloc C library function.

Parameters:

info returned pointer

Returns:

0 on success otherwise a negative error code if fails

void
snd_timer_info_free(snd_timer_info_t* obj)

frees the snd_timer_info_t structure

Frees the given snd_timer_info_t structure using the standard free C library function.

Parameters:

info pointer to the snd_timer_info_t structure to free
void
snd_timer_info_copy(
    snd_timer_info_t* dst,
    const snd_timer_info_t* src
)

copy one snd_timer_info_t structure to another

Parameters:

dst destination snd_timer_info_t structure
src source snd_timer_info_t structure
int
snd_timer_info_is_slave(snd_timer_info_t* info)

determine, if timer is slave

Parameters:

info pointer to snd_timer_info_t structure

Returns:

nonzero if timer is slave

int
snd_timer_info_get_card(snd_timer_info_t* info)

get timer card

Parameters:

info pointer to snd_timer_info_t structure

Returns:

timer card number

const char*
snd_timer_info_get_id(snd_timer_info_t* info)

get timer id

Parameters:

info pointer to snd_timer_info_t structure

Returns:

timer id

const char*
snd_timer_info_get_name(snd_timer_info_t* info)

get timer name

Parameters:

info pointer to snd_timer_info_t structure

Returns:

timer name

long
snd_timer_info_get_resolution(snd_timer_info_t* info)

get timer resolution in us

Parameters:

info pointer to snd_timer_info_t structure

Returns:

timer resolution

size_t
snd_timer_params_sizeof(void)

get size of the snd_timer_params_t structure in bytes

Returns:

size of the snd_timer_params_t structure in bytes

int
snd_timer_params_malloc(snd_timer_params_t** ptr)

allocate a new snd_timer_params_t structure

Allocates a new snd_timer_params_t structure using the standard malloc C library function.

Parameters:

params returned pointer

Returns:

0 on success otherwise a negative error code if fails

void
snd_timer_params_free(snd_timer_params_t* obj)

frees the snd_timer_params_t structure

Frees the given snd_timer_params_t structure using the standard free C library function.

Parameters:

params pointer to the snd_timer_params_t structure to free
void
snd_timer_params_copy(
    snd_timer_params_t* dst,
    const snd_timer_params_t* src
)

copy one snd_timer_params_t structure to another

Parameters:

dst destination snd_timer_params_t structure
src source snd_timer_params_t structure
int
snd_timer_params_set_auto_start(
    snd_timer_params_t* params,
    int auto_start
)

set timer auto start

Parameters:

params pointer to snd_timer_params_t structure
auto_start The boolean value to set
int
snd_timer_params_get_auto_start(snd_timer_params_t* params)

determine if timer has auto start flag

Parameters:

params pointer to snd_timer_params_t structure

Returns:

nonzero if timer has auto start flag

int
snd_timer_params_set_exclusive(
    snd_timer_params_t* params,
    int exclusive
)

set timer exclusive use

Parameters:

params pointer to snd_timer_params_t structure
exclusive The boolean value to set
int
snd_timer_params_get_exclusive(snd_timer_params_t* params)

determine if timer has exclusive flag

Parameters:

params pointer to snd_timer_params_t structure

Returns:

nonzero if timer has exclusive flag

int
snd_timer_params_set_early_event(
    snd_timer_params_t* params,
    int early_event
)

set timer early event

Parameters:

params pointer to snd_timer_params_t structure
early_event The boolean value to set
int
snd_timer_params_get_early_event(snd_timer_params_t* params)

determine if timer has early event flag

Parameters:

params pointer to snd_timer_params_t structure

Returns:

nonzero if timer has early event flag set

void
snd_timer_params_set_ticks(
    snd_timer_params_t* params,
    long ticks
)

set timer ticks

Parameters:

params pointer to snd_timer_params_t structure
ticks Ticks to set
long
snd_timer_params_get_ticks(snd_timer_params_t* params)

get timer ticks

Parameters:

params pointer to snd_timer_params_t structure

Returns:

timer ticks

void
snd_timer_params_set_queue_size(
    snd_timer_params_t* params,
    long queue_size
)

set timer queue size (32-1024)

Parameters:

params pointer to snd_timer_params_t structure
queue_size The queue size to set
long
snd_timer_params_get_queue_size(snd_timer_params_t* params)

get queue size

Parameters:

params pointer to snd_timer_params_t structure

Returns:

queue size

void
snd_timer_params_set_filter(
    snd_timer_params_t* params,
    unsigned int filter
)

set timer event filter

Parameters:

params pointer to snd_timer_params_t structure
filter The event filter bits to set
unsigned int
snd_timer_params_get_filter(snd_timer_params_t* params)

get timer event filter

Parameters:

params pointer to snd_timer_params_t structure

Returns:

timer event filter

size_t
snd_timer_status_sizeof(void)

get size of the snd_timer_status_t structure in bytes

Returns:

size of the snd_timer_status_t structure in bytes

int
snd_timer_status_malloc(snd_timer_status_t** ptr)

allocate a new snd_timer_status_t structure

Allocates a new snd_timer_status_t structure using the standard malloc C library function.

Parameters:

status returned pointer

Returns:

0 on success otherwise a negative error code if fails

void
snd_timer_status_free(snd_timer_status_t* obj)

frees the snd_timer_status_t structure

Frees the given snd_timer_status_t structure using the standard free C library function.

Parameters:

status pointer to the snd_timer_status_t structure to free
void
snd_timer_status_copy(
    snd_timer_status_t* dst,
    const snd_timer_status_t* src
)

copy one snd_timer_status_t structure to another

Parameters:

dst destination snd_timer_status_t structure
src source snd_timer_status_t structure
snd_htimestamp_t
snd_timer_status_get_timestamp(snd_timer_status_t* status)

get timestamp

Parameters:

status pointer to snd_timer_status_t structure

Returns:

timestamp

long
snd_timer_status_get_resolution(snd_timer_status_t* status)

get resolution in us

Parameters:

status pointer to snd_timer_status_t structure

Returns:

resolution

long
snd_timer_status_get_lost(snd_timer_status_t* status)

get master tick lost count

Parameters:

status pointer to snd_timer_status_t structure

Returns:

master tick lost count

long
snd_timer_status_get_overrun(snd_timer_status_t* status)

get overrun count

Parameters:

status pointer to snd_timer_status_t structure

Returns:

overrun count

long
snd_timer_status_get_queue(snd_timer_status_t* status)

get count of used queue elements

Parameters:

status pointer to snd_timer_status_t structure

Returns:

count of used queue elements

long
snd_timer_info_get_ticks(snd_timer_info_t* info)

(DEPRECATED) get maximum timer ticks

Parameters:

info pointer to snd_timer_info_t structure

Returns:

maximum timer ticks

Macros

#define SND_TIMER_DLSYM_VERSION

dlsym version for interface entry callback

#define SND_TIMER_GLOBAL_HPET

global timer - HPET

#define SND_TIMER_GLOBAL_HRTIMER

global timer - HRTIMER

#define SND_TIMER_GLOBAL_RTC

global timer - RTC

#define SND_TIMER_GLOBAL_SYSTEM

global timer - system

#define SND_TIMER_OPEN_NONBLOCK

timer open mode flag - non-blocking behaviour

#define SND_TIMER_OPEN_TREAD

use timestamps and event notification - enhanced read

#define SND_TIMER_QUERY_DLSYM_VERSION

dlsym version for interface entry callback

#define snd_timer_ginfo_alloca(ptr)

allocate snd_timer_ginfo_t container on stack

#define snd_timer_id_alloca(ptr)

allocate snd_timer_id_t container on stack

#define snd_timer_info_alloca(ptr)

allocate snd_timer_info_t container on stack

#define snd_timer_params_alloca(ptr)

allocate snd_timer_params_t container on stack

#define snd_timer_status_alloca(ptr)

allocate snd_timer_status_t container on stack