;; == Control Interface ; https://alsa-project.org/alsa-doc/alsa-lib/group___control.html ;;*************************************************************************** ; Highlevel control interface ;; Function: int snd_hctl_compare_fast ;; [in] const snd_hctl_elem_t *c1 ;; [in] const snd_hctl_elem_t *c2) ; A "don't care" fast compare functions that may be used with ; snd_hctl_set_compare. ; ; Returns -1 if c1c2 ;; Function: int snd_hctl_open ;; [out] snd_hctl_t **hctl = Returned HCTL handle ;; [in] const char *name = ASCII identifier of the underlying CTL handle ;; [in] int mode = Open mode (see SND_CTL_NONBLOCK, SND_CTL_ASYNC) ; Opens an HCTL. ;; Function: int snd_hctl_open_ctl ;; [out] snd_hctl_t **hctlp = Returned HCTL handle ;; [in] snd_ctl_t *ctl = underlying CTL handle ; Opens an HCTL. ;; Function: int snd_hctl_close ;; [in] snd_hctl_t *hctl = HCTL handle ; Closes the specified HCTL handle and frees all associated resources. ;; Function: int snd_hctl_nonblock ;; [in] snd_hctl_t *hctl ;; [in] int nonblock ; set nonblock mode. 0 = block, 1 = nonblock. ;; Function: int snd_hctl_poll_descriptors_count ;; [in] snd_hctl_t *hctl ; Get count of poll descriptors for HCTL handle. ;; Function: int snd_hctl_poll_descriptors ;; [in] snd_hctl_t *hctl = HCTL handle ;; [out] struct pollfd *pfds = array of poll descriptors ;; [in] unsigned int space = space in the poll descriptor array ; Get poll descriptors; fills the array and retuns count of filled ; descriptors. ;; Function: int snd_hctl_poll_descriptors_revents ;; [in] snd_hctl_t *ctl = HCTL handle ;; [in] struct pollfd *pfds = array of poll descriptors ;; [in] unsigned int nfds = count of poll descriptors ;; [out] unsigned short *revents = returned events ; Get returned events from poll descriptors. Returns 0 on success, ; otherwise a negative error code ;; Function: unsigned int snd_hctl_get_count ; [in] snd_hctl_t *hctl = HCTL handle ; Get number of loaded elements for an HCTL. ;; Function: int snd_hctl_set_compare ;; [in] snd_hctl_t *hctl = HCTL handle ;; [in] snd_hctl_compare_t hsort = Element compare function ; Change HCTL compare function and reorder elements. Returns 0 on ; success otherwise a negative error code ;; Function: snd _hctl_elem_t * snd_hctl_first_elem ;; [in] snd_hctl_t *hctl = HCTL handle ; get first element for an HCTL. ;; Function snd _hctl_elem_t * snd_hctl_last_elem ;; [in] snd_hctl_t *hctl = HCTL handle ; get last element for an HCTL. ;; Function: snd _hctl_elem_t * snd_hctl_find_elem ;; [in] snd_hctl_t *hctl = HCTL handle ;; [in] const snd_ctl_elem_id_t *id = Element identifier ; Find an HCTL element by id. Returns pointer to found HCTL element or ; NULL if not found. ;; Function: void snd_hctl_set_callback ;; [in] snd_hctl_t *hctl ;; [in] snd_hctl_callback_t callback ; Set callback function for an HCTL. ;; Function: void snd_hctl_set_callback_private ;; [in] snd_hctl_t *hctl ;; [in] void *data ; Set callback private value for an HCTL. ;; Function: void * snd_hctl_get_callback_private ;; [in] snd_hctl_t *hctl ; Get callback private value for an HCTL. ;; Function: int snd_hctl_load ;; [int] snd_hctl_t *hctl ; Load an HCTL with all elements and sort them. ;; Function: int snd_hctl_free ;; [in] snd_hctl_t *hctl ; Free HCTL loaded elements ;; Function: int snd_hctl_handle_events ;; [in] snd_hctl_t *hctl ; Handle pending HCTL events invoking callbacks. ;; Function: const char * snd_hctl_name ;; [in] snd_hctl_t *hctl ; Get identifier of HCTL handle. Returns the ASCII identifier of given ; HCTL handle. It's the same identifier specified in snd_hctl_open(). ;; Function: int snd_hctl_wait ;; [in] snd_hctl_t *hctl = HCTL handle ;; [in] int timeout = maximum time in milliseconds to wait ; Wait for a HCTL to become ready (i.e. at least one event pending). ; Returns a positive value on success otherwise a negative error code. ; 0 timeout occurred; 1 an event is pending. ;; Function: snd _ctl_t * snd_hctl_ctl ;; [in] snd_hctl_t *hctl ; Get a ctl handle associated to the given hctl handle. ;; Function: snd _hctl_elem_t * snd_hctl_elem_next ;; [in] snd_hctl_elem_t *elem ; get next HCTL element. Returns pointer to next element. ;; Function: snd _hctl_elem_t * snd_hctl_elem_prev ;; [in] snd_hctl_elem_t *elem ; Get previous HCTL element. Returns pointer to next element. ;; Function: int snd_hctl_elem_info ;; [in] snd_hctl_elem_t *elem ;; [out] snd_ctl_elem_info_t *info ; Get information for an HCTL element. ;; Function: int snd_hctl_elem_read ;; [in] snd_hctl_elem_t *elem ;; [out] snd_ctl_elem_value_t *value ; Get value for an HCTL element. ;; Function: int snd_hctl_elem_write ;; [in] snd_hctl_elem_t *elem ;; [in] snd_ctl_elem_value_t *value ; Set value for an HCTL element. ;; Function: int snd_hctl_elem_tlv_read ;; [in] snd_hctl_elem_t *elem ;; [out] unsigned int *tlv = TLV array for value ;; [in] unsigned int tlv_size = byte size of TLV array ; Get TLV value for an HCTL element. Returns 0 otherwise a negative ; error code on failure. ;; Function: int snd_hctl_elem_tlv_write ;; [in] snd_hctl_elem_t *elem ;; [in] const unsigned int *tlv = TLV array for value ; Set TLV value for an HCTL element. Returns 0 on success, >1 on ; success when value was changed, and <0 a negative error code on ; failure. ;; Function: int snd_hctl_elem_tlv_command ;; [in] snd_hctl_elem_t *elem ;; [in] const unsigned int *tlv = TLV array for value ; Set TLV value for an HCTL element. Returns 0 on success, >1 on ; success when value was changed, and <0 a negative error code on ; failure. ;; Function: snd _hctl_t * snd_hctl_elem_get_hctl ;; [in] snd_hctl_elem_t *elem ; Get HCTL handle for an HCTL element. ;; Function: void snd_hctl_elem_get_id ;; [in] const snd_hctl_elem_t *obj ;; [out] snd_ctl_elem_id_t *ptr = Pointer to returned CTL element identifier ; Get CTL element identifier of a CTL element id/value. ;; Functionunsigned int snd_hctl_elem_get_numid ;; [in] const snd_hctl_elem_t *obj ; Get element numeric identifier of a CTL element id/value. ;; Function: snd _ctl_elem_iface_t snd_hctl_elem_get_interface ;; [in] const snd_hctl_elem_t *obj ; Get interface part of CTL element identifier of a CTL element ; id/value. ;; Function: unsigned int snd_hctl_elem_get_device ;; [in] const snd_hctl_elem_t *obj ; Get device part of CTL element identifier of a CTL element id/value. ;; Function: unsigned int snd_hctl_elem_get_subdevice ;; [in] const snd_hctl_elem_t *obj ; Get subdevice part of CTL element identifier of a CTL element ; id/value. ;; Function: const char * snd_hctl_elem_get_name ;; [in] const snd_hctl_elem_t *obj ; Get name part of CTL element identifier of a CTL element id/value. ;; Function: unsigned int snd_hctl_elem_get_index ;; [in] const snd_hctl_elem_t *obj ; Get index part of CTL element identifier of a CTL element id/value. ;; Function: void snd_hctl_elem_set_callback ;; [in] snd_hctl_elem_t *obj ;; snd_hctl_elem_callback_t val ; Set callback function for an HCTL element. ;; Function: void * snd_hctl_elem_get_callback_private ;; [in] const snd_hctl_elem_t *obj ; Get callback private value for an HCTL element. ;; Function: void snd_hctl_elem_set_callback_private ;; [in] snd_hctl_elem_t *obj ;; [in] void *val ; Set callback private value for an HCTL element. ;*************************************************************************** ; Setup Control Interface ;; Function: int snd_sctl_build ;; [out] snd_sctl_t **ctl = Result - setup control handle ;; [in] snd_ctl_t *handle = Master control handle ;; [in] snd_config_t *config = Setup configuration ;; [in] snd_config_t *private_data = Private data for runtime evaluation ;; [in] int mode = Build mode - SND_SCTL_xxxx ; Build setup control handle. ;; Function: int snd_sctl_free ;; [in] snd_sctl_t *handle ; Free setup control handle. ;; Function: int snd_sctl_install ;; [in] snd_sctl_t *handle ; Install given values to control elements. ;; Function: int snd_sctl_remove ;; [in] (snd_sctl_t *handle ; Remove (restore) previous values from control elements. ;*************************************************************************** (constant ;;'SND_CONTROL_DLSYM_VERSION "_dlsym_control_001" ;;'SND_CTL_EVENT_MASK_REMOVE ?? ;;'SND_CTL_EVENT_MASK_VALUE ?? ;;'SND_CTL_EVENT_MASK_INFO ?? ;;'SND_CTL_EVENT_MASK_ADD ?? ;;'SND_CTL_EVENT_MASK_TLV ?? 'SND_CTL_NAME_NONE "" 'SND_CTL_NAME_PLAYBACK "Playback " 'SND_CTL_NAME_CAPTURE "Capture " 'SND_CTL_NAME_IEC958_NONE "" 'SND_CTL_NAME_IEC958_SWITCH "Switch" 'SND_CTL_NAME_IEC958_VOLUME "Volume" 'SND_CTL_NAME_IEC958_DEFAULT "Default" 'SND_CTL_NAME_IEC958_MASK "Mask" 'SND_CTL_NAME_IEC958_CON_MASK "Con Mask" 'SND_CTL_NAME_IEC958_PRO_MASK "Pro Mask" 'SND_CTL_NAME_IEC958_PCM_STREAM "PCM Stream" ;;'SND_CTL_NAME_IEC958(expl, direction, what) "IEC958 " expl SND_CTL_NAME_##direction SND_CTL_NAME_IEC958_##what 'SND_CTL_POWER_MASK 0xff00 'SND_CTL_POWER_D0 0x0000 'SND_CTL_POWER_D1 0x0100 'SND_CTL_POWER_D2 0x0200 'SND_CTL_POWER_D3 0x0300 'SND_CTL_POWER_D3hot (or SND_CTL_POWER_D3 0x0000) 'SND_CTL_POWER_D3cold (or SND_CTL_POWER_D3 0x0001) 'SND_CTL_TLVT_CONTAINER 0x0000 'SND_CTL_TLVT_DB_SCALE 0x0001 'SND_CTL_TLVT_DB_LINEAR 0x0002 'SND_CTL_TLVT_DB_RANGE 0x0003 'SND_CTL_TLVT_DB_MINMAX 0x0004 'SND_CTL_TLVT_DB_MINMAX_MUTE 0x0005 'SND_CTL_TLV_DB_GAIN_MUTE -9999999 'SND_CTL_TLVT_CHMAP_FIXED 0x00101 'SND_CTL_TLVT_CHMAP_VAR 0x00102 'SND_CTL_TLVT_CHMAP_PAIRED 0x00103 ;;'SND_CTL_NONBLOCK ;;'SND_CTL_ASYNC ;;'SND_CTL_READONLY 'SND_SCTL_NOFREE 0x0001 ;;snd_ctl_elem_id_alloca(ptr) ;; allocate an invalid snd_ctl_elem_id_t using standard alloca More... ;;snd_ctl_card_info_alloca(ptr) ;; Allocate an invalid snd_ctl_card_info_t on the stack. More... ;;snd_ctl_event_alloca(ptr) ;; allocate an invalid snd_ctl_event_t using standard alloca More... ;;snd_ctl_elem_list_alloca(ptr) ;; Allocate a snd_ctl_elem_list_t using standard alloca. More... ;;snd_ctl_elem_info_alloca(ptr) ;;allocate an invalid snd_ctl_elem_info_t using standard alloca More... ;;snd_ctl_elem_value_alloca(ptr) ;;Allocate an invalid snd_ctl_elem_value_t on the stack. More... ) ;*************************************************************************** ;;========== CARD Functions (import LIB "snd_card_next" "int" "void*") (import LIB "snd_card_get_longname" "int" "int" "void*") (import LIB "snd_card_get_name" "int" "int" "void*") (import LIB "snd_ctl_open" "int" "void*" "char*" "int") (import LIB "snd_ctl_close" "int" "void*") ;; snd_ctl_card_info_t functions (import LIB "snd_ctl_card_info_malloc" "int" "void*") (import LIB "snd_ctl_card_info_free" "int" "void*") (import LIB "snd_ctl_card_info" "int" "void*" "void*") (import LIB "snd_ctl_card_info_get_card" "int" "void*") (import LIB "snd_ctl_card_info_get_name" "char*" "void*") (import LIB "snd_ctl_card_info_get_id" "char*" "void*") (import LIB "snd_ctl_card_info_get_longname" "char*" "void*") (import LIB "snd_ctl_card_info_get_components" "char*" "void*") (import LIB "snd_ctl_card_info_get_driver" "char*" "void*") (import LIB "snd_ctl_card_info_get_mixername" "char*" "void*") ;; snd_ctl_elem_list_t functions (import LIB "snd_ctl_elem_info_free" "void" "void*") (import LIB "snd_ctl_elem_info_malloc" "int" "void*") (import LIB "snd_ctl_elem_list" "int" "void*" "void*") (import LIB "snd_ctl_elem_list_alloc_space" "int" "void*" "int") (import LIB "snd_ctl_elem_list_free" "int" "void*") (import LIB "snd_ctl_elem_list_free_space" "int" "void*") (import LIB "snd_ctl_elem_list_get_count" "unsigned int" "void*") (import LIB "snd_ctl_elem_list_get_device" "unsigned int" "void*" "int") (import LIB "snd_ctl_elem_list_get_id" "void" "void*" "int" "void*") (import LIB "snd_ctl_elem_list_get_index" "unsigned int" "void*" "int") (import LIB "snd_ctl_elem_list_get_interface" "int" "void*""int") (import LIB "snd_ctl_elem_list_get_name" "char*" "void*""int") (import LIB "snd_ctl_elem_list_get_numid" "unsigned int" "void*" "int") (import LIB "snd_ctl_elem_list_get_subdevice" "unsigned int" "void*" "int") (import LIB "snd_ctl_elem_list_get_used" "unsigned int" "void*") (import LIB "snd_ctl_elem_list_malloc" "int" "void*") ;; snd_ctl_elem_info_t functions (import LIB "snd_ctl_elem_info" "int" "void*" "void*") (import LIB "snd_ctl_elem_info_malloc" "int" "void*") (import LIB "snd_ctl_elem_info_free" "void" "void*") (import LIB "snd_ctl_elem_info_get_type" "int" "void*")