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

Unified Diff: ash/system/audio/tray_audio.cc

Issue 1199413008: Work around for HDMI audio output rediscovering transistion loss. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Changed to VLOG. Created 5 years, 6 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
« no previous file with comments | « ash/system/audio/tray_audio.h ('k') | ash/system/audio/tray_audio_delegate.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: ash/system/audio/tray_audio.cc
diff --git a/ash/system/audio/tray_audio.cc b/ash/system/audio/tray_audio.cc
index 7260fc01fe82e371a1093413c1b8b1e54fdbb19c..13269bc228a48a9766396fb7a3631cf950511a88 100644
--- a/ash/system/audio/tray_audio.cc
+++ b/ash/system/audio/tray_audio.cc
@@ -138,6 +138,21 @@ void TrayAudio::OnActiveInputNodeChanged() {
Update();
}
+void TrayAudio::ChangeInternalSpeakerChannelMode() {
+ // Swap left/right channel only if it is in Yoga mode.
+ system::TrayAudioDelegate::AudioChannelMode channel_mode =
+ system::TrayAudioDelegate::NORMAL;
+ if (gfx::Display::InternalDisplayId() != gfx::Display::kInvalidDisplayID) {
+ const DisplayInfo& display_info =
+ Shell::GetInstance()->display_manager()->GetDisplayInfo(
+ gfx::Display::InternalDisplayId());
+ if (display_info.GetActiveRotation() == gfx::Display::ROTATE_180)
+ channel_mode = system::TrayAudioDelegate::LEFT_RIGHT_SWAPPED;
+ }
+
+ audio_delegate_->SetInternalSpeakerChannelMode(channel_mode);
+}
+
void TrayAudio::OnDisplayAdded(const gfx::Display& new_display) {
if (new_display.id() != gfx::Display::InternalDisplayId())
return;
@@ -159,21 +174,6 @@ void TrayAudio::OnDisplayMetricsChanged(const gfx::Display& display,
ChangeInternalSpeakerChannelMode();
}
-void TrayAudio::ChangeInternalSpeakerChannelMode() {
- // Swap left/right channel only if it is in Yoga mode.
- system::TrayAudioDelegate::AudioChannelMode channel_mode =
- system::TrayAudioDelegate::NORMAL;
- if (gfx::Display::InternalDisplayId() != gfx::Display::kInvalidDisplayID) {
- const DisplayInfo& display_info =
- Shell::GetInstance()->display_manager()->GetDisplayInfo(
- gfx::Display::InternalDisplayId());
- if (display_info.GetActiveRotation() == gfx::Display::ROTATE_180)
- channel_mode = system::TrayAudioDelegate::LEFT_RIGHT_SWAPPED;
- }
-
- audio_delegate_->SetInternalSpeakerChannelMode(channel_mode);
-}
-
void TrayAudio::Update() {
if (tray_view())
tray_view()->SetVisible(GetInitialVisibility());
« no previous file with comments | « ash/system/audio/tray_audio.h ('k') | ash/system/audio/tray_audio_delegate.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698