- Timestamp:
- Mar 22, 2021 10:06:14 AM (4 years ago)
- Location:
- trunk/src/VBox/Devices
- Files:
-
- 2 edited
- 2 moved
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/Devices/Audio/DrvHostAudioDSound.cpp
r88230 r88233 36 36 #ifdef VBOX_WITH_AUDIO_MMNOTIFICATION_CLIENT 37 37 # include <new> /* For bad_alloc. */ 38 # include " VBoxMMNotificationClient.h"38 # include "DrvHostAudioDSoundMMNotifClient.h" 39 39 #endif 40 40 … … 224 224 LPDIRECTSOUNDCAPTURE8 pDSC; 225 225 #ifdef VBOX_WITH_AUDIO_MMNOTIFICATION_CLIENT 226 VBoxMMNotificationClient *m_pNotificationClient;226 DrvHostAudioDSoundMMNotifClient *m_pNotificationClient; 227 227 #endif 228 228 #ifdef VBOX_WITH_AUDIO_CALLBACKS … … 2713 2713 try 2714 2714 { 2715 pThis->m_pNotificationClient = new VBoxMMNotificationClient();2715 pThis->m_pNotificationClient = new DrvHostAudioDSoundMMNotifClient(); 2716 2716 2717 2717 hr = pThis->m_pNotificationClient->Initialize(); -
trunk/src/VBox/Devices/Audio/DrvHostAudioDSoundMMNotifClient.cpp
r88232 r88233 1 1 /* $Id$ */ 2 2 /** @file 3 * VBoxMMNotificationClient.cpp - Implementation of the IMMNotificationClient interface3 * DrvHostAudioDSoundMMNotifClient.cpp - Implementation of the IMMNotificationClient interface 4 4 * to detect audio endpoint changes. 5 5 */ … … 17 17 */ 18 18 19 #include " VBoxMMNotificationClient.h"19 #include "DrvHostAudioDSoundMMNotifClient.h" 20 20 21 21 #include <iprt/win/windows.h> … … 30 30 #include <VBox/log.h> 31 31 32 VBoxMMNotificationClient::VBoxMMNotificationClient(void) 32 33 DrvHostAudioDSoundMMNotifClient::DrvHostAudioDSoundMMNotifClient(void) 33 34 : m_fRegisteredClient(false) 34 35 , m_cRef(1) … … 36 37 } 37 38 38 VBoxMMNotificationClient::~VBoxMMNotificationClient(void)39 DrvHostAudioDSoundMMNotifClient::~DrvHostAudioDSoundMMNotifClient(void) 39 40 { 40 41 } … … 43 44 * Registers the mulitmedia notification client implementation. 44 45 */ 45 HRESULT VBoxMMNotificationClient::Register(void)46 HRESULT DrvHostAudioDSoundMMNotifClient::Register(void) 46 47 { 47 48 HRESULT hr = m_pEnum->RegisterEndpointNotificationCallback(this); … … 59 60 * Unregisters the mulitmedia notification client implementation. 60 61 */ 61 void VBoxMMNotificationClient::Unregister(void)62 void DrvHostAudioDSoundMMNotifClient::Unregister(void) 62 63 { 63 64 DetachFromEndpoint(); … … 76 77 * @return HRESULT 77 78 */ 78 HRESULT VBoxMMNotificationClient::Initialize(void)79 HRESULT DrvHostAudioDSoundMMNotifClient::Initialize(void) 79 80 { 80 81 HRESULT hr = CoCreateInstance(__uuidof(MMDeviceEnumerator), 0, CLSCTX_ALL, __uuidof(IMMDeviceEnumerator), … … 92 93 * @param pfnCallback Audio callback to call by the notification client in case of new events. 93 94 */ 94 int VBoxMMNotificationClient::RegisterCallback(PPDMDRVINS pDrvIns, PFNPDMHOSTAUDIOCALLBACK pfnCallback)95 int DrvHostAudioDSoundMMNotifClient::RegisterCallback(PPDMDRVINS pDrvIns, PFNPDMHOSTAUDIOCALLBACK pfnCallback) 95 96 { 96 97 this->m_pDrvIns = pDrvIns; … … 104 105 * with notifications. 105 106 */ 106 void VBoxMMNotificationClient::UnregisterCallback(void)107 void DrvHostAudioDSoundMMNotifClient::UnregisterCallback(void) 107 108 { 108 109 this->m_pDrvIns = NULL; … … 114 115 * Does nothing at the moment. 115 116 */ 116 HRESULT VBoxMMNotificationClient::AttachToDefaultEndpoint(void)117 HRESULT DrvHostAudioDSoundMMNotifClient::AttachToDefaultEndpoint(void) 117 118 { 118 119 return S_OK; … … 123 124 * Does nothing at the moment. 124 125 */ 125 void VBoxMMNotificationClient::DetachFromEndpoint(void)126 void DrvHostAudioDSoundMMNotifClient::DetachFromEndpoint(void) 126 127 { 127 128 … … 131 132 * Helper function for invoking the audio connector callback (if any). 132 133 */ 133 void VBoxMMNotificationClient::doCallback(void)134 void DrvHostAudioDSoundMMNotifClient::doCallback(void) 134 135 { 135 136 #ifdef VBOX_WITH_AUDIO_CALLBACKS … … 150 151 * @param dwNewState New state the device is now in. 151 152 */ 152 STDMETHODIMP VBoxMMNotificationClient::OnDeviceStateChanged(LPCWSTR pwstrDeviceId, DWORD dwNewState)153 STDMETHODIMP DrvHostAudioDSoundMMNotifClient::OnDeviceStateChanged(LPCWSTR pwstrDeviceId, DWORD dwNewState) 153 154 { 154 155 char *pszState = "unknown"; … … 185 186 * @param pwstrDeviceId Device ID which has been added. 186 187 */ 187 STDMETHODIMP VBoxMMNotificationClient::OnDeviceAdded(LPCWSTR pwstrDeviceId)188 STDMETHODIMP DrvHostAudioDSoundMMNotifClient::OnDeviceAdded(LPCWSTR pwstrDeviceId) 188 189 { 189 190 LogRel(("Audio: Device '%ls' has been added\n", pwstrDeviceId)); … … 198 199 * @param pwstrDeviceId Device ID which has been removed. 199 200 */ 200 STDMETHODIMP VBoxMMNotificationClient::OnDeviceRemoved(LPCWSTR pwstrDeviceId)201 STDMETHODIMP DrvHostAudioDSoundMMNotifClient::OnDeviceRemoved(LPCWSTR pwstrDeviceId) 201 202 { 202 203 LogRel(("Audio: Device '%ls' has been removed\n", pwstrDeviceId)); … … 214 215 * @param pwstrDefaultDeviceId ID of the new default device. 215 216 */ 216 STDMETHODIMP VBoxMMNotificationClient::OnDefaultDeviceChanged(EDataFlow eFlow, ERole eRole, LPCWSTR pwstrDefaultDeviceId)217 STDMETHODIMP DrvHostAudioDSoundMMNotifClient::OnDefaultDeviceChanged(EDataFlow eFlow, ERole eRole, LPCWSTR pwstrDefaultDeviceId) 217 218 { 218 219 RT_NOREF(eRole); … … 232 233 } 233 234 234 STDMETHODIMP VBoxMMNotificationClient::QueryInterface(REFIID interfaceID, void **ppvInterface)235 STDMETHODIMP DrvHostAudioDSoundMMNotifClient::QueryInterface(REFIID interfaceID, void **ppvInterface) 235 236 { 236 237 const IID MY_IID_IMMNotificationClient = __uuidof(IMMNotificationClient); … … 248 249 } 249 250 250 STDMETHODIMP_(ULONG) VBoxMMNotificationClient::AddRef(void)251 STDMETHODIMP_(ULONG) DrvHostAudioDSoundMMNotifClient::AddRef(void) 251 252 { 252 253 return InterlockedIncrement(&m_cRef); 253 254 } 254 255 255 STDMETHODIMP_(ULONG) VBoxMMNotificationClient::Release(void)256 STDMETHODIMP_(ULONG) DrvHostAudioDSoundMMNotifClient::Release(void) 256 257 { 257 258 long lRef = InterlockedDecrement(&m_cRef); -
trunk/src/VBox/Devices/Audio/DrvHostAudioDSoundMMNotifClient.h
r88232 r88233 1 1 /* $Id$ */ 2 2 /** @file 3 * VBoxMMNotificationClient.h - Implementation of the IMMNotificationClient interface3 * DrvHostAudioDSoundMMNotifClient.h - Implementation of the IMMNotificationClient interface 4 4 * to detect audio endpoint changes. 5 5 */ … … 17 17 */ 18 18 19 #ifndef VBOX_INCLUDED_SRC_Audio_ VBoxMMNotificationClient_h20 #define VBOX_INCLUDED_SRC_Audio_ VBoxMMNotificationClient_h19 #ifndef VBOX_INCLUDED_SRC_Audio_DrvHostAudioDSoundMMNotifClient_h 20 #define VBOX_INCLUDED_SRC_Audio_DrvHostAudioDSoundMMNotifClient_h 21 21 #ifndef RT_WITHOUT_PRAGMA_ONCE 22 22 # pragma once … … 40 40 41 41 42 class VBoxMMNotificationClient : IMMNotificationClient42 class DrvHostAudioDSoundMMNotifClient : IMMNotificationClient 43 43 { 44 44 public: 45 45 46 VBoxMMNotificationClient();47 virtual ~ VBoxMMNotificationClient();46 DrvHostAudioDSoundMMNotifClient(); 47 virtual ~DrvHostAudioDSoundMMNotifClient(); 48 48 49 49 HRESULT Initialize(); … … 94 94 /** @} */ 95 95 }; 96 #endif /* !VBOX_INCLUDED_SRC_Audio_ VBoxMMNotificationClient_h */96 #endif /* !VBOX_INCLUDED_SRC_Audio_DrvHostAudioDSoundMMNotifClient_h */ 97 97 -
trunk/src/VBox/Devices/Makefile.kmk
r88229 r88233 666 666 Audio/DrvHostAudioDSound.cpp 667 667 ifdef VBOX_WITH_AUDIO_MMNOTIFICATION_CLIENT 668 VBoxDD_DEFS += VBOX_WITH_AUDIO_MMNOTIFICATION_CLIENT 668 669 VBoxDD_SOURCES += \ 669 Audio/VBoxMMNotificationClient.cpp 670 VBoxDD_DEFS += VBOX_WITH_AUDIO_MMNOTIFICATION_CLIENT 670 Audio/DrvHostAudioDSoundMMNotifClient.cpp 671 671 endif 672 672 endif
Note:
See TracChangeset
for help on using the changeset viewer.