OLD | NEW |
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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 "media/audio/win/audio_device_listener_win.h" | 5 #include "media/audio/win/audio_device_listener_win.h" |
6 | 6 |
7 #include <Audioclient.h> | 7 #include <Audioclient.h> |
8 | 8 |
9 #include "base/logging.h" | 9 #include "base/logging.h" |
10 #include "base/strings/utf_string_conversions.h" | 10 #include "base/strings/utf_string_conversions.h" |
(...skipping 82 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
93 | 93 |
94 STDMETHODIMP AudioDeviceListenerWin::OnDeviceRemoved(LPCWSTR device_id) { | 94 STDMETHODIMP AudioDeviceListenerWin::OnDeviceRemoved(LPCWSTR device_id) { |
95 // We don't care when devices are removed. | 95 // We don't care when devices are removed. |
96 return S_OK; | 96 return S_OK; |
97 } | 97 } |
98 | 98 |
99 STDMETHODIMP AudioDeviceListenerWin::OnDeviceStateChanged(LPCWSTR device_id, | 99 STDMETHODIMP AudioDeviceListenerWin::OnDeviceStateChanged(LPCWSTR device_id, |
100 DWORD new_state) { | 100 DWORD new_state) { |
101 base::SystemMonitor* monitor = base::SystemMonitor::Get(); | 101 base::SystemMonitor* monitor = base::SystemMonitor::Get(); |
102 if (monitor) | 102 if (monitor) |
103 monitor->ProcessDevicesChanged(base::SystemMonitor::DEVTYPE_AUDIO_CAPTURE); | 103 monitor->ProcessDevicesChanged(base::SystemMonitor::DEVTYPE_AUDIO); |
104 | 104 |
105 return S_OK; | 105 return S_OK; |
106 } | 106 } |
107 | 107 |
108 STDMETHODIMP AudioDeviceListenerWin::OnDefaultDeviceChanged( | 108 STDMETHODIMP AudioDeviceListenerWin::OnDefaultDeviceChanged( |
109 EDataFlow flow, ERole role, LPCWSTR new_default_device_id) { | 109 EDataFlow flow, ERole role, LPCWSTR new_default_device_id) { |
110 // Only listen for console and communication device changes. | 110 // Only listen for console and communication device changes. |
111 if ((role != eConsole && role != eCommunications) || | 111 if ((role != eConsole && role != eCommunications) || |
112 (flow != eRender && flow != eCapture)) { | 112 (flow != eRender && flow != eCapture)) { |
113 return S_OK; | 113 return S_OK; |
(...skipping 27 matching lines...) Expand all Loading... |
141 ? CoreAudioUtil::GetFriendlyName(new_device_id) | 141 ? CoreAudioUtil::GetFriendlyName(new_device_id) |
142 : "no device") | 142 : "no device") |
143 << ", flow: " << FlowToString(flow) | 143 << ", flow: " << FlowToString(flow) |
144 << ", role: " << RoleToString(role) | 144 << ", role: " << RoleToString(role) |
145 << ", notified manager: " << (did_run_listener_cb ? "Yes" : "No"); | 145 << ", notified manager: " << (did_run_listener_cb ? "Yes" : "No"); |
146 | 146 |
147 return S_OK; | 147 return S_OK; |
148 } | 148 } |
149 | 149 |
150 } // namespace media | 150 } // namespace media |
OLD | NEW |