OLD | NEW |
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 Loading... |
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 |
OLD | NEW |