1 /****************************************************************************
6 ****************************************************************************/
9 * \defgroup Control Control Interface
10 * The control interface.
14 typedef struct sndrv_aes_iec958 snd_aes_iec958_t;
16 /** CTL card info container */
17 typedef struct _snd_ctl_card_info snd_ctl_card_info_t;
19 /** CTL element identificator container */
20 typedef struct _snd_ctl_elem_id snd_ctl_elem_id_t;
22 /** CTL element identificator list container */
23 typedef struct _snd_ctl_elem_list snd_ctl_elem_list_t;
25 /** CTL element info container */
26 typedef struct _snd_ctl_elem_info snd_ctl_elem_info_t;
28 /** CTL element value container */
29 typedef struct _snd_ctl_elem_value snd_ctl_elem_value_t;
31 /** CTL event container */
32 typedef struct _snd_ctl_event snd_ctl_event_t;
34 /** CTL element type */
35 typedef enum _snd_ctl_elem_type {
37 SND_CTL_ELEM_TYPE_NONE = SNDRV_CTL_ELEM_TYPE_NONE,
38 /** Boolean contents */
39 SND_CTL_ELEM_TYPE_BOOLEAN = SNDRV_CTL_ELEM_TYPE_BOOLEAN,
40 /** Integer contents */
41 SND_CTL_ELEM_TYPE_INTEGER = SNDRV_CTL_ELEM_TYPE_INTEGER,
42 /** Enumerated contents */
43 SND_CTL_ELEM_TYPE_ENUMERATED = SNDRV_CTL_ELEM_TYPE_ENUMERATED,
45 SND_CTL_ELEM_TYPE_BYTES = SNDRV_CTL_ELEM_TYPE_BYTES,
46 /** IEC958 (S/PDIF) setting content */
47 SND_CTL_ELEM_TYPE_IEC958 = SNDRV_CTL_ELEM_TYPE_IEC958,
48 SND_CTL_ELEM_TYPE_LAST = SNDRV_CTL_ELEM_TYPE_LAST,
49 } snd_ctl_elem_type_t;
51 /** CTL related interface */
52 typedef enum _snd_ctl_elem_iface {
54 SND_CTL_ELEM_IFACE_CARD = SNDRV_CTL_ELEM_IFACE_CARD,
55 /** Hardware dependent device */
56 SND_CTL_ELEM_IFACE_HWDEP = SNDRV_CTL_ELEM_IFACE_HWDEP,
58 SND_CTL_ELEM_IFACE_MIXER = SNDRV_CTL_ELEM_IFACE_MIXER,
60 SND_CTL_ELEM_IFACE_PCM = SNDRV_CTL_ELEM_IFACE_PCM,
62 SND_CTL_ELEM_IFACE_RAWMIDI = SNDRV_CTL_ELEM_IFACE_RAWMIDI,
64 SND_CTL_ELEM_IFACE_TIMER = SNDRV_CTL_ELEM_IFACE_TIMER,
66 SND_CTL_ELEM_IFACE_SEQUENCER = SNDRV_CTL_ELEM_IFACE_SEQUENCER,
67 SND_CTL_ELEM_IFACE_LAST = SNDRV_CTL_ELEM_IFACE_LAST,
68 } snd_ctl_elem_iface_t;
71 typedef enum _snd_ctl_event_type {
72 /** Elements related event */
73 SND_CTL_EVENT_ELEM = SNDRV_CTL_EVENT_ELEM,
74 SND_CTL_EVENT_LAST = SNDRV_CTL_EVENT_LAST,
75 }snd_ctl_event_type_t;
77 /** Element has been removed (Warning: test this first and if set don't
78 * test the other masks) \hideinitializer */
79 #define SND_CTL_EVENT_MASK_REMOVE SNDRV_CTL_EVENT_MASK_REMOVE
80 /** Element has been added \hideinitializer */
81 #define SND_CTL_EVENT_MASK_ADD SNDRV_CTL_EVENT_MASK_ADD
82 /** Element info has been changed \hideinitializer */
83 #define SND_CTL_EVENT_MASK_INFO SNDRV_CTL_EVENT_MASK_INFO
84 /** Element value has been changed \hideinitializer */
85 #define SND_CTL_EVENT_MASK_VALUE SNDRV_CTL_EVENT_MASK_VALUE
87 #define SND_CTL_NAME_IEC958 SNDRV_CTL_NAME_IEC958
90 typedef enum _snd_ctl_type {
91 /** Kernel level CTL */
93 /** Shared memory client CTL */
95 /** INET client CTL (not yet implemented) */
99 /** Non blocking mode \hideinitializer */
100 #define SND_CTL_NONBLOCK 0x0001
102 /** Async notification \hideinitializer */
103 #define SND_CTL_ASYNC 0x0002
106 typedef struct _snd_ctl snd_ctl_t;
108 /** Don't destroy the ctl handle when close */
109 #define SND_SCTL_NOFREE 0x0001
112 typedef struct _snd_sctl snd_sctl_t;
118 int snd_card_load(int card);
119 int snd_card_next(int *card);
120 int snd_card_get_index(const char *name);
121 int snd_card_get_name(int card, char **name);
122 int snd_card_get_longname(int card, char **name);
124 int snd_sctl_build(snd_sctl_t **ctl, snd_ctl_t *handle, snd_config_t *config,
125 void *private_data, int mode);
126 int snd_sctl_free(snd_sctl_t *handle);
127 int snd_sctl_install(snd_sctl_t *handle);
128 int snd_sctl_remove(snd_sctl_t *handle);
130 int snd_ctl_open(snd_ctl_t **ctl, const char *name, int mode);
131 int snd_ctl_close(snd_ctl_t *ctl);
132 int snd_ctl_nonblock(snd_ctl_t *ctl, int nonblock);
133 int snd_async_add_ctl_handler(snd_async_handler_t **handler, snd_ctl_t *ctl,
134 snd_async_callback_t callback, void *private_data);
135 snd_ctl_t *snd_async_handler_get_ctl(snd_async_handler_t *handler);
136 int snd_ctl_poll_descriptors_count(snd_ctl_t *ctl);
137 int snd_ctl_poll_descriptors(snd_ctl_t *ctl, struct pollfd *pfds, unsigned int space);
138 int snd_ctl_subscribe_events(snd_ctl_t *ctl, int subscribe);
139 int snd_ctl_card_info(snd_ctl_t *ctl, snd_ctl_card_info_t *info);
140 int snd_ctl_elem_list(snd_ctl_t *ctl, snd_ctl_elem_list_t * list);
141 int snd_ctl_elem_info(snd_ctl_t *ctl, snd_ctl_elem_info_t *info);
142 int snd_ctl_elem_read(snd_ctl_t *ctl, snd_ctl_elem_value_t *value);
143 int snd_ctl_elem_write(snd_ctl_t *ctl, snd_ctl_elem_value_t *value);
144 int snd_ctl_elem_lock(snd_ctl_t *ctl, snd_ctl_elem_id_t *id);
145 int snd_ctl_elem_unlock(snd_ctl_t *ctl, snd_ctl_elem_id_t *id);
146 int snd_ctl_hwdep_next_device(snd_ctl_t *ctl, int * device);
147 int snd_ctl_hwdep_info(snd_ctl_t *ctl, snd_hwdep_info_t * info);
148 int snd_ctl_pcm_next_device(snd_ctl_t *ctl, int *device);
149 int snd_ctl_pcm_info(snd_ctl_t *ctl, snd_pcm_info_t * info);
150 int snd_ctl_pcm_prefer_subdevice(snd_ctl_t *ctl, int subdev);
151 int snd_ctl_rawmidi_next_device(snd_ctl_t *ctl, int * device);
152 int snd_ctl_rawmidi_info(snd_ctl_t *ctl, snd_rawmidi_info_t * info);
153 int snd_ctl_rawmidi_prefer_subdevice(snd_ctl_t *ctl, int subdev);
155 int snd_ctl_read(snd_ctl_t *ctl, snd_ctl_event_t *event);
156 int snd_ctl_wait(snd_ctl_t *ctl, int timeout);
157 const char *snd_ctl_name(snd_ctl_t *ctl);
158 snd_ctl_type_t snd_ctl_type(snd_ctl_t *ctl);
160 void snd_ctl_elem_set_bytes(snd_ctl_elem_value_t *obj, void *data, size_t size);
161 const char *snd_ctl_elem_type_name(snd_ctl_elem_type_t type);
162 const char *snd_ctl_elem_iface_name(snd_ctl_elem_iface_t iface);
163 const char *snd_ctl_event_type_name(snd_ctl_event_type_t type);
165 unsigned int snd_ctl_event_elem_get_mask(const snd_ctl_event_t *obj);
166 unsigned int snd_ctl_event_elem_get_numid(const snd_ctl_event_t *obj);
167 void snd_ctl_event_elem_get_id(const snd_ctl_event_t *obj, snd_ctl_elem_id_t *ptr);
168 snd_ctl_elem_iface_t snd_ctl_event_elem_get_interface(const snd_ctl_event_t *obj);
169 unsigned int snd_ctl_event_elem_get_device(const snd_ctl_event_t *obj);
170 unsigned int snd_ctl_event_elem_get_subdevice(const snd_ctl_event_t *obj);
171 const char *snd_ctl_event_elem_get_name(const snd_ctl_event_t *obj);
172 unsigned int snd_ctl_event_elem_get_index(const snd_ctl_event_t *obj);
174 int snd_ctl_elem_list_alloc_space(snd_ctl_elem_list_t *obj, unsigned int entries);
175 void snd_ctl_elem_list_free_space(snd_ctl_elem_list_t *obj);
177 size_t snd_ctl_elem_id_sizeof(void);
179 * \brief allocate an invalid #snd_ctl_elem_id_t using standard alloca
180 * \param ptr returned pointer
182 #define snd_ctl_elem_id_alloca(ptr) do { assert(ptr); *ptr = (snd_ctl_elem_id_t *) alloca(snd_ctl_elem_id_sizeof()); memset(*ptr, 0, snd_ctl_elem_id_sizeof()); } while (0)
183 int snd_ctl_elem_id_malloc(snd_ctl_elem_id_t **ptr);
184 void snd_ctl_elem_id_free(snd_ctl_elem_id_t *obj);
185 void snd_ctl_elem_id_clear(snd_ctl_elem_id_t *obj);
186 void snd_ctl_elem_id_copy(snd_ctl_elem_id_t *dst, const snd_ctl_elem_id_t *src);
187 unsigned int snd_ctl_elem_id_get_numid(const snd_ctl_elem_id_t *obj);
188 snd_ctl_elem_iface_t snd_ctl_elem_id_get_interface(const snd_ctl_elem_id_t *obj);
189 unsigned int snd_ctl_elem_id_get_device(const snd_ctl_elem_id_t *obj);
190 unsigned int snd_ctl_elem_id_get_subdevice(const snd_ctl_elem_id_t *obj);
191 const char *snd_ctl_elem_id_get_name(const snd_ctl_elem_id_t *obj);
192 unsigned int snd_ctl_elem_id_get_index(const snd_ctl_elem_id_t *obj);
193 void snd_ctl_elem_id_set_numid(snd_ctl_elem_id_t *obj, unsigned int val);
194 void snd_ctl_elem_id_set_interface(snd_ctl_elem_id_t *obj, snd_ctl_elem_iface_t val);
195 void snd_ctl_elem_id_set_device(snd_ctl_elem_id_t *obj, unsigned int val);
196 void snd_ctl_elem_id_set_subdevice(snd_ctl_elem_id_t *obj, unsigned int val);
197 void snd_ctl_elem_id_set_name(snd_ctl_elem_id_t *obj, const char *val);
198 void snd_ctl_elem_id_set_index(snd_ctl_elem_id_t *obj, unsigned int val);
200 size_t snd_ctl_card_info_sizeof(void);
202 * \brief allocate an invalid #snd_ctl_card_info_t using standard alloca
203 * \param ptr returned pointer
205 #define snd_ctl_card_info_alloca(ptr) do { assert(ptr); *ptr = (snd_ctl_card_info_t *) alloca(snd_ctl_card_info_sizeof()); memset(*ptr, 0, snd_ctl_card_info_sizeof()); } while (0)
206 int snd_ctl_card_info_malloc(snd_ctl_card_info_t **ptr);
207 void snd_ctl_card_info_free(snd_ctl_card_info_t *obj);
208 void snd_ctl_card_info_clear(snd_ctl_card_info_t *obj);
209 void snd_ctl_card_info_copy(snd_ctl_card_info_t *dst, const snd_ctl_card_info_t *src);
210 int snd_ctl_card_info_get_card(const snd_ctl_card_info_t *obj);
211 const char *snd_ctl_card_info_get_id(const snd_ctl_card_info_t *obj);
212 const char *snd_ctl_card_info_get_driver(const snd_ctl_card_info_t *obj);
213 const char *snd_ctl_card_info_get_name(const snd_ctl_card_info_t *obj);
214 const char *snd_ctl_card_info_get_longname(const snd_ctl_card_info_t *obj);
215 const char *snd_ctl_card_info_get_mixername(const snd_ctl_card_info_t *obj);
216 const char *snd_ctl_card_info_get_components(const snd_ctl_card_info_t *obj);
218 size_t snd_ctl_event_sizeof(void);
220 * \brief allocate an invalid #snd_ctl_event_t using standard alloca
221 * \param ptr returned pointer
223 #define snd_ctl_event_alloca(ptr) do { assert(ptr); *ptr = (snd_ctl_event_t *) alloca(snd_ctl_event_sizeof()); memset(*ptr, 0, snd_ctl_event_sizeof()); } while (0)
224 int snd_ctl_event_malloc(snd_ctl_event_t **ptr);
225 void snd_ctl_event_free(snd_ctl_event_t *obj);
226 void snd_ctl_event_clear(snd_ctl_event_t *obj);
227 void snd_ctl_event_copy(snd_ctl_event_t *dst, const snd_ctl_event_t *src);
228 snd_ctl_event_type_t snd_ctl_event_get_type(const snd_ctl_event_t *obj);
230 size_t snd_ctl_elem_list_sizeof(void);
232 * \brief allocate an invalid #snd_ctl_elem_list_t using standard alloca
233 * \param ptr returned pointer
235 #define snd_ctl_elem_list_alloca(ptr) do { assert(ptr); *ptr = (snd_ctl_elem_list_t *) alloca(snd_ctl_elem_list_sizeof()); memset(*ptr, 0, snd_ctl_elem_list_sizeof()); } while (0)
236 int snd_ctl_elem_list_malloc(snd_ctl_elem_list_t **ptr);
237 void snd_ctl_elem_list_free(snd_ctl_elem_list_t *obj);
238 void snd_ctl_elem_list_clear(snd_ctl_elem_list_t *obj);
239 void snd_ctl_elem_list_copy(snd_ctl_elem_list_t *dst, const snd_ctl_elem_list_t *src);
240 void snd_ctl_elem_list_set_offset(snd_ctl_elem_list_t *obj, unsigned int val);
241 unsigned int snd_ctl_elem_list_get_used(const snd_ctl_elem_list_t *obj);
242 unsigned int snd_ctl_elem_list_get_count(const snd_ctl_elem_list_t *obj);
243 void snd_ctl_elem_list_get_id(const snd_ctl_elem_list_t *obj, unsigned int idx, snd_ctl_elem_id_t *ptr);
244 unsigned int snd_ctl_elem_list_get_numid(const snd_ctl_elem_list_t *obj, unsigned int idx);
245 snd_ctl_elem_iface_t snd_ctl_elem_list_get_interface(const snd_ctl_elem_list_t *obj, unsigned int idx);
246 unsigned int snd_ctl_elem_list_get_device(const snd_ctl_elem_list_t *obj, unsigned int idx);
247 unsigned int snd_ctl_elem_list_get_subdevice(const snd_ctl_elem_list_t *obj, unsigned int idx);
248 const char *snd_ctl_elem_list_get_name(const snd_ctl_elem_list_t *obj, unsigned int idx);
249 unsigned int snd_ctl_elem_list_get_index(const snd_ctl_elem_list_t *obj, unsigned int idx);
251 size_t snd_ctl_elem_info_sizeof(void);
253 * \brief allocate an invalid #snd_ctl_elem_info_t using standard alloca
254 * \param ptr returned pointer
256 #define snd_ctl_elem_info_alloca(ptr) do { assert(ptr); *ptr = (snd_ctl_elem_info_t *) alloca(snd_ctl_elem_info_sizeof()); memset(*ptr, 0, snd_ctl_elem_info_sizeof()); } while (0)
257 int snd_ctl_elem_info_malloc(snd_ctl_elem_info_t **ptr);
258 void snd_ctl_elem_info_free(snd_ctl_elem_info_t *obj);
259 void snd_ctl_elem_info_clear(snd_ctl_elem_info_t *obj);
260 void snd_ctl_elem_info_copy(snd_ctl_elem_info_t *dst, const snd_ctl_elem_info_t *src);
261 snd_ctl_elem_type_t snd_ctl_elem_info_get_type(const snd_ctl_elem_info_t *obj);
262 int snd_ctl_elem_info_is_readable(const snd_ctl_elem_info_t *obj);
263 int snd_ctl_elem_info_is_writable(const snd_ctl_elem_info_t *obj);
264 int snd_ctl_elem_info_is_volatile(const snd_ctl_elem_info_t *obj);
265 int snd_ctl_elem_info_is_inactive(const snd_ctl_elem_info_t *obj);
266 int snd_ctl_elem_info_is_locked(const snd_ctl_elem_info_t *obj);
267 int snd_ctl_elem_info_is_owner(const snd_ctl_elem_info_t *obj);
268 int snd_ctl_elem_info_is_indirect(const snd_ctl_elem_info_t *obj);
269 pid_t snd_ctl_elem_info_get_owner(const snd_ctl_elem_info_t *obj);
270 unsigned int snd_ctl_elem_info_get_count(const snd_ctl_elem_info_t *obj);
271 long snd_ctl_elem_info_get_min(const snd_ctl_elem_info_t *obj);
272 long snd_ctl_elem_info_get_max(const snd_ctl_elem_info_t *obj);
273 long snd_ctl_elem_info_get_step(const snd_ctl_elem_info_t *obj);
274 unsigned int snd_ctl_elem_info_get_items(const snd_ctl_elem_info_t *obj);
275 void snd_ctl_elem_info_set_item(snd_ctl_elem_info_t *obj, unsigned int val);
276 const char *snd_ctl_elem_info_get_item_name(const snd_ctl_elem_info_t *obj);
277 void snd_ctl_elem_info_get_id(const snd_ctl_elem_info_t *obj, snd_ctl_elem_id_t *ptr);
278 unsigned int snd_ctl_elem_info_get_numid(const snd_ctl_elem_info_t *obj);
279 snd_ctl_elem_iface_t snd_ctl_elem_info_get_interface(const snd_ctl_elem_info_t *obj);
280 unsigned int snd_ctl_elem_info_get_device(const snd_ctl_elem_info_t *obj);
281 unsigned int snd_ctl_elem_info_get_subdevice(const snd_ctl_elem_info_t *obj);
282 const char *snd_ctl_elem_info_get_name(const snd_ctl_elem_info_t *obj);
283 unsigned int snd_ctl_elem_info_get_index(const snd_ctl_elem_info_t *obj);
284 void snd_ctl_elem_info_set_id(snd_ctl_elem_info_t *obj, const snd_ctl_elem_id_t *ptr);
285 void snd_ctl_elem_info_set_numid(snd_ctl_elem_info_t *obj, unsigned int val);
286 void snd_ctl_elem_info_set_interface(snd_ctl_elem_info_t *obj, snd_ctl_elem_iface_t val);
287 void snd_ctl_elem_info_set_device(snd_ctl_elem_info_t *obj, unsigned int val);
288 void snd_ctl_elem_info_set_subdevice(snd_ctl_elem_info_t *obj, unsigned int val);
289 void snd_ctl_elem_info_set_name(snd_ctl_elem_info_t *obj, const char *val);
290 void snd_ctl_elem_info_set_index(snd_ctl_elem_info_t *obj, unsigned int val);
292 size_t snd_ctl_elem_value_sizeof(void);
294 * \brief allocate an invalid #snd_ctl_elem_value_t using standard alloca
295 * \param ptr returned pointer
297 #define snd_ctl_elem_value_alloca(ptr) do { assert(ptr); *ptr = (snd_ctl_elem_value_t *) alloca(snd_ctl_elem_value_sizeof()); memset(*ptr, 0, snd_ctl_elem_value_sizeof()); } while (0)
298 int snd_ctl_elem_value_malloc(snd_ctl_elem_value_t **ptr);
299 void snd_ctl_elem_value_free(snd_ctl_elem_value_t *obj);
300 void snd_ctl_elem_value_clear(snd_ctl_elem_value_t *obj);
301 void snd_ctl_elem_value_copy(snd_ctl_elem_value_t *dst, const snd_ctl_elem_value_t *src);
302 void snd_ctl_elem_value_get_id(const snd_ctl_elem_value_t *obj, snd_ctl_elem_id_t *ptr);
303 unsigned int snd_ctl_elem_value_get_numid(const snd_ctl_elem_value_t *obj);
304 snd_ctl_elem_iface_t snd_ctl_elem_value_get_interface(const snd_ctl_elem_value_t *obj);
305 unsigned int snd_ctl_elem_value_get_device(const snd_ctl_elem_value_t *obj);
306 unsigned int snd_ctl_elem_value_get_subdevice(const snd_ctl_elem_value_t *obj);
307 const char *snd_ctl_elem_value_get_name(const snd_ctl_elem_value_t *obj);
308 unsigned int snd_ctl_elem_value_get_index(const snd_ctl_elem_value_t *obj);
309 void snd_ctl_elem_value_set_id(snd_ctl_elem_value_t *obj, const snd_ctl_elem_id_t *ptr);
310 void snd_ctl_elem_value_set_numid(snd_ctl_elem_value_t *obj, unsigned int val);
311 void snd_ctl_elem_value_set_interface(snd_ctl_elem_value_t *obj, snd_ctl_elem_iface_t val);
312 void snd_ctl_elem_value_set_device(snd_ctl_elem_value_t *obj, unsigned int val);
313 void snd_ctl_elem_value_set_subdevice(snd_ctl_elem_value_t *obj, unsigned int val);
314 void snd_ctl_elem_value_set_name(snd_ctl_elem_value_t *obj, const char *val);
315 void snd_ctl_elem_value_set_index(snd_ctl_elem_value_t *obj, unsigned int val);
316 int snd_ctl_elem_value_get_boolean(const snd_ctl_elem_value_t *obj, unsigned int idx);
317 long snd_ctl_elem_value_get_integer(const snd_ctl_elem_value_t *obj, unsigned int idx);
318 unsigned int snd_ctl_elem_value_get_enumerated(const snd_ctl_elem_value_t *obj, unsigned int idx);
319 unsigned char snd_ctl_elem_value_get_byte(const snd_ctl_elem_value_t *obj, unsigned int idx);
320 void snd_ctl_elem_value_set_boolean(snd_ctl_elem_value_t *obj, unsigned int idx, long val);
321 void snd_ctl_elem_value_set_integer(snd_ctl_elem_value_t *obj, unsigned int idx, long val);
322 void snd_ctl_elem_value_set_enumerated(snd_ctl_elem_value_t *obj, unsigned int idx, unsigned int val);
323 void snd_ctl_elem_value_set_byte(snd_ctl_elem_value_t *obj, unsigned int idx, unsigned char val);
324 const void * snd_ctl_elem_value_get_bytes(const snd_ctl_elem_value_t *obj);
325 void snd_ctl_elem_value_get_iec958(const snd_ctl_elem_value_t *obj, snd_aes_iec958_t *ptr);
326 void snd_ctl_elem_value_set_iec958(snd_ctl_elem_value_t *obj, const snd_aes_iec958_t *ptr);
333 * \defgroup HControl Highlevel Control Interface
335 * The highlevel control interface.
339 /** HCTL element handle */
340 typedef struct _snd_hctl_elem snd_hctl_elem_t;
343 typedef struct _snd_hctl snd_hctl_t;
350 * \brief Compare function for sorting HCTL elements
351 * \param e1 First element
352 * \param e2 Second element
353 * \return -1 if e1 < e2, 0 if e1 == e2, 1 if e1 > e2
355 typedef int (*snd_hctl_compare_t)(const snd_hctl_elem_t *e1,
356 const snd_hctl_elem_t *e2);
357 int snd_hctl_compare_fast(const snd_hctl_elem_t *c1,
358 const snd_hctl_elem_t *c2);
360 * \brief HCTL callback function
361 * \param hctl HCTL handle
362 * \param mask event mask
363 * \param elem related HCTL element (if any)
364 * \return 0 on success otherwise a negative error code
366 typedef int (*snd_hctl_callback_t)(snd_hctl_t *hctl,
368 snd_hctl_elem_t *elem);
370 * \brief HCTL element callback function
371 * \param elem HCTL element
372 * \param mask event mask
373 * \return 0 on success otherwise a negative error code
375 typedef int (*snd_hctl_elem_callback_t)(snd_hctl_elem_t *elem,
378 int snd_hctl_open(snd_hctl_t **hctl, const char *name, int mode);
379 int snd_hctl_close(snd_hctl_t *hctl);
380 int snd_hctl_nonblock(snd_hctl_t *hctl, int nonblock);
381 int snd_hctl_poll_descriptors_count(snd_hctl_t *hctl);
382 int snd_hctl_poll_descriptors(snd_hctl_t *hctl, struct pollfd *pfds, unsigned int space);
383 unsigned int snd_hctl_get_count(snd_hctl_t *hctl);
384 int snd_hctl_set_compare(snd_hctl_t *hctl, snd_hctl_compare_t hsort);
385 snd_hctl_elem_t *snd_hctl_first_elem(snd_hctl_t *hctl);
386 snd_hctl_elem_t *snd_hctl_last_elem(snd_hctl_t *hctl);
387 snd_hctl_elem_t *snd_hctl_find_elem(snd_hctl_t *hctl, const snd_ctl_elem_id_t *id);
388 void snd_hctl_set_callback(snd_hctl_t *hctl, snd_hctl_callback_t callback);
389 void snd_hctl_set_callback_private(snd_hctl_t *hctl, void *data);
390 void *snd_hctl_get_callback_private(snd_hctl_t *hctl);
391 int snd_hctl_load(snd_hctl_t *hctl);
392 int snd_hctl_free(snd_hctl_t *hctl);
393 int snd_hctl_handle_events(snd_hctl_t *hctl);
394 const char *snd_hctl_name(snd_hctl_t *hctl);
395 snd_ctl_type_t snd_hctl_type(snd_hctl_t *hctl);
396 int snd_hctl_wait(snd_hctl_t *hctl, int timeout);
398 snd_hctl_elem_t *snd_hctl_elem_next(snd_hctl_elem_t *elem);
399 snd_hctl_elem_t *snd_hctl_elem_prev(snd_hctl_elem_t *elem);
400 int snd_hctl_elem_info(snd_hctl_elem_t *elem, snd_ctl_elem_info_t * info);
401 int snd_hctl_elem_read(snd_hctl_elem_t *elem, snd_ctl_elem_value_t * value);
402 int snd_hctl_elem_write(snd_hctl_elem_t *elem, snd_ctl_elem_value_t * value);
404 snd_hctl_t *snd_hctl_elem_get_hctl(snd_hctl_elem_t *elem);
406 void snd_hctl_elem_get_id(const snd_hctl_elem_t *obj, snd_ctl_elem_id_t *ptr);
407 unsigned int snd_hctl_elem_get_numid(const snd_hctl_elem_t *obj);
408 snd_ctl_elem_iface_t snd_hctl_elem_get_interface(const snd_hctl_elem_t *obj);
409 unsigned int snd_hctl_elem_get_device(const snd_hctl_elem_t *obj);
410 unsigned int snd_hctl_elem_get_subdevice(const snd_hctl_elem_t *obj);
411 const char *snd_hctl_elem_get_name(const snd_hctl_elem_t *obj);
412 unsigned int snd_hctl_elem_get_index(const snd_hctl_elem_t *obj);
413 void snd_hctl_elem_set_callback(snd_hctl_elem_t *obj, snd_hctl_elem_callback_t val);
414 void * snd_hctl_elem_get_callback_private(const snd_hctl_elem_t *obj);
415 void snd_hctl_elem_set_callback_private(snd_hctl_elem_t *obj, void * val);