1 /****************************************************************************
6 ****************************************************************************/
8 typedef struct _snd_mixer snd_mixer_t;
14 int snd_mixer_open(snd_mixer_t **handle, char *name);
15 int snd_mixer_close(snd_mixer_t *handle);
16 int snd_mixer_card(snd_mixer_t *handle);
17 int snd_mixer_poll_descriptor(snd_mixer_t *handle);
24 * Simple (legacy) mixer API
27 enum _snd_mixer_channel_id {
28 SND_MIXER_CHN_UNKNOWN = -1,
29 SND_MIXER_CHN_FRONT_LEFT = 0,
30 SND_MIXER_CHN_FRONT_RIGHT,
31 SND_MIXER_CHN_FRONT_CENTER,
32 SND_MIXER_CHN_REAR_LEFT,
33 SND_MIXER_CHN_REAR_RIGHT,
35 SND_MIXER_CHN_LAST = 31,
36 SND_MIXER_CHN_MONO = SND_MIXER_CHN_FRONT_LEFT
39 #ifdef SND_ENUM_TYPECHECK
40 typedef struct __snd_mixer_channel_id *snd_mixer_channel_id_t;
42 typedef enum _snd_mixer_channel_id snd_mixer_channel_id_t;
45 #define SND_MIXER_CHN_UNKNOWN ((snd_mixer_channel_id_t) SND_MIXER_CHN_UNKNOWN)
46 #define SND_MIXER_CHN_FRONT_LEFT ((snd_mixer_channel_id_t) SND_MIXER_CHN_FRONT_LEFT)
47 #define SND_MIXER_CHN_FRONT_RIGHT ((snd_mixer_channel_id_t) SND_MIXER_CHN_FRONT_RIGHT)
48 #define SND_MIXER_CHN_FRONT_CENTER ((snd_mixer_channel_id_t) SND_MIXER_CHN_FRONT_CENTER)
49 #define SND_MIXER_CHN_REAR_LEFT ((snd_mixer_channel_id_t) SND_MIXER_CHN_REAR_LEFT)
50 #define SND_MIXER_CHN_REAR_RIGHT ((snd_mixer_channel_id_t) SND_MIXER_CHN_REAR_RIGHT)
51 #define SND_MIXER_CHN_WOOFER ((snd_mixer_channel_id_t) SND_MIXER_CHN_WOOFER)
52 #define SND_MIXER_CHN_LAST ((snd_mixer_channel_id_t) SND_MIXER_CHN_LAST)
53 #define SND_MIXER_CHN_MONO ((snd_mixer_channel_id_t) SND_MIXER_CHN_MONO)
55 #define SND_MIXER_CHN_MASK_MONO (1<<snd_enum_to_int(SND_MIXER_CHN_MONO))
56 #define SND_MIXER_CHN_MASK_FRONT_LEFT (1<<snd_enum_to_int(SND_MIXER_CHN_FRONT_LEFT))
57 #define SND_MIXER_CHN_MASK_FRONT_RIGHT (1<<snd_enum_to_int(SND_MIXER_CHN_FRONT_RIGHT))
58 #define SND_MIXER_CHN_MASK_FRONT_CENTER (1<<snd_enum_to_int(SND_MIXER_CHN_FRONT_CENTER))
59 #define SND_MIXER_CHN_MASK_REAR_LEFT (1<<snd_enum_to_int(SND_MIXER_CHN_REAR_LEFT))
60 #define SND_MIXER_CHN_MASK_REAR_RIGHT (1<<snd_enum_to_int(SND_MIXER_CHN_REAR_RIGHT))
61 #define SND_MIXER_CHN_MASK_WOOFER (1<<snd_enum_to_int(SND_MIXER_CHN_WOOFER))
62 #define SND_MIXER_CHN_MASK_STEREO (SND_MIXER_CHN_MASK_FRONT_LEFT|SND_MIXER_CHN_MASK_FRONT_RIGHT)
64 #define SND_MIXER_SCTCAP_VOLUME (1<<0)
65 #define SND_MIXER_SCTCAP_JOINTLY_VOLUME (1<<1)
66 #define SND_MIXER_SCTCAP_MUTE (1<<2)
67 #define SND_MIXER_SCTCAP_JOINTLY_MUTE (1<<3)
68 #define SND_MIXER_SCTCAP_CAPTURE (1<<4)
69 #define SND_MIXER_SCTCAP_JOINTLY_CAPTURE (1<<5)
70 #define SND_MIXER_SCTCAP_EXCL_CAPTURE (1<<6)
72 typedef struct _snd_mixer_sid {
73 unsigned char name[60];
77 typedef struct _snd_mixer_simple_element_list {
78 unsigned int controls_offset; /* W: first control ID to get */
79 unsigned int controls_request; /* W: count of control IDs to get */
80 unsigned int controls_count; /* R: count of available (set) IDs */
81 unsigned int controls; /* R: count of all available controls */
82 snd_mixer_sid_t *pids; /* W: IDs */
84 } snd_mixer_simple_element_list_t;
86 typedef struct _snd_mixer_simple_element {
87 snd_mixer_sid_t sid; /* WR: simple control identification */
88 unsigned int caps; /* RO: capabilities */
89 unsigned int channels; /* RO: bitmap of active channels */
90 unsigned int mute; /* RW: bitmap of muted channels */
91 unsigned int capture; /* RW: bitmap of capture channels */
92 int capture_group; /* RO: capture group (for exclusive capture) */
93 long min; /* RO: minimum value */
94 long max; /* RO: maximum value */
98 long front_left; /* front left value */
99 long front_right; /* front right value */
100 long front_center; /* front center */
101 long rear_left; /* left rear */
102 long rear_right; /* right rear */
103 long woofer; /* woofer */
107 } snd_mixer_simple_element_t;
109 typedef struct _snd_mixer_simple_callbacks {
110 void *private_data; /* may be used by an application */
111 void (*rebuild) (snd_mixer_t *handle, void *private_data);
112 void (*value) (snd_mixer_t *handle, void *private_data, snd_mixer_sid_t *id);
113 void (*change) (snd_mixer_t *handle, void *private_data, snd_mixer_sid_t *id);
114 void (*add) (snd_mixer_t *handle, void *private_data, snd_mixer_sid_t *id);
115 void (*remove) (snd_mixer_t *handle, void *private_data, snd_mixer_sid_t *id);
116 void *reserved[58]; /* reserved for future use - must be NULL!!! */
117 } snd_mixer_simple_callbacks_t;
123 const char *snd_mixer_simple_channel_name(snd_mixer_channel_id_t channel);
124 int snd_mixer_simple_element_list(snd_mixer_t *handle, snd_mixer_simple_element_list_t *list);
125 int snd_mixer_simple_element_read(snd_mixer_t *handle, snd_mixer_simple_element_t *simple);
126 int snd_mixer_simple_element_write(snd_mixer_t *handle, snd_mixer_simple_element_t *simple);
127 int snd_mixer_simple_read(snd_mixer_t *handle, snd_mixer_simple_callbacks_t *callbacks);