| OLD | NEW |
| 1 // Copyright (c) 2010 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2010 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 #ifndef CHROME_BROWSER_CHROMEOS_AUDIO_MIXER_ALSA_H_ | 5 #ifndef CHROME_BROWSER_CHROMEOS_AUDIO_MIXER_ALSA_H_ |
| 6 #define CHROME_BROWSER_CHROMEOS_AUDIO_MIXER_ALSA_H_ | 6 #define CHROME_BROWSER_CHROMEOS_AUDIO_MIXER_ALSA_H_ |
| 7 #pragma once | 7 #pragma once |
| 8 | 8 |
| 9 #include "base/basictypes.h" | 9 #include "base/basictypes.h" |
| 10 #include "base/callback.h" | 10 #include "base/callback.h" |
| (...skipping 59 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 70 // so actual_vol will contain the true volume that was set. This information | 70 // so actual_vol will contain the true volume that was set. This information |
| 71 // can be used to further refine the volume by adjust a different mixer | 71 // can be used to further refine the volume by adjust a different mixer |
| 72 // element. The rounding_bias is added in before rounding to the nearest | 72 // element. The rounding_bias is added in before rounding to the nearest |
| 73 // volume step (use 0.5 to round to nearest). | 73 // volume step (use 0.5 to round to nearest). |
| 74 bool SetElementVolume_Locked(_snd_mixer_elem* elem, | 74 bool SetElementVolume_Locked(_snd_mixer_elem* elem, |
| 75 double new_vol, | 75 double new_vol, |
| 76 double* actual_vol, | 76 double* actual_vol, |
| 77 double rounding_bias); | 77 double rounding_bias); |
| 78 | 78 |
| 79 // In ALSA, the mixer element's 'switch' is turned off to mute. | 79 // In ALSA, the mixer element's 'switch' is turned off to mute. |
| 80 // GetElementMuted_Locked() returns false on failure. |
| 80 bool GetElementMuted_Locked(_snd_mixer_elem* elem) const; | 81 bool GetElementMuted_Locked(_snd_mixer_elem* elem) const; |
| 81 void SetElementMuted_Locked(_snd_mixer_elem* elem, bool mute); | 82 void SetElementMuted_Locked(_snd_mixer_elem* elem, bool mute); |
| 82 | 83 |
| 83 // Volume range limits are computed once during InitializeAlsaMixer. | 84 // Volume range limits are computed once during InitializeAlsaMixer. |
| 84 double min_volume_; | 85 double min_volume_; |
| 85 double max_volume_; | 86 double max_volume_; |
| 86 | 87 |
| 87 // Muting is done by setting volume to minimum, so we must save the original. | 88 // Muting is done by setting volume to minimum, so we must save the original. |
| 88 // This is the only state information kept in this object. In some cases, | 89 // This is the only state information kept in this object. In some cases, |
| 89 // ALSA can report it has a volume switch and we can turn it off, but it has | 90 // ALSA can report it has a volume switch and we can turn it off, but it has |
| (...skipping 14 matching lines...) Expand all Loading... |
| 104 scoped_ptr<base::Thread> thread_; | 105 scoped_ptr<base::Thread> thread_; |
| 105 | 106 |
| 106 DISALLOW_COPY_AND_ASSIGN(AudioMixerAlsa); | 107 DISALLOW_COPY_AND_ASSIGN(AudioMixerAlsa); |
| 107 }; | 108 }; |
| 108 | 109 |
| 109 } // namespace chromeos | 110 } // namespace chromeos |
| 110 | 111 |
| 111 DISABLE_RUNNABLE_METHOD_REFCOUNT(chromeos::AudioMixerAlsa); | 112 DISABLE_RUNNABLE_METHOD_REFCOUNT(chromeos::AudioMixerAlsa); |
| 112 | 113 |
| 113 #endif // CHROME_BROWSER_CHROMEOS_AUDIO_MIXER_ALSA_H_ | 114 #endif // CHROME_BROWSER_CHROMEOS_AUDIO_MIXER_ALSA_H_ |
| OLD | NEW |