| OLD | NEW |
| 1 // Copyright (c) 2013 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2013 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 CHROMEOS_AUDIO_AUDIO_DEVICES_PREF_HANDLER_H_ | 5 #ifndef CHROMEOS_AUDIO_AUDIO_DEVICES_PREF_HANDLER_H_ |
| 6 #define CHROMEOS_AUDIO_AUDIO_DEVICES_PREF_HANDLER_H_ | 6 #define CHROMEOS_AUDIO_AUDIO_DEVICES_PREF_HANDLER_H_ |
| 7 | 7 |
| 8 #include "base/basictypes.h" | 8 #include "base/basictypes.h" |
| 9 #include "base/memory/ref_counted.h" | 9 #include "base/memory/ref_counted.h" |
| 10 #include "chromeos/audio/audio_pref_observer.h" | 10 #include "chromeos/audio/audio_pref_observer.h" |
| 11 #include "chromeos/chromeos_export.h" | 11 #include "chromeos/chromeos_export.h" |
| 12 | 12 |
| 13 class PrefService; | 13 class PrefService; |
| 14 | 14 |
| 15 namespace chromeos { | 15 namespace chromeos { |
| 16 | 16 |
| 17 struct AudioDevice; | 17 struct AudioDevice; |
| 18 | 18 |
| 19 // Interface that handles audio preference related work, reads and writes | 19 // Interface that handles audio preference related work, reads and writes |
| 20 // audio preferences, and notifies AudioPrefObserver for audio preference | 20 // audio preferences, and notifies AudioPrefObserver for audio preference |
| 21 // changes. | 21 // changes. |
| 22 class CHROMEOS_EXPORT AudioDevicesPrefHandler | 22 class CHROMEOS_EXPORT AudioDevicesPrefHandler |
| 23 : public base::RefCountedThreadSafe<AudioDevicesPrefHandler> { | 23 : public base::RefCountedThreadSafe<AudioDevicesPrefHandler> { |
| 24 public: | 24 public: |
| 25 // Gets the audio output volume value from prefs for a device. Since we can | 25 // Gets the audio output volume value from prefs for a device. Since we can |
| 26 // only have either a gain or a volume for a device (depending on whether it | 26 // only have either a gain or a volume for a device (depending on whether it |
| 27 // is input or output), we don't really care which value it is. | 27 // is input or output), we don't really care which value it is. |
| 28 virtual double GetVolumeGainValue(const AudioDevice& device) = 0; | 28 virtual double GetOutputVolumeValue(const AudioDevice* device) = 0; |
| 29 virtual double GetInputGainValue(const AudioDevice* device) = 0; |
| 29 // Sets the audio volume or gain value to prefs for a device. | 30 // Sets the audio volume or gain value to prefs for a device. |
| 30 virtual void SetVolumeGainValue(const AudioDevice& device, double value) = 0; | 31 virtual void SetVolumeGainValue(const AudioDevice& device, double value) = 0; |
| 31 | 32 |
| 32 // Reads the audio mute value from prefs for a device. | 33 // Reads the audio mute value from prefs for a device. |
| 33 virtual bool GetMuteValue(const AudioDevice& device) = 0; | 34 virtual bool GetMuteValue(const AudioDevice& device) = 0; |
| 34 // Sets the audio mute value to prefs for a device. | 35 // Sets the audio mute value to prefs for a device. |
| 35 virtual void SetMuteValue(const AudioDevice& device, bool mute_on) = 0; | 36 virtual void SetMuteValue(const AudioDevice& device, bool mute_on) = 0; |
| 36 | 37 |
| 37 // Reads the audio capture allowed value from prefs. | 38 // Reads the audio capture allowed value from prefs. |
| 38 virtual bool GetAudioCaptureAllowedValue() = 0; | 39 virtual bool GetAudioCaptureAllowedValue() = 0; |
| (...skipping 11 matching lines...) Expand all Loading... |
| 50 protected: | 51 protected: |
| 51 virtual ~AudioDevicesPrefHandler() {} | 52 virtual ~AudioDevicesPrefHandler() {} |
| 52 | 53 |
| 53 private: | 54 private: |
| 54 friend class base::RefCountedThreadSafe<AudioDevicesPrefHandler>; | 55 friend class base::RefCountedThreadSafe<AudioDevicesPrefHandler>; |
| 55 }; | 56 }; |
| 56 | 57 |
| 57 } // namespace chromeos | 58 } // namespace chromeos |
| 58 | 59 |
| 59 #endif // CHROMEOS_AUDIO_AUDIO_DEVICES_PREF_HANDLER_H_ | 60 #endif // CHROMEOS_AUDIO_AUDIO_DEVICES_PREF_HANDLER_H_ |
| OLD | NEW |