OSDN Git Service

added snd_hctl_ctl() function
[android-x86/external-alsa-lib.git] / include / mixer_ordinary.h
1 /**
2  * \file <alsa/mixer_ordinary.h>
3  * \brief Application interface library for the ALSA driver
4  * \author Jaroslav Kysela <perex@suse.cz>
5  * \date 2003
6  *
7  * Application interface library for the ALSA driver.
8  * See the \ref mixer_ordinary page for more details.
9  *
10  *
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.
15  *
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.
20  *
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
24  *
25  */
26
27 #ifndef __ALSA_MIXER_SIMPLE_H
28 #define __ALSA_MIXER_SIMPLE_H
29
30 #include <alsa/asoundlib.h>
31
32 /** Ordinary Mixer I/O type */
33 enum sndo_mixer_io_type {
34
35         /*
36          *  playback section
37          */
38
39         /** Master volume - left (0-1000) */
40         SNDO_MIO_MASTER_LVOL = 0,
41         /** Master volume - right (0-1000) */
42         SNDO_MIO_MASTER_RVOL,
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,
63
64         /** PCM volume - left (0-1000) */
65         SNDO_MIO_PCM_LVOL = 0,
66         /** PCM volume - right (0-1000) */
67         SNDO_MIO_PCM_RVOL,
68         /** PCM volume - left surround (0-1000) */
69         SNDO_MIO_PCM_LSVOL = 0,
70         /** PCM volume - right surround (0-1000) */
71         SNDO_MIO_PCM_RSVOL,
72         /** PCM volume - center (0-1000) */
73         SNDO_MIO_PCM_CVOL = 0,
74         /** PCM volume - LFE (0-1000) */
75         SNDO_MIO_PCM_LFEVOL,
76         /** PCM volume - left mute (0 = off, 1 = on) */
77         SNDO_MIO_PCM_LMUTE,
78         /** PCM volume - right mute (0 = off, 1 = on) */
79         SNDO_MIO_PCM_RMUTE,
80         /** PCM volume - left surround mute (0 = off, 1 = on) */
81         SNDO_MIO_PCM_LSMUTE,
82         /** PCM volume - right surround mute (0 = off, 1 = on) */
83         SNDO_MIO_PCM_RSMUTE,
84         /** PCM volume - center mute (0 = off, 1 = on) */
85         SNDO_MIO_PCM_CMUTE,
86         /** PCM volume - LFE mute (0 = off, 1 = on) */
87         SNDO_MIO_PCM_LFEMUTE,
88
89         /** LINE volume - left (0-1000) */
90         SNDO_MIO_LINE_LVOL = 0,
91         /** LINE volume - right (0-1000) */
92         SNDO_MIO_LINE_RVOL,
93         /** LINE volume - left surround (0-1000) */
94         SNDO_MIO_LINE_LSVOL = 0,
95         /** LINE volume - right surround (0-1000) */
96         SNDO_MIO_LINE_RSVOL,
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) */
102         SNDO_MIO_LINE_LMUTE,
103         /** LINE volume - right mute (0 = off, 1 = on) */
104         SNDO_MIO_LINE_RMUTE,
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) */
110         SNDO_MIO_LINE_CMUTE,
111         /** LINE volume - LFE mute (0 = off, 1 = on) */
112         SNDO_MIO_LINE_LFEMUTE,
113
114         /** MIC volume - left (0-1000) */
115         SNDO_MIO_MIC_LVOL = 0,
116         /** MIC volume - right (0-1000) */
117         SNDO_MIO_MIC_RVOL,
118         /** MIC volume - left surround (0-1000) */
119         SNDO_MIO_MIC_LSVOL = 0,
120         /** MIC volume - right surround (0-1000) */
121         SNDO_MIO_MIC_RSVOL,
122         /** MIC volume - center (0-1000) */
123         SNDO_MIO_MIC_CVOL = 0,
124         /** MIC volume - LFE (0-1000) */
125         SNDO_MIO_MIC_LFEVOL,
126         /** MIC volume - left mute (0 = off, 1 = on) */
127         SNDO_MIO_MIC_LMUTE,
128         /** MIC volume - right mute (0 = off, 1 = on) */
129         SNDO_MIO_MIC_RMUTE,
130         /** MIC volume - left surround mute (0 = off, 1 = on) */
131         SNDO_MIO_MIC_LSMUTE,
132         /** MIC volume - right surround mute (0 = off, 1 = on) */
133         SNDO_MIO_MIC_RSMUTE,
134         /** MIC volume - center mute (0 = off, 1 = on) */
135         SNDO_MIO_MIC_CMUTE,
136         /** MIC volume - LFE mute (0 = off, 1 = on) */
137         SNDO_MIO_MIC_LFEMUTE,
138
139         /** CD volume - left (0-1000) */
140         SNDO_MIO_CD_LVOL = 0,
141         /** CD volume - right (0-1000) */
142         SNDO_MIO_CD_RVOL,
143         /** CD volume - left surround (0-1000) */
144         SNDO_MIO_CD_LSVOL = 0,
145         /** CD volume - right surround (0-1000) */
146         SNDO_MIO_CD_RSVOL,
147         /** CD volume - center (0-1000) */
148         SNDO_MIO_CD_CVOL = 0,
149         /** CD volume - LFE (0-1000) */
150         SNDO_MIO_CD_LFEVOL,
151         /** CD volume - left mute (0 = off, 1 = on) */
152         SNDO_MIO_CD_LMUTE,
153         /** CD volume - right mute (0 = off, 1 = on) */
154         SNDO_MIO_CD_RMUTE,
155         /** CD volume - left surround mute (0 = off, 1 = on) */
156         SNDO_MIO_CD_LSMUTE,
157         /** CD volume - right surround mute (0 = off, 1 = on) */
158         SNDO_MIO_CD_RSMUTE,
159         /** CD volume - center mute (0 = off, 1 = on) */
160         SNDO_MIO_CD_CMUTE,
161         /** CD volume - LFE mute (0 = off, 1 = on) */
162         SNDO_MIO_CD_LFEMUTE,
163
164         /*
165          *  capture section
166          */
167
168         /** capture gain - left (0-1000) */
169         SNDO_MIO_CGAIN_LVOL = 0x1000,
170         /** capture gain - right (0-1000) */
171         SNDO_MIO_CGAIN_RVOL,
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) */
177         SNDO_MIO_CGAIN_CVOL,
178         /** capture gain - LFE (0-1000) */
179         SNDO_MIO_CGAIN_LFEVOL,
180
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) */
186         SNDO_MIO_CSOURCE_CD,
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) */
190         SNDO_MIO_CSOURCE_MIX
191 };
192
193 typedef struct sndo_mixer sndo_mixer_t;
194 struct alisp_cfg;
195
196 #ifdef __cplusplus
197 extern "C" {
198 #endif
199
200 /**
201  *  \defgroup Mixer_ordinary Mixer Ordinary Interface
202  *  See the \ref mixer_ordinary page for more details.
203  *  \{
204  */
205
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);
214
215 /** \} */
216
217 #ifdef __cplusplus
218 }
219 #endif
220
221 #endif /* __ALSA_MIXER_SIMPLE_H */