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

Unified Diff: components/arc/audio/arc_audio_bridge.cc

Issue 2813113002: Adding ArcBridge Interface for Volume Update Requests (Closed)
Patch Set: Adding ArcBridge Interface for Volume Update Requests Created 3 years, 8 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: components/arc/audio/arc_audio_bridge.cc
diff --git a/components/arc/audio/arc_audio_bridge.cc b/components/arc/audio/arc_audio_bridge.cc
index bdf7e4feafce96eb955d6e98bff5e3a6a36b2686..979d4b007fad58a483de3a682adc226ab31178e5 100644
--- a/components/arc/audio/arc_audio_bridge.cc
+++ b/components/arc/audio/arc_audio_bridge.cc
@@ -39,6 +39,14 @@ void ArcAudioBridge::ShowVolumeControls() {
ash::TrayAudio::ShowPopUpVolumeView();
}
+void ArcAudioBridge::OnVolumeUpdateRequest(float volume) {
+ cras_audio_handler_->SetOutputVolumePercent(volume);
dcheng 2017/04/14 03:36:42 This should check that the input is in range. (Ou
yueli 2017/06/02 19:10:13 It seems the range is already handled in SetOutput
dcheng 2017/06/02 23:25:35 This is OK, but I will note that it makes it a bit
yueli 2017/06/06 16:43:09 Done.
+ bool is_muted =
+ volume <= cras_audio_handler_->GetOutputDefaultVolumeMuteThreshold();
+ if (cras_audio_handler_->IsOutputMuted() != is_muted)
+ cras_audio_handler_->SetOutputMute(is_muted);
+}
+
void ArcAudioBridge::OnAudioNodesChanged() {
uint64_t output_id = cras_audio_handler_->GetPrimaryActiveOutputNode();
const chromeos::AudioDevice* output_device =

Powered by Google App Engine
This is Rietveld 408576698