ALSA project - the C library reference
|
Timer Interface. More...
Functions | |
int | snd_timer_open (snd_timer_t **timer, const char *name, int mode) |
Opens a new connection to the timer interface. | |
int | snd_timer_open_lconf (snd_timer_t **timer, const char *name, int mode, snd_config_t *lconf) |
Opens a new connection to the timer interface using local configuration. | |
int | snd_timer_close (snd_timer_t *timer) |
close timer handle | |
const char * | snd_timer_name (snd_timer_t *timer) |
get identifier of timer handle | |
snd_timer_type_t | snd_timer_type (snd_timer_t *timer) |
get type of timer handle | |
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. | |
snd_timer_t * | snd_async_handler_get_timer (snd_async_handler_t *handler) |
Return timer handle related to an async handler. | |
int | snd_timer_poll_descriptors_count (snd_timer_t *timer) |
get count of poll descriptors for timer handle | |
int | snd_timer_poll_descriptors (snd_timer_t *timer, struct pollfd *pfds, unsigned int space) |
get poll 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 | |
int | snd_timer_nonblock (snd_timer_t *timer, int nonblock) |
set nonblock mode | |
size_t | snd_timer_info_sizeof () |
get size of the snd_timer_info_t structure in bytes | |
int | snd_timer_info_malloc (snd_timer_info_t **info) |
allocate a new snd_timer_info_t structure | |
void | snd_timer_info_free (snd_timer_info_t *info) |
frees the snd_timer_info_t structure | |
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 | |
int | snd_timer_info_is_slave (snd_timer_info_t *info) |
determine, if timer is slave | |
int | snd_timer_info_get_card (snd_timer_info_t *info) |
get timer card | |
const char * | snd_timer_info_get_id (snd_timer_info_t *info) |
get timer id | |
const char * | snd_timer_info_get_name (snd_timer_info_t *info) |
get timer name | |
long | snd_timer_info_get_resolution (snd_timer_info_t *info) |
get timer resolution in us | |
int | snd_timer_info (snd_timer_t *timer, snd_timer_info_t *info) |
get information about timer handle | |
size_t | snd_timer_params_sizeof () |
get size of the snd_timer_params_t structure in bytes | |
int | snd_timer_params_malloc (snd_timer_params_t **params) |
allocate a new snd_timer_params_t structure | |
void | snd_timer_params_free (snd_timer_params_t *params) |
frees the snd_timer_params_t structure | |
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 | |
int | snd_timer_params_set_auto_start (snd_timer_params_t *params, int auto_start) |
set timer auto start | |
int | snd_timer_params_get_auto_start (snd_timer_params_t *params) |
determine if timer has auto start flag | |
int | snd_timer_params_set_exclusive (snd_timer_params_t *params, int exclusive) |
set timer exclusive use | |
int | snd_timer_params_get_exclusive (snd_timer_params_t *params) |
determine if timer has exclusive flag | |
int | snd_timer_params_set_early_event (snd_timer_params_t *params, int early_event) |
set timer early event | |
int | snd_timer_params_get_early_event (snd_timer_params_t *params) |
determine if timer has early event flag | |
void | snd_timer_params_set_ticks (snd_timer_params_t *params, long ticks) |
set timer ticks | |
long | snd_timer_params_get_ticks (snd_timer_params_t *params) |
get timer ticks | |
void | snd_timer_params_set_queue_size (snd_timer_params_t *params, long queue_size) |
set timer queue size (32-1024) | |
long | snd_timer_params_get_queue_size (snd_timer_params_t *params) |
get queue size | |
void | snd_timer_params_set_filter (snd_timer_params_t *params, unsigned int filter) |
set timer event filter | |
unsigned int | snd_timer_params_get_filter (snd_timer_params_t *params) |
get timer event filter | |
int | snd_timer_params (snd_timer_t *timer, snd_timer_params_t *params) |
set parameters for timer handle | |
size_t | snd_timer_status_sizeof () |
get size of the snd_timer_status_t structure in bytes | |
int | snd_timer_status_malloc (snd_timer_status_t **status) |
allocate a new snd_timer_status_t structure | |
void | snd_timer_status_free (snd_timer_status_t *status) |
frees the snd_timer_status_t structure | |
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 | |
snd_htimestamp_t | snd_timer_status_get_timestamp (snd_timer_status_t *status) |
get timestamp | |
long | snd_timer_status_get_resolution (snd_timer_status_t *status) |
get resolution in us | |
long | snd_timer_status_get_lost (snd_timer_status_t *status) |
get master tick lost count | |
long | snd_timer_status_get_overrun (snd_timer_status_t *status) |
get overrun count | |
long | snd_timer_status_get_queue (snd_timer_status_t *status) |
get count of used queue elements | |
int | snd_timer_status (snd_timer_t *timer, snd_timer_status_t *status) |
get status from timer handle | |
int | snd_timer_start (snd_timer_t *timer) |
start the timer | |
int | snd_timer_stop (snd_timer_t *timer) |
stop the timer | |
int | snd_timer_continue (snd_timer_t *timer) |
continue the timer | |
ssize_t | snd_timer_read (snd_timer_t *timer, void *buffer, size_t size) |
read bytes using timer handle | |
long | snd_timer_info_get_ticks (snd_timer_info_t *info) |
(DEPRECATED) get maximum timer ticks | |
Timer Interface.
Timer Interface is designed to access timers. See Timer interface page for more details.
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.
handler | Returned handler handle |
timer | timer handle |
callback | Callback function |
private_data | Callback private data |
The asynchronous callback is called when new timer event occurs.
snd_timer_t * snd_async_handler_get_timer | ( | snd_async_handler_t * | handler | ) |
Return timer handle related to an async handler.
handler | Async handler handle |
int snd_timer_close | ( | snd_timer_t * | timer | ) |
close timer handle
timer | timer handle |
Closes the specified timer handle and frees all associated resources.
int snd_timer_continue | ( | snd_timer_t * | timer | ) |
continue the timer
timer | timer handle |
int snd_timer_info | ( | snd_timer_t * | timer, |
snd_timer_info_t * | info ) |
get information about timer handle
timer | timer handle |
info | pointer to a snd_timer_info_t structure to be filled |
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
dst | destination snd_timer_info_t structure |
src | source snd_timer_info_t structure |
void snd_timer_info_free | ( | snd_timer_info_t * | info | ) |
frees the snd_timer_info_t structure
info | pointer to the snd_timer_info_t structure to free |
Frees the given snd_timer_info_t structure using the standard free C library function.
int snd_timer_info_get_card | ( | snd_timer_info_t * | info | ) |
get timer card
info | pointer to #snd_timer_info_t structure |
const char * snd_timer_info_get_id | ( | snd_timer_info_t * | info | ) |
get timer id
info | pointer to #snd_timer_info_t structure |
const char * snd_timer_info_get_name | ( | snd_timer_info_t * | info | ) |
get timer name
info | pointer to #snd_timer_info_t structure |
long snd_timer_info_get_resolution | ( | snd_timer_info_t * | info | ) |
get timer resolution in us
info | pointer to #snd_timer_info_t structure |
long snd_timer_info_get_ticks | ( | snd_timer_info_t * | info | ) |
(DEPRECATED) get maximum timer ticks
info | pointer to #snd_timer_info_t structure |
int snd_timer_info_is_slave | ( | snd_timer_info_t * | info | ) |
determine, if timer is slave
info | pointer to #snd_timer_info_t structure |
int snd_timer_info_malloc | ( | snd_timer_info_t ** | info | ) |
allocate a new snd_timer_info_t structure
info | returned pointer |
Allocates a new snd_timer_info_t structure using the standard malloc C library function.
size_t snd_timer_info_sizeof | ( | ) |
get size of the snd_timer_info_t structure in bytes
const char * snd_timer_name | ( | snd_timer_t * | timer | ) |
get identifier of timer handle
timer | a timer handle |
Returns the ASCII identifier of given timer handle. It's the same identifier specified in snd_timer_open().
int snd_timer_nonblock | ( | snd_timer_t * | timer, |
int | nonblock ) |
set nonblock mode
timer | timer handle |
nonblock | 0 = block, 1 = nonblock mode |
int snd_timer_open | ( | snd_timer_t ** | timer, |
const char * | name, | ||
int | mode ) |
Opens a new connection to the timer interface.
timer | Returned handle (NULL if not wanted) |
name | ASCII identifier of the timer handle |
mode | Open mode |
Opens a new connection to the timer interface specified with an ASCII identifier and mode.
int snd_timer_open_lconf | ( | snd_timer_t ** | timer, |
const char * | name, | ||
int | mode, | ||
snd_config_t * | lconf ) |
Opens a new connection to the timer interface using local configuration.
timer | Returned handle (NULL if not wanted) |
name | ASCII identifier of the timer handle |
mode | Open mode |
lconf | Local configuration |
Opens a new connection to the timer interface specified with an ASCII identifier and mode.
int snd_timer_params | ( | snd_timer_t * | timer, |
snd_timer_params_t * | params ) |
set parameters for timer handle
timer | timer handle |
params | pointer to a #snd_timer_params_t structure |
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
dst | destination snd_timer_params_t structure |
src | source snd_timer_params_t structure |
void snd_timer_params_free | ( | snd_timer_params_t * | params | ) |
frees the snd_timer_params_t structure
params | pointer to the snd_timer_params_t structure to free |
Frees the given snd_timer_params_t structure using the standard free C library function.
int snd_timer_params_get_auto_start | ( | snd_timer_params_t * | params | ) |
determine if timer has auto start flag
params | pointer to #snd_timer_params_t structure |
int snd_timer_params_get_early_event | ( | snd_timer_params_t * | params | ) |
determine if timer has early event flag
params | pointer to #snd_timer_params_t structure |
int snd_timer_params_get_exclusive | ( | snd_timer_params_t * | params | ) |
determine if timer has exclusive flag
params | pointer to #snd_timer_params_t structure |
unsigned int snd_timer_params_get_filter | ( | snd_timer_params_t * | params | ) |
get timer event filter
params | pointer to #snd_timer_params_t structure |
long snd_timer_params_get_queue_size | ( | snd_timer_params_t * | params | ) |
get queue size
params | pointer to #snd_timer_params_t structure |
long snd_timer_params_get_ticks | ( | snd_timer_params_t * | params | ) |
get timer ticks
params | pointer to #snd_timer_params_t structure |
int snd_timer_params_malloc | ( | snd_timer_params_t ** | params | ) |
allocate a new snd_timer_params_t structure
params | returned pointer |
Allocates a new snd_timer_params_t structure using the standard malloc C library function.
int snd_timer_params_set_auto_start | ( | snd_timer_params_t * | params, |
int | auto_start ) |
set timer auto start
params | pointer to #snd_timer_params_t structure |
auto_start | The boolean value to set |
int snd_timer_params_set_early_event | ( | snd_timer_params_t * | params, |
int | early_event ) |
set timer early event
params | pointer to #snd_timer_params_t structure |
early_event | The boolean value to set |
int snd_timer_params_set_exclusive | ( | snd_timer_params_t * | params, |
int | exclusive ) |
set timer exclusive use
params | pointer to #snd_timer_params_t structure |
exclusive | The boolean value to set |
void snd_timer_params_set_filter | ( | snd_timer_params_t * | params, |
unsigned int | filter ) |
set timer event filter
params | pointer to #snd_timer_params_t structure |
filter | The event filter bits to set |
void snd_timer_params_set_queue_size | ( | snd_timer_params_t * | params, |
long | queue_size ) |
set timer queue size (32-1024)
params | pointer to #snd_timer_params_t structure |
queue_size | The queue size to set |
void snd_timer_params_set_ticks | ( | snd_timer_params_t * | params, |
long | ticks ) |
set timer ticks
params | pointer to #snd_timer_params_t structure |
ticks | Ticks to set |
size_t snd_timer_params_sizeof | ( | ) |
get size of the snd_timer_params_t structure in bytes
int snd_timer_poll_descriptors | ( | snd_timer_t * | timer, |
struct pollfd * | pfds, | ||
unsigned int | space ) |
get poll descriptors
timer | timer handle |
pfds | array of poll descriptors |
space | space in the poll descriptor array |
int snd_timer_poll_descriptors_count | ( | snd_timer_t * | timer | ) |
get count of poll descriptors for timer handle
timer | timer handle |
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
timer | timer handle |
pfds | array of poll descriptors |
nfds | count of poll descriptors |
revents | returned events |
ssize_t snd_timer_read | ( | snd_timer_t * | timer, |
void * | buffer, | ||
size_t | size ) |
read bytes using timer handle
timer | timer handle |
buffer | buffer to store the input bytes |
size | input buffer size in bytes |
int snd_timer_start | ( | snd_timer_t * | timer | ) |
start the timer
timer | timer handle |
int snd_timer_status | ( | snd_timer_t * | timer, |
snd_timer_status_t * | status ) |
get status from timer handle
timer | timer handle |
status | pointer to a #snd_timer_status_t structure to be filled |
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
dst | destination snd_timer_status_t structure |
src | source snd_timer_status_t structure |
void snd_timer_status_free | ( | snd_timer_status_t * | status | ) |
frees the snd_timer_status_t structure
status | pointer to the snd_timer_status_t structure to free |
Frees the given snd_timer_status_t structure using the standard free C library function.
long snd_timer_status_get_lost | ( | snd_timer_status_t * | status | ) |
get master tick lost count
status | pointer to #snd_timer_status_t structure |
long snd_timer_status_get_overrun | ( | snd_timer_status_t * | status | ) |
get overrun count
status | pointer to #snd_timer_status_t structure |
long snd_timer_status_get_queue | ( | snd_timer_status_t * | status | ) |
get count of used queue elements
status | pointer to #snd_timer_status_t structure |
long snd_timer_status_get_resolution | ( | snd_timer_status_t * | status | ) |
get resolution in us
status | pointer to #snd_timer_status_t structure |
snd_htimestamp_t snd_timer_status_get_timestamp | ( | snd_timer_status_t * | status | ) |
get timestamp
status | pointer to #snd_timer_status_t structure |
int snd_timer_status_malloc | ( | snd_timer_status_t ** | status | ) |
allocate a new snd_timer_status_t structure
status | returned pointer |
Allocates a new snd_timer_status_t structure using the standard malloc C library function.
size_t snd_timer_status_sizeof | ( | ) |
get size of the snd_timer_status_t structure in bytes
int snd_timer_stop | ( | snd_timer_t * | timer | ) |
stop the timer
timer | timer handle |
snd_timer_type_t snd_timer_type | ( | snd_timer_t * | timer | ) |
get type of timer handle
timer | a timer handle |
Returns the type #snd_timer_type_t of given timer handle.