Chromium Code Reviews

Side by Side Diff: chrome/browser/chromeos/audio_mixer_alsa.h

Issue 6562002: Merge 75698 - chromeos: Check ALSA return values in mixer code.... (Closed) Base URL: svn://svn.chromium.org/chrome/branches/648/src/
Patch Set: Created 9 years, 10 months ago
Use n/p to move between diff chunks; N/P to move between comments.
Jump to:
View unified diff | | Annotate | Revision Log
« no previous file with comments | « no previous file | chrome/browser/chromeos/audio_mixer_alsa.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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 57 matching lines...)
68 // so actual_vol will contain the true volume that was set. This information 68 // so actual_vol will contain the true volume that was set. This information
69 // can be used to further refine the volume by adjust a different mixer 69 // can be used to further refine the volume by adjust a different mixer
70 // element. The rounding_bias is added in before rounding to the nearest 70 // element. The rounding_bias is added in before rounding to the nearest
71 // volume step (use 0.5 to round to nearest). 71 // volume step (use 0.5 to round to nearest).
72 bool SetElementVolume_Locked(_snd_mixer_elem* elem, 72 bool SetElementVolume_Locked(_snd_mixer_elem* elem,
73 double new_vol, 73 double new_vol,
74 double* actual_vol, 74 double* actual_vol,
75 double rounding_bias); 75 double rounding_bias);
76 76
77 // In ALSA, the mixer element's 'switch' is turned off to mute. 77 // In ALSA, the mixer element's 'switch' is turned off to mute.
78 // GetElementMuted_Locked() returns false on failure.
78 bool GetElementMuted_Locked(_snd_mixer_elem* elem) const; 79 bool GetElementMuted_Locked(_snd_mixer_elem* elem) const;
79 void SetElementMuted_Locked(_snd_mixer_elem* elem, bool mute); 80 void SetElementMuted_Locked(_snd_mixer_elem* elem, bool mute);
80 81
81 // Volume range limits are computed once during InitializeAlsaMixer. 82 // Volume range limits are computed once during InitializeAlsaMixer.
82 double min_volume_; 83 double min_volume_;
83 double max_volume_; 84 double max_volume_;
84 85
85 // Muting is done by setting volume to minimum, so we must save the original. 86 // Muting is done by setting volume to minimum, so we must save the original.
86 // This is the only state information kept in this object. In some cases, 87 // This is the only state information kept in this object. In some cases,
87 // ALSA can report it has a volume switch and we can turn it off, but it has 88 // ALSA can report it has a volume switch and we can turn it off, but it has
(...skipping 15 matching lines...)
103 104
104 DISALLOW_COPY_AND_ASSIGN(AudioMixerAlsa); 105 DISALLOW_COPY_AND_ASSIGN(AudioMixerAlsa);
105 }; 106 };
106 107
107 } // namespace chromeos 108 } // namespace chromeos
108 109
109 DISABLE_RUNNABLE_METHOD_REFCOUNT(chromeos::AudioMixerAlsa); 110 DISABLE_RUNNABLE_METHOD_REFCOUNT(chromeos::AudioMixerAlsa);
110 111
111 #endif // CHROME_BROWSER_CHROMEOS_AUDIO_MIXER_ALSA_H_ 112 #endif // CHROME_BROWSER_CHROMEOS_AUDIO_MIXER_ALSA_H_
112 113
OLDNEW
« no previous file with comments | « no previous file | chrome/browser/chromeos/audio_mixer_alsa.cc » ('j') | no next file with comments »

Powered by Google App Engine