diff options
author | jennyz@chromium.org <jennyz@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2013-07-12 01:39:44 +0000 |
---|---|---|
committer | jennyz@chromium.org <jennyz@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2013-07-12 01:39:44 +0000 |
commit | 5e2e00c273f94e6768b0900328716669e0322012 (patch) | |
tree | 0717d96377ec729cb79539a44f1c5f0fb660a771 /chromeos/audio/cras_audio_handler.h | |
parent | 98cf3002ce111ffce01bdc68f6a8b078abd2a77d (diff) | |
download | chromium_src-5e2e00c273f94e6768b0900328716669e0322012.zip chromium_src-5e2e00c273f94e6768b0900328716669e0322012.tar.gz chromium_src-5e2e00c273f94e6768b0900328716669e0322012.tar.bz2 |
Migrate to use SetOutputNodeVolume and SetInputNodeGain cras apis.
Based on our discussion about cras apis with cras team, chrome will switch to use per node volume/gain set apis, and do not use the apis for setting system output volume and input gain. This should simplify the flow for switching active input/output audio devices and solve the racing problems during the switch related to previous work around.
BUG=244597
Review URL: https://chromiumcodereview.appspot.com/18641003
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@211282 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chromeos/audio/cras_audio_handler.h')
-rw-r--r-- | chromeos/audio/cras_audio_handler.h | 15 |
1 files changed, 9 insertions, 6 deletions
diff --git a/chromeos/audio/cras_audio_handler.h b/chromeos/audio/cras_audio_handler.h index cb26f23..99025f3 100644 --- a/chromeos/audio/cras_audio_handler.h +++ b/chromeos/audio/cras_audio_handler.h @@ -177,9 +177,7 @@ class CHROMEOS_EXPORT CrasAudioHandler : public CrasAudioClient::Observer, private: // Overriden from CrasAudioClient::Observer. virtual void AudioClientRestarted() OVERRIDE; - virtual void OutputVolumeChanged(int volume) OVERRIDE; virtual void OutputMuteChanged(bool mute_on) OVERRIDE; - virtual void InputGainChanged(int gain) OVERRIDE; virtual void InputMuteChanged(bool mute_on) OVERRIDE; virtual void NodesChanged() OVERRIDE; virtual void ActiveOutputNodeChanged(uint64 node_id) OVERRIDE; @@ -203,15 +201,15 @@ class CHROMEOS_EXPORT CrasAudioHandler : public CrasAudioClient::Observer, // change notification is received. void ApplyAudioPolicy(); - // Sets output volume to specified value of |volume|. - void SetOutputVolumeInternal(int volume); + // Sets output volume of |node_id| to |volume|. + void SetOutputNodeVolume(uint64 node_id, int volume); // Sets output mute state to |mute_on| internally, returns true if output mute // is set. bool SetOutputMuteInternal(bool mute_on); - // Sets output volume to specified value and notifies observers. - void SetInputGainInternal(int gain); + // Sets input gain of |node_id| to |gain|. + void SetInputNodeGain(uint64 node_id, int gain); // Sets input mute state to |mute_on| internally, returns true if input mute // is set. @@ -224,6 +222,11 @@ class CHROMEOS_EXPORT CrasAudioHandler : public CrasAudioClient::Observer, // if needed. void UpdateDevicesAndSwitchActive(const AudioNodeList& nodes); + // Returns true if *|current_active_node_id| device is changed to + // |new_active_device|. + bool ChangeActiveDevice(const AudioDevice& new_active_device, + uint64* current_active_node_id); + void SwitchToDevice(const AudioDevice& device); // Handles dbus callback for GetNodes. |