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

Side by Side Diff: ash/system/win/audio/tray_audio_delegate_win.cc

Issue 620673002: Flip the left/right speaker when the device is in yoga mode. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Observe DisplayObserver::OnDisplayMetricsChanged for rotation change. Created 6 years, 2 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 unified diff | Download patch
OLDNEW
1 // Copyright 2014 The Chromium Authors. All rights reserved. 1 // Copyright 2014 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "ash/system/win/audio/tray_audio_delegate_win.h" 5 #include "ash/system/win/audio/tray_audio_delegate_win.h"
6 6
7 #include <audiopolicy.h> 7 #include <audiopolicy.h>
8 #include <cmath> 8 #include <cmath>
9 9
10 #include "media/audio/win/core_audio_util_win.h" 10 #include "media/audio/win/core_audio_util_win.h"
(...skipping 74 matching lines...) Expand 10 before | Expand all | Expand 10 after
85 ScopedComPtr<ISimpleAudioVolume> volume_control = 85 ScopedComPtr<ISimpleAudioVolume> volume_control =
86 CreateDefaultVolumeControl(); 86 CreateDefaultVolumeControl();
87 87
88 if (!volume_control) 88 if (!volume_control)
89 return; 89 return;
90 90
91 float volume_level = static_cast<float>(level) / 100.0f; 91 float volume_level = static_cast<float>(level) / 100.0f;
92 volume_control->SetMasterVolume(volume_level, NULL); 92 volume_control->SetMasterVolume(volume_level, NULL);
93 } 93 }
94 94
95 void TrayAudioDelegateWin::SetAudioChannelMode(AudioChannelMode mode) {
96 }
97
95 ScopedComPtr<ISimpleAudioVolume> 98 ScopedComPtr<ISimpleAudioVolume>
96 TrayAudioDelegateWin::CreateDefaultVolumeControl() { 99 TrayAudioDelegateWin::CreateDefaultVolumeControl() {
97 ScopedComPtr<ISimpleAudioVolume> volume_control; 100 ScopedComPtr<ISimpleAudioVolume> volume_control;
98 ScopedComPtr<IAudioSessionManager> session_manager; 101 ScopedComPtr<IAudioSessionManager> session_manager;
99 102
100 ScopedComPtr<IMMDevice> device = 103 ScopedComPtr<IMMDevice> device =
101 media::CoreAudioUtil::CreateDefaultDevice(eRender, eConsole); 104 media::CoreAudioUtil::CreateDefaultDevice(eRender, eConsole);
102 if (!device || 105 if (!device ||
103 FAILED(device->Activate(__uuidof(IAudioSessionManager), CLSCTX_ALL, NULL, 106 FAILED(device->Activate(__uuidof(IAudioSessionManager), CLSCTX_ALL, NULL,
104 session_manager.ReceiveVoid()))) { 107 session_manager.ReceiveVoid()))) {
105 return volume_control; 108 return volume_control;
106 } 109 }
107 110
108 session_manager->GetSimpleAudioVolume(NULL, FALSE, 111 session_manager->GetSimpleAudioVolume(NULL, FALSE,
109 volume_control.Receive()); 112 volume_control.Receive());
110 113
111 return volume_control; 114 return volume_control;
112 } 115 }
113 116
114 } // namespace system 117 } // namespace system
115 } // namespace ash 118 } // namespace ash
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698