ALSA project - the C library reference

mixer.h
Go to the documentation of this file.
1
11/*
12 * This library is free software; you can redistribute it and/or modify
13 * it under the terms of the GNU Lesser General Public License as
14 * published by the Free Software Foundation; either version 2.1 of
15 * the License, or (at your option) any later version.
16 *
17 * This program is distributed in the hope that it will be useful,
18 * but WITHOUT ANY WARRANTY; without even the implied warranty of
19 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
20 * GNU Lesser General Public License for more details.
21 *
22 * You should have received a copy of the GNU Lesser General Public
23 * License along with this library; if not, write to the Free Software
24 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
25 *
26 */
27
28#ifndef __ALSA_MIXER_H
29#define __ALSA_MIXER_H
30
31#ifdef __cplusplus
32 extern "C" {
33#endif
34
42 typedef struct _snd_mixer snd_mixer_t;
44 typedef struct _snd_mixer_class snd_mixer_class_t;
46 typedef struct _snd_mixer_elem snd_mixer_elem_t;
47
55 typedef int (*snd_mixer_callback_t)(snd_mixer_t *ctl,
56 unsigned int mask,
57 snd_mixer_elem_t *elem);
58
65 typedef int (*snd_mixer_elem_callback_t)(snd_mixer_elem_t *elem,
66 unsigned int mask);
67
74 typedef int (*snd_mixer_compare_t)(const snd_mixer_elem_t *e1,
75 const snd_mixer_elem_t *e2);
76
85 typedef int (*snd_mixer_event_t)(snd_mixer_class_t *class_, unsigned int mask,
86 snd_hctl_elem_t *helem, snd_mixer_elem_t *melem);
87
88
90 typedef enum _snd_mixer_elem_type {
91 /* Simple mixer elements */
92 SND_MIXER_ELEM_SIMPLE,
93 SND_MIXER_ELEM_LAST = SND_MIXER_ELEM_SIMPLE
94} snd_mixer_elem_type_t;
95
96 int snd_mixer_open(snd_mixer_t **mixer, int mode);
97 int snd_mixer_close(snd_mixer_t *mixer);
98 snd_mixer_elem_t *snd_mixer_first_elem(snd_mixer_t *mixer);
99 snd_mixer_elem_t *snd_mixer_last_elem(snd_mixer_t *mixer);
100 int snd_mixer_handle_events(snd_mixer_t *mixer);
101 int snd_mixer_attach(snd_mixer_t *mixer, const char *name);
102 int snd_mixer_attach_hctl(snd_mixer_t *mixer, snd_hctl_t *hctl);
103 int snd_mixer_detach(snd_mixer_t *mixer, const char *name);
104 int snd_mixer_detach_hctl(snd_mixer_t *mixer, snd_hctl_t *hctl);
105 int snd_mixer_get_hctl(snd_mixer_t *mixer, const char *name, snd_hctl_t **hctl);
106 int snd_mixer_poll_descriptors_count(snd_mixer_t *mixer);
107 int snd_mixer_poll_descriptors(snd_mixer_t *mixer, struct pollfd *pfds, unsigned int space);
108 int snd_mixer_poll_descriptors_revents(snd_mixer_t *mixer, struct pollfd *pfds, unsigned int nfds, unsigned short *revents);
109 int snd_mixer_load(snd_mixer_t *mixer);
110 void snd_mixer_free(snd_mixer_t *mixer);
111 int snd_mixer_wait(snd_mixer_t *mixer, int timeout);
112 int snd_mixer_set_compare(snd_mixer_t *mixer, snd_mixer_compare_t msort);
113 void snd_mixer_set_callback(snd_mixer_t *obj, snd_mixer_callback_t val);
114 void * snd_mixer_get_callback_private(const snd_mixer_t *obj);
115 void snd_mixer_set_callback_private(snd_mixer_t *obj, void * val);
116 unsigned int snd_mixer_get_count(const snd_mixer_t *obj);
117 int snd_mixer_class_unregister(snd_mixer_class_t *clss);
118
119 snd_mixer_elem_t *snd_mixer_elem_next(snd_mixer_elem_t *elem);
120 snd_mixer_elem_t *snd_mixer_elem_prev(snd_mixer_elem_t *elem);
121 void snd_mixer_elem_set_callback(snd_mixer_elem_t *obj, snd_mixer_elem_callback_t val);
122 void * snd_mixer_elem_get_callback_private(const snd_mixer_elem_t *obj);
123 void snd_mixer_elem_set_callback_private(snd_mixer_elem_t *obj, void * val);
124 snd_mixer_elem_type_t snd_mixer_elem_get_type(const snd_mixer_elem_t *obj);
125
126 int snd_mixer_class_register(snd_mixer_class_t *class_, snd_mixer_t *mixer);
127 int snd_mixer_elem_new(snd_mixer_elem_t **elem,
128 snd_mixer_elem_type_t type,
129 int compare_weight,
130 void *private_data,
131 void (*private_free)(snd_mixer_elem_t *elem));
132 int snd_mixer_elem_add(snd_mixer_elem_t *elem, snd_mixer_class_t *class_);
133 int snd_mixer_elem_remove(snd_mixer_elem_t *elem);
134 void snd_mixer_elem_free(snd_mixer_elem_t *elem);
135 int snd_mixer_elem_info(snd_mixer_elem_t *elem);
136 int snd_mixer_elem_value(snd_mixer_elem_t *elem);
137 int snd_mixer_elem_attach(snd_mixer_elem_t *melem, snd_hctl_elem_t *helem);
138 int snd_mixer_elem_detach(snd_mixer_elem_t *melem, snd_hctl_elem_t *helem);
139 int snd_mixer_elem_empty(snd_mixer_elem_t *melem);
140 void *snd_mixer_elem_get_private(const snd_mixer_elem_t *melem);
141
142 size_t snd_mixer_class_sizeof(void);
147#define snd_mixer_class_alloca(ptr) __snd_alloca(ptr, snd_mixer_class)
148 int snd_mixer_class_malloc(snd_mixer_class_t **ptr);
149 void snd_mixer_class_free(snd_mixer_class_t *obj);
150 void snd_mixer_class_copy(snd_mixer_class_t *dst, const snd_mixer_class_t *src);
151 snd_mixer_t *snd_mixer_class_get_mixer(const snd_mixer_class_t *class_);
152 snd_mixer_event_t snd_mixer_class_get_event(const snd_mixer_class_t *class_);
153 void *snd_mixer_class_get_private(const snd_mixer_class_t *class_);
154 snd_mixer_compare_t snd_mixer_class_get_compare(const snd_mixer_class_t *class_);
155 int snd_mixer_class_set_event(snd_mixer_class_t *class_, snd_mixer_event_t event);
156 int snd_mixer_class_set_private(snd_mixer_class_t *class_, void *private_data);
157 int snd_mixer_class_set_private_free(snd_mixer_class_t *class_, void (*private_free)(snd_mixer_class_t *));
158 int snd_mixer_class_set_compare(snd_mixer_class_t *class_, snd_mixer_compare_t compare);
159
167/* Simple mixer elements API */
168
170 typedef enum _snd_mixer_selem_channel_id {
172 SND_MIXER_SCHN_UNKNOWN = -1,
174 SND_MIXER_SCHN_FRONT_LEFT = 0,
176 SND_MIXER_SCHN_FRONT_RIGHT,
178 SND_MIXER_SCHN_REAR_LEFT,
180 SND_MIXER_SCHN_REAR_RIGHT,
182 SND_MIXER_SCHN_FRONT_CENTER,
184 SND_MIXER_SCHN_WOOFER,
186 SND_MIXER_SCHN_SIDE_LEFT,
188 SND_MIXER_SCHN_SIDE_RIGHT,
190 SND_MIXER_SCHN_REAR_CENTER,
191 SND_MIXER_SCHN_LAST = 31,
193 SND_MIXER_SCHN_MONO = SND_MIXER_SCHN_FRONT_LEFT
194} snd_mixer_selem_channel_id_t;
195
197 enum snd_mixer_selem_regopt_abstract {
199 SND_MIXER_SABSTRACT_NONE = 0,
201 SND_MIXER_SABSTRACT_BASIC,
202};
203
205 struct snd_mixer_selem_regopt {
207 int ver;
209 enum snd_mixer_selem_regopt_abstract abstract;
211 const char *device;
213 snd_pcm_t *playback_pcm;
215 snd_pcm_t *capture_pcm;
216};
217
219 typedef struct _snd_mixer_selem_id snd_mixer_selem_id_t;
220
221 const char *snd_mixer_selem_channel_name(snd_mixer_selem_channel_id_t channel);
222
223 int snd_mixer_selem_register(snd_mixer_t *mixer,
224 struct snd_mixer_selem_regopt *options,
225 snd_mixer_class_t **classp);
226 void snd_mixer_selem_get_id(snd_mixer_elem_t *element,
227 snd_mixer_selem_id_t *id);
228 const char *snd_mixer_selem_get_name(snd_mixer_elem_t *elem);
229 unsigned int snd_mixer_selem_get_index(snd_mixer_elem_t *elem);
230 snd_mixer_elem_t *snd_mixer_find_selem(snd_mixer_t *mixer,
231 const snd_mixer_selem_id_t *id);
232
233 int snd_mixer_selem_is_active(snd_mixer_elem_t *elem);
234 int snd_mixer_selem_is_playback_mono(snd_mixer_elem_t *elem);
235 int snd_mixer_selem_has_playback_channel(snd_mixer_elem_t *obj, snd_mixer_selem_channel_id_t channel);
236 int snd_mixer_selem_is_capture_mono(snd_mixer_elem_t *elem);
237 int snd_mixer_selem_has_capture_channel(snd_mixer_elem_t *obj, snd_mixer_selem_channel_id_t channel);
238 int snd_mixer_selem_get_capture_group(snd_mixer_elem_t *elem);
239 int snd_mixer_selem_has_common_volume(snd_mixer_elem_t *elem);
240 int snd_mixer_selem_has_playback_volume(snd_mixer_elem_t *elem);
241 int snd_mixer_selem_has_playback_volume_joined(snd_mixer_elem_t *elem);
242 int snd_mixer_selem_has_capture_volume(snd_mixer_elem_t *elem);
243 int snd_mixer_selem_has_capture_volume_joined(snd_mixer_elem_t *elem);
244 int snd_mixer_selem_has_common_switch(snd_mixer_elem_t *elem);
245 int snd_mixer_selem_has_playback_switch(snd_mixer_elem_t *elem);
246 int snd_mixer_selem_has_playback_switch_joined(snd_mixer_elem_t *elem);
247 int snd_mixer_selem_has_capture_switch(snd_mixer_elem_t *elem);
248 int snd_mixer_selem_has_capture_switch_joined(snd_mixer_elem_t *elem);
249 int snd_mixer_selem_has_capture_switch_exclusive(snd_mixer_elem_t *elem);
250
251 int snd_mixer_selem_ask_playback_vol_dB(snd_mixer_elem_t *elem, long value, long *dBvalue);
252 int snd_mixer_selem_ask_capture_vol_dB(snd_mixer_elem_t *elem, long value, long *dBvalue);
253 int snd_mixer_selem_ask_playback_dB_vol(snd_mixer_elem_t *elem, long dBvalue, int dir, long *value);
254 int snd_mixer_selem_ask_capture_dB_vol(snd_mixer_elem_t *elem, long dBvalue, int dir, long *value);
255 int snd_mixer_selem_get_playback_volume(snd_mixer_elem_t *elem, snd_mixer_selem_channel_id_t channel, long *value);
256 int snd_mixer_selem_get_capture_volume(snd_mixer_elem_t *elem, snd_mixer_selem_channel_id_t channel, long *value);
257 int snd_mixer_selem_get_playback_dB(snd_mixer_elem_t *elem, snd_mixer_selem_channel_id_t channel, long *value);
258 int snd_mixer_selem_get_capture_dB(snd_mixer_elem_t *elem, snd_mixer_selem_channel_id_t channel, long *value);
259 int snd_mixer_selem_get_playback_switch(snd_mixer_elem_t *elem, snd_mixer_selem_channel_id_t channel, int *value);
260 int snd_mixer_selem_get_capture_switch(snd_mixer_elem_t *elem, snd_mixer_selem_channel_id_t channel, int *value);
261 int snd_mixer_selem_set_playback_volume(snd_mixer_elem_t *elem, snd_mixer_selem_channel_id_t channel, long value);
262 int snd_mixer_selem_set_capture_volume(snd_mixer_elem_t *elem, snd_mixer_selem_channel_id_t channel, long value);
263 int snd_mixer_selem_set_playback_dB(snd_mixer_elem_t *elem, snd_mixer_selem_channel_id_t channel, long value, int dir);
264 int snd_mixer_selem_set_capture_dB(snd_mixer_elem_t *elem, snd_mixer_selem_channel_id_t channel, long value, int dir);
265 int snd_mixer_selem_set_playback_volume_all(snd_mixer_elem_t *elem, long value);
266 int snd_mixer_selem_set_capture_volume_all(snd_mixer_elem_t *elem, long value);
267 int snd_mixer_selem_set_playback_dB_all(snd_mixer_elem_t *elem, long value, int dir);
268 int snd_mixer_selem_set_capture_dB_all(snd_mixer_elem_t *elem, long value, int dir);
269 int snd_mixer_selem_set_playback_switch(snd_mixer_elem_t *elem, snd_mixer_selem_channel_id_t channel, int value);
270 int snd_mixer_selem_set_capture_switch(snd_mixer_elem_t *elem, snd_mixer_selem_channel_id_t channel, int value);
271 int snd_mixer_selem_set_playback_switch_all(snd_mixer_elem_t *elem, int value);
272 int snd_mixer_selem_set_capture_switch_all(snd_mixer_elem_t *elem, int value);
273 int snd_mixer_selem_get_playback_volume_range(snd_mixer_elem_t *elem,
274 long *min, long *max);
275 int snd_mixer_selem_get_playback_dB_range(snd_mixer_elem_t *elem,
276 long *min, long *max);
277 int snd_mixer_selem_set_playback_volume_range(snd_mixer_elem_t *elem,
278 long min, long max);
279 int snd_mixer_selem_get_capture_volume_range(snd_mixer_elem_t *elem,
280 long *min, long *max);
281 int snd_mixer_selem_get_capture_dB_range(snd_mixer_elem_t *elem,
282 long *min, long *max);
283 int snd_mixer_selem_set_capture_volume_range(snd_mixer_elem_t *elem,
284 long min, long max);
285
286 int snd_mixer_selem_is_enumerated(snd_mixer_elem_t *elem);
287 int snd_mixer_selem_is_enum_playback(snd_mixer_elem_t *elem);
288 int snd_mixer_selem_is_enum_capture(snd_mixer_elem_t *elem);
289 int snd_mixer_selem_get_enum_items(snd_mixer_elem_t *elem);
290 int snd_mixer_selem_get_enum_item_name(snd_mixer_elem_t *elem, unsigned int idx, size_t maxlen, char *str);
291 int snd_mixer_selem_get_enum_item(snd_mixer_elem_t *elem, snd_mixer_selem_channel_id_t channel, unsigned int *idxp);
292 int snd_mixer_selem_set_enum_item(snd_mixer_elem_t *elem, snd_mixer_selem_channel_id_t channel, unsigned int idx);
293
294 size_t snd_mixer_selem_id_sizeof(void);
299#define snd_mixer_selem_id_alloca(ptr) __snd_alloca(ptr, snd_mixer_selem_id)
300 int snd_mixer_selem_id_malloc(snd_mixer_selem_id_t **ptr);
301 void snd_mixer_selem_id_free(snd_mixer_selem_id_t *obj);
302 void snd_mixer_selem_id_copy(snd_mixer_selem_id_t *dst, const snd_mixer_selem_id_t *src);
303 const char *snd_mixer_selem_id_get_name(const snd_mixer_selem_id_t *obj);
304 unsigned int snd_mixer_selem_id_get_index(const snd_mixer_selem_id_t *obj);
305 void snd_mixer_selem_id_set_name(snd_mixer_selem_id_t *obj, const char *val);
306 void snd_mixer_selem_id_set_index(snd_mixer_selem_id_t *obj, unsigned int val);
307 int snd_mixer_selem_id_parse(snd_mixer_selem_id_t *dst, const char *str);
308
313#ifdef __cplusplus
314}
315#endif
316
317#endif /* __ALSA_MIXER_H */
318
snd_hctl_t
struct _snd_hctl snd_hctl_t
Definition: control.h:699
snd_hctl_elem_t
struct _snd_hctl_elem snd_hctl_elem_t
Definition: control.h:696
snd_mixer_elem_set_callback
void snd_mixer_elem_set_callback(snd_mixer_elem_t *obj, snd_mixer_elem_callback_t val)
Set callback function for a mixer element.
Definition: mixer.c:917
snd_mixer_attach_hctl
int snd_mixer_attach_hctl(snd_mixer_t *mixer, snd_hctl_t *hctl)
Attach an HCTL to an opened mixer.
Definition: mixer.c:232
snd_mixer_wait
int snd_mixer_wait(snd_mixer_t *mixer, int timeout)
Wait for a mixer to become ready (i.e. at least one event pending)
Definition: mixer.c:772
snd_mixer_poll_descriptors
int snd_mixer_poll_descriptors(snd_mixer_t *mixer, struct pollfd *pfds, unsigned int space)
get poll descriptors
Definition: mixer.c:722
snd_mixer_elem_value
int snd_mixer_elem_value(snd_mixer_elem_t *elem)
Mixer element values is changed.
Definition: mixer.c:515
snd_mixer_elem_get_type
snd_mixer_elem_type_t snd_mixer_elem_get_type(const snd_mixer_elem_t *obj)
Get type for a mixer element.
Definition: mixer.c:950
snd_mixer_elem_type_t
snd_mixer_elem_type_t
Definition: mixer.h:90
snd_mixer_elem_new
int snd_mixer_elem_new(snd_mixer_elem_t **elem, snd_mixer_elem_type_t type, int compare_weight, void *private_data, void(*private_free)(snd_mixer_elem_t *elem))
Allocate a new mixer element.
Definition: mixer.c:385
snd_mixer_open
int snd_mixer_open(snd_mixer_t **mixer, int mode)
Opens an empty mixer.
Definition: mixer.c:68
snd_mixer_load
int snd_mixer_load(snd_mixer_t *mixer)
Load a mixer elements.
Definition: mixer.c:580
snd_mixer_t
struct _snd_mixer snd_mixer_t
Definition: mixer.h:42
snd_mixer_get_count
unsigned int snd_mixer_get_count(const snd_mixer_t *obj)
Get elements count for a mixer.
Definition: mixer.c:906
snd_mixer_elem_add
int snd_mixer_elem_add(snd_mixer_elem_t *elem, snd_mixer_class_t *class_)
Add an element for a registered mixer element class.
Definition: mixer.c:411
snd_mixer_elem_free
void snd_mixer_elem_free(snd_mixer_elem_t *elem)
Free a mixer element.
Definition: mixer.c:489
snd_mixer_elem_set_callback_private
void snd_mixer_elem_set_callback_private(snd_mixer_elem_t *obj, void *val)
Set callback private value for a mixer element.
Definition: mixer.c:928
snd_mixer_class_t
struct _snd_mixer_class snd_mixer_class_t
Definition: mixer.h:44
snd_mixer_elem_next
snd_mixer_elem_t * snd_mixer_elem_next(snd_mixer_elem_t *elem)
get next mixer element
Definition: mixer.c:826
snd_mixer_class_get_event
snd_mixer_event_t snd_mixer_class_get_event(const snd_mixer_class_t *class_)
Get mixer event callback associated to given mixer class.
Definition: mixer.c:1018
snd_mixer_class_register
int snd_mixer_class_register(snd_mixer_class_t *class_, snd_mixer_t *mixer)
Register mixer element class.
Definition: mixer.c:528
snd_mixer_detach_hctl
int snd_mixer_detach_hctl(snd_mixer_t *mixer, snd_hctl_t *hctl)
Detach a previously attached HCTL to an opened mixer freeing all related resources.
Definition: mixer.c:286
snd_mixer_elem_callback_t
int(* snd_mixer_elem_callback_t)(snd_mixer_elem_t *elem, unsigned int mask)
Mixer element callback function.
Definition: mixer.h:65
snd_mixer_set_callback
void snd_mixer_set_callback(snd_mixer_t *obj, snd_mixer_callback_t val)
Set callback function for a mixer.
Definition: mixer.c:873
snd_mixer_class_unregister
int snd_mixer_class_unregister(snd_mixer_class_t *clss)
Unregister mixer element class and remove all its elements.
Definition: mixer.c:558
snd_mixer_class_get_private
void * snd_mixer_class_get_private(const snd_mixer_class_t *class_)
Get mixer private data associated to given mixer class.
Definition: mixer.c:1029
snd_mixer_elem_detach
int snd_mixer_elem_detach(snd_mixer_elem_t *melem, snd_hctl_elem_t *helem)
Detach an HCTL element from a mixer element.
Definition: mixer.c:119
snd_mixer_elem_get_private
void * snd_mixer_elem_get_private(const snd_mixer_elem_t *melem)
Get private data associated to give mixer element.
Definition: mixer.c:369
snd_mixer_elem_prev
snd_mixer_elem_t * snd_mixer_elem_prev(snd_mixer_elem_t *elem)
get previous mixer element
Definition: mixer.c:839
snd_mixer_first_elem
snd_mixer_elem_t * snd_mixer_first_elem(snd_mixer_t *mixer)
get first element for a mixer
Definition: mixer.c:800
snd_mixer_attach
int snd_mixer_attach(snd_mixer_t *mixer, const char *name)
Attach an HCTL specified with the CTL device name to an opened mixer.
Definition: mixer.c:210
snd_mixer_callback_t
int(* snd_mixer_callback_t)(snd_mixer_t *ctl, unsigned int mask, snd_mixer_elem_t *elem)
Mixer callback function.
Definition: mixer.h:55
snd_mixer_free
void snd_mixer_free(snd_mixer_t *mixer)
Unload all mixer elements and free all related resources.
Definition: mixer.c:598
snd_mixer_detach
int snd_mixer_detach(snd_mixer_t *mixer, const char *name)
Detach a previously attached HCTL to an opened mixer freeing all related resources.
Definition: mixer.c:262
snd_mixer_elem_t
struct _snd_mixer_elem snd_mixer_elem_t
Definition: mixer.h:46
snd_mixer_close
int snd_mixer_close(snd_mixer_t *mixer)
Close a mixer and free all related resources.
Definition: mixer.c:613
snd_mixer_last_elem
snd_mixer_elem_t * snd_mixer_last_elem(snd_mixer_t *mixer)
get last element for a mixer
Definition: mixer.c:813
snd_mixer_event_t
int(* snd_mixer_event_t)(snd_mixer_class_t *class_, unsigned int mask, snd_hctl_elem_t *helem, snd_mixer_elem_t *melem)
Event callback for the mixer class.
Definition: mixer.h:85
snd_mixer_get_callback_private
void * snd_mixer_get_callback_private(const snd_mixer_t *obj)
Get callback private value for a mixer.
Definition: mixer.c:895
snd_mixer_class_sizeof
size_t snd_mixer_class_sizeof(void)
get size of snd_mixer_class_t
Definition: mixer.c:961
snd_mixer_poll_descriptors_revents
int snd_mixer_poll_descriptors_revents(snd_mixer_t *mixer, struct pollfd *pfds, unsigned int nfds, unsigned short *revents)
get returned events from poll descriptors
Definition: mixer.c:752
snd_mixer_class_set_compare
int snd_mixer_class_set_compare(snd_mixer_class_t *class_, snd_mixer_compare_t compare)
Set mixer compare callback to given mixer class.
Definition: mixer.c:1092
snd_mixer_poll_descriptors_count
int snd_mixer_poll_descriptors_count(snd_mixer_t *mixer)
get count of poll descriptors for mixer handle
Definition: mixer.c:698
snd_mixer_class_get_mixer
snd_mixer_t * snd_mixer_class_get_mixer(const snd_mixer_class_t *class_)
Get a mixer associated to given mixer class.
Definition: mixer.c:1007
snd_mixer_set_callback_private
void snd_mixer_set_callback_private(snd_mixer_t *obj, void *val)
Set callback private value for a mixer.
Definition: mixer.c:884
snd_mixer_class_copy
void snd_mixer_class_copy(snd_mixer_class_t *dst, const snd_mixer_class_t *src)
copy one snd_mixer_class_t to another
Definition: mixer.c:996
snd_mixer_elem_get_callback_private
void * snd_mixer_elem_get_callback_private(const snd_mixer_elem_t *obj)
Get callback private value for a mixer element.
Definition: mixer.c:939
snd_mixer_elem_attach
int snd_mixer_elem_attach(snd_mixer_elem_t *melem, snd_hctl_elem_t *helem)
Attach an HCTL element to a mixer element.
Definition: mixer.c:96
snd_mixer_set_compare
int snd_mixer_set_compare(snd_mixer_t *mixer, snd_mixer_compare_t msort)
Change mixer compare function and reorder elements.
Definition: mixer.c:678
snd_mixer_elem_remove
int snd_mixer_elem_remove(snd_mixer_elem_t *elem)
Remove a mixer element.
Definition: mixer.c:455
snd_mixer_class_set_event
int snd_mixer_class_set_event(snd_mixer_class_t *class_, snd_mixer_event_t event)
Set mixer event callback to given mixer class.
Definition: mixer.c:1053
snd_mixer_class_get_compare
snd_mixer_compare_t snd_mixer_class_get_compare(const snd_mixer_class_t *class_)
Get mixer compare callback associated to given mixer class.
Definition: mixer.c:1041
snd_mixer_class_malloc
int snd_mixer_class_malloc(snd_mixer_class_t **ptr)
allocate an invalid snd_mixer_class_t using standard malloc
Definition: mixer.c:971
snd_mixer_elem_empty
int snd_mixer_elem_empty(snd_mixer_elem_t *melem)
Return true if a mixer element does not contain any HCTL elements.
Definition: mixer.c:138
snd_mixer_handle_events
int snd_mixer_handle_events(snd_mixer_t *mixer)
Handle pending mixer events invoking callbacks.
Definition: mixer.c:852
snd_mixer_elem_info
int snd_mixer_elem_info(snd_mixer_elem_t *elem)
Mixer element informations are changed.
Definition: mixer.c:503
snd_mixer_class_set_private
int snd_mixer_class_set_private(snd_mixer_class_t *class_, void *private_data)
Set mixer private data to given mixer class.
Definition: mixer.c:1066
snd_mixer_compare_t
int(* snd_mixer_compare_t)(const snd_mixer_elem_t *e1, const snd_mixer_elem_t *e2)
Compare function for sorting mixer elements.
Definition: mixer.h:74
snd_mixer_get_hctl
int snd_mixer_get_hctl(snd_mixer_t *mixer, const char *name, snd_hctl_t **hctl)
Obtain a HCTL pointer associated to given name.
Definition: mixer.c:308
snd_mixer_class_set_private_free
int snd_mixer_class_set_private_free(snd_mixer_class_t *class_, void(*private_free)(snd_mixer_class_t *))
Set mixer private data free callback to given mixer class.
Definition: mixer.c:1079
snd_mixer_class_free
void snd_mixer_class_free(snd_mixer_class_t *obj)
frees a previously allocated snd_mixer_class_t
Definition: mixer.c:984
snd_pcm_t
struct _snd_pcm snd_pcm_t
Definition: pcm.h:408
snd_mixer_selem_get_id
void snd_mixer_selem_get_id(snd_mixer_elem_t *element, snd_mixer_selem_id_t *id)
Get mixer simple element identifier.
Definition: simple.c:156
snd_mixer_selem_id_set_index
void snd_mixer_selem_id_set_index(snd_mixer_selem_id_t *obj, unsigned int val)
Set index part of a mixer simple element identifier.
Definition: simple.c:1056
snd_mixer_selem_id_copy
void snd_mixer_selem_id_copy(snd_mixer_selem_id_t *dst, const snd_mixer_selem_id_t *src)
copy one snd_mixer_selem_id_t to another
Definition: simple.c:1011
snd_mixer_selem_has_common_volume
int snd_mixer_selem_has_common_volume(snd_mixer_elem_t *elem)
Return true if mixer simple element has only one volume control for both playback and capture.
Definition: simple.c:197
snd_mixer_selem_get_playback_volume_range
int snd_mixer_selem_get_playback_volume_range(snd_mixer_elem_t *elem, long *min, long *max)
Get range for playback volume of a mixer simple element.
Definition: simple.c:280
snd_mixer_selem_has_capture_volume
int snd_mixer_selem_has_capture_volume(snd_mixer_elem_t *elem)
Return info about capture volume control of a mixer simple element.
Definition: simple.c:628
snd_mixer_selem_set_capture_volume_all
int snd_mixer_selem_set_capture_volume_all(snd_mixer_elem_t *elem, long value)
Set value of capture volume control for all channels of a mixer simple element.
Definition: simple.c:801
snd_mixer_selem_get_index
unsigned int snd_mixer_selem_get_index(snd_mixer_elem_t *elem)
Get index part of mixer simple element identifier.
Definition: simple.c:184
snd_mixer_selem_get_playback_volume
int snd_mixer_selem_get_playback_volume(snd_mixer_elem_t *elem, snd_mixer_selem_channel_id_t channel, long *value)
Return value of playback volume control of a mixer simple element.
Definition: simple.c:398
snd_mixer_selem_has_capture_switch_joined
int snd_mixer_selem_has_capture_switch_joined(snd_mixer_elem_t *elem)
Return info about capture switch control of a mixer simple element.
Definition: simple.c:661
snd_mixer_selem_has_playback_switch_joined
int snd_mixer_selem_has_playback_switch_joined(snd_mixer_elem_t *elem)
Return info about playback switch control of a mixer simple element.
Definition: simple.c:355
snd_mixer_selem_has_capture_volume_joined
int snd_mixer_selem_has_capture_volume_joined(snd_mixer_elem_t *elem)
Return info about capture volume control of a mixer simple element.
Definition: simple.c:639
snd_mixer_selem_has_playback_volume
int snd_mixer_selem_has_playback_volume(snd_mixer_elem_t *elem)
Return info about playback volume control of a mixer simple element.
Definition: simple.c:322
snd_mixer_selem_set_playback_switch
int snd_mixer_selem_set_playback_switch(snd_mixer_elem_t *elem, snd_mixer_selem_channel_id_t channel, int value)
Set value of playback switch control of a mixer simple element.
Definition: simple.c:524
snd_mixer_selem_has_capture_switch_exclusive
int snd_mixer_selem_has_capture_switch_exclusive(snd_mixer_elem_t *elem)
Return info about capture switch control of a mixer simple element.
Definition: simple.c:672
snd_mixer_selem_set_playback_volume
int snd_mixer_selem_set_playback_volume(snd_mixer_elem_t *elem, snd_mixer_selem_channel_id_t channel, long value)
Set value of playback volume control of a mixer simple element.
Definition: simple.c:446
snd_mixer_selem_set_playback_volume_all
int snd_mixer_selem_set_playback_volume_all(snd_mixer_elem_t *elem, long value)
Set value of playback volume control for all channels of a mixer simple element.
Definition: simple.c:475
snd_mixer_selem_get_capture_dB
int snd_mixer_selem_get_capture_dB(snd_mixer_elem_t *elem, snd_mixer_selem_channel_id_t channel, long *value)
Return value of capture volume in dB control of a mixer simple element.
Definition: simple.c:744
snd_mixer_selem_id_sizeof
size_t snd_mixer_selem_id_sizeof(void)
get size of snd_mixer_selem_id_t
Definition: simple.c:978
snd_mixer_selem_id_free
void snd_mixer_selem_id_free(snd_mixer_selem_id_t *obj)
frees a previously allocated snd_mixer_selem_id_t
Definition: simple.c:1001
snd_mixer_selem_get_capture_dB_range
int snd_mixer_selem_get_capture_dB_range(snd_mixer_elem_t *elem, long *min, long *max)
Get range in dB for capture volume of a mixer simple element.
Definition: simple.c:600
snd_mixer_selem_set_capture_dB_all
int snd_mixer_selem_set_capture_dB_all(snd_mixer_elem_t *elem, long value, int dir)
Set value in dB of capture volume control for all channels of a mixer simple element.
Definition: simple.c:826
snd_mixer_selem_get_capture_volume
int snd_mixer_selem_get_capture_volume(snd_mixer_elem_t *elem, snd_mixer_selem_channel_id_t channel, long *value)
Return value of capture volume control of a mixer simple element.
Definition: simple.c:730
snd_mixer_selem_ask_playback_dB_vol
int snd_mixer_selem_ask_playback_dB_vol(snd_mixer_elem_t *elem, long dBvalue, int dir, long *value)
Return corresponding integer playback volume for given dB value for a mixer simple element.
Definition: simple.c:384
snd_mixer_selem_set_capture_switch
int snd_mixer_selem_set_capture_switch(snd_mixer_elem_t *elem, snd_mixer_selem_channel_id_t channel, int value)
Set value of capture switch control of a mixer simple element.
Definition: simple.c:850
snd_mixer_selem_ask_capture_dB_vol
int snd_mixer_selem_ask_capture_dB_vol(snd_mixer_elem_t *elem, long dBvalue, int dir, long *value)
Return corresponding integer capture volume for given dB value for a mixer simple element.
Definition: simple.c:716
snd_mixer_selem_is_active
int snd_mixer_selem_is_active(snd_mixer_elem_t *elem)
Get info about the active state of a mixer simple element.
Definition: simple.c:245
snd_mixer_selem_has_common_switch
int snd_mixer_selem_has_common_switch(snd_mixer_elem_t *elem)
Return true if mixer simple element has only one switch control for both playback and capture.
Definition: simple.c:208
snd_mixer_selem_get_capture_switch
int snd_mixer_selem_get_capture_switch(snd_mixer_elem_t *elem, snd_mixer_selem_channel_id_t channel, int *value)
Return value of capture switch control of a mixer simple element.
Definition: simple.c:758
snd_mixer_selem_has_playback_switch
int snd_mixer_selem_has_playback_switch(snd_mixer_elem_t *elem)
Return info about playback switch control existence of a mixer simple element.
Definition: simple.c:344
snd_mixer_selem_set_playback_dB_all
int snd_mixer_selem_set_playback_dB_all(snd_mixer_elem_t *elem, long value, int dir)
Set value in dB of playback volume control for all channels of a mixer simple element.
Definition: simple.c:500
snd_mixer_selem_get_playback_switch
int snd_mixer_selem_get_playback_switch(snd_mixer_elem_t *elem, snd_mixer_selem_channel_id_t channel, int *value)
Return value of playback switch control of a mixer simple element.
Definition: simple.c:432
snd_mixer_selem_channel_name
const char * snd_mixer_selem_channel_name(snd_mixer_selem_channel_id_t channel)
Return name of mixer simple element channel.
Definition: simple.c:219
snd_mixer_selem_set_capture_volume_range
int snd_mixer_selem_set_capture_volume_range(snd_mixer_elem_t *elem, long min, long max)
Set range for capture volume of a mixer simple element.
Definition: simple.c:614
snd_mixer_selem_has_playback_channel
int snd_mixer_selem_has_playback_channel(snd_mixer_elem_t *obj, snd_mixer_selem_channel_id_t channel)
Get info about channels of playback stream of a mixer simple element.
Definition: simple.c:268
snd_mixer_selem_get_enum_item
int snd_mixer_selem_get_enum_item(snd_mixer_elem_t *elem, snd_mixer_selem_channel_id_t channel, unsigned int *idxp)
get the current selected enumerated item for the given mixer simple element
Definition: simple.c:949
snd_mixer_selem_has_capture_switch
int snd_mixer_selem_has_capture_switch(snd_mixer_elem_t *elem)
Return info about capture switch control existence of a mixer simple element.
Definition: simple.c:650
snd_mixer_selem_get_playback_dB
int snd_mixer_selem_get_playback_dB(snd_mixer_elem_t *elem, snd_mixer_selem_channel_id_t channel, long *value)
Return value of playback volume in dB control of a mixer simple element.
Definition: simple.c:412
snd_mixer_selem_get_name
const char * snd_mixer_selem_get_name(snd_mixer_elem_t *elem)
Get name part of mixer simple element identifier.
Definition: simple.c:171
snd_mixer_selem_id_parse
int snd_mixer_selem_id_parse(snd_mixer_selem_id_t *dst, const char *str)
Parse ASCII simple mixer element identifier.
Definition: simple.c:1067
snd_mixer_selem_ask_capture_vol_dB
int snd_mixer_selem_ask_capture_vol_dB(snd_mixer_elem_t *elem, long value, long *dBvalue)
Return corresponding dB value to an integer capture volume for a mixer simple element.
Definition: simple.c:700
snd_mixer_selem_set_capture_volume
int snd_mixer_selem_set_capture_volume(snd_mixer_elem_t *elem, snd_mixer_selem_channel_id_t channel, long value)
Set value of capture volume control of a mixer simple element.
Definition: simple.c:772
snd_mixer_selem_set_playback_dB
int snd_mixer_selem_set_playback_dB(snd_mixer_elem_t *elem, snd_mixer_selem_channel_id_t channel, long value, int dir)
Set value in dB of playback volume control of a mixer simple element.
Definition: simple.c:462
snd_mixer_selem_is_enum_capture
int snd_mixer_selem_is_enum_capture(snd_mixer_elem_t *elem)
Return true if mixer simple enumerated element belongs to the capture direction.
Definition: simple.c:907
snd_mixer_selem_get_capture_volume_range
int snd_mixer_selem_get_capture_volume_range(snd_mixer_elem_t *elem, long *min, long *max)
Get range for capture volume of a mixer simple element.
Definition: simple.c:586
snd_mixer_selem_set_playback_switch_all
int snd_mixer_selem_set_playback_switch_all(snd_mixer_elem_t *elem, int value)
Set value of playback switch control for all channels of a mixer simple element.
Definition: simple.c:537
snd_mixer_selem_is_enumerated
int snd_mixer_selem_is_enumerated(snd_mixer_elem_t *elem)
Return true if mixer simple element is an enumerated control.
Definition: simple.c:885
snd_mixer_selem_regopt_abstract
snd_mixer_selem_regopt_abstract
Definition: mixer.h:197
snd_mixer_selem_get_enum_items
int snd_mixer_selem_get_enum_items(snd_mixer_elem_t *elem)
Return the number of enumerated items of the given mixer simple element.
Definition: simple.c:918
snd_mixer_selem_id_get_index
unsigned int snd_mixer_selem_id_get_index(const snd_mixer_selem_id_t *obj)
Get index part of a mixer simple element identifier.
Definition: simple.c:1033
snd_mixer_selem_has_capture_channel
int snd_mixer_selem_has_capture_channel(snd_mixer_elem_t *obj, snd_mixer_selem_channel_id_t channel)
Get info about channels of capture stream of a mixer simple element.
Definition: simple.c:573
snd_mixer_selem_id_t
struct _snd_mixer_selem_id snd_mixer_selem_id_t
Definition: mixer.h:219
snd_mixer_selem_set_capture_dB
int snd_mixer_selem_set_capture_dB(snd_mixer_elem_t *elem, snd_mixer_selem_channel_id_t channel, long value, int dir)
Set value in dB of capture volume control of a mixer simple element.
Definition: simple.c:788
snd_mixer_selem_id_malloc
int snd_mixer_selem_id_malloc(snd_mixer_selem_id_t **ptr)
allocate an invalid snd_mixer_selem_id_t using standard malloc
Definition: simple.c:988
snd_mixer_selem_ask_playback_vol_dB
int snd_mixer_selem_ask_playback_vol_dB(snd_mixer_elem_t *elem, long value, long *dBvalue)
Return corresponding dB value to an integer playback volume for a mixer simple element.
Definition: simple.c:368
snd_mixer_selem_get_enum_item_name
int snd_mixer_selem_get_enum_item_name(snd_mixer_elem_t *elem, unsigned int idx, size_t maxlen, char *str)
get the enumerated item string for the given mixer simple element
Definition: simple.c:933
snd_mixer_selem_is_playback_mono
int snd_mixer_selem_is_playback_mono(snd_mixer_elem_t *elem)
Get info about channels of playback stream of a mixer simple element.
Definition: simple.c:256
snd_mixer_selem_id_set_name
void snd_mixer_selem_id_set_name(snd_mixer_selem_id_t *obj, const char *val)
Set name part of a mixer simple element identifier.
Definition: simple.c:1044
snd_mixer_selem_set_capture_switch_all
int snd_mixer_selem_set_capture_switch_all(snd_mixer_elem_t *elem, int value)
Set value of capture switch control for all channels of a mixer simple element.
Definition: simple.c:863
snd_mixer_find_selem
snd_mixer_elem_t * snd_mixer_find_selem(snd_mixer_t *mixer, const snd_mixer_selem_id_t *id)
Find a mixer simple element.
Definition: simple.c:133
snd_mixer_selem_get_playback_dB_range
int snd_mixer_selem_get_playback_dB_range(snd_mixer_elem_t *elem, long *min, long *max)
Get range in dB for playback volume of a mixer simple element.
Definition: simple.c:294
snd_mixer_selem_is_capture_mono
int snd_mixer_selem_is_capture_mono(snd_mixer_elem_t *elem)
Get info about channels of capture stream of a mixer simple element.
Definition: simple.c:560
snd_mixer_selem_set_enum_item
int snd_mixer_selem_set_enum_item(snd_mixer_elem_t *elem, snd_mixer_selem_channel_id_t channel, unsigned int idx)
set the current selected enumerated item for the given mixer simple element
Definition: simple.c:965
snd_mixer_selem_register
int snd_mixer_selem_register(snd_mixer_t *mixer, struct snd_mixer_selem_regopt *options, snd_mixer_class_t **classp)
Register mixer simple element class.
Definition: simple.c:50
snd_mixer_selem_get_capture_group
int snd_mixer_selem_get_capture_group(snd_mixer_elem_t *elem)
Return info about capture switch control of a mixer simple element.
Definition: simple.c:683
snd_mixer_selem_is_enum_playback
int snd_mixer_selem_is_enum_playback(snd_mixer_elem_t *elem)
Return true if mixer simple enumerated element belongs to the playback direction.
Definition: simple.c:896
snd_mixer_selem_channel_id_t
snd_mixer_selem_channel_id_t
Definition: mixer.h:170
snd_mixer_selem_has_playback_volume_joined
int snd_mixer_selem_has_playback_volume_joined(snd_mixer_elem_t *elem)
Return info about playback volume control of a mixer simple element.
Definition: simple.c:333
snd_mixer_selem_set_playback_volume_range
int snd_mixer_selem_set_playback_volume_range(snd_mixer_elem_t *elem, long min, long max)
Set range for playback volume of a mixer simple element.
Definition: simple.c:308
snd_mixer_selem_id_get_name
const char * snd_mixer_selem_id_get_name(const snd_mixer_selem_id_t *obj)
Get name part of a mixer simple element identifier.
Definition: simple.c:1022
SND_MIXER_SABSTRACT_BASIC
@ SND_MIXER_SABSTRACT_BASIC
Definition: mixer.h:201
SND_MIXER_SABSTRACT_NONE
@ SND_MIXER_SABSTRACT_NONE
Definition: mixer.h:199
SND_MIXER_SCHN_MONO
@ SND_MIXER_SCHN_MONO
Definition: mixer.h:193
SND_MIXER_SCHN_REAR_CENTER
@ SND_MIXER_SCHN_REAR_CENTER
Definition: mixer.h:190
SND_MIXER_SCHN_FRONT_CENTER
@ SND_MIXER_SCHN_FRONT_CENTER
Definition: mixer.h:182
SND_MIXER_SCHN_UNKNOWN
@ SND_MIXER_SCHN_UNKNOWN
Definition: mixer.h:172
SND_MIXER_SCHN_SIDE_LEFT
@ SND_MIXER_SCHN_SIDE_LEFT
Definition: mixer.h:186
SND_MIXER_SCHN_FRONT_RIGHT
@ SND_MIXER_SCHN_FRONT_RIGHT
Definition: mixer.h:176
SND_MIXER_SCHN_REAR_LEFT
@ SND_MIXER_SCHN_REAR_LEFT
Definition: mixer.h:178
SND_MIXER_SCHN_WOOFER
@ SND_MIXER_SCHN_WOOFER
Definition: mixer.h:184
SND_MIXER_SCHN_SIDE_RIGHT
@ SND_MIXER_SCHN_SIDE_RIGHT
Definition: mixer.h:188
SND_MIXER_SCHN_REAR_RIGHT
@ SND_MIXER_SCHN_REAR_RIGHT
Definition: mixer.h:180
SND_MIXER_SCHN_FRONT_LEFT
@ SND_MIXER_SCHN_FRONT_LEFT
Definition: mixer.h:174
ptr
void * ptr
Definition: seq_event.h:1
snd_mixer_selem_regopt
Definition: mixer.h:205
snd_mixer_selem_regopt::ver
int ver
Definition: mixer.h:207
snd_mixer_selem_regopt::playback_pcm
snd_pcm_t * playback_pcm
Definition: mixer.h:213
snd_mixer_selem_regopt::abstract
enum snd_mixer_selem_regopt_abstract abstract
Definition: mixer.h:209
snd_mixer_selem_regopt::device
const char * device
Definition: mixer.h:211
snd_mixer_selem_regopt::capture_pcm
snd_pcm_t * capture_pcm
Definition: mixer.h:215