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

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: Change internal speaker channel mode OnDisplayAdded. 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::SetInternalSpeakerChannelMode(
96 AudioChannelMode mode) {
97 }
98
95 ScopedComPtr<ISimpleAudioVolume> 99 ScopedComPtr<ISimpleAudioVolume>
96 TrayAudioDelegateWin::CreateDefaultVolumeControl() { 100 TrayAudioDelegateWin::CreateDefaultVolumeControl() {
97 ScopedComPtr<ISimpleAudioVolume> volume_control; 101 ScopedComPtr<ISimpleAudioVolume> volume_control;
98 ScopedComPtr<IAudioSessionManager> session_manager; 102 ScopedComPtr<IAudioSessionManager> session_manager;
99 103
100 ScopedComPtr<IMMDevice> device = 104 ScopedComPtr<IMMDevice> device =
101 media::CoreAudioUtil::CreateDefaultDevice(eRender, eConsole); 105 media::CoreAudioUtil::CreateDefaultDevice(eRender, eConsole);
102 if (!device || 106 if (!device ||
103 FAILED(device->Activate(__uuidof(IAudioSessionManager), CLSCTX_ALL, NULL, 107 FAILED(device->Activate(__uuidof(IAudioSessionManager), CLSCTX_ALL, NULL,
104 session_manager.ReceiveVoid()))) { 108 session_manager.ReceiveVoid()))) {
105 return volume_control; 109 return volume_control;
106 } 110 }
107 111
108 session_manager->GetSimpleAudioVolume(NULL, FALSE, 112 session_manager->GetSimpleAudioVolume(NULL, FALSE,
109 volume_control.Receive()); 113 volume_control.Receive());
110 114
111 return volume_control; 115 return volume_control;
112 } 116 }
113 117
114 } // namespace system 118 } // namespace system
115 } // namespace ash 119 } // namespace ash
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698