jpayne@69
|
1 /**
|
jpayne@69
|
2 * \file include/control.h
|
jpayne@69
|
3 * \brief Application interface library for the ALSA driver
|
jpayne@69
|
4 * \author Jaroslav Kysela <perex@perex.cz>
|
jpayne@69
|
5 * \author Abramo Bagnara <abramo@alsa-project.org>
|
jpayne@69
|
6 * \author Takashi Iwai <tiwai@suse.de>
|
jpayne@69
|
7 * \date 1998-2001
|
jpayne@69
|
8 *
|
jpayne@69
|
9 * Application interface library for the ALSA driver
|
jpayne@69
|
10 */
|
jpayne@69
|
11 /*
|
jpayne@69
|
12 * This library is free software; you can redistribute it and/or modify
|
jpayne@69
|
13 * it under the terms of the GNU Lesser General Public License as
|
jpayne@69
|
14 * published by the Free Software Foundation; either version 2.1 of
|
jpayne@69
|
15 * the License, or (at your option) any later version.
|
jpayne@69
|
16 *
|
jpayne@69
|
17 * This program is distributed in the hope that it will be useful,
|
jpayne@69
|
18 * but WITHOUT ANY WARRANTY; without even the implied warranty of
|
jpayne@69
|
19 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
jpayne@69
|
20 * GNU Lesser General Public License for more details.
|
jpayne@69
|
21 *
|
jpayne@69
|
22 * You should have received a copy of the GNU Lesser General Public
|
jpayne@69
|
23 * License along with this library; if not, write to the Free Software
|
jpayne@69
|
24 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
|
jpayne@69
|
25 *
|
jpayne@69
|
26 */
|
jpayne@69
|
27
|
jpayne@69
|
28 #ifndef __ALSA_CONTROL_H
|
jpayne@69
|
29 #define __ALSA_CONTROL_H
|
jpayne@69
|
30
|
jpayne@69
|
31 #ifdef __cplusplus
|
jpayne@69
|
32 extern "C" {
|
jpayne@69
|
33 #endif
|
jpayne@69
|
34
|
jpayne@69
|
35 /**
|
jpayne@69
|
36 * \defgroup Control Control Interface
|
jpayne@69
|
37 * The control interface.
|
jpayne@69
|
38 * See \ref control page for more details.
|
jpayne@69
|
39 * \{
|
jpayne@69
|
40 */
|
jpayne@69
|
41
|
jpayne@69
|
42 /** dlsym version for interface entry callback */
|
jpayne@69
|
43 #define SND_CONTROL_DLSYM_VERSION _dlsym_control_001
|
jpayne@69
|
44
|
jpayne@69
|
45 /** IEC958 structure */
|
jpayne@69
|
46 typedef struct snd_aes_iec958 {
|
jpayne@69
|
47 unsigned char status[24]; /**< AES/IEC958 channel status bits */
|
jpayne@69
|
48 unsigned char subcode[147]; /**< AES/IEC958 subcode bits */
|
jpayne@69
|
49 unsigned char pad; /**< nothing */
|
jpayne@69
|
50 unsigned char dig_subframe[4]; /**< AES/IEC958 subframe bits */
|
jpayne@69
|
51 } snd_aes_iec958_t;
|
jpayne@69
|
52
|
jpayne@69
|
53 /** CTL card info container */
|
jpayne@69
|
54 typedef struct _snd_ctl_card_info snd_ctl_card_info_t;
|
jpayne@69
|
55
|
jpayne@69
|
56 /** CTL element identifier container */
|
jpayne@69
|
57 typedef struct _snd_ctl_elem_id snd_ctl_elem_id_t;
|
jpayne@69
|
58
|
jpayne@69
|
59 /** CTL element identifier list container */
|
jpayne@69
|
60 typedef struct _snd_ctl_elem_list snd_ctl_elem_list_t;
|
jpayne@69
|
61
|
jpayne@69
|
62 /** CTL element info container */
|
jpayne@69
|
63 typedef struct _snd_ctl_elem_info snd_ctl_elem_info_t;
|
jpayne@69
|
64
|
jpayne@69
|
65 /** CTL element value container */
|
jpayne@69
|
66 typedef struct _snd_ctl_elem_value snd_ctl_elem_value_t;
|
jpayne@69
|
67
|
jpayne@69
|
68 /** CTL event container */
|
jpayne@69
|
69 typedef struct _snd_ctl_event snd_ctl_event_t;
|
jpayne@69
|
70
|
jpayne@69
|
71 /** CTL element type */
|
jpayne@69
|
72 typedef enum _snd_ctl_elem_type {
|
jpayne@69
|
73 /** Invalid type */
|
jpayne@69
|
74 SND_CTL_ELEM_TYPE_NONE = 0,
|
jpayne@69
|
75 /** Boolean contents */
|
jpayne@69
|
76 SND_CTL_ELEM_TYPE_BOOLEAN,
|
jpayne@69
|
77 /** Integer contents */
|
jpayne@69
|
78 SND_CTL_ELEM_TYPE_INTEGER,
|
jpayne@69
|
79 /** Enumerated contents */
|
jpayne@69
|
80 SND_CTL_ELEM_TYPE_ENUMERATED,
|
jpayne@69
|
81 /** Bytes contents */
|
jpayne@69
|
82 SND_CTL_ELEM_TYPE_BYTES,
|
jpayne@69
|
83 /** IEC958 (S/PDIF) setting content */
|
jpayne@69
|
84 SND_CTL_ELEM_TYPE_IEC958,
|
jpayne@69
|
85 /** 64-bit integer contents */
|
jpayne@69
|
86 SND_CTL_ELEM_TYPE_INTEGER64,
|
jpayne@69
|
87 SND_CTL_ELEM_TYPE_LAST = SND_CTL_ELEM_TYPE_INTEGER64
|
jpayne@69
|
88 } snd_ctl_elem_type_t;
|
jpayne@69
|
89
|
jpayne@69
|
90 /** CTL related interface */
|
jpayne@69
|
91 typedef enum _snd_ctl_elem_iface {
|
jpayne@69
|
92 /** Card level */
|
jpayne@69
|
93 SND_CTL_ELEM_IFACE_CARD = 0,
|
jpayne@69
|
94 /** Hardware dependent device */
|
jpayne@69
|
95 SND_CTL_ELEM_IFACE_HWDEP,
|
jpayne@69
|
96 /** Mixer */
|
jpayne@69
|
97 SND_CTL_ELEM_IFACE_MIXER,
|
jpayne@69
|
98 /** PCM */
|
jpayne@69
|
99 SND_CTL_ELEM_IFACE_PCM,
|
jpayne@69
|
100 /** RawMidi */
|
jpayne@69
|
101 SND_CTL_ELEM_IFACE_RAWMIDI,
|
jpayne@69
|
102 /** Timer */
|
jpayne@69
|
103 SND_CTL_ELEM_IFACE_TIMER,
|
jpayne@69
|
104 /** Sequencer */
|
jpayne@69
|
105 SND_CTL_ELEM_IFACE_SEQUENCER,
|
jpayne@69
|
106 SND_CTL_ELEM_IFACE_LAST = SND_CTL_ELEM_IFACE_SEQUENCER
|
jpayne@69
|
107 } snd_ctl_elem_iface_t;
|
jpayne@69
|
108
|
jpayne@69
|
109 /** Event class */
|
jpayne@69
|
110 typedef enum _snd_ctl_event_type {
|
jpayne@69
|
111 /** Elements related event */
|
jpayne@69
|
112 SND_CTL_EVENT_ELEM = 0,
|
jpayne@69
|
113 SND_CTL_EVENT_LAST = SND_CTL_EVENT_ELEM
|
jpayne@69
|
114 }snd_ctl_event_type_t;
|
jpayne@69
|
115
|
jpayne@69
|
116 /** Element has been removed (Warning: test this first and if set don't
|
jpayne@69
|
117 * test the other masks) \hideinitializer */
|
jpayne@69
|
118 #define SND_CTL_EVENT_MASK_REMOVE (~0U)
|
jpayne@69
|
119 /** Element value has been changed \hideinitializer */
|
jpayne@69
|
120 #define SND_CTL_EVENT_MASK_VALUE (1<<0)
|
jpayne@69
|
121 /** Element info has been changed \hideinitializer */
|
jpayne@69
|
122 #define SND_CTL_EVENT_MASK_INFO (1<<1)
|
jpayne@69
|
123 /** Element has been added \hideinitializer */
|
jpayne@69
|
124 #define SND_CTL_EVENT_MASK_ADD (1<<2)
|
jpayne@69
|
125 /** Element's TLV value has been changed \hideinitializer */
|
jpayne@69
|
126 #define SND_CTL_EVENT_MASK_TLV (1<<3)
|
jpayne@69
|
127
|
jpayne@69
|
128 /** CTL name helper */
|
jpayne@69
|
129 #define SND_CTL_NAME_NONE ""
|
jpayne@69
|
130 /** CTL name helper */
|
jpayne@69
|
131 #define SND_CTL_NAME_PLAYBACK "Playback "
|
jpayne@69
|
132 /** CTL name helper */
|
jpayne@69
|
133 #define SND_CTL_NAME_CAPTURE "Capture "
|
jpayne@69
|
134
|
jpayne@69
|
135 /** CTL name helper */
|
jpayne@69
|
136 #define SND_CTL_NAME_IEC958_NONE ""
|
jpayne@69
|
137 /** CTL name helper */
|
jpayne@69
|
138 #define SND_CTL_NAME_IEC958_SWITCH "Switch"
|
jpayne@69
|
139 /** CTL name helper */
|
jpayne@69
|
140 #define SND_CTL_NAME_IEC958_VOLUME "Volume"
|
jpayne@69
|
141 /** CTL name helper */
|
jpayne@69
|
142 #define SND_CTL_NAME_IEC958_DEFAULT "Default"
|
jpayne@69
|
143 /** CTL name helper */
|
jpayne@69
|
144 #define SND_CTL_NAME_IEC958_MASK "Mask"
|
jpayne@69
|
145 /** CTL name helper */
|
jpayne@69
|
146 #define SND_CTL_NAME_IEC958_CON_MASK "Con Mask"
|
jpayne@69
|
147 /** CTL name helper */
|
jpayne@69
|
148 #define SND_CTL_NAME_IEC958_PRO_MASK "Pro Mask"
|
jpayne@69
|
149 /** CTL name helper */
|
jpayne@69
|
150 #define SND_CTL_NAME_IEC958_PCM_STREAM "PCM Stream"
|
jpayne@69
|
151 /** Element name for IEC958 (S/PDIF) */
|
jpayne@69
|
152 #define SND_CTL_NAME_IEC958(expl,direction,what) "IEC958 " expl SND_CTL_NAME_##direction SND_CTL_NAME_IEC958_##what
|
jpayne@69
|
153
|
jpayne@69
|
154 /** Mask for the major Power State identifier */
|
jpayne@69
|
155 #define SND_CTL_POWER_MASK 0xff00
|
jpayne@69
|
156 /** ACPI/PCI Power State D0 */
|
jpayne@69
|
157 #define SND_CTL_POWER_D0 0x0000
|
jpayne@69
|
158 /** ACPI/PCI Power State D1 */
|
jpayne@69
|
159 #define SND_CTL_POWER_D1 0x0100
|
jpayne@69
|
160 /** ACPI/PCI Power State D2 */
|
jpayne@69
|
161 #define SND_CTL_POWER_D2 0x0200
|
jpayne@69
|
162 /** ACPI/PCI Power State D3 */
|
jpayne@69
|
163 #define SND_CTL_POWER_D3 0x0300
|
jpayne@69
|
164 /** ACPI/PCI Power State D3hot */
|
jpayne@69
|
165 #define SND_CTL_POWER_D3hot (SND_CTL_POWER_D3|0x0000)
|
jpayne@69
|
166 /** ACPI/PCI Power State D3cold */
|
jpayne@69
|
167 #define SND_CTL_POWER_D3cold (SND_CTL_POWER_D3|0x0001)
|
jpayne@69
|
168
|
jpayne@69
|
169 /** TLV type - Container */
|
jpayne@69
|
170 #define SND_CTL_TLVT_CONTAINER 0x0000
|
jpayne@69
|
171 /** TLV type - basic dB scale */
|
jpayne@69
|
172 #define SND_CTL_TLVT_DB_SCALE 0x0001
|
jpayne@69
|
173 /** TLV type - linear volume */
|
jpayne@69
|
174 #define SND_CTL_TLVT_DB_LINEAR 0x0002
|
jpayne@69
|
175 /** TLV type - dB range container */
|
jpayne@69
|
176 #define SND_CTL_TLVT_DB_RANGE 0x0003
|
jpayne@69
|
177 /** TLV type - dB scale specified by min/max values */
|
jpayne@69
|
178 #define SND_CTL_TLVT_DB_MINMAX 0x0004
|
jpayne@69
|
179 /** TLV type - dB scale specified by min/max values (with mute) */
|
jpayne@69
|
180 #define SND_CTL_TLVT_DB_MINMAX_MUTE 0x0005
|
jpayne@69
|
181
|
jpayne@69
|
182 /** Mute state */
|
jpayne@69
|
183 #define SND_CTL_TLV_DB_GAIN_MUTE -9999999
|
jpayne@69
|
184
|
jpayne@69
|
185 /** TLV type - fixed channel map positions */
|
jpayne@69
|
186 #define SND_CTL_TLVT_CHMAP_FIXED 0x00101
|
jpayne@69
|
187 /** TLV type - freely swappable channel map positions */
|
jpayne@69
|
188 #define SND_CTL_TLVT_CHMAP_VAR 0x00102
|
jpayne@69
|
189 /** TLV type - pair-wise swappable channel map positions */
|
jpayne@69
|
190 #define SND_CTL_TLVT_CHMAP_PAIRED 0x00103
|
jpayne@69
|
191
|
jpayne@69
|
192 /** CTL type */
|
jpayne@69
|
193 typedef enum _snd_ctl_type {
|
jpayne@69
|
194 /** Kernel level CTL */
|
jpayne@69
|
195 SND_CTL_TYPE_HW,
|
jpayne@69
|
196 /** Shared memory client CTL */
|
jpayne@69
|
197 SND_CTL_TYPE_SHM,
|
jpayne@69
|
198 /** INET client CTL (not yet implemented) */
|
jpayne@69
|
199 SND_CTL_TYPE_INET,
|
jpayne@69
|
200 /** External control plugin */
|
jpayne@69
|
201 SND_CTL_TYPE_EXT
|
jpayne@69
|
202 } snd_ctl_type_t;
|
jpayne@69
|
203
|
jpayne@69
|
204 /** Non blocking mode (flag for open mode) \hideinitializer */
|
jpayne@69
|
205 #define SND_CTL_NONBLOCK 0x0001
|
jpayne@69
|
206
|
jpayne@69
|
207 /** Async notification (flag for open mode) \hideinitializer */
|
jpayne@69
|
208 #define SND_CTL_ASYNC 0x0002
|
jpayne@69
|
209
|
jpayne@69
|
210 /** Read only (flag for open mode) \hideinitializer */
|
jpayne@69
|
211 #define SND_CTL_READONLY 0x0004
|
jpayne@69
|
212
|
jpayne@69
|
213 /** CTL handle */
|
jpayne@69
|
214 typedef struct _snd_ctl snd_ctl_t;
|
jpayne@69
|
215
|
jpayne@69
|
216 /** Don't destroy the ctl handle when close */
|
jpayne@69
|
217 #define SND_SCTL_NOFREE 0x0001
|
jpayne@69
|
218
|
jpayne@69
|
219 /** SCTL type */
|
jpayne@69
|
220 typedef struct _snd_sctl snd_sctl_t;
|
jpayne@69
|
221
|
jpayne@69
|
222 int snd_card_load(int card);
|
jpayne@69
|
223 int snd_card_next(int *card);
|
jpayne@69
|
224 int snd_card_get_index(const char *name);
|
jpayne@69
|
225 int snd_card_get_name(int card, char **name);
|
jpayne@69
|
226 int snd_card_get_longname(int card, char **name);
|
jpayne@69
|
227
|
jpayne@69
|
228 int snd_device_name_hint(int card, const char *iface, void ***hints);
|
jpayne@69
|
229 int snd_device_name_free_hint(void **hints);
|
jpayne@69
|
230 char *snd_device_name_get_hint(const void *hint, const char *id);
|
jpayne@69
|
231
|
jpayne@69
|
232 int snd_ctl_open(snd_ctl_t **ctl, const char *name, int mode);
|
jpayne@69
|
233 int snd_ctl_open_lconf(snd_ctl_t **ctl, const char *name, int mode, snd_config_t *lconf);
|
jpayne@69
|
234 int snd_ctl_open_fallback(snd_ctl_t **ctl, snd_config_t *root, const char *name, const char *orig_name, int mode);
|
jpayne@69
|
235 int snd_ctl_close(snd_ctl_t *ctl);
|
jpayne@69
|
236 int snd_ctl_nonblock(snd_ctl_t *ctl, int nonblock);
|
jpayne@69
|
237 static __inline__ int snd_ctl_abort(snd_ctl_t *ctl) { return snd_ctl_nonblock(ctl, 2); }
|
jpayne@69
|
238 int snd_async_add_ctl_handler(snd_async_handler_t **handler, snd_ctl_t *ctl,
|
jpayne@69
|
239 snd_async_callback_t callback, void *private_data);
|
jpayne@69
|
240 snd_ctl_t *snd_async_handler_get_ctl(snd_async_handler_t *handler);
|
jpayne@69
|
241 int snd_ctl_poll_descriptors_count(snd_ctl_t *ctl);
|
jpayne@69
|
242 int snd_ctl_poll_descriptors(snd_ctl_t *ctl, struct pollfd *pfds, unsigned int space);
|
jpayne@69
|
243 int snd_ctl_poll_descriptors_revents(snd_ctl_t *ctl, struct pollfd *pfds, unsigned int nfds, unsigned short *revents);
|
jpayne@69
|
244 int snd_ctl_subscribe_events(snd_ctl_t *ctl, int subscribe);
|
jpayne@69
|
245 int snd_ctl_card_info(snd_ctl_t *ctl, snd_ctl_card_info_t *info);
|
jpayne@69
|
246 int snd_ctl_elem_list(snd_ctl_t *ctl, snd_ctl_elem_list_t *list);
|
jpayne@69
|
247 int snd_ctl_elem_info(snd_ctl_t *ctl, snd_ctl_elem_info_t *info);
|
jpayne@69
|
248 int snd_ctl_elem_read(snd_ctl_t *ctl, snd_ctl_elem_value_t *data);
|
jpayne@69
|
249 int snd_ctl_elem_write(snd_ctl_t *ctl, snd_ctl_elem_value_t *data);
|
jpayne@69
|
250 int snd_ctl_elem_lock(snd_ctl_t *ctl, snd_ctl_elem_id_t *id);
|
jpayne@69
|
251 int snd_ctl_elem_unlock(snd_ctl_t *ctl, snd_ctl_elem_id_t *id);
|
jpayne@69
|
252 int snd_ctl_elem_tlv_read(snd_ctl_t *ctl, const snd_ctl_elem_id_t *id,
|
jpayne@69
|
253 unsigned int *tlv, unsigned int tlv_size);
|
jpayne@69
|
254 int snd_ctl_elem_tlv_write(snd_ctl_t *ctl, const snd_ctl_elem_id_t *id,
|
jpayne@69
|
255 const unsigned int *tlv);
|
jpayne@69
|
256 int snd_ctl_elem_tlv_command(snd_ctl_t *ctl, const snd_ctl_elem_id_t *id,
|
jpayne@69
|
257 const unsigned int *tlv);
|
jpayne@69
|
258 #ifdef __ALSA_HWDEP_H
|
jpayne@69
|
259 int snd_ctl_hwdep_next_device(snd_ctl_t *ctl, int * device);
|
jpayne@69
|
260 int snd_ctl_hwdep_info(snd_ctl_t *ctl, snd_hwdep_info_t * info);
|
jpayne@69
|
261 #endif
|
jpayne@69
|
262 #ifdef __ALSA_PCM_H
|
jpayne@69
|
263 int snd_ctl_pcm_next_device(snd_ctl_t *ctl, int *device);
|
jpayne@69
|
264 int snd_ctl_pcm_info(snd_ctl_t *ctl, snd_pcm_info_t * info);
|
jpayne@69
|
265 int snd_ctl_pcm_prefer_subdevice(snd_ctl_t *ctl, int subdev);
|
jpayne@69
|
266 #endif
|
jpayne@69
|
267 #ifdef __ALSA_RAWMIDI_H
|
jpayne@69
|
268 int snd_ctl_rawmidi_next_device(snd_ctl_t *ctl, int * device);
|
jpayne@69
|
269 int snd_ctl_rawmidi_info(snd_ctl_t *ctl, snd_rawmidi_info_t * info);
|
jpayne@69
|
270 int snd_ctl_rawmidi_prefer_subdevice(snd_ctl_t *ctl, int subdev);
|
jpayne@69
|
271 #endif
|
jpayne@69
|
272 int snd_ctl_set_power_state(snd_ctl_t *ctl, unsigned int state);
|
jpayne@69
|
273 int snd_ctl_get_power_state(snd_ctl_t *ctl, unsigned int *state);
|
jpayne@69
|
274
|
jpayne@69
|
275 int snd_ctl_read(snd_ctl_t *ctl, snd_ctl_event_t *event);
|
jpayne@69
|
276 int snd_ctl_wait(snd_ctl_t *ctl, int timeout);
|
jpayne@69
|
277 const char *snd_ctl_name(snd_ctl_t *ctl);
|
jpayne@69
|
278 snd_ctl_type_t snd_ctl_type(snd_ctl_t *ctl);
|
jpayne@69
|
279
|
jpayne@69
|
280 const char *snd_ctl_elem_type_name(snd_ctl_elem_type_t type);
|
jpayne@69
|
281 const char *snd_ctl_elem_iface_name(snd_ctl_elem_iface_t iface);
|
jpayne@69
|
282 const char *snd_ctl_event_type_name(snd_ctl_event_type_t type);
|
jpayne@69
|
283
|
jpayne@69
|
284 unsigned int snd_ctl_event_elem_get_mask(const snd_ctl_event_t *obj);
|
jpayne@69
|
285 unsigned int snd_ctl_event_elem_get_numid(const snd_ctl_event_t *obj);
|
jpayne@69
|
286 void snd_ctl_event_elem_get_id(const snd_ctl_event_t *obj, snd_ctl_elem_id_t *ptr);
|
jpayne@69
|
287 snd_ctl_elem_iface_t snd_ctl_event_elem_get_interface(const snd_ctl_event_t *obj);
|
jpayne@69
|
288 unsigned int snd_ctl_event_elem_get_device(const snd_ctl_event_t *obj);
|
jpayne@69
|
289 unsigned int snd_ctl_event_elem_get_subdevice(const snd_ctl_event_t *obj);
|
jpayne@69
|
290 const char *snd_ctl_event_elem_get_name(const snd_ctl_event_t *obj);
|
jpayne@69
|
291 unsigned int snd_ctl_event_elem_get_index(const snd_ctl_event_t *obj);
|
jpayne@69
|
292
|
jpayne@69
|
293 int snd_ctl_elem_list_alloc_space(snd_ctl_elem_list_t *obj, unsigned int entries);
|
jpayne@69
|
294 void snd_ctl_elem_list_free_space(snd_ctl_elem_list_t *obj);
|
jpayne@69
|
295
|
jpayne@69
|
296 char *snd_ctl_ascii_elem_id_get(snd_ctl_elem_id_t *id);
|
jpayne@69
|
297 int snd_ctl_ascii_elem_id_parse(snd_ctl_elem_id_t *dst, const char *str);
|
jpayne@69
|
298 int snd_ctl_ascii_value_parse(snd_ctl_t *handle,
|
jpayne@69
|
299 snd_ctl_elem_value_t *dst,
|
jpayne@69
|
300 snd_ctl_elem_info_t *info,
|
jpayne@69
|
301 const char *value);
|
jpayne@69
|
302
|
jpayne@69
|
303 size_t snd_ctl_elem_id_sizeof(void);
|
jpayne@69
|
304 /** \hideinitializer
|
jpayne@69
|
305 * \brief allocate an invalid #snd_ctl_elem_id_t using standard alloca
|
jpayne@69
|
306 * \param ptr returned pointer
|
jpayne@69
|
307 */
|
jpayne@69
|
308 #define snd_ctl_elem_id_alloca(ptr) __snd_alloca(ptr, snd_ctl_elem_id)
|
jpayne@69
|
309 int snd_ctl_elem_id_malloc(snd_ctl_elem_id_t **ptr);
|
jpayne@69
|
310 void snd_ctl_elem_id_free(snd_ctl_elem_id_t *obj);
|
jpayne@69
|
311 void snd_ctl_elem_id_clear(snd_ctl_elem_id_t *obj);
|
jpayne@69
|
312 void snd_ctl_elem_id_copy(snd_ctl_elem_id_t *dst, const snd_ctl_elem_id_t *src);
|
jpayne@69
|
313 unsigned int snd_ctl_elem_id_get_numid(const snd_ctl_elem_id_t *obj);
|
jpayne@69
|
314 snd_ctl_elem_iface_t snd_ctl_elem_id_get_interface(const snd_ctl_elem_id_t *obj);
|
jpayne@69
|
315 unsigned int snd_ctl_elem_id_get_device(const snd_ctl_elem_id_t *obj);
|
jpayne@69
|
316 unsigned int snd_ctl_elem_id_get_subdevice(const snd_ctl_elem_id_t *obj);
|
jpayne@69
|
317 const char *snd_ctl_elem_id_get_name(const snd_ctl_elem_id_t *obj);
|
jpayne@69
|
318 unsigned int snd_ctl_elem_id_get_index(const snd_ctl_elem_id_t *obj);
|
jpayne@69
|
319 void snd_ctl_elem_id_set_numid(snd_ctl_elem_id_t *obj, unsigned int val);
|
jpayne@69
|
320 void snd_ctl_elem_id_set_interface(snd_ctl_elem_id_t *obj, snd_ctl_elem_iface_t val);
|
jpayne@69
|
321 void snd_ctl_elem_id_set_device(snd_ctl_elem_id_t *obj, unsigned int val);
|
jpayne@69
|
322 void snd_ctl_elem_id_set_subdevice(snd_ctl_elem_id_t *obj, unsigned int val);
|
jpayne@69
|
323 void snd_ctl_elem_id_set_name(snd_ctl_elem_id_t *obj, const char *val);
|
jpayne@69
|
324 void snd_ctl_elem_id_set_index(snd_ctl_elem_id_t *obj, unsigned int val);
|
jpayne@69
|
325
|
jpayne@69
|
326 size_t snd_ctl_card_info_sizeof(void);
|
jpayne@69
|
327 /** \hideinitializer
|
jpayne@69
|
328 * \brief allocate an invalid #snd_ctl_card_info_t using standard alloca
|
jpayne@69
|
329 * \param ptr returned pointer
|
jpayne@69
|
330 */
|
jpayne@69
|
331 #define snd_ctl_card_info_alloca(ptr) __snd_alloca(ptr, snd_ctl_card_info)
|
jpayne@69
|
332 int snd_ctl_card_info_malloc(snd_ctl_card_info_t **ptr);
|
jpayne@69
|
333 void snd_ctl_card_info_free(snd_ctl_card_info_t *obj);
|
jpayne@69
|
334 void snd_ctl_card_info_clear(snd_ctl_card_info_t *obj);
|
jpayne@69
|
335 void snd_ctl_card_info_copy(snd_ctl_card_info_t *dst, const snd_ctl_card_info_t *src);
|
jpayne@69
|
336 int snd_ctl_card_info_get_card(const snd_ctl_card_info_t *obj);
|
jpayne@69
|
337 const char *snd_ctl_card_info_get_id(const snd_ctl_card_info_t *obj);
|
jpayne@69
|
338 const char *snd_ctl_card_info_get_driver(const snd_ctl_card_info_t *obj);
|
jpayne@69
|
339 const char *snd_ctl_card_info_get_name(const snd_ctl_card_info_t *obj);
|
jpayne@69
|
340 const char *snd_ctl_card_info_get_longname(const snd_ctl_card_info_t *obj);
|
jpayne@69
|
341 const char *snd_ctl_card_info_get_mixername(const snd_ctl_card_info_t *obj);
|
jpayne@69
|
342 const char *snd_ctl_card_info_get_components(const snd_ctl_card_info_t *obj);
|
jpayne@69
|
343
|
jpayne@69
|
344 size_t snd_ctl_event_sizeof(void);
|
jpayne@69
|
345 /** \hideinitializer
|
jpayne@69
|
346 * \brief allocate an invalid #snd_ctl_event_t using standard alloca
|
jpayne@69
|
347 * \param ptr returned pointer
|
jpayne@69
|
348 */
|
jpayne@69
|
349 #define snd_ctl_event_alloca(ptr) __snd_alloca(ptr, snd_ctl_event)
|
jpayne@69
|
350 int snd_ctl_event_malloc(snd_ctl_event_t **ptr);
|
jpayne@69
|
351 void snd_ctl_event_free(snd_ctl_event_t *obj);
|
jpayne@69
|
352 void snd_ctl_event_clear(snd_ctl_event_t *obj);
|
jpayne@69
|
353 void snd_ctl_event_copy(snd_ctl_event_t *dst, const snd_ctl_event_t *src);
|
jpayne@69
|
354 snd_ctl_event_type_t snd_ctl_event_get_type(const snd_ctl_event_t *obj);
|
jpayne@69
|
355
|
jpayne@69
|
356 size_t snd_ctl_elem_list_sizeof(void);
|
jpayne@69
|
357 /** \hideinitializer
|
jpayne@69
|
358 * \brief allocate an invalid #snd_ctl_elem_list_t using standard alloca
|
jpayne@69
|
359 * \param ptr returned pointer
|
jpayne@69
|
360 */
|
jpayne@69
|
361 #define snd_ctl_elem_list_alloca(ptr) __snd_alloca(ptr, snd_ctl_elem_list)
|
jpayne@69
|
362 int snd_ctl_elem_list_malloc(snd_ctl_elem_list_t **ptr);
|
jpayne@69
|
363 void snd_ctl_elem_list_free(snd_ctl_elem_list_t *obj);
|
jpayne@69
|
364 void snd_ctl_elem_list_clear(snd_ctl_elem_list_t *obj);
|
jpayne@69
|
365 void snd_ctl_elem_list_copy(snd_ctl_elem_list_t *dst, const snd_ctl_elem_list_t *src);
|
jpayne@69
|
366 void snd_ctl_elem_list_set_offset(snd_ctl_elem_list_t *obj, unsigned int val);
|
jpayne@69
|
367 unsigned int snd_ctl_elem_list_get_used(const snd_ctl_elem_list_t *obj);
|
jpayne@69
|
368 unsigned int snd_ctl_elem_list_get_count(const snd_ctl_elem_list_t *obj);
|
jpayne@69
|
369 void snd_ctl_elem_list_get_id(const snd_ctl_elem_list_t *obj, unsigned int idx, snd_ctl_elem_id_t *ptr);
|
jpayne@69
|
370 unsigned int snd_ctl_elem_list_get_numid(const snd_ctl_elem_list_t *obj, unsigned int idx);
|
jpayne@69
|
371 snd_ctl_elem_iface_t snd_ctl_elem_list_get_interface(const snd_ctl_elem_list_t *obj, unsigned int idx);
|
jpayne@69
|
372 unsigned int snd_ctl_elem_list_get_device(const snd_ctl_elem_list_t *obj, unsigned int idx);
|
jpayne@69
|
373 unsigned int snd_ctl_elem_list_get_subdevice(const snd_ctl_elem_list_t *obj, unsigned int idx);
|
jpayne@69
|
374 const char *snd_ctl_elem_list_get_name(const snd_ctl_elem_list_t *obj, unsigned int idx);
|
jpayne@69
|
375 unsigned int snd_ctl_elem_list_get_index(const snd_ctl_elem_list_t *obj, unsigned int idx);
|
jpayne@69
|
376
|
jpayne@69
|
377 size_t snd_ctl_elem_info_sizeof(void);
|
jpayne@69
|
378 /** \hideinitializer
|
jpayne@69
|
379 * \brief allocate an invalid #snd_ctl_elem_info_t using standard alloca
|
jpayne@69
|
380 * \param ptr returned pointer
|
jpayne@69
|
381 */
|
jpayne@69
|
382 #define snd_ctl_elem_info_alloca(ptr) __snd_alloca(ptr, snd_ctl_elem_info)
|
jpayne@69
|
383 int snd_ctl_elem_info_malloc(snd_ctl_elem_info_t **ptr);
|
jpayne@69
|
384 void snd_ctl_elem_info_free(snd_ctl_elem_info_t *obj);
|
jpayne@69
|
385 void snd_ctl_elem_info_clear(snd_ctl_elem_info_t *obj);
|
jpayne@69
|
386 void snd_ctl_elem_info_copy(snd_ctl_elem_info_t *dst, const snd_ctl_elem_info_t *src);
|
jpayne@69
|
387 snd_ctl_elem_type_t snd_ctl_elem_info_get_type(const snd_ctl_elem_info_t *obj);
|
jpayne@69
|
388 int snd_ctl_elem_info_is_readable(const snd_ctl_elem_info_t *obj);
|
jpayne@69
|
389 int snd_ctl_elem_info_is_writable(const snd_ctl_elem_info_t *obj);
|
jpayne@69
|
390 int snd_ctl_elem_info_is_volatile(const snd_ctl_elem_info_t *obj);
|
jpayne@69
|
391 int snd_ctl_elem_info_is_inactive(const snd_ctl_elem_info_t *obj);
|
jpayne@69
|
392 int snd_ctl_elem_info_is_locked(const snd_ctl_elem_info_t *obj);
|
jpayne@69
|
393 int snd_ctl_elem_info_is_tlv_readable(const snd_ctl_elem_info_t *obj);
|
jpayne@69
|
394 int snd_ctl_elem_info_is_tlv_writable(const snd_ctl_elem_info_t *obj);
|
jpayne@69
|
395 int snd_ctl_elem_info_is_tlv_commandable(const snd_ctl_elem_info_t *obj);
|
jpayne@69
|
396 int snd_ctl_elem_info_is_owner(const snd_ctl_elem_info_t *obj);
|
jpayne@69
|
397 int snd_ctl_elem_info_is_user(const snd_ctl_elem_info_t *obj);
|
jpayne@69
|
398 pid_t snd_ctl_elem_info_get_owner(const snd_ctl_elem_info_t *obj);
|
jpayne@69
|
399 unsigned int snd_ctl_elem_info_get_count(const snd_ctl_elem_info_t *obj);
|
jpayne@69
|
400 long snd_ctl_elem_info_get_min(const snd_ctl_elem_info_t *obj);
|
jpayne@69
|
401 long snd_ctl_elem_info_get_max(const snd_ctl_elem_info_t *obj);
|
jpayne@69
|
402 long snd_ctl_elem_info_get_step(const snd_ctl_elem_info_t *obj);
|
jpayne@69
|
403 long long snd_ctl_elem_info_get_min64(const snd_ctl_elem_info_t *obj);
|
jpayne@69
|
404 long long snd_ctl_elem_info_get_max64(const snd_ctl_elem_info_t *obj);
|
jpayne@69
|
405 long long snd_ctl_elem_info_get_step64(const snd_ctl_elem_info_t *obj);
|
jpayne@69
|
406 unsigned int snd_ctl_elem_info_get_items(const snd_ctl_elem_info_t *obj);
|
jpayne@69
|
407 void snd_ctl_elem_info_set_item(snd_ctl_elem_info_t *obj, unsigned int val);
|
jpayne@69
|
408 const char *snd_ctl_elem_info_get_item_name(const snd_ctl_elem_info_t *obj);
|
jpayne@69
|
409 int snd_ctl_elem_info_get_dimensions(const snd_ctl_elem_info_t *obj);
|
jpayne@69
|
410 int snd_ctl_elem_info_get_dimension(const snd_ctl_elem_info_t *obj, unsigned int idx);
|
jpayne@69
|
411 int snd_ctl_elem_info_set_dimension(snd_ctl_elem_info_t *info,
|
jpayne@69
|
412 const int dimension[4]);
|
jpayne@69
|
413 void snd_ctl_elem_info_get_id(const snd_ctl_elem_info_t *obj, snd_ctl_elem_id_t *ptr);
|
jpayne@69
|
414 unsigned int snd_ctl_elem_info_get_numid(const snd_ctl_elem_info_t *obj);
|
jpayne@69
|
415 snd_ctl_elem_iface_t snd_ctl_elem_info_get_interface(const snd_ctl_elem_info_t *obj);
|
jpayne@69
|
416 unsigned int snd_ctl_elem_info_get_device(const snd_ctl_elem_info_t *obj);
|
jpayne@69
|
417 unsigned int snd_ctl_elem_info_get_subdevice(const snd_ctl_elem_info_t *obj);
|
jpayne@69
|
418 const char *snd_ctl_elem_info_get_name(const snd_ctl_elem_info_t *obj);
|
jpayne@69
|
419 unsigned int snd_ctl_elem_info_get_index(const snd_ctl_elem_info_t *obj);
|
jpayne@69
|
420 void snd_ctl_elem_info_set_id(snd_ctl_elem_info_t *obj, const snd_ctl_elem_id_t *ptr);
|
jpayne@69
|
421 void snd_ctl_elem_info_set_numid(snd_ctl_elem_info_t *obj, unsigned int val);
|
jpayne@69
|
422 void snd_ctl_elem_info_set_interface(snd_ctl_elem_info_t *obj, snd_ctl_elem_iface_t val);
|
jpayne@69
|
423 void snd_ctl_elem_info_set_device(snd_ctl_elem_info_t *obj, unsigned int val);
|
jpayne@69
|
424 void snd_ctl_elem_info_set_subdevice(snd_ctl_elem_info_t *obj, unsigned int val);
|
jpayne@69
|
425 void snd_ctl_elem_info_set_name(snd_ctl_elem_info_t *obj, const char *val);
|
jpayne@69
|
426 void snd_ctl_elem_info_set_index(snd_ctl_elem_info_t *obj, unsigned int val);
|
jpayne@69
|
427
|
jpayne@69
|
428 int snd_ctl_add_integer_elem_set(snd_ctl_t *ctl, snd_ctl_elem_info_t *info,
|
jpayne@69
|
429 unsigned int element_count,
|
jpayne@69
|
430 unsigned int member_count,
|
jpayne@69
|
431 long min, long max, long step);
|
jpayne@69
|
432 int snd_ctl_add_integer64_elem_set(snd_ctl_t *ctl, snd_ctl_elem_info_t *info,
|
jpayne@69
|
433 unsigned int element_count,
|
jpayne@69
|
434 unsigned int member_count,
|
jpayne@69
|
435 long long min, long long max,
|
jpayne@69
|
436 long long step);
|
jpayne@69
|
437 int snd_ctl_add_boolean_elem_set(snd_ctl_t *ctl, snd_ctl_elem_info_t *info,
|
jpayne@69
|
438 unsigned int element_count,
|
jpayne@69
|
439 unsigned int member_count);
|
jpayne@69
|
440 int snd_ctl_add_enumerated_elem_set(snd_ctl_t *ctl, snd_ctl_elem_info_t *info,
|
jpayne@69
|
441 unsigned int element_count,
|
jpayne@69
|
442 unsigned int member_count,
|
jpayne@69
|
443 unsigned int items,
|
jpayne@69
|
444 const char *const labels[]);
|
jpayne@69
|
445 int snd_ctl_add_bytes_elem_set(snd_ctl_t *ctl, snd_ctl_elem_info_t *info,
|
jpayne@69
|
446 unsigned int element_count,
|
jpayne@69
|
447 unsigned int member_count);
|
jpayne@69
|
448
|
jpayne@69
|
449 int snd_ctl_elem_add_integer(snd_ctl_t *ctl, const snd_ctl_elem_id_t *id, unsigned int count, long imin, long imax, long istep);
|
jpayne@69
|
450 int snd_ctl_elem_add_integer64(snd_ctl_t *ctl, const snd_ctl_elem_id_t *id, unsigned int count, long long imin, long long imax, long long istep);
|
jpayne@69
|
451 int snd_ctl_elem_add_boolean(snd_ctl_t *ctl, const snd_ctl_elem_id_t *id, unsigned int count);
|
jpayne@69
|
452 int snd_ctl_elem_add_enumerated(snd_ctl_t *ctl, const snd_ctl_elem_id_t *id, unsigned int count, unsigned int items, const char *const names[]);
|
jpayne@69
|
453 int snd_ctl_elem_add_iec958(snd_ctl_t *ctl, const snd_ctl_elem_id_t *id);
|
jpayne@69
|
454 int snd_ctl_elem_remove(snd_ctl_t *ctl, snd_ctl_elem_id_t *id);
|
jpayne@69
|
455
|
jpayne@69
|
456 size_t snd_ctl_elem_value_sizeof(void);
|
jpayne@69
|
457 /** \hideinitializer
|
jpayne@69
|
458 * \brief allocate an invalid #snd_ctl_elem_value_t using standard alloca
|
jpayne@69
|
459 * \param ptr returned pointer
|
jpayne@69
|
460 */
|
jpayne@69
|
461 #define snd_ctl_elem_value_alloca(ptr) __snd_alloca(ptr, snd_ctl_elem_value)
|
jpayne@69
|
462 int snd_ctl_elem_value_malloc(snd_ctl_elem_value_t **ptr);
|
jpayne@69
|
463 void snd_ctl_elem_value_free(snd_ctl_elem_value_t *obj);
|
jpayne@69
|
464 void snd_ctl_elem_value_clear(snd_ctl_elem_value_t *obj);
|
jpayne@69
|
465 void snd_ctl_elem_value_copy(snd_ctl_elem_value_t *dst, const snd_ctl_elem_value_t *src);
|
jpayne@69
|
466 int snd_ctl_elem_value_compare(snd_ctl_elem_value_t *left, const snd_ctl_elem_value_t *right);
|
jpayne@69
|
467 void snd_ctl_elem_value_get_id(const snd_ctl_elem_value_t *obj, snd_ctl_elem_id_t *ptr);
|
jpayne@69
|
468 unsigned int snd_ctl_elem_value_get_numid(const snd_ctl_elem_value_t *obj);
|
jpayne@69
|
469 snd_ctl_elem_iface_t snd_ctl_elem_value_get_interface(const snd_ctl_elem_value_t *obj);
|
jpayne@69
|
470 unsigned int snd_ctl_elem_value_get_device(const snd_ctl_elem_value_t *obj);
|
jpayne@69
|
471 unsigned int snd_ctl_elem_value_get_subdevice(const snd_ctl_elem_value_t *obj);
|
jpayne@69
|
472 const char *snd_ctl_elem_value_get_name(const snd_ctl_elem_value_t *obj);
|
jpayne@69
|
473 unsigned int snd_ctl_elem_value_get_index(const snd_ctl_elem_value_t *obj);
|
jpayne@69
|
474 void snd_ctl_elem_value_set_id(snd_ctl_elem_value_t *obj, const snd_ctl_elem_id_t *ptr);
|
jpayne@69
|
475 void snd_ctl_elem_value_set_numid(snd_ctl_elem_value_t *obj, unsigned int val);
|
jpayne@69
|
476 void snd_ctl_elem_value_set_interface(snd_ctl_elem_value_t *obj, snd_ctl_elem_iface_t val);
|
jpayne@69
|
477 void snd_ctl_elem_value_set_device(snd_ctl_elem_value_t *obj, unsigned int val);
|
jpayne@69
|
478 void snd_ctl_elem_value_set_subdevice(snd_ctl_elem_value_t *obj, unsigned int val);
|
jpayne@69
|
479 void snd_ctl_elem_value_set_name(snd_ctl_elem_value_t *obj, const char *val);
|
jpayne@69
|
480 void snd_ctl_elem_value_set_index(snd_ctl_elem_value_t *obj, unsigned int val);
|
jpayne@69
|
481 int snd_ctl_elem_value_get_boolean(const snd_ctl_elem_value_t *obj, unsigned int idx);
|
jpayne@69
|
482 long snd_ctl_elem_value_get_integer(const snd_ctl_elem_value_t *obj, unsigned int idx);
|
jpayne@69
|
483 long long snd_ctl_elem_value_get_integer64(const snd_ctl_elem_value_t *obj, unsigned int idx);
|
jpayne@69
|
484 unsigned int snd_ctl_elem_value_get_enumerated(const snd_ctl_elem_value_t *obj, unsigned int idx);
|
jpayne@69
|
485 unsigned char snd_ctl_elem_value_get_byte(const snd_ctl_elem_value_t *obj, unsigned int idx);
|
jpayne@69
|
486 void snd_ctl_elem_value_set_boolean(snd_ctl_elem_value_t *obj, unsigned int idx, long val);
|
jpayne@69
|
487 void snd_ctl_elem_value_set_integer(snd_ctl_elem_value_t *obj, unsigned int idx, long val);
|
jpayne@69
|
488 void snd_ctl_elem_value_set_integer64(snd_ctl_elem_value_t *obj, unsigned int idx, long long val);
|
jpayne@69
|
489 void snd_ctl_elem_value_set_enumerated(snd_ctl_elem_value_t *obj, unsigned int idx, unsigned int val);
|
jpayne@69
|
490 void snd_ctl_elem_value_set_byte(snd_ctl_elem_value_t *obj, unsigned int idx, unsigned char val);
|
jpayne@69
|
491 void snd_ctl_elem_set_bytes(snd_ctl_elem_value_t *obj, void *data, size_t size);
|
jpayne@69
|
492 const void * snd_ctl_elem_value_get_bytes(const snd_ctl_elem_value_t *obj);
|
jpayne@69
|
493 void snd_ctl_elem_value_get_iec958(const snd_ctl_elem_value_t *obj, snd_aes_iec958_t *ptr);
|
jpayne@69
|
494 void snd_ctl_elem_value_set_iec958(snd_ctl_elem_value_t *obj, const snd_aes_iec958_t *ptr);
|
jpayne@69
|
495
|
jpayne@69
|
496 int snd_tlv_parse_dB_info(unsigned int *tlv, unsigned int tlv_size,
|
jpayne@69
|
497 unsigned int **db_tlvp);
|
jpayne@69
|
498 int snd_tlv_get_dB_range(unsigned int *tlv, long rangemin, long rangemax,
|
jpayne@69
|
499 long *min, long *max);
|
jpayne@69
|
500 int snd_tlv_convert_to_dB(unsigned int *tlv, long rangemin, long rangemax,
|
jpayne@69
|
501 long volume, long *db_gain);
|
jpayne@69
|
502 int snd_tlv_convert_from_dB(unsigned int *tlv, long rangemin, long rangemax,
|
jpayne@69
|
503 long db_gain, long *value, int xdir);
|
jpayne@69
|
504 int snd_ctl_get_dB_range(snd_ctl_t *ctl, const snd_ctl_elem_id_t *id,
|
jpayne@69
|
505 long *min, long *max);
|
jpayne@69
|
506 int snd_ctl_convert_to_dB(snd_ctl_t *ctl, const snd_ctl_elem_id_t *id,
|
jpayne@69
|
507 long volume, long *db_gain);
|
jpayne@69
|
508 int snd_ctl_convert_from_dB(snd_ctl_t *ctl, const snd_ctl_elem_id_t *id,
|
jpayne@69
|
509 long db_gain, long *value, int xdir);
|
jpayne@69
|
510
|
jpayne@69
|
511 /**
|
jpayne@69
|
512 * \defgroup HControl High level Control Interface
|
jpayne@69
|
513 * \ingroup Control
|
jpayne@69
|
514 * The high level control interface.
|
jpayne@69
|
515 * See \ref hcontrol page for more details.
|
jpayne@69
|
516 * \{
|
jpayne@69
|
517 */
|
jpayne@69
|
518
|
jpayne@69
|
519 /** HCTL element handle */
|
jpayne@69
|
520 typedef struct _snd_hctl_elem snd_hctl_elem_t;
|
jpayne@69
|
521
|
jpayne@69
|
522 /** HCTL handle */
|
jpayne@69
|
523 typedef struct _snd_hctl snd_hctl_t;
|
jpayne@69
|
524
|
jpayne@69
|
525 /**
|
jpayne@69
|
526 * \brief Compare function for sorting HCTL elements
|
jpayne@69
|
527 * \param e1 First element
|
jpayne@69
|
528 * \param e2 Second element
|
jpayne@69
|
529 * \return -1 if e1 < e2, 0 if e1 == e2, 1 if e1 > e2
|
jpayne@69
|
530 */
|
jpayne@69
|
531 typedef int (*snd_hctl_compare_t)(const snd_hctl_elem_t *e1,
|
jpayne@69
|
532 const snd_hctl_elem_t *e2);
|
jpayne@69
|
533 int snd_hctl_compare_fast(const snd_hctl_elem_t *c1,
|
jpayne@69
|
534 const snd_hctl_elem_t *c2);
|
jpayne@69
|
535 /**
|
jpayne@69
|
536 * \brief HCTL callback function
|
jpayne@69
|
537 * \param hctl HCTL handle
|
jpayne@69
|
538 * \param mask event mask
|
jpayne@69
|
539 * \param elem related HCTL element (if any)
|
jpayne@69
|
540 * \return 0 on success otherwise a negative error code
|
jpayne@69
|
541 */
|
jpayne@69
|
542 typedef int (*snd_hctl_callback_t)(snd_hctl_t *hctl,
|
jpayne@69
|
543 unsigned int mask,
|
jpayne@69
|
544 snd_hctl_elem_t *elem);
|
jpayne@69
|
545 /**
|
jpayne@69
|
546 * \brief HCTL element callback function
|
jpayne@69
|
547 * \param elem HCTL element
|
jpayne@69
|
548 * \param mask event mask
|
jpayne@69
|
549 * \return 0 on success otherwise a negative error code
|
jpayne@69
|
550 */
|
jpayne@69
|
551 typedef int (*snd_hctl_elem_callback_t)(snd_hctl_elem_t *elem,
|
jpayne@69
|
552 unsigned int mask);
|
jpayne@69
|
553
|
jpayne@69
|
554 int snd_hctl_open(snd_hctl_t **hctl, const char *name, int mode);
|
jpayne@69
|
555 int snd_hctl_open_ctl(snd_hctl_t **hctlp, snd_ctl_t *ctl);
|
jpayne@69
|
556 int snd_hctl_close(snd_hctl_t *hctl);
|
jpayne@69
|
557 int snd_hctl_nonblock(snd_hctl_t *hctl, int nonblock);
|
jpayne@69
|
558 static __inline__ int snd_hctl_abort(snd_hctl_t *hctl) { return snd_hctl_nonblock(hctl, 2); }
|
jpayne@69
|
559 int snd_hctl_poll_descriptors_count(snd_hctl_t *hctl);
|
jpayne@69
|
560 int snd_hctl_poll_descriptors(snd_hctl_t *hctl, struct pollfd *pfds, unsigned int space);
|
jpayne@69
|
561 int snd_hctl_poll_descriptors_revents(snd_hctl_t *ctl, struct pollfd *pfds, unsigned int nfds, unsigned short *revents);
|
jpayne@69
|
562 unsigned int snd_hctl_get_count(snd_hctl_t *hctl);
|
jpayne@69
|
563 int snd_hctl_set_compare(snd_hctl_t *hctl, snd_hctl_compare_t hsort);
|
jpayne@69
|
564 snd_hctl_elem_t *snd_hctl_first_elem(snd_hctl_t *hctl);
|
jpayne@69
|
565 snd_hctl_elem_t *snd_hctl_last_elem(snd_hctl_t *hctl);
|
jpayne@69
|
566 snd_hctl_elem_t *snd_hctl_find_elem(snd_hctl_t *hctl, const snd_ctl_elem_id_t *id);
|
jpayne@69
|
567 void snd_hctl_set_callback(snd_hctl_t *hctl, snd_hctl_callback_t callback);
|
jpayne@69
|
568 void snd_hctl_set_callback_private(snd_hctl_t *hctl, void *data);
|
jpayne@69
|
569 void *snd_hctl_get_callback_private(snd_hctl_t *hctl);
|
jpayne@69
|
570 int snd_hctl_load(snd_hctl_t *hctl);
|
jpayne@69
|
571 int snd_hctl_free(snd_hctl_t *hctl);
|
jpayne@69
|
572 int snd_hctl_handle_events(snd_hctl_t *hctl);
|
jpayne@69
|
573 const char *snd_hctl_name(snd_hctl_t *hctl);
|
jpayne@69
|
574 int snd_hctl_wait(snd_hctl_t *hctl, int timeout);
|
jpayne@69
|
575 snd_ctl_t *snd_hctl_ctl(snd_hctl_t *hctl);
|
jpayne@69
|
576
|
jpayne@69
|
577 snd_hctl_elem_t *snd_hctl_elem_next(snd_hctl_elem_t *elem);
|
jpayne@69
|
578 snd_hctl_elem_t *snd_hctl_elem_prev(snd_hctl_elem_t *elem);
|
jpayne@69
|
579 int snd_hctl_elem_info(snd_hctl_elem_t *elem, snd_ctl_elem_info_t * info);
|
jpayne@69
|
580 int snd_hctl_elem_read(snd_hctl_elem_t *elem, snd_ctl_elem_value_t * value);
|
jpayne@69
|
581 int snd_hctl_elem_write(snd_hctl_elem_t *elem, snd_ctl_elem_value_t * value);
|
jpayne@69
|
582 int snd_hctl_elem_tlv_read(snd_hctl_elem_t *elem, unsigned int *tlv, unsigned int tlv_size);
|
jpayne@69
|
583 int snd_hctl_elem_tlv_write(snd_hctl_elem_t *elem, const unsigned int *tlv);
|
jpayne@69
|
584 int snd_hctl_elem_tlv_command(snd_hctl_elem_t *elem, const unsigned int *tlv);
|
jpayne@69
|
585
|
jpayne@69
|
586 snd_hctl_t *snd_hctl_elem_get_hctl(snd_hctl_elem_t *elem);
|
jpayne@69
|
587
|
jpayne@69
|
588 void snd_hctl_elem_get_id(const snd_hctl_elem_t *obj, snd_ctl_elem_id_t *ptr);
|
jpayne@69
|
589 unsigned int snd_hctl_elem_get_numid(const snd_hctl_elem_t *obj);
|
jpayne@69
|
590 snd_ctl_elem_iface_t snd_hctl_elem_get_interface(const snd_hctl_elem_t *obj);
|
jpayne@69
|
591 unsigned int snd_hctl_elem_get_device(const snd_hctl_elem_t *obj);
|
jpayne@69
|
592 unsigned int snd_hctl_elem_get_subdevice(const snd_hctl_elem_t *obj);
|
jpayne@69
|
593 const char *snd_hctl_elem_get_name(const snd_hctl_elem_t *obj);
|
jpayne@69
|
594 unsigned int snd_hctl_elem_get_index(const snd_hctl_elem_t *obj);
|
jpayne@69
|
595 void snd_hctl_elem_set_callback(snd_hctl_elem_t *obj, snd_hctl_elem_callback_t val);
|
jpayne@69
|
596 void * snd_hctl_elem_get_callback_private(const snd_hctl_elem_t *obj);
|
jpayne@69
|
597 void snd_hctl_elem_set_callback_private(snd_hctl_elem_t *obj, void * val);
|
jpayne@69
|
598
|
jpayne@69
|
599 /** \} */
|
jpayne@69
|
600
|
jpayne@69
|
601 /** \} */
|
jpayne@69
|
602
|
jpayne@69
|
603 /**
|
jpayne@69
|
604 * \defgroup SControl Setup Control Interface
|
jpayne@69
|
605 * \ingroup Control
|
jpayne@69
|
606 * The setup control interface - set or modify control elements from a configuration file.
|
jpayne@69
|
607 * \{
|
jpayne@69
|
608 */
|
jpayne@69
|
609
|
jpayne@69
|
610 int snd_sctl_build(snd_sctl_t **ctl, snd_ctl_t *handle, snd_config_t *config,
|
jpayne@69
|
611 snd_config_t *private_data, int mode);
|
jpayne@69
|
612 int snd_sctl_free(snd_sctl_t *handle);
|
jpayne@69
|
613 int snd_sctl_install(snd_sctl_t *handle);
|
jpayne@69
|
614 int snd_sctl_remove(snd_sctl_t *handle);
|
jpayne@69
|
615
|
jpayne@69
|
616 /** \} */
|
jpayne@69
|
617
|
jpayne@69
|
618 #ifdef __cplusplus
|
jpayne@69
|
619 }
|
jpayne@69
|
620 #endif
|
jpayne@69
|
621
|
jpayne@69
|
622 #endif /* __ALSA_CONTROL_H */
|