2 * \file <alsa/mixer_ordinary.h>
3 * \brief Application interface library for the ALSA driver
4 * \author Jaroslav Kysela <perex@suse.cz>
7 * Application interface library for the ALSA driver.
8 * See the \ref mixer_ordinary page for more details.
11 * This library is free software; you can redistribute it and/or modify
12 * it under the terms of the GNU Lesser General Public License as
13 * published by the Free Software Foundation; either version 2.1 of
14 * the License, or (at your option) any later version.
16 * This program is distributed in the hope that it will be useful,
17 * but WITHOUT ANY WARRANTY; without even the implied warranty of
18 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
19 * GNU Lesser General Public License for more details.
21 * You should have received a copy of the GNU Lesser General Public
22 * License along with this library; if not, write to the Free Software
23 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
27 #ifndef __ALSA_MIXER_SIMPLE_H
28 #define __ALSA_MIXER_SIMPLE_H
30 #include <alsa/asoundlib.h>
32 /** Ordinary Mixer I/O type */
33 enum sndo_mixer_io_type {
39 /** Master volume - left (0-1000) */
40 SNDO_MIO_MASTER_LVOL = 0,
41 /** Master volume - right (0-1000) */
43 /** Master volume - left surround (0-1000) */
44 SNDO_MIO_MASTER_LSVOL = 0,
45 /** Master volume - right surround (0-1000) */
46 SNDO_MIO_MASTER_RSVOL,
47 /** Master volume - center (0-1000) */
48 SNDO_MIO_MASTER_CVOL = 0,
49 /** Master volume - LFE (0-1000) */
50 SNDO_MIO_MASTER_LFEVOL,
51 /** Master volume - left mute (0 = off, 1 = on) */
52 SNDO_MIO_MASTER_LMUTE,
53 /** Master volume - right mute (0 = off, 1 = on) */
54 SNDO_MIO_MASTER_RMUTE,
55 /** Master volume - left surround mute (0 = off, 1 = on) */
56 SNDO_MIO_MASTER_LSMUTE,
57 /** Master volume - right surround mute (0 = off, 1 = on) */
58 SNDO_MIO_MASTER_RSMUTE,
59 /** Master volume - center mute (0 = off, 1 = on) */
60 SNDO_MIO_MASTER_CMUTE,
61 /** Master volume - LFE mute (0 = off, 1 = on) */
62 SNDO_MIO_MASTER_LFEMUTE,
64 /** PCM volume - left (0-1000) */
65 SNDO_MIO_PCM_LVOL = 0,
66 /** PCM volume - right (0-1000) */
68 /** PCM volume - left surround (0-1000) */
69 SNDO_MIO_PCM_LSVOL = 0,
70 /** PCM volume - right surround (0-1000) */
72 /** PCM volume - center (0-1000) */
73 SNDO_MIO_PCM_CVOL = 0,
74 /** PCM volume - LFE (0-1000) */
76 /** PCM volume - left mute (0 = off, 1 = on) */
78 /** PCM volume - right mute (0 = off, 1 = on) */
80 /** PCM volume - left surround mute (0 = off, 1 = on) */
82 /** PCM volume - right surround mute (0 = off, 1 = on) */
84 /** PCM volume - center mute (0 = off, 1 = on) */
86 /** PCM volume - LFE mute (0 = off, 1 = on) */
89 /** LINE volume - left (0-1000) */
90 SNDO_MIO_LINE_LVOL = 0,
91 /** LINE volume - right (0-1000) */
93 /** LINE volume - left surround (0-1000) */
94 SNDO_MIO_LINE_LSVOL = 0,
95 /** LINE volume - right surround (0-1000) */
97 /** LINE volume - center (0-1000) */
98 SNDO_MIO_LINE_CVOL = 0,
99 /** LINE volume - LFE (0-1000) */
100 SNDO_MIO_LINE_LFEVOL,
101 /** LINE volume - left mute (0 = off, 1 = on) */
103 /** LINE volume - right mute (0 = off, 1 = on) */
105 /** LINE volume - left surround mute (0 = off, 1 = on) */
106 SNDO_MIO_LINE_LSMUTE,
107 /** LINE volume - right surround mute (0 = off, 1 = on) */
108 SNDO_MIO_LINE_RSMUTE,
109 /** LINE volume - center mute (0 = off, 1 = on) */
111 /** LINE volume - LFE mute (0 = off, 1 = on) */
112 SNDO_MIO_LINE_LFEMUTE,
114 /** MIC volume - left (0-1000) */
115 SNDO_MIO_MIC_LVOL = 0,
116 /** MIC volume - right (0-1000) */
118 /** MIC volume - left surround (0-1000) */
119 SNDO_MIO_MIC_LSVOL = 0,
120 /** MIC volume - right surround (0-1000) */
122 /** MIC volume - center (0-1000) */
123 SNDO_MIO_MIC_CVOL = 0,
124 /** MIC volume - LFE (0-1000) */
126 /** MIC volume - left mute (0 = off, 1 = on) */
128 /** MIC volume - right mute (0 = off, 1 = on) */
130 /** MIC volume - left surround mute (0 = off, 1 = on) */
132 /** MIC volume - right surround mute (0 = off, 1 = on) */
134 /** MIC volume - center mute (0 = off, 1 = on) */
136 /** MIC volume - LFE mute (0 = off, 1 = on) */
137 SNDO_MIO_MIC_LFEMUTE,
139 /** CD volume - left (0-1000) */
140 SNDO_MIO_CD_LVOL = 0,
141 /** CD volume - right (0-1000) */
143 /** CD volume - left surround (0-1000) */
144 SNDO_MIO_CD_LSVOL = 0,
145 /** CD volume - right surround (0-1000) */
147 /** CD volume - center (0-1000) */
148 SNDO_MIO_CD_CVOL = 0,
149 /** CD volume - LFE (0-1000) */
151 /** CD volume - left mute (0 = off, 1 = on) */
153 /** CD volume - right mute (0 = off, 1 = on) */
155 /** CD volume - left surround mute (0 = off, 1 = on) */
157 /** CD volume - right surround mute (0 = off, 1 = on) */
159 /** CD volume - center mute (0 = off, 1 = on) */
161 /** CD volume - LFE mute (0 = off, 1 = on) */
168 /** capture gain - left (0-1000) */
169 SNDO_MIO_CGAIN_LVOL = 0x1000,
170 /** capture gain - right (0-1000) */
172 /** capture gain - left surround (0-1000) */
173 SNDO_MIO_CGAIN_LSVOL,
174 /** capture gain - right surround (0-1000) */
175 SNDO_MIO_CGAIN_RSVOL,
176 /** capture gain - center (0-1000) */
178 /** capture gain - LFE (0-1000) */
179 SNDO_MIO_CGAIN_LFEVOL,
181 /** capture source - MIC exclusive switch (0 = off, 1 = on) */
182 SNDO_MIO_CSOURCE_MIC = 0x1100,
183 /** capture source - LINE exclusive switch (0 = off, 1 = on) */
184 SNDO_MIO_CSOURCE_LINE,
185 /** capture source - CD exclusive switch (0 = off, 1 = on) */
187 /** capture source - AUX exclusive switch (0 = off, 1 = on) */
188 SNDO_MIO_CSOURCE_AUX,
189 /** capture source - MIX exclusive switch (0 = off, 1 = on) */
193 typedef struct sndo_mixer sndo_mixer_t;
201 * \defgroup Mixer_ordinary Mixer Ordinary Interface
202 * See the \ref mixer_ordinary page for more details.
206 int sndo_mixer_open(sndo_mixer_t **pmixer, snd_pcm_t *playback_pcm, snd_pcm_t *capture_pcm, struct alisp_cfg *lconf);
207 int sndo_mixer_close(sndo_mixer_t *mixer);
208 int sndo_mixer_poll_descriptors_count(sndo_mixer_t *mixer);
209 int sndo_mixer_poll_descriptors(sndo_mixer_t *mixer, struct pollfd *pfds, unsigned int space);
210 int sndo_mixer_poll_descriptors_revents(sndo_mixer_t *mixer, struct pollfd *pfds, unsigned int nfds, unsigned short *revents);
211 int sndo_mixer_io_get(sndo_mixer_t *mixer, enum sndo_mixer_io_type type, int *val);
212 int sndo_mixer_io_set(sndo_mixer_t *mixer, enum sndo_mixer_io_type type, int val);
213 int sndo_mixer_io_change(sndo_mixer_t *mixer, enum sndo_mixer_io_type *changed, int changed_array_size);
221 #endif /* __ALSA_MIXER_SIMPLE_H */