Chromium Code Reviews| OLD | NEW |
|---|---|
| 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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_AUDIO_MIXER_H_ | 5 #ifndef CHROME_BROWSER_CHROMEOS_AUDIO_AUDIO_MIXER_H_ |
| 6 #define CHROME_BROWSER_CHROMEOS_AUDIO_AUDIO_MIXER_H_ | 6 #define CHROME_BROWSER_CHROMEOS_AUDIO_AUDIO_MIXER_H_ |
| 7 | 7 |
| 8 #include "base/basictypes.h" | 8 #include "base/basictypes.h" |
| 9 | 9 |
| 10 namespace chromeos { | 10 namespace chromeos { |
| 11 | 11 |
| 12 class AudioMixer { | 12 class AudioMixer { |
| 13 public: | 13 public: |
| 14 AudioMixer() {} | 14 AudioMixer() {} |
| 15 virtual ~AudioMixer() {} | 15 virtual ~AudioMixer() {} |
| 16 | 16 |
| 17 // Initializes the connection to the device. This must be called on the UI | 17 // Initializes the connection to the device. This must be called on the UI |
| 18 // thread; blocking tasks may take place in the background. Note that the | 18 // thread; blocking tasks may take place in the background. Note that the |
| 19 // other methods in this interface can be called before Init(). | 19 // other methods in this interface can be called before Init(). |
| 20 virtual void Init() = 0; | 20 virtual void Init() = 0; |
| 21 | 21 |
| 22 // Returns the most-recently-set volume, in the range [0.0, 100.0]. | 22 // Returns the most-recently-set volume, in the range [0.0, 100.0]. |
| 23 virtual double GetVolumePercent() = 0; | 23 virtual double GetVolumePercent() = 0; |
| 24 | 24 |
| 25 // Sets the volume, possibly asynchronously. | 25 // Sets the volume, possibly asynchronously. |
| 26 // |percent| should be in the range [0.0, 100.0]. | 26 // |percent| should be in the range [0.0, 100.0]. |
| 27 virtual void SetVolumePercent(double percent) = 0; | 27 virtual void SetVolumePercent(double percent) = 0; |
| 28 | 28 |
| 29 // Is the device currently muted? | 29 // Is the device currently muted? If SetMuteLocked has been called with true |
| 30 // this function will not change the mute state until it is unlocked with | |
|
Daniel Erat
2012/08/29 15:37:00
is this comment meant to be above SetMuted() inste
pastarmovj
2012/08/29 16:15:52
Shoot! Sorry, it is of course.
| |
| 31 // another call to SetMuteLocked(false). | |
| 30 virtual bool IsMuted() = 0; | 32 virtual bool IsMuted() = 0; |
| 31 | 33 |
| 32 // Mutes or unmutes the device, possibly asynchronously. | 34 // Mutes or unmutes the device, possibly asynchronously. The called must |
|
Daniel Erat
2012/08/29 15:37:00
nit: s/called/caller/
pastarmovj
2012/08/29 16:15:52
Done.
| |
| 35 // first verify that the mute state is not locked by calling IsMuteLocked. | |
| 33 virtual void SetMuted(bool mute) = 0; | 36 virtual void SetMuted(bool mute) = 0; |
| 34 | 37 |
| 38 // Is the device's mute state currently locked? | |
| 39 virtual bool IsMuteLocked() = 0; | |
| 40 | |
| 41 // Locks the mute state of the device to muted. After this is done SetMute | |
|
Daniel Erat
2012/08/29 15:37:00
the "to muted" bit seems inaccurate. this method
pastarmovj
2012/08/29 16:15:52
I would prefer to fix the comment to match the cod
| |
| 42 // will ignore unmuting requests until SetMuteLocked is called with false. | |
| 43 virtual void SetMuteLocked(bool locked) = 0; | |
| 44 | |
| 45 // Is the capture device currently muted? | |
| 46 virtual bool IsCaptureMuted() = 0; | |
| 47 | |
| 48 // Mutes or unmutes the capture device, possible asynchronously. The called | |
|
Daniel Erat
2012/08/29 15:37:00
nit: s/called/caller/
pastarmovj
2012/08/29 16:15:52
Done.
| |
| 49 // must first verify that the mute state is not locked by calling | |
| 50 // IsCaptureMuteLocked. | |
| 51 virtual void SetCaptureMuted(bool mute) = 0; | |
| 52 | |
| 53 // Is the capture device's mute state currently locked? | |
| 54 virtual bool IsCaptureMuteLocked() = 0; | |
| 55 | |
| 56 // Locks the capture mute state of the device. | |
| 57 virtual void SetCaptureMuteLocked(bool locked) = 0; | |
| 58 | |
| 35 private: | 59 private: |
| 36 DISALLOW_COPY_AND_ASSIGN(AudioMixer); | 60 DISALLOW_COPY_AND_ASSIGN(AudioMixer); |
| 37 }; | 61 }; |
| 38 | 62 |
| 39 } // namespace chromeos | 63 } // namespace chromeos |
| 40 | 64 |
| 41 #endif // CHROME_BROWSER_CHROMEOS_AUDIO_AUDIO_MIXER_H_ | 65 #endif // CHROME_BROWSER_CHROMEOS_AUDIO_AUDIO_MIXER_H_ |
| OLD | NEW |