Index: chromeos/audio/audio_devices_pref_handler.h |
diff --git a/chromeos/audio/audio_devices_pref_handler.h b/chromeos/audio/audio_devices_pref_handler.h |
index 2347aad6a467c1e7956d7ec9537e8bf186b9d12f..0be562143a2b36b0c6b3da1dafa65e4a1e593cd2 100644 |
--- a/chromeos/audio/audio_devices_pref_handler.h |
+++ b/chromeos/audio/audio_devices_pref_handler.h |
@@ -15,6 +15,18 @@ namespace chromeos { |
struct AudioDevice; |
+// Used to represent an audio device's state. This state should be updated |
+// to AUDIO_STATE_ACTIVE when it is selected as active or set to |
+// AUDIO_STATE_INACTIVE when selected to a different device. When the audio |
+// device is unplugged, its last active/inactive state should be stored. |
+// The default value of device state will be AUDIO_STATE_NOT_AVAILABLE if |
+// the device is not found in the pref settings. |
+enum AudioDeviceState { |
+ AUDIO_STATE_ACTIVE, |
Daniel Erat
2016/01/07 17:31:12
explicitly specify the numbers for these and docum
hychao
2016/01/11 07:02:32
Done.
|
+ AUDIO_STATE_INACTIVE, |
+ AUDIO_STATE_NOT_AVAILABLE, |
+}; |
+ |
// Interface that handles audio preference related work, reads and writes |
// audio preferences, and notifies AudioPrefObserver for audio preference |
// changes. |
@@ -38,6 +50,11 @@ class CHROMEOS_EXPORT AudioDevicesPrefHandler |
// Sets the audio mute value to prefs for a device. |
virtual void SetMuteValue(const AudioDevice& device, bool mute_on) = 0; |
+ virtual AudioDeviceState GetDeviceState( |
+ const AudioDevice &device) = 0; |
+ virtual void SetDeviceState(const AudioDevice& device, |
+ AudioDeviceState state) = 0; |
+ |
// Reads the audio output allowed value from prefs. |
virtual bool GetAudioOutputAllowedValue() = 0; |