ALSA project - the C library reference
|
HCTL Interface - High Level CTL. More...
Functions | |
int | snd_hctl_open (snd_hctl_t **hctlp, const char *name, int mode) |
Opens an HCTL. | |
int | snd_hctl_open_ctl (snd_hctl_t **hctlp, snd_ctl_t *ctl) |
Opens an HCTL. | |
int | snd_hctl_close (snd_hctl_t *hctl) |
close HCTL handle | |
const char * | snd_hctl_name (snd_hctl_t *hctl) |
get identifier of HCTL handle | |
int | snd_hctl_nonblock (snd_hctl_t *hctl, int nonblock) |
set nonblock mode | |
int | snd_hctl_async (snd_hctl_t *hctl, int sig, pid_t pid) |
set async mode | |
int | snd_hctl_poll_descriptors_count (snd_hctl_t *hctl) |
get count of poll descriptors for HCTL handle | |
int | snd_hctl_poll_descriptors (snd_hctl_t *hctl, struct pollfd *pfds, unsigned int space) |
get poll descriptors | |
int | snd_hctl_poll_descriptors_revents (snd_hctl_t *hctl, struct pollfd *pfds, unsigned int nfds, unsigned short *revents) |
get returned events from poll descriptors | |
int | snd_hctl_free (snd_hctl_t *hctl) |
free HCTL loaded elements | |
int | snd_hctl_set_compare (snd_hctl_t *hctl, snd_hctl_compare_t compare) |
Change HCTL compare function and reorder elements. | |
int | snd_hctl_compare_fast (const snd_hctl_elem_t *c1, const snd_hctl_elem_t *c2) |
A "don't care" fast compare functions that may be used with snd_hctl_set_compare. | |
snd_hctl_elem_t * | snd_hctl_first_elem (snd_hctl_t *hctl) |
get first element for an HCTL | |
snd_hctl_elem_t * | snd_hctl_last_elem (snd_hctl_t *hctl) |
get last element for an HCTL | |
snd_hctl_elem_t * | snd_hctl_elem_next (snd_hctl_elem_t *elem) |
get next HCTL element | |
snd_hctl_elem_t * | snd_hctl_elem_prev (snd_hctl_elem_t *elem) |
get previous HCTL element | |
snd_hctl_elem_t * | snd_hctl_find_elem (snd_hctl_t *hctl, const snd_ctl_elem_id_t *id) |
Search an HCTL element. | |
int | snd_hctl_load (snd_hctl_t *hctl) |
Load an HCTL with all elements and sort them. | |
void | snd_hctl_set_callback (snd_hctl_t *hctl, snd_hctl_callback_t callback) |
Set callback function for an HCTL. | |
void | snd_hctl_set_callback_private (snd_hctl_t *hctl, void *callback_private) |
Set callback private value for an HCTL. | |
void * | snd_hctl_get_callback_private (snd_hctl_t *hctl) |
Get callback private value for an HCTL. | |
unsigned int | snd_hctl_get_count (snd_hctl_t *hctl) |
Get number of loaded elements for an HCTL. | |
int | snd_hctl_wait (snd_hctl_t *hctl, int timeout) |
Wait for a HCTL to become ready (i.e. at least one event pending) | |
snd_ctl_t * | snd_hctl_ctl (snd_hctl_t *hctl) |
Get a ctl handle associated to the given hctl handle. | |
int | snd_hctl_handle_events (snd_hctl_t *hctl) |
Handle pending HCTL events invoking callbacks. | |
int | snd_hctl_elem_info (snd_hctl_elem_t *elem, snd_ctl_elem_info_t *info) |
Get information for an HCTL element. | |
int | snd_hctl_elem_read (snd_hctl_elem_t *elem, snd_ctl_elem_value_t *value) |
Get value for an HCTL element. | |
int | snd_hctl_elem_write (snd_hctl_elem_t *elem, snd_ctl_elem_value_t *value) |
Set value for an HCTL element. | |
int | snd_hctl_elem_tlv_read (snd_hctl_elem_t *elem, unsigned int *tlv, unsigned int tlv_size) |
Get TLV value for an HCTL element. | |
int | snd_hctl_elem_tlv_write (snd_hctl_elem_t *elem, const unsigned int *tlv) |
Set TLV value for an HCTL element. | |
int | snd_hctl_elem_tlv_command (snd_hctl_elem_t *elem, const unsigned int *tlv) |
Set TLV value for an HCTL element. | |
snd_hctl_t * | snd_hctl_elem_get_hctl (snd_hctl_elem_t *elem) |
Get HCTL handle for an HCTL element. | |
void | snd_hctl_elem_get_id (const snd_hctl_elem_t *obj, snd_ctl_elem_id_t *ptr) |
Get CTL element identifier of a CTL element id/value. | |
unsigned int | snd_hctl_elem_get_numid (const snd_hctl_elem_t *obj) |
Get element numeric identifier of a CTL element id/value. | |
snd_ctl_elem_iface_t | snd_hctl_elem_get_interface (const snd_hctl_elem_t *obj) |
Get interface part of CTL element identifier of a CTL element id/value. | |
unsigned int | snd_hctl_elem_get_device (const snd_hctl_elem_t *obj) |
Get device part of CTL element identifier of a CTL element id/value. | |
unsigned int | snd_hctl_elem_get_subdevice (const snd_hctl_elem_t *obj) |
Get subdevice part of CTL element identifier of a CTL element id/value. | |
const char * | snd_hctl_elem_get_name (const snd_hctl_elem_t *obj) |
Get name part of CTL element identifier of a CTL element id/value. | |
unsigned int | snd_hctl_elem_get_index (const snd_hctl_elem_t *obj) |
Get index part of CTL element identifier of a CTL element id/value. | |
void | snd_hctl_elem_set_callback (snd_hctl_elem_t *obj, snd_hctl_elem_callback_t val) |
Set callback function for an HCTL element. | |
void | snd_hctl_elem_set_callback_private (snd_hctl_elem_t *obj, void *val) |
Set callback private value for an HCTL element. | |
void * | snd_hctl_elem_get_callback_private (const snd_hctl_elem_t *obj) |
Get callback private value for an HCTL element. | |
HCTL Interface - High Level CTL.
HCTL interface is designed to access preloaded and sorted primitive controls. Callbacks may be used for event handling. See High level control interface page for more details.
int snd_hctl_async | ( | snd_hctl_t * | hctl, |
int | sig, | ||
pid_t | pid ) |
set async mode
hctl | HCTL handle |
sig | Signal to raise: < 0 disable, 0 default (SIGIO) |
pid | Process ID to signal: 0 current |
A signal is raised when a change happens.
int snd_hctl_close | ( | snd_hctl_t * | hctl | ) |
close HCTL handle
hctl | HCTL handle |
Closes the specified HCTL handle and frees all associated resources.
int snd_hctl_compare_fast | ( | const snd_hctl_elem_t * | c1, |
const snd_hctl_elem_t * | c2 ) |
A "don't care" fast compare functions that may be used with snd_hctl_set_compare.
c1 | First HCTL element |
c2 | Second HCTL element |
snd_ctl_t * snd_hctl_ctl | ( | snd_hctl_t * | hctl | ) |
Get a ctl handle associated to the given hctl handle.
hctl | HCTL handle |
void * snd_hctl_elem_get_callback_private | ( | const snd_hctl_elem_t * | obj | ) |
Get callback private value for an HCTL element.
obj | HCTL element |
unsigned int snd_hctl_elem_get_device | ( | const snd_hctl_elem_t * | obj | ) |
Get device part of CTL element identifier of a CTL element id/value.
obj | CTL element id/value |
snd_hctl_t * snd_hctl_elem_get_hctl | ( | snd_hctl_elem_t * | elem | ) |
Get HCTL handle for an HCTL element.
elem | HCTL element |
void snd_hctl_elem_get_id | ( | const snd_hctl_elem_t * | obj, |
snd_ctl_elem_id_t * | ptr ) |
Get CTL element identifier of a CTL element id/value.
obj | CTL element id/value |
ptr | Pointer to returned CTL element identifier |
unsigned int snd_hctl_elem_get_index | ( | const snd_hctl_elem_t * | obj | ) |
Get index part of CTL element identifier of a CTL element id/value.
obj | CTL element id/value |
snd_ctl_elem_iface_t snd_hctl_elem_get_interface | ( | const snd_hctl_elem_t * | obj | ) |
Get interface part of CTL element identifier of a CTL element id/value.
obj | CTL element id/value |
const char * snd_hctl_elem_get_name | ( | const snd_hctl_elem_t * | obj | ) |
Get name part of CTL element identifier of a CTL element id/value.
obj | CTL element id/value |
unsigned int snd_hctl_elem_get_numid | ( | const snd_hctl_elem_t * | obj | ) |
Get element numeric identifier of a CTL element id/value.
obj | CTL element id/value |
unsigned int snd_hctl_elem_get_subdevice | ( | const snd_hctl_elem_t * | obj | ) |
Get subdevice part of CTL element identifier of a CTL element id/value.
obj | CTL element id/value |
int snd_hctl_elem_info | ( | snd_hctl_elem_t * | elem, |
snd_ctl_elem_info_t * | info ) |
Get information for an HCTL element.
elem | HCTL element |
info | HCTL element information |
snd_hctl_elem_t * snd_hctl_elem_next | ( | snd_hctl_elem_t * | elem | ) |
get next HCTL element
elem | HCTL element |
snd_hctl_elem_t * snd_hctl_elem_prev | ( | snd_hctl_elem_t * | elem | ) |
get previous HCTL element
elem | HCTL element |
int snd_hctl_elem_read | ( | snd_hctl_elem_t * | elem, |
snd_ctl_elem_value_t * | value ) |
Get value for an HCTL element.
elem | HCTL element |
value | HCTL element value |
void snd_hctl_elem_set_callback | ( | snd_hctl_elem_t * | obj, |
snd_hctl_elem_callback_t | val ) |
Set callback function for an HCTL element.
obj | HCTL element |
val | callback function |
void snd_hctl_elem_set_callback_private | ( | snd_hctl_elem_t * | obj, |
void * | val ) |
Set callback private value for an HCTL element.
obj | HCTL element |
val | callback private value |
int snd_hctl_elem_tlv_command | ( | snd_hctl_elem_t * | elem, |
const unsigned int * | tlv ) |
Set TLV value for an HCTL element.
elem | HCTL element |
tlv | TLV array for value |
0 | on success |
>1 | on success when value was changed |
<0 | a negative error code on failure |
int snd_hctl_elem_tlv_read | ( | snd_hctl_elem_t * | elem, |
unsigned int * | tlv, | ||
unsigned int | tlv_size ) |
Get TLV value for an HCTL element.
elem | HCTL element |
tlv | TLV array for value |
tlv_size | size of TLV array in bytes |
int snd_hctl_elem_tlv_write | ( | snd_hctl_elem_t * | elem, |
const unsigned int * | tlv ) |
Set TLV value for an HCTL element.
elem | HCTL element |
tlv | TLV array for value |
0 | on success |
>1 | on success when value was changed |
<0 | a negative error code on failure |
int snd_hctl_elem_write | ( | snd_hctl_elem_t * | elem, |
snd_ctl_elem_value_t * | value ) |
Set value for an HCTL element.
elem | HCTL element |
value | HCTL element value |
0 | on success |
>1 | on success when value was changed |
<0 | a negative error code on failure |
snd_hctl_elem_t * snd_hctl_find_elem | ( | snd_hctl_t * | hctl, |
const snd_ctl_elem_id_t * | id ) |
Search an HCTL element.
hctl | HCTL handle |
id | Element identifier |
snd_hctl_elem_t * snd_hctl_first_elem | ( | snd_hctl_t * | hctl | ) |
get first element for an HCTL
hctl | HCTL handle |
int snd_hctl_free | ( | snd_hctl_t * | hctl | ) |
free HCTL loaded elements
hctl | HCTL handle |
void * snd_hctl_get_callback_private | ( | snd_hctl_t * | hctl | ) |
Get callback private value for an HCTL.
hctl | HCTL handle |
unsigned int snd_hctl_get_count | ( | snd_hctl_t * | hctl | ) |
Get number of loaded elements for an HCTL.
hctl | HCTL handle |
int snd_hctl_handle_events | ( | snd_hctl_t * | hctl | ) |
Handle pending HCTL events invoking callbacks.
hctl | HCTL handle |
snd_hctl_elem_t * snd_hctl_last_elem | ( | snd_hctl_t * | hctl | ) |
get last element for an HCTL
hctl | HCTL handle |
int snd_hctl_load | ( | snd_hctl_t * | hctl | ) |
Load an HCTL with all elements and sort them.
hctl | HCTL handle |
const char * snd_hctl_name | ( | snd_hctl_t * | hctl | ) |
get identifier of HCTL handle
hctl | HCTL handle |
Returns the ASCII identifier of given HCTL handle. It's the same identifier specified in snd_hctl_open().
int snd_hctl_nonblock | ( | snd_hctl_t * | hctl, |
int | nonblock ) |
set nonblock mode
hctl | HCTL handle |
nonblock | 0 = block, 1 = nonblock mode |
int snd_hctl_open | ( | snd_hctl_t ** | hctlp, |
const char * | name, | ||
int | mode ) |
Opens an HCTL.
hctlp | Returned HCTL handle |
name | ASCII identifier of the underlying CTL handle |
mode | Open mode (see #SND_CTL_NONBLOCK, #SND_CTL_ASYNC) |
int snd_hctl_open_ctl | ( | snd_hctl_t ** | hctlp, |
snd_ctl_t * | ctl ) |
Opens an HCTL.
hctlp | Returned HCTL handle |
ctl | underlying CTL handle |
int snd_hctl_poll_descriptors | ( | snd_hctl_t * | hctl, |
struct pollfd * | pfds, | ||
unsigned int | space ) |
get poll descriptors
hctl | HCTL handle |
pfds | array of poll descriptors |
space | space in the poll descriptor array |
int snd_hctl_poll_descriptors_count | ( | snd_hctl_t * | hctl | ) |
get count of poll descriptors for HCTL handle
hctl | HCTL handle |
int snd_hctl_poll_descriptors_revents | ( | snd_hctl_t * | hctl, |
struct pollfd * | pfds, | ||
unsigned int | nfds, | ||
unsigned short * | revents ) |
get returned events from poll descriptors
hctl | HCTL handle |
pfds | array of poll descriptors |
nfds | count of poll descriptors |
revents | returned events |
void snd_hctl_set_callback | ( | snd_hctl_t * | hctl, |
snd_hctl_callback_t | callback ) |
Set callback function for an HCTL.
hctl | HCTL handle |
callback | callback function |
void snd_hctl_set_callback_private | ( | snd_hctl_t * | hctl, |
void * | callback_private ) |
Set callback private value for an HCTL.
hctl | HCTL handle |
callback_private | callback private value |
int snd_hctl_set_compare | ( | snd_hctl_t * | hctl, |
snd_hctl_compare_t | compare ) |
Change HCTL compare function and reorder elements.
hctl | HCTL handle |
compare | Element compare function |
int snd_hctl_wait | ( | snd_hctl_t * | hctl, |
int | timeout ) |
Wait for a HCTL to become ready (i.e. at least one event pending)
hctl | HCTL handle |
timeout | maximum time in milliseconds to wait |
0 | timeout occurred |
1 | an event is pending |