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 #include "base/callback_forward.h" |
9 | 10 |
10 namespace chromeos { | 11 namespace chromeos { |
11 | 12 |
12 class AudioMixer { | 13 class AudioMixer { |
13 public: | 14 public: |
14 AudioMixer() {} | 15 AudioMixer() {} |
15 virtual ~AudioMixer() {} | 16 virtual ~AudioMixer() {} |
16 | 17 |
17 // Initializes the connection to the device. This must be called on the UI | 18 // 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 | 19 // thread; blocking tasks may take place in the background. Note that the |
19 // other methods in this interface can be called before Init(). | 20 // other methods in this interface can be called before Init(). |
20 virtual void Init() = 0; | 21 virtual void Init(const base::Closure& on_connected) = 0; |
21 | 22 |
22 // Returns the most-recently-set volume, in the range [0.0, 100.0]. | 23 // Returns the most-recently-set volume, in the range [0.0, 100.0]. |
23 virtual double GetVolumePercent() = 0; | 24 virtual double GetVolumePercent() = 0; |
24 | 25 |
25 // Sets the volume, possibly asynchronously. | 26 // Sets the volume, possibly asynchronously. |
26 // |percent| should be in the range [0.0, 100.0]. | 27 // |percent| should be in the range [0.0, 100.0]. |
27 virtual void SetVolumePercent(double percent) = 0; | 28 virtual void SetVolumePercent(double percent) = 0; |
28 | 29 |
29 // Is the device currently muted? | 30 // Is the device currently muted? |
30 virtual bool IsMuted() = 0; | 31 virtual bool IsMuted() = 0; |
(...skipping 23 matching lines...) Expand all Loading... |
54 // Locks the capture mute state of the device. | 55 // Locks the capture mute state of the device. |
55 virtual void SetCaptureMuteLocked(bool locked) = 0; | 56 virtual void SetCaptureMuteLocked(bool locked) = 0; |
56 | 57 |
57 private: | 58 private: |
58 DISALLOW_COPY_AND_ASSIGN(AudioMixer); | 59 DISALLOW_COPY_AND_ASSIGN(AudioMixer); |
59 }; | 60 }; |
60 | 61 |
61 } // namespace chromeos | 62 } // namespace chromeos |
62 | 63 |
63 #endif // CHROME_BROWSER_CHROMEOS_AUDIO_AUDIO_MIXER_H_ | 64 #endif // CHROME_BROWSER_CHROMEOS_AUDIO_AUDIO_MIXER_H_ |
OLD | NEW |