Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(254)

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

Issue 6562001: chromeos: Check ALSA return values in mixer code. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src/chrome/browser/chromeos
Patch Set: Created 9 years, 10 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | 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 59 matching lines...) Expand 10 before | Expand all | Expand 10 after
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
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_
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
This is Rietveld 408576698