OLD | NEW |
---|---|
1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. |
2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 #include "media/audio/linux/alsa_wrapper.h" | 5 #include "media/audio/linux/alsa_wrapper.h" |
6 | 6 |
7 #include <alsa/asoundlib.h> | 7 #include <alsa/asoundlib.h> |
8 | 8 |
9 AlsaWrapper::AlsaWrapper() { | 9 AlsaWrapper::AlsaWrapper() { |
10 } | 10 } |
(...skipping 144 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
155 } | 155 } |
156 | 156 |
157 const char* AlsaWrapper::StrError(int errnum) { | 157 const char* AlsaWrapper::StrError(int errnum) { |
158 return snd_strerror(errnum); | 158 return snd_strerror(errnum); |
159 } | 159 } |
160 | 160 |
161 int AlsaWrapper::PcmStart(snd_pcm_t* handle) { | 161 int AlsaWrapper::PcmStart(snd_pcm_t* handle) { |
162 return snd_pcm_start(handle); | 162 return snd_pcm_start(handle); |
163 } | 163 } |
164 | 164 |
165 int AlsaWrapper::MixerOpen(snd_mixer_t** mixer, int mode) { | |
166 return snd_mixer_open(mixer, mode); | |
167 } | |
168 | |
169 int AlsaWrapper::MixerAttach(snd_mixer_t* mixer, const char *name) { | |
170 return snd_mixer_attach(mixer, name); | |
171 } | |
172 | |
173 int AlsaWrapper::MixerElementRegister(snd_mixer_t* mixer, | |
174 struct snd_mixer_selem_regopt* options, | |
175 snd_mixer_class_t** classp) { | |
176 return snd_mixer_selem_register(mixer, options, classp); | |
177 } | |
178 | |
179 void AlsaWrapper::MixerFree(snd_mixer_t* mixer) { | |
180 snd_mixer_free(mixer); | |
181 } | |
182 | |
183 int AlsaWrapper::MixerDetach(snd_mixer_t* mixer, const char* name) { | |
184 return snd_mixer_detach(mixer, name); | |
185 } | |
186 | |
187 int AlsaWrapper::MixerClose(snd_mixer_t* mixer) { | |
188 return snd_mixer_close(mixer); | |
189 } | |
190 | |
191 int AlsaWrapper::MixerLoad(snd_mixer_t *mixer) { | |
tommi (sloooow) - chröme
2012/02/24 12:07:34
please fix all "foo *bar" and convert them to "fo
no longer working on chromium
2012/02/24 15:05:55
Done.
| |
192 return snd_mixer_load(mixer); | |
193 } | |
194 | |
195 snd_mixer_elem_t* AlsaWrapper::MixerFirstElem(snd_mixer_t *mixer) { | |
196 return snd_mixer_first_elem(mixer); | |
197 } | |
198 | |
199 snd_mixer_elem_t* AlsaWrapper::MixerNextElem(snd_mixer_elem_t *elem) { | |
200 return snd_mixer_elem_next(elem); | |
201 } | |
202 | |
203 int AlsaWrapper::MixerSelemIsActive(snd_mixer_elem_t *elem) { | |
204 return snd_mixer_selem_is_active(elem); | |
205 } | |
206 | |
207 const char* AlsaWrapper::MixerSelemName(snd_mixer_elem_t *elem) { | |
208 return snd_mixer_selem_get_name(elem); | |
tommi (sloooow) - chröme
2012/02/24 12:07:34
just checking, but the returned string must not be
no longer working on chromium
2012/02/24 15:05:55
Really good question. Since the returned value is
| |
209 } | |
210 | |
211 int AlsaWrapper::MixerSelemSetCaptureVolumeAll( | |
212 snd_mixer_elem_t *elem, long value) { | |
213 return snd_mixer_selem_set_capture_volume_all(elem, value); | |
214 } | |
215 | |
216 int AlsaWrapper::MixerSelemGetCaptureVolume( | |
217 snd_mixer_elem_t *elem, snd_mixer_selem_channel_id_t channel, long *value) { | |
218 return snd_mixer_selem_get_capture_volume(elem, channel, value); | |
219 } | |
220 | |
221 int AlsaWrapper::MixerSelemHasCaptureVolume(snd_mixer_elem_t *elem) { | |
222 return snd_mixer_selem_has_capture_volume(elem); | |
223 } | |
224 | |
225 int AlsaWrapper::MixerSelemGetCaptureVolumeRange(snd_mixer_elem_t *elem, | |
226 long *min, long *max) { | |
227 return snd_mixer_selem_get_capture_volume_range(elem, min, max); | |
228 } | |
OLD | NEW |