1 /****************************************************************************
6 ****************************************************************************/
8 typedef struct sndrv_aes_iec958 snd_aes_iec958_t;
9 typedef struct _snd_ctl_card_info snd_ctl_card_info_t;
10 typedef struct _snd_ctl_element_id snd_ctl_element_id_t;
11 typedef struct _snd_ctl_element_list snd_ctl_element_list_t;
12 typedef struct _snd_ctl_element_info snd_ctl_element_info_t;
13 typedef struct _snd_ctl_element snd_ctl_element_t;
14 typedef struct _snd_ctl_event snd_ctl_event_t;
16 #ifdef SND_ENUM_TYPECHECK
17 typedef struct __snd_card_type *snd_card_type_t;
18 typedef struct __snd_ctl_element_type *snd_ctl_element_type_t;
19 typedef struct __snd_ctl_element_iface *snd_ctl_element_iface_t;
20 typedef struct __snd_ctl_event_type *snd_ctl_event_type_t;
22 typedef enum sndrv_card_type snd_card_type_t;
23 typedef enum sndrv_ctl_element_type snd_ctl_element_type_t;
24 typedef enum sndrv_ctl_element_iface snd_ctl_element_iface_t;
25 typedef enum sndrv_ctl_event_type snd_ctl_event_type_t;
28 #define SND_CARD_TYPE_GUS_CLASSIC ((snd_card_type_t) SNDRV_CARD_TYPE_GUS_CLASSIC)
29 #define SND_CARD_TYPE_GUS_EXTREME ((snd_card_type_t) SNDRV_CARD_TYPE_GUS_EXTREME)
30 #define SND_CARD_TYPE_GUS_ACE ((snd_card_type_t) SNDRV_CARD_TYPE_GUS_ACE)
31 #define SND_CARD_TYPE_GUS_MAX ((snd_card_type_t) SNDRV_CARD_TYPE_GUS_MAX)
32 #define SND_CARD_TYPE_AMD_INTERWAVE ((snd_card_type_t) SNDRV_CARD_TYPE_AMD_INTERWAVE)
33 #define SND_CARD_TYPE_SB_10 ((snd_card_type_t) SNDRV_CARD_TYPE_SB_10)
34 #define SND_CARD_TYPE_SB_20 ((snd_card_type_t) SNDRV_CARD_TYPE_SB_20)
35 #define SND_CARD_TYPE_SB_PRO ((snd_card_type_t) SNDRV_CARD_TYPE_SB_PRO)
36 #define SND_CARD_TYPE_SB_16 ((snd_card_type_t) SNDRV_CARD_TYPE_SB_16)
37 #define SND_CARD_TYPE_SB_AWE ((snd_card_type_t) SNDRV_CARD_TYPE_SB_AWE)
38 #define SND_CARD_TYPE_ESS_ES1688 ((snd_card_type_t) SNDRV_CARD_TYPE_ESS_ES1688)
39 #define SND_CARD_TYPE_OPL3_SA2 ((snd_card_type_t) SNDRV_CARD_TYPE_OPL3_SA2)
40 #define SND_CARD_TYPE_MOZART ((snd_card_type_t) SNDRV_CARD_TYPE_MOZART)
41 #define SND_CARD_TYPE_S3_SONICVIBES ((snd_card_type_t) SNDRV_CARD_TYPE_S3_SONICVIBES)
42 #define SND_CARD_TYPE_ENS1370 ((snd_card_type_t) SNDRV_CARD_TYPE_ENS1370)
43 #define SND_CARD_TYPE_ENS1371 ((snd_card_type_t) SNDRV_CARD_TYPE_ENS1371)
44 #define SND_CARD_TYPE_CS4232 ((snd_card_type_t) SNDRV_CARD_TYPE_CS4232)
45 #define SND_CARD_TYPE_CS4236 ((snd_card_type_t) SNDRV_CARD_TYPE_CS4236)
46 #define SND_CARD_TYPE_AMD_INTERWAVE_STB ((snd_card_type_t) SNDRV_CARD_TYPE_AMD_INTERWAVE_STB)
47 #define SND_CARD_TYPE_ESS_ES1938 ((snd_card_type_t) SNDRV_CARD_TYPE_ESS_ES1938)
48 #define SND_CARD_TYPE_ESS_ES18XX ((snd_card_type_t) SNDRV_CARD_TYPE_ESS_ES18XX)
49 #define SND_CARD_TYPE_CS4231 ((snd_card_type_t) SNDRV_CARD_TYPE_CS4231)
50 #define SND_CARD_TYPE_OPTI92X ((snd_card_type_t) SNDRV_CARD_TYPE_OPTI92X)
51 #define SND_CARD_TYPE_SERIAL ((snd_card_type_t) SNDRV_CARD_TYPE_SERIAL)
52 #define SND_CARD_TYPE_AD1848 ((snd_card_type_t) SNDRV_CARD_TYPE_AD1848)
53 #define SND_CARD_TYPE_TRID4DWAVEDX ((snd_card_type_t) SNDRV_CARD_TYPE_TRID4DWAVEDX)
54 #define SND_CARD_TYPE_TRID4DWAVENX ((snd_card_type_t) SNDRV_CARD_TYPE_TRID4DWAVENX)
55 #define SND_CARD_TYPE_SGALAXY ((snd_card_type_t) SNDRV_CARD_TYPE_SGALAXY)
56 #define SND_CARD_TYPE_CS46XX ((snd_card_type_t) SNDRV_CARD_TYPE_CS46XX)
57 #define SND_CARD_TYPE_WAVEFRONT ((snd_card_type_t) SNDRV_CARD_TYPE_WAVEFRONT)
58 #define SND_CARD_TYPE_TROPEZ ((snd_card_type_t) SNDRV_CARD_TYPE_TROPEZ)
59 #define SND_CARD_TYPE_TROPEZPLUS ((snd_card_type_t) SNDRV_CARD_TYPE_TROPEZPLUS)
60 #define SND_CARD_TYPE_MAUI ((snd_card_type_t) SNDRV_CARD_TYPE_MAUI)
61 #define SND_CARD_TYPE_CMI8330 ((snd_card_type_t) SNDRV_CARD_TYPE_CMI8330)
62 #define SND_CARD_TYPE_DUMMY ((snd_card_type_t) SNDRV_CARD_TYPE_DUMMY)
63 #define SND_CARD_TYPE_ALS100 ((snd_card_type_t) SNDRV_CARD_TYPE_ALS100)
64 #define SND_CARD_TYPE_SHARE ((snd_card_type_t) SNDRV_CARD_TYPE_SHARE)
65 #define SND_CARD_TYPE_SI_7018 ((snd_card_type_t) SNDRV_CARD_TYPE_SI_7018)
66 #define SND_CARD_TYPE_OPTI93X ((snd_card_type_t) SNDRV_CARD_TYPE_OPTI93X)
67 #define SND_CARD_TYPE_MTPAV ((snd_card_type_t) SNDRV_CARD_TYPE_MTPAV)
68 #define SND_CARD_TYPE_VIRMIDI ((snd_card_type_t) SNDRV_CARD_TYPE_VIRMIDI)
69 #define SND_CARD_TYPE_EMU10K1 ((snd_card_type_t) SNDRV_CARD_TYPE_EMU10K1)
70 #define SND_CARD_TYPE_HAMMERFALL ((snd_card_type_t) SNDRV_CARD_TYPE_HAMMERFALL)
71 #define SND_CARD_TYPE_HAMMERFALL_LIGHT ((snd_card_type_t) SNDRV_CARD_TYPE_HAMMERFALL_LIGHT)
72 #define SND_CARD_TYPE_ICE1712 ((snd_card_type_t) SNDRV_CARD_TYPE_ICE1712)
73 #define SND_CARD_TYPE_CMI8338 ((snd_card_type_t) SNDRV_CARD_TYPE_CMI8338)
74 #define SND_CARD_TYPE_CMI8738 ((snd_card_type_t) SNDRV_CARD_TYPE_CMI8738)
75 #define SND_CARD_TYPE_AD1816A ((snd_card_type_t) SNDRV_CARD_TYPE_AD1816A)
76 #define SND_CARD_TYPE_INTEL8X0 ((snd_card_type_t) SNDRV_CARD_TYPE_INTEL8X0)
77 #define SND_CARD_TYPE_ESS_ESOLDM1 ((snd_card_type_t) SNDRV_CARD_TYPE_ESS_ESOLDM1)
78 #define SND_CARD_TYPE_ESS_ES1968 ((snd_card_type_t) SNDRV_CARD_TYPE_ESS_ES1968)
79 #define SND_CARD_TYPE_ESS_ES1978 ((snd_card_type_t) SNDRV_CARD_TYPE_ESS_ES1978)
80 #define SND_CARD_TYPE_DIGI96 ((snd_card_type_t) SNDRV_CARD_TYPE_DIGI96)
81 #define SND_CARD_TYPE_VIA82C686A ((snd_card_type_t) SNDRV_CARD_TYPE_VIA82C686A)
82 #define SND_CARD_TYPE_FM801 ((snd_card_type_t) SNDRV_CARD_TYPE_FM801)
83 #define SND_CARD_TYPE_AZT2320 ((snd_card_type_t) SNDRV_CARD_TYPE_AZT2320)
84 #define SND_CARD_TYPE_PRODIF_PLUS ((snd_card_type_t) SNDRV_CARD_TYPE_PRODIF_PLUS)
85 #define SND_CARD_TYPE_YMFPCI ((snd_card_type_t) SNDRV_CARD_TYPE_YMFPCI)
86 #define SND_CARD_TYPE_CS4281 ((snd_card_type_t) SNDRV_CARD_TYPE_CS4281)
87 #define SND_CARD_TYPE_MPU401_UART ((snd_card_type_t) SNDRV_CARD_TYPE_MPU401_UART)
88 #define SND_CARD_TYPE_ALS4000 ((snd_card_type_t) SNDRV_CARD_TYPE_ALS4000)
89 #define SND_CARD_TYPE_ALLEGRO_1 ((snd_card_type_t) SNDRV_CARD_TYPE_ALLEGRO_1)
90 #define SND_CARD_TYPE_ALLEGRO ((snd_card_type_t) SNDRV_CARD_TYPE_ALLEGRO)
91 #define SND_CARD_TYPE_MAESTRO3 ((snd_card_type_t) SNDRV_CARD_TYPE_MAESTRO3)
92 #define SND_CARD_TYPE_AWACS ((snd_card_type_t) SNDRV_CARD_TYPE_AWACS)
93 #define SND_CARD_TYPE_NM256AV ((snd_card_type_t) SNDRV_CARD_TYPE_NM256AV)
94 #define SND_CARD_TYPE_NM256ZX ((snd_card_type_t) SNDRV_CARD_TYPE_NM256ZX)
95 #define SND_CARD_TYPE_VIA8233 ((snd_card_type_t) SNDRV_CARD_TYPE_VIA8233)
96 #define SND_CARD_TYPE_LAST ((snd_card_type_t) SNDRV_CARD_TYPE_LAST)
98 #define SND_CTL_ELEMENT_TYPE_NONE ((snd_ctl_element_type_t) SNDRV_CTL_ELEMENT_TYPE_NONE)
99 #define SND_CTL_ELEMENT_TYPE_BOOLEAN ((snd_ctl_element_type_t) SNDRV_CTL_ELEMENT_TYPE_BOOLEAN)
100 #define SND_CTL_ELEMENT_TYPE_INTEGER ((snd_ctl_element_type_t) SNDRV_CTL_ELEMENT_TYPE_INTEGER)
101 #define SND_CTL_ELEMENT_TYPE_ENUMERATED ((snd_ctl_element_type_t) SNDRV_CTL_ELEMENT_TYPE_ENUMERATED)
102 #define SND_CTL_ELEMENT_TYPE_BYTES ((snd_ctl_element_type_t) SNDRV_CTL_ELEMENT_TYPE_BYTES)
103 #define SND_CTL_ELEMENT_TYPE_IEC958 ((snd_ctl_element_type_t) SNDRV_CTL_ELEMENT_TYPE_IEC958)
104 #define SND_CTL_ELEMENT_TYPE_LAST ((snd_ctl_element_type_t) SNDRV_CTL_ELEMENT_TYPE_LAST)
106 #define SND_CTL_ELEMENT_IFACE_CARD ((snd_ctl_element_iface_t) SNDRV_CTL_ELEMENT_IFACE_CARD)
107 #define SND_CTL_ELEMENT_IFACE_HWDEP ((snd_ctl_element_iface_t) SNDRV_CTL_ELEMENT_IFACE_HWDEP)
108 #define SND_CTL_ELEMENT_IFACE_MIXER ((snd_ctl_element_iface_t) SNDRV_CTL_ELEMENT_IFACE_MIXER)
109 #define SND_CTL_ELEMENT_IFACE_PCM ((snd_ctl_element_iface_t) SNDRV_CTL_ELEMENT_IFACE_PCM)
110 #define SND_CTL_ELEMENT_IFACE_RAWMIDI ((snd_ctl_element_iface_t) SNDRV_CTL_ELEMENT_IFACE_RAWMIDI)
111 #define SND_CTL_ELEMENT_IFACE_TIMER ((snd_ctl_element_iface_t) SNDRV_CTL_ELEMENT_IFACE_TIMER)
112 #define SND_CTL_ELEMENT_IFACE_SEQUENCER ((snd_ctl_element_iface_t) SNDRV_CTL_ELEMENT_IFACE_SEQUENCER)
113 #define SND_CTL_ELEMENT_IFACE_LAST ((snd_ctl_element_iface_t) SNDRV_CTL_ELEMENT_IFACE_LAST)
115 #define SND_CTL_EVENT_REBUILD ((snd_ctl_event_type_t) SNDRV_CTL_EVENT_REBUILD)
116 #define SND_CTL_EVENT_VALUE ((snd_ctl_event_type_t) SNDRV_CTL_EVENT_VALUE)
117 #define SND_CTL_EVENT_CHANGE ((snd_ctl_event_type_t) SNDRV_CTL_EVENT_CHANGE)
118 #define SND_CTL_EVENT_ADD ((snd_ctl_event_type_t) SNDRV_CTL_EVENT_ADD)
119 #define SND_CTL_EVENT_REMOVE ((snd_ctl_event_type_t) SNDRV_CTL_EVENT_REMOVE)
120 #define SND_CTL_EVENT_LAST ((snd_ctl_event_type_t) SNDRV_CTL_EVENT_LAST)
128 #ifdef SND_ENUM_TYPECHECK
129 typedef struct __snd_ctl_type *snd_ctl_type_t;
131 typedef enum _snd_ctl_type snd_ctl_type_t;
134 #define SND_CTL_TYPE_HW ((snd_ctl_type_t) SND_CTL_TYPE_HW)
135 #define SND_CTL_TYPE_SHM ((snd_ctl_type_t) SND_CTL_TYPE_SHM)
136 #define SND_CTL_TYPE_INET ((snd_ctl_type_t) SND_CTL_TYPE_INET)
138 typedef struct _snd_ctl snd_ctl_t;
139 typedef struct _snd_ctl_callbacks snd_ctl_callbacks_t;
145 int snd_card_load(int card);
146 int snd_card_next(int *card);
147 int snd_card_get_index(const char *name);
148 int snd_card_get_name(int card, char **name);
149 int snd_card_get_longname(int card, char **name);
151 int snd_defaults_card(void);
152 int snd_defaults_mixer_card(void);
153 int snd_defaults_pcm_card(void);
154 int snd_defaults_pcm_device(void);
155 int snd_defaults_rawmidi_card(void);
156 int snd_defaults_rawmidi_device(void);
158 snd_ctl_type_t snd_ctl_type(snd_ctl_t *handle);
159 int snd_ctl_open(snd_ctl_t **handle, char *name);
160 int snd_ctl_close(snd_ctl_t *handle);
161 int snd_ctl_card(snd_ctl_t *handle);
162 int snd_ctl_poll_descriptor(snd_ctl_t *handle);
163 int snd_ctl_card_info(snd_ctl_t *handle, snd_ctl_card_info_t *info);
164 int snd_ctl_clist(snd_ctl_t *handle, snd_ctl_element_list_t * list);
165 int snd_ctl_element_info(snd_ctl_t *handle, snd_ctl_element_info_t * sw);
166 int snd_ctl_element_read(snd_ctl_t *handle, snd_ctl_element_t * control);
167 int snd_ctl_element_write(snd_ctl_t *handle, snd_ctl_element_t * control);
168 int snd_ctl_hwdep_next_device(snd_ctl_t *handle, int * device);
169 int snd_ctl_hwdep_info(snd_ctl_t *handle, snd_hwdep_info_t * info);
170 int snd_ctl_pcm_next_device(snd_ctl_t *handle, int *device);
171 int snd_ctl_pcm_info(snd_ctl_t *handle, snd_pcm_info_t * info);
172 int snd_ctl_pcm_prefer_subdevice(snd_ctl_t *handle, int subdev);
173 int snd_ctl_rawmidi_next_device(snd_ctl_t *handle, int * device);
174 int snd_ctl_rawmidi_info(snd_ctl_t *handle, snd_rawmidi_info_t * info);
175 int snd_ctl_rawmidi_prefer_subdevice(snd_ctl_t *handle, int subdev);
177 int snd_ctl_read(snd_ctl_t *handle, snd_ctl_callbacks_t * callbacks);
179 void snd_ctl_element_set_bytes(snd_ctl_element_t *obj, void *data, size_t size);
181 const char *snd_ctl_element_type_name(snd_ctl_element_type_t type);
182 const char *snd_ctl_element_iface_name(snd_ctl_element_iface_t iface);
183 const char *snd_ctl_event_type_name(snd_ctl_event_type_t type);
185 int snd_ctl_element_list_alloc_space(snd_ctl_element_list_t *obj, unsigned int entries);
186 void snd_ctl_element_list_free_space(snd_ctl_element_list_t *obj);
193 * Highlevel API for controls
196 typedef struct _snd_hctl_element_list snd_hctl_element_list_t;
197 typedef struct _snd_hctl_element snd_hctl_element_t;
203 typedef int (*snd_ctl_hsort_t)(const snd_hctl_element_t *c1, const snd_hctl_element_t *c2);
204 typedef void (*snd_ctl_hcallback_rebuild_t)(snd_ctl_t *handle, void *private_data);
205 typedef void (*snd_ctl_hcallback_add_t)(snd_ctl_t *handle, void *private_data, snd_hctl_element_t *helem);
206 typedef void (*snd_hctl_element_callback_t)(snd_ctl_t *handle, snd_hctl_element_t *helem);
207 typedef void (*snd_hctl_element_private_free_t)(snd_hctl_element_t *helem);
209 int snd_ctl_hbuild(snd_ctl_t *handle, snd_ctl_hsort_t csort);
210 int snd_ctl_hfree(snd_ctl_t *handle);
211 snd_hctl_element_t *snd_ctl_hfirst(snd_ctl_t *handle);
212 snd_hctl_element_t *snd_ctl_hlast(snd_ctl_t *handle);
213 snd_hctl_element_t *snd_ctl_hnext(snd_ctl_t *handle, snd_hctl_element_t *helem);
214 snd_hctl_element_t *snd_ctl_hprev(snd_ctl_t *handle, snd_hctl_element_t *helem);
215 int snd_ctl_hcount(snd_ctl_t *handle);
216 snd_hctl_element_t *snd_ctl_hfind(snd_ctl_t *handle, snd_ctl_element_id_t *id);
217 int snd_ctl_hlist(snd_ctl_t *handle, snd_hctl_element_list_t *hlist);
218 int snd_ctl_hsort(const snd_hctl_element_t *c1, const snd_hctl_element_t *c2);
219 int snd_ctl_hresort(snd_ctl_t *handle, snd_ctl_hsort_t csort);
220 int snd_ctl_hcallback_rebuild(snd_ctl_t *handle, snd_ctl_hcallback_rebuild_t callback, void *private_data);
221 int snd_ctl_hcallback_add(snd_ctl_t *handle, snd_ctl_hcallback_add_t callback, void *private_data);
222 int snd_ctl_hevent(snd_ctl_t *handle);
224 int snd_ctl_hbag_create(void **bag);
225 int snd_ctl_hbag_destroy(void **bag, void (*hctl_element_free)(snd_hctl_element_t *helem));
226 int snd_ctl_hbag_add(void **bag, snd_hctl_element_t *helem);
227 int snd_ctl_hbag_del(void **bag, snd_hctl_element_t *helem);
228 snd_hctl_element_t *snd_ctl_hbag_find(void **bag, snd_ctl_element_id_t *id);
229 int snd_hctl_element_list_alloc_space(snd_hctl_element_list_t *obj, unsigned int entries);
230 void snd_hctl_element_list_free_space(snd_hctl_element_list_t *obj);