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

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

Issue 6591095: Mute ALSA audio completely (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src/chrome/browser/chromeos
Patch Set: Created 9 years, 9 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
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 63 matching lines...) Expand 10 before | Expand all | Expand 10 after
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 // GetElementMuted_Locked() returns false on failure.
81 bool GetElementMuted_Locked(_snd_mixer_elem* elem) const; 81 bool GetElementMuted_Locked(_snd_mixer_elem* elem) const;
82 void SetElementMuted_Locked(_snd_mixer_elem* elem, bool mute); 82 void SetElementMuted_Locked(_snd_mixer_elem* elem, bool mute);
83 83
84 // Verify PCM can be opened, which also instantiates the PCM mixer element
85 // which is needed for finer volume control and for muting by setting to zero.
86 void PingPCM();
Daniel Erat 2011/03/02 17:45:07 worthwhile to return a bool here?
davejcool 2011/03/03 20:05:02 I thought about returning bool here as well, but A
87
84 // Volume range limits are computed once during InitializeAlsaMixer. 88 // Volume range limits are computed once during InitializeAlsaMixer.
85 double min_volume_; 89 double min_volume_;
86 double max_volume_; 90 double max_volume_;
87 91
88 // Muting is done by setting volume to minimum, so we must save the original. 92 // Muting is done by setting volume to minimum, so we must save the original.
89 // This is the only state information kept in this object. In some cases, 93 // This is the only state information kept in this object. In some cases,
90 // ALSA can report it has a volume switch and we can turn it off, but it has 94 // ALSA can report it has a volume switch and we can turn it off, but it has
91 // no effect. 95 // no effect.
92 double save_volume_; 96 double save_volume_;
93 97
(...skipping 11 matching lines...) Expand all
105 scoped_ptr<base::Thread> thread_; 109 scoped_ptr<base::Thread> thread_;
106 110
107 DISALLOW_COPY_AND_ASSIGN(AudioMixerAlsa); 111 DISALLOW_COPY_AND_ASSIGN(AudioMixerAlsa);
108 }; 112 };
109 113
110 } // namespace chromeos 114 } // namespace chromeos
111 115
112 DISABLE_RUNNABLE_METHOD_REFCOUNT(chromeos::AudioMixerAlsa); 116 DISABLE_RUNNABLE_METHOD_REFCOUNT(chromeos::AudioMixerAlsa);
113 117
114 #endif // CHROME_BROWSER_CHROMEOS_AUDIO_MIXER_ALSA_H_ 118 #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') | chrome/browser/chromeos/audio_mixer_alsa.cc » ('J')

Powered by Google App Engine
This is Rietveld 408576698