Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(77)

Unified Diff: chromeos/audio/cras_audio_handler.cc

Issue 23536034: Set up hdmi output device default volume to 100. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Remove the default value of input gain. Created 7 years, 3 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: chromeos/audio/cras_audio_handler.cc
diff --git a/chromeos/audio/cras_audio_handler.cc b/chromeos/audio/cras_audio_handler.cc
index 3fa81cbcdecf912aa55eedf8df7ad623aabf33b3..9ed52532055345ea803b15fe04c40a92f9c0dc14 100644
--- a/chromeos/audio/cras_audio_handler.cc
+++ b/chromeos/audio/cras_audio_handler.cc
@@ -134,9 +134,7 @@ int CrasAudioHandler::GetOutputVolumePercentForDevice(uint64 device_id) {
return output_volume_;
} else {
const AudioDevice* device = GetDeviceFromId(device_id);
- if (!device)
- return kDefaultVolumeGainPercent;
- return static_cast<int>(audio_pref_handler_->GetVolumeGainValue(*device));
+ return static_cast<int>(audio_pref_handler_->GetOutputVolumeValue(device));
}
}
@@ -149,9 +147,7 @@ int CrasAudioHandler::GetInputGainPercentForDevice(uint64 device_id) {
return input_gain_;
} else {
const AudioDevice* device = GetDeviceFromId(device_id);
- if (!device)
- return kDefaultVolumeGainPercent;
- return static_cast<int>(audio_pref_handler_->GetVolumeGainValue(*device));
+ return static_cast<int>(audio_pref_handler_->GetInputGainValue(device));
}
}
@@ -379,7 +375,7 @@ void CrasAudioHandler::SetupAudioInputState() {
return;
}
input_mute_on_ = audio_pref_handler_->GetMuteValue(*device);
- input_gain_ = audio_pref_handler_->GetVolumeGainValue(*device);
+ input_gain_ = audio_pref_handler_->GetInputGainValue(device);
SetInputMuteInternal(input_mute_on_);
// TODO(rkc,jennyz): Set input gain once we decide on how to store
// the gain values since the range and step are both device specific.
@@ -393,7 +389,7 @@ void CrasAudioHandler::SetupAudioOutputState() {
return;
}
output_mute_on_ = audio_pref_handler_->GetMuteValue(*device);
- output_volume_ = audio_pref_handler_->GetVolumeGainValue(*device);
+ output_volume_ = audio_pref_handler_->GetOutputVolumeValue(device);
SetOutputMuteInternal(output_mute_on_);
SetOutputNodeVolume(active_output_node_id_, output_volume_);

Powered by Google App Engine
This is Rietveld 408576698