summaryrefslogtreecommitdiffstats
path: root/chromeos/audio
diff options
context:
space:
mode:
authorjennyz <jennyz@chromium.org>2015-03-20 18:49:29 -0700
committerCommit bot <commit-bot@chromium.org>2015-03-21 01:50:23 +0000
commit481292c5ac84c13aee9a1e1d0ebd83fdd52d744d (patch)
tree1b264b9eef8885a010ab80a78f5bf74373595c74 /chromeos/audio
parent4a0e88b3dac88987d0311f8976dc7b0d4ed21325 (diff)
downloadchromium_src-481292c5ac84c13aee9a1e1d0ebd83fdd52d744d.zip
chromium_src-481292c5ac84c13aee9a1e1d0ebd83fdd52d744d.tar.gz
chromium_src-481292c5ac84c13aee9a1e1d0ebd83fdd52d744d.tar.bz2
Redesign audio extension apis. This adds the following P1 requests api features:
OnLevelChanged event: This is fired when the level of an active audio device changes(volume for output, gain for inout), node id and new value of level are passed as arguments of the event. BUG=429312 Review URL: https://codereview.chromium.org/945103002 Cr-Commit-Position: refs/heads/master@{#321679}
Diffstat (limited to 'chromeos/audio')
-rw-r--r--chromeos/audio/cras_audio_handler.cc70
-rw-r--r--chromeos/audio/cras_audio_handler.h62
-rw-r--r--chromeos/audio/cras_audio_handler_unittest.cc83
3 files changed, 109 insertions, 106 deletions
diff --git a/chromeos/audio/cras_audio_handler.cc b/chromeos/audio/cras_audio_handler.cc
index c3e7c2d..5cf17ee 100644
--- a/chromeos/audio/cras_audio_handler.cc
+++ b/chromeos/audio/cras_audio_handler.cc
@@ -35,11 +35,12 @@ bool IsSameAudioDevice(const AudioDevice& a, const AudioDevice& b) {
&& a.device_name == b.device_name;
}
-bool IsInNodeList(uint64 node_id, const CrasAudioHandler::NodeIdList& id_list) {
+bool IsInNodeList(uint64_t node_id,
+ const CrasAudioHandler::NodeIdList& id_list) {
return std::find(id_list.begin(), id_list.end(), node_id) != id_list.end();
}
-bool IsNodeInTheList(uint64 node_id, const AudioNodeList& node_list) {
+bool IsNodeInTheList(uint64_t node_id, const AudioNodeList& node_list) {
for (size_t i = 0; i < node_list.size(); ++i) {
if (node_id == node_list[i].id)
return true;
@@ -55,10 +56,14 @@ CrasAudioHandler::AudioObserver::AudioObserver() {
CrasAudioHandler::AudioObserver::~AudioObserver() {
}
-void CrasAudioHandler::AudioObserver::OnOutputVolumeChanged() {
+void CrasAudioHandler::AudioObserver::OnOutputNodeVolumeChanged(
+ uint64_t /* node_id */,
+ int /* volume */) {
}
-void CrasAudioHandler::AudioObserver::OnInputGainChanged() {
+void CrasAudioHandler::AudioObserver::OnInputNodeGainChanged(
+ uint64_t /* node_id */,
+ int /* gain */) {
}
void CrasAudioHandler::AudioObserver::OnOutputMuteChanged() {
@@ -124,7 +129,7 @@ bool CrasAudioHandler::IsOutputMuted() {
return output_mute_on_;
}
-bool CrasAudioHandler::IsOutputMutedForDevice(uint64 device_id) {
+bool CrasAudioHandler::IsOutputMutedForDevice(uint64_t device_id) {
const AudioDevice* device = GetDeviceFromId(device_id);
if (!device)
return false;
@@ -140,7 +145,7 @@ bool CrasAudioHandler::IsInputMuted() {
return input_mute_on_;
}
-bool CrasAudioHandler::IsInputMutedForDevice(uint64 device_id) {
+bool CrasAudioHandler::IsInputMutedForDevice(uint64_t device_id) {
const AudioDevice* device = GetDeviceFromId(device_id);
if (!device)
return false;
@@ -160,7 +165,7 @@ int CrasAudioHandler::GetOutputVolumePercent() {
return output_volume_;
}
-int CrasAudioHandler::GetOutputVolumePercentForDevice(uint64 device_id) {
+int CrasAudioHandler::GetOutputVolumePercentForDevice(uint64_t device_id) {
if (device_id == active_output_node_id_) {
return output_volume_;
} else {
@@ -173,7 +178,7 @@ int CrasAudioHandler::GetInputGainPercent() {
return input_gain_;
}
-int CrasAudioHandler::GetInputGainPercentForDevice(uint64 device_id) {
+int CrasAudioHandler::GetInputGainPercentForDevice(uint64_t device_id) {
if (device_id == active_input_node_id_) {
return input_gain_;
} else {
@@ -182,11 +187,11 @@ int CrasAudioHandler::GetInputGainPercentForDevice(uint64 device_id) {
}
}
-uint64 CrasAudioHandler::GetPrimaryActiveOutputNode() const {
+uint64_t CrasAudioHandler::GetPrimaryActiveOutputNode() const {
return active_output_node_id_;
}
-uint64 CrasAudioHandler::GetPrimaryActiveInputNode() const {
+uint64_t CrasAudioHandler::GetPrimaryActiveInputNode() const {
return active_input_node_id_;
}
@@ -218,7 +223,7 @@ void CrasAudioHandler::SetKeyboardMicActive(bool active) {
RemoveActiveNodeInternal(keyboard_mic->id, true);
}
-void CrasAudioHandler::AddActiveNode(uint64 node_id, bool notify) {
+void CrasAudioHandler::AddActiveNode(uint64_t node_id, bool notify) {
const AudioDevice* device = GetDeviceFromId(node_id);
if (!device) {
VLOG(1) << "AddActiveInputNode: Cannot find device id="
@@ -378,21 +383,21 @@ void CrasAudioHandler::SetInputMute(bool mute_on) {
FOR_EACH_OBSERVER(AudioObserver, observers_, OnInputMuteChanged());
}
-void CrasAudioHandler::SetActiveOutputNode(uint64 node_id, bool notify) {
+void CrasAudioHandler::SetActiveOutputNode(uint64_t node_id, bool notify) {
chromeos::DBusThreadManager::Get()->GetCrasAudioClient()->
SetActiveOutputNode(node_id);
if (notify)
NotifyActiveNodeChanged(false);
}
-void CrasAudioHandler::SetActiveInputNode(uint64 node_id, bool notify) {
+void CrasAudioHandler::SetActiveInputNode(uint64_t node_id, bool notify) {
chromeos::DBusThreadManager::Get()->GetCrasAudioClient()->
SetActiveInputNode(node_id);
if (notify)
NotifyActiveNodeChanged(true);
}
-void CrasAudioHandler::SetVolumeGainPercentForDevice(uint64 device_id,
+void CrasAudioHandler::SetVolumeGainPercentForDevice(uint64_t device_id,
int value) {
const AudioDevice* device = GetDeviceFromId(device_id);
if (!device)
@@ -404,7 +409,7 @@ void CrasAudioHandler::SetVolumeGainPercentForDevice(uint64 device_id,
SetOutputNodeVolumePercent(device_id, value);
}
-void CrasAudioHandler::SetMuteForDevice(uint64 device_id, bool mute_on) {
+void CrasAudioHandler::SetMuteForDevice(uint64_t device_id, bool mute_on) {
if (device_id == active_output_node_id_) {
SetOutputMute(mute_on);
return;
@@ -482,7 +487,7 @@ void CrasAudioHandler::NodesChanged() {
GetNodes();
}
-void CrasAudioHandler::ActiveOutputNodeChanged(uint64 node_id) {
+void CrasAudioHandler::ActiveOutputNodeChanged(uint64_t node_id) {
if (active_output_node_id_ == node_id)
return;
@@ -496,7 +501,7 @@ void CrasAudioHandler::ActiveOutputNodeChanged(uint64 node_id) {
}
}
-void CrasAudioHandler::ActiveInputNodeChanged(uint64 node_id) {
+void CrasAudioHandler::ActiveInputNodeChanged(uint64_t node_id) {
if (active_input_node_id_ == node_id)
return;
@@ -520,7 +525,7 @@ void CrasAudioHandler::EmitLoginPromptVisibleCalled() {
LogErrors();
}
-const AudioDevice* CrasAudioHandler::GetDeviceFromId(uint64 device_id) const {
+const AudioDevice* CrasAudioHandler::GetDeviceFromId(uint64_t device_id) const {
AudioDeviceMap::const_iterator it = audio_devices_.find(device_id);
if (it == audio_devices_.end())
return NULL;
@@ -571,7 +576,7 @@ void CrasAudioHandler::SetupAudioOutputState() {
}
// This sets up the state of an additional active node.
-void CrasAudioHandler::SetupAdditionalActiveAudioNodeState(uint64 node_id) {
+void CrasAudioHandler::SetupAdditionalActiveAudioNodeState(uint64_t node_id) {
const AudioDevice* device = GetDeviceFromId(node_id);
if (!device) {
VLOG(1) << "Can't set up audio state for unknown device id ="
@@ -615,12 +620,12 @@ void CrasAudioHandler::ApplyAudioPolicy() {
// media system.
}
-void CrasAudioHandler::SetOutputNodeVolume(uint64 node_id, int volume) {
+void CrasAudioHandler::SetOutputNodeVolume(uint64_t node_id, int volume) {
chromeos::DBusThreadManager::Get()->GetCrasAudioClient()->
SetOutputNodeVolume(node_id, volume);
}
-void CrasAudioHandler::SetOutputNodeVolumePercent(uint64 node_id,
+void CrasAudioHandler::SetOutputNodeVolumePercent(uint64_t node_id,
int volume_percent) {
const AudioDevice* device = this->GetDeviceFromId(node_id);
if (!device || device->is_input)
@@ -636,7 +641,8 @@ void CrasAudioHandler::SetOutputNodeVolumePercent(uint64 node_id,
if (device->active) {
SetOutputNodeVolume(node_id, volume_percent);
- FOR_EACH_OBSERVER(AudioObserver, observers_, OnOutputVolumeChanged());
+ FOR_EACH_OBSERVER(AudioObserver, observers_,
+ OnOutputNodeVolumeChanged(node_id, volume_percent));
}
}
@@ -650,12 +656,12 @@ bool CrasAudioHandler::SetOutputMuteInternal(bool mute_on) {
return true;
}
-void CrasAudioHandler::SetInputNodeGain(uint64 node_id, int gain) {
+void CrasAudioHandler::SetInputNodeGain(uint64_t node_id, int gain) {
chromeos::DBusThreadManager::Get()->GetCrasAudioClient()->
SetInputNodeGain(node_id, gain);
}
-void CrasAudioHandler::SetInputNodeGainPercent(uint64 node_id,
+void CrasAudioHandler::SetInputNodeGainPercent(uint64_t node_id,
int gain_percent) {
const AudioDevice* device = GetDeviceFromId(node_id);
if (!device || !device->is_input)
@@ -670,7 +676,8 @@ void CrasAudioHandler::SetInputNodeGainPercent(uint64 node_id,
if (device->active) {
SetInputNodeGain(node_id, gain_percent);
- FOR_EACH_OBSERVER(AudioObserver, observers_, OnInputGainChanged());
+ FOR_EACH_OBSERVER(AudioObserver, observers_,
+ OnInputNodeGainChanged(node_id, gain_percent));
}
}
@@ -689,7 +696,7 @@ void CrasAudioHandler::GetNodes() {
}
bool CrasAudioHandler::ChangeActiveDevice(const AudioDevice& new_active_device,
- uint64* current_active_node_id) {
+ uint64_t* current_active_node_id) {
// If the device we want to switch to is already the current active device,
// do nothing.
if (new_active_device.active &&
@@ -713,10 +720,9 @@ bool CrasAudioHandler::ChangeActiveDevice(const AudioDevice& new_active_device,
return true;
}
-bool CrasAudioHandler::NonActiveDeviceUnplugged(
- size_t old_devices_size,
- size_t new_devices_size,
- uint64 current_active_node) {
+bool CrasAudioHandler::NonActiveDeviceUnplugged(size_t old_devices_size,
+ size_t new_devices_size,
+ uint64_t current_active_node) {
return (new_devices_size < old_devices_size &&
GetDeviceFromId(current_active_node));
}
@@ -909,7 +915,7 @@ void CrasAudioHandler::HandleGetNodesError(const std::string& error_name,
<< error_name << ": " << error_msg;
}
-void CrasAudioHandler::AddAdditionalActiveNode(uint64 node_id, bool notify) {
+void CrasAudioHandler::AddAdditionalActiveNode(uint64_t node_id, bool notify) {
const AudioDevice* device = GetDeviceFromId(node_id);
if (!device) {
VLOG(1) << "AddActiveInputNode: Cannot find device id="
@@ -937,7 +943,7 @@ void CrasAudioHandler::AddAdditionalActiveNode(uint64 node_id, bool notify) {
}
}
-void CrasAudioHandler::RemoveActiveNodeInternal(uint64 node_id, bool notify) {
+void CrasAudioHandler::RemoveActiveNodeInternal(uint64_t node_id, bool notify) {
const AudioDevice* device = GetDeviceFromId(node_id);
if (!device) {
VLOG(1) << "RemoveActiveInputNode: Cannot find device id="
diff --git a/chromeos/audio/cras_audio_handler.h b/chromeos/audio/cras_audio_handler.h
index 28a858b..081e20d 100644
--- a/chromeos/audio/cras_audio_handler.h
+++ b/chromeos/audio/cras_audio_handler.h
@@ -5,9 +5,9 @@
#ifndef CHROMEOS_AUDIO_CRAS_AUDIO_HANDLER_H_
#define CHROMEOS_AUDIO_CRAS_AUDIO_HANDLER_H_
+#include <stdint.h>
#include <queue>
-#include "base/basictypes.h"
#include "base/memory/ref_counted.h"
#include "base/memory/weak_ptr.h"
#include "base/observer_list.h"
@@ -32,18 +32,18 @@ class CHROMEOS_EXPORT CrasAudioHandler : public CrasAudioClient::Observer,
typedef std::priority_queue<AudioDevice,
std::vector<AudioDevice>,
AudioDeviceCompare> AudioDevicePriorityQueue;
- typedef std::vector<uint64> NodeIdList;
+ typedef std::vector<uint64_t> NodeIdList;
class AudioObserver {
public:
- // Called when output volume changed.
- virtual void OnOutputVolumeChanged();
+ // Called when an active output volume changed.
+ virtual void OnOutputNodeVolumeChanged(uint64_t node_id, int volume);
// Called when output mute state changed.
virtual void OnOutputMuteChanged();
- // Called when input mute state changed.
- virtual void OnInputGainChanged();
+ // Called when active input node's gain changed.
+ virtual void OnInputNodeGainChanged(uint64_t node_id, int gain);
// Called when input mute state changed.
virtual void OnInputMuteChanged();
@@ -92,13 +92,13 @@ class CHROMEOS_EXPORT CrasAudioHandler : public CrasAudioClient::Observer,
virtual bool IsOutputMuted();
// Returns true if audio output is muted for a device.
- virtual bool IsOutputMutedForDevice(uint64 device_id);
+ virtual bool IsOutputMutedForDevice(uint64_t device_id);
// Returns true if audio input is muted.
virtual bool IsInputMuted();
// Returns true if audio input is muted for a device.
- virtual bool IsInputMutedForDevice(uint64 device_id);
+ virtual bool IsInputMutedForDevice(uint64_t device_id);
// Returns true if the output volume is below the default mute volume level.
virtual bool IsOutputVolumeBelowDefaultMuteLevel();
@@ -111,20 +111,20 @@ class CHROMEOS_EXPORT CrasAudioHandler : public CrasAudioClient::Observer,
virtual int GetOutputVolumePercent();
// Gets volume level in 0-100% range (0 being pure silence) for a device.
- virtual int GetOutputVolumePercentForDevice(uint64 device_id);
+ virtual int GetOutputVolumePercentForDevice(uint64_t device_id);
// Gets gain level in 0-100% range (0 being pure silence) for the current
// active node.
virtual int GetInputGainPercent();
// Gets volume level in 0-100% range (0 being pure silence) for a device.
- virtual int GetInputGainPercentForDevice(uint64 device_id);
+ virtual int GetInputGainPercentForDevice(uint64_t device_id);
// Returns node_id of the primary active output node.
- virtual uint64 GetPrimaryActiveOutputNode() const;
+ virtual uint64_t GetPrimaryActiveOutputNode() const;
// Returns the node_id of the primary active input node.
- virtual uint64 GetPrimaryActiveInputNode() const;
+ virtual uint64_t GetPrimaryActiveInputNode() const;
// Gets the audio devices back in |device_list|.
virtual void GetAudioDevices(AudioDeviceList* device_list) const;
@@ -161,10 +161,10 @@ class CHROMEOS_EXPORT CrasAudioHandler : public CrasAudioClient::Observer,
virtual void SwitchToDevice(const AudioDevice& device, bool notify);
// Sets volume/gain level for a device.
- virtual void SetVolumeGainPercentForDevice(uint64 device_id, int value);
+ virtual void SetVolumeGainPercentForDevice(uint64_t device_id, int value);
// Sets the mute for device.
- virtual void SetMuteForDevice(uint64 device_id, bool mute_on);
+ virtual void SetMuteForDevice(uint64_t device_id, bool mute_on);
// Activates or deactivates keyboard mic if there's one.
virtual void SetKeyboardMicActive(bool active);
@@ -199,8 +199,8 @@ class CHROMEOS_EXPORT CrasAudioHandler : public CrasAudioClient::Observer,
// CrasAudioClient::Observer overrides.
void AudioClientRestarted() override;
void NodesChanged() override;
- void ActiveOutputNodeChanged(uint64 node_id) override;
- void ActiveInputNodeChanged(uint64 node_id) override;
+ void ActiveOutputNodeChanged(uint64_t node_id) override;
+ void ActiveInputNodeChanged(uint64_t node_id) override;
// AudioPrefObserver overrides.
void OnAudioPolicyPrefChanged() override;
@@ -210,8 +210,8 @@ class CHROMEOS_EXPORT CrasAudioHandler : public CrasAudioClient::Observer,
// Sets the active audio output/input node to the node with |node_id|.
// If |notify|, notifies Active*NodeChange.
- void SetActiveOutputNode(uint64 node_id, bool notify);
- void SetActiveInputNode(uint64 node_id, bool notify);
+ void SetActiveOutputNode(uint64_t node_id, bool notify);
+ void SetActiveInputNode(uint64_t node_id, bool notify);
// Sets up the audio device state based on audio policy and audio settings
// saved in prefs.
@@ -219,9 +219,9 @@ class CHROMEOS_EXPORT CrasAudioHandler : public CrasAudioClient::Observer,
void SetupAudioOutputState();
// Sets up the additional active audio node's state.
- void SetupAdditionalActiveAudioNodeState(uint64 node_id);
+ void SetupAdditionalActiveAudioNodeState(uint64_t node_id);
- const AudioDevice* GetDeviceFromId(uint64 device_id) const;
+ const AudioDevice* GetDeviceFromId(uint64_t device_id) const;
const AudioDevice* GetKeyboardMic() const;
// Initializes audio state, which should only be called when CrasAudioHandler
@@ -233,18 +233,18 @@ class CHROMEOS_EXPORT CrasAudioHandler : public CrasAudioClient::Observer,
void ApplyAudioPolicy();
// Sets output volume of |node_id| to |volume|.
- void SetOutputNodeVolume(uint64 node_id, int volume);
+ void SetOutputNodeVolume(uint64_t node_id, int volume);
- void SetOutputNodeVolumePercent(uint64 node_id, int volume_percent);
+ void SetOutputNodeVolumePercent(uint64_t node_id, int volume_percent);
// Sets output mute state to |mute_on| internally, returns true if output mute
// is set.
bool SetOutputMuteInternal(bool mute_on);
// Sets input gain of |node_id| to |gain|.
- void SetInputNodeGain(uint64 node_id, int gain);
+ void SetInputNodeGain(uint64_t node_id, int gain);
- void SetInputNodeGainPercent(uint64 node_id, int gain_percent);
+ void SetInputNodeGainPercent(uint64_t node_id, int gain_percent);
// Sets input mute state to |mute_on| internally.
void SetInputMuteInternal(bool mute_on);
@@ -259,13 +259,13 @@ class CHROMEOS_EXPORT CrasAudioHandler : public CrasAudioClient::Observer,
// 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);
+ uint64_t* current_active_node_id);
// Returns true if the audio nodes change is caused by some non-active
// audio nodes unplugged.
bool NonActiveDeviceUnplugged(size_t old_devices_size,
size_t new_device_size,
- uint64 current_active_node);
+ uint64_t current_active_node);
// Returns true if there is any device change for for input or output,
// specified by |is_input|.
@@ -285,13 +285,13 @@ class CHROMEOS_EXPORT CrasAudioHandler : public CrasAudioClient::Observer,
// If there is no active node, |node_id| will be switched to become the
// primary active node. Otherwise, it will be added as an additional active
// node.
- void AddActiveNode(uint64 node_id, bool notify);
+ void AddActiveNode(uint64_t node_id, bool notify);
// Adds |node_id| into additional active nodes.
- void AddAdditionalActiveNode(uint64 node_id, bool notify);
+ void AddAdditionalActiveNode(uint64_t node_id, bool notify);
// Removes |node_id| from additional active nodes.
- void RemoveActiveNodeInternal(uint64 node_id, bool notify);
+ void RemoveActiveNodeInternal(uint64_t node_id, bool notify);
enum DeviceStatus {
OLD_DEVICE,
@@ -318,8 +318,8 @@ class CHROMEOS_EXPORT CrasAudioHandler : public CrasAudioClient::Observer,
bool input_mute_on_;
int output_volume_;
int input_gain_;
- uint64 active_output_node_id_;
- uint64 active_input_node_id_;
+ uint64_t active_output_node_id_;
+ uint64_t active_input_node_id_;
bool has_alternative_input_;
bool has_alternative_output_;
diff --git a/chromeos/audio/cras_audio_handler_unittest.cc b/chromeos/audio/cras_audio_handler_unittest.cc
index 574b421..ac9493c 100644
--- a/chromeos/audio/cras_audio_handler_unittest.cc
+++ b/chromeos/audio/cras_audio_handler_unittest.cc
@@ -114,45 +114,37 @@ const AudioNode kOtherTypeInput(
0
);
-const AudioNode kBluetoothHeadset (
- false,
- kBluetoothHeadsetId,
- "Bluetooth Headset",
- "BLUETOOTH",
- "Bluetooth Headset 1",
- false,
- 0
-);
-
-const AudioNode kHDMIOutput (
- false,
- kHDMIOutputId,
- "HDMI output",
- "HDMI",
- "HDMI output",
- false,
- 0
-);
-
-const AudioNode kUSBHeadphone1 (
- false,
- kUSBHeadphoneId1,
- "USB Headphone",
- "USB",
- "USB Headphone 1",
- false,
- 0
-);
-
-const AudioNode kUSBHeadphone2 (
- false,
- kUSBHeadphoneId2,
- "USB Headphone",
- "USB",
- "USB Headphone 1",
- false,
- 0
-);
+const AudioNode kBluetoothHeadset(false,
+ kBluetoothHeadsetId,
+ "Bluetooth Headset",
+ "BLUETOOTH",
+ "Bluetooth Headset 1",
+ false,
+ 0);
+
+const AudioNode kHDMIOutput(false,
+ kHDMIOutputId,
+ "HDMI output",
+ "HDMI",
+ "HDMI output",
+ false,
+ 0);
+
+const AudioNode kUSBHeadphone1(false,
+ kUSBHeadphoneId1,
+ "USB Headphone",
+ "USB",
+ "USB Headphone 1",
+ false,
+ 0);
+
+const AudioNode kUSBHeadphone2(false,
+ kUSBHeadphoneId2,
+ "USB Headphone",
+ "USB",
+ "USB Headphone 1",
+ false,
+ 0);
const AudioNode kUSBJabraSpeakerOutput1(false,
kUSBJabraSpeakerOutputId1,
@@ -259,9 +251,14 @@ class TestObserver : public chromeos::CrasAudioHandler::AudioObserver {
void OnInputMuteChanged() override { ++input_mute_changed_count_; }
- void OnOutputVolumeChanged() override { ++output_volume_changed_count_; }
+ void OnOutputNodeVolumeChanged(uint64 /* node_id */,
+ int /* volume */) override {
+ ++output_volume_changed_count_;
+ }
- void OnInputGainChanged() override { ++input_gain_changed_count_; }
+ void OnInputNodeGainChanged(uint64 /* node_id */, int /* gain */) override {
+ ++input_gain_changed_count_;
+ }
private:
int active_output_node_changed_count_;
@@ -1811,7 +1808,7 @@ TEST_F(CrasAudioHandlerTest, SetOutputVolumePercent) {
cras_audio_handler_->SetOutputVolumePercent(60);
// Verify the output volume is changed to the designated value,
- // OnOutputVolumeChanged event is fired, and the device volume value
+ // OnOutputNodeVolumeChanged event is fired, and the device volume value
// is saved the preferences.
const int kVolume = 60;
EXPECT_EQ(kVolume, cras_audio_handler_->GetOutputVolumePercent());
@@ -1831,7 +1828,7 @@ TEST_F(CrasAudioHandlerTest, SetInputGainPercent) {
cras_audio_handler_->SetInputGainPercent(60);
// Verify the input gain changed to the designated value,
- // OnInputGainChanged event is fired, and the device gain value
+ // OnInputNodeGainChanged event is fired, and the device gain value
// is saved in the preferences.
const int kGain = 60;
EXPECT_EQ(kGain, cras_audio_handler_->GetInputGainPercent());