26 #ifndef __ALSA_CONTROL_EXTERNAL_H 27 #define __ALSA_CONTROL_EXTERNAL_H 43 #define SND_CTL_PLUGIN_ENTRY(name) _snd_ctl_##name##_open 48 #define SND_CTL_PLUGIN_SYMBOL(name) SND_DLSYM_BUILD_VERSION(SND_CTL_PLUGIN_ENTRY(name), SND_CONTROL_DLSYM_VERSION); 53 #define SND_CTL_PLUGIN_DEFINE_FUNC(plugin) \ 54 int SND_CTL_PLUGIN_ENTRY(plugin) (snd_ctl_t **handlep, const char *name,\ 55 snd_config_t *root, snd_config_t *conf, int mode) 69 typedef int (
snd_ctl_ext_tlv_rw_t)(snd_ctl_ext_t *ext, snd_ctl_ext_key_t key,
int op_flag,
unsigned int numid,
70 unsigned int *tlv,
unsigned int tlv_size);
75 #define SND_CTL_EXT_VERSION_MAJOR 1 76 #define SND_CTL_EXT_VERSION_MINOR 0 77 #define SND_CTL_EXT_VERSION_TINY 1 81 #define SND_CTL_EXT_VERSION ((SND_CTL_EXT_VERSION_MAJOR<<16) |\ 82 (SND_CTL_EXT_VERSION_MINOR<<8) |\ 83 (SND_CTL_EXT_VERSION_TINY)) 142 const unsigned int *p;
151 void (*close)(snd_ctl_ext_t *ext);
155 int (*elem_count)(snd_ctl_ext_t *ext);
167 void (*free_key)(snd_ctl_ext_t *ext, snd_ctl_ext_key_t key);
171 int (*get_attribute)(snd_ctl_ext_t *ext, snd_ctl_ext_key_t key,
172 int *type,
unsigned int *acc,
unsigned int *count);
176 int (*get_integer_info)(snd_ctl_ext_t *ext, snd_ctl_ext_key_t key,
177 long *imin,
long *imax,
long *istep);
181 int (*get_integer64_info)(snd_ctl_ext_t *ext, snd_ctl_ext_key_t key,
182 int64_t *imin, int64_t *imax, int64_t *istep);
186 int (*get_enumerated_info)(snd_ctl_ext_t *ext, snd_ctl_ext_key_t key,
unsigned int *items);
190 int (*get_enumerated_name)(snd_ctl_ext_t *ext, snd_ctl_ext_key_t key,
unsigned int item,
191 char *
name,
size_t name_max_len);
195 int (*read_integer)(snd_ctl_ext_t *ext, snd_ctl_ext_key_t key,
long *value);
199 int (*read_integer64)(snd_ctl_ext_t *ext, snd_ctl_ext_key_t key, int64_t *value);
203 int (*read_enumerated)(snd_ctl_ext_t *ext, snd_ctl_ext_key_t key,
unsigned int *items);
207 int (*read_bytes)(snd_ctl_ext_t *ext, snd_ctl_ext_key_t key,
unsigned char *data,
216 int (*write_integer)(snd_ctl_ext_t *ext, snd_ctl_ext_key_t key,
long *value);
220 int (*write_integer64)(snd_ctl_ext_t *ext, snd_ctl_ext_key_t key, int64_t *value);
224 int (*write_enumerated)(snd_ctl_ext_t *ext, snd_ctl_ext_key_t key,
unsigned int *items);
228 int (*write_bytes)(snd_ctl_ext_t *ext, snd_ctl_ext_key_t key,
unsigned char *data,
237 void (*subscribe_events)(snd_ctl_ext_t *ext,
int subscribe);
245 int (*poll_descriptors_count)(snd_ctl_ext_t *ext);
249 int (*poll_descriptors)(snd_ctl_ext_t *ext,
struct pollfd *pfds,
unsigned int space);
253 int (*poll_revents)(snd_ctl_ext_t *ext,
struct pollfd *pfds,
unsigned int nfds,
unsigned short *revents);
259 typedef enum snd_ctl_ext_access {
260 SND_CTL_EXT_ACCESS_READ = (1<<0),
261 SND_CTL_EXT_ACCESS_WRITE = (1<<1),
262 SND_CTL_EXT_ACCESS_READWRITE = (3<<0),
263 SND_CTL_EXT_ACCESS_VOLATILE = (1<<2),
264 SND_CTL_EXT_ACCESS_TLV_READ = (1<<4),
265 SND_CTL_EXT_ACCESS_TLV_WRITE = (1<<5),
266 SND_CTL_EXT_ACCESS_TLV_READWRITE = (3<<4),
267 SND_CTL_EXT_ACCESS_TLV_COMMAND = (1<<6),
268 SND_CTL_EXT_ACCESS_INACTIVE = (1<<8),
269 SND_CTL_EXT_ACCESS_TLV_CALLBACK = (1<<28),
275 #define SND_CTL_EXT_KEY_NOT_FOUND (snd_ctl_ext_key_t)(-1) int poll_fd
Definition: control_external.h:119
snd_ctl_t * handle
Definition: control_external.h:132
int subscribed
Definition: control_external.h:135
int snd_ctl_ext_delete(snd_ctl_ext_t *ext)
Delete the external control plugin.
Definition: control_ext.c:735
const snd_ctl_ext_callback_t * callback
Definition: control_external.h:124
char mixername[80]
Definition: control_external.h:115
struct _snd_ctl snd_ctl_t
Definition: control.h:214
snd_ctl_ext snd_ctl_ext_t
Definition: control_external.h:65
struct _snd_ctl_elem_id snd_ctl_elem_id_t
Definition: control.h:57
Definition: control_external.h:147
unsigned long snd_ctl_ext_key_t
Definition: control_external.h:62
char id[16]
Definition: control_external.h:99
unsigned int version
Definition: control_external.h:91
Definition: control_external.h:86
int nonblock
Definition: control_external.h:134
snd_ctl_ext_access_t
Definition: control_external.h:259
union snd_ctl_ext::@7 tlv
snd_ctl_ext_callback snd_ctl_ext_callback_t
Definition: control_external.h:66
int snd_ctl_ext_create(snd_ctl_ext_t *ext, const char *name, int mode)
Create an external control plugin instance.
Definition: control_ext.c:704
char name[32]
Definition: control_external.h:107
Application interface library for the ALSA driver.
int( snd_ctl_ext_tlv_rw_t)(snd_ctl_ext_t *ext, snd_ctl_ext_key_t key, int op_flag, unsigned int numid, unsigned int *tlv, unsigned int tlv_size)
Definition: control_external.h:69
char longname[80]
Definition: control_external.h:111
void * private_data
Definition: control_external.h:128
int card_idx
Definition: control_external.h:95
char driver[16]
Definition: control_external.h:103