diff options
author | Jörg Müller <nexyon@gmail.com> | 2022-01-15 00:51:35 +0300 |
---|---|---|
committer | Jörg Müller <nexyon@gmail.com> | 2022-01-15 00:51:35 +0300 |
commit | 2a095d8bfee39cb6f7f4f108d7febf9780bb8241 (patch) | |
tree | 4d9c7e282428f4ed8c0ae296c396bced8a1c6913 /extern/audaspace/plugins/wasapi/WASAPIDevice.h | |
parent | 9fe704800ef1288ef7258e9dda6a538dc92ddddd (diff) |
Audaspace: port bugfixes from upstream.
Windows audio backend (WASAPI) now automatically switches to
the selected audio device in windows.
Diffstat (limited to 'extern/audaspace/plugins/wasapi/WASAPIDevice.h')
-rw-r--r-- | extern/audaspace/plugins/wasapi/WASAPIDevice.h | 15 |
1 files changed, 14 insertions, 1 deletions
diff --git a/extern/audaspace/plugins/wasapi/WASAPIDevice.h b/extern/audaspace/plugins/wasapi/WASAPIDevice.h index 3b11adc98ef..24d0fedc191 100644 --- a/extern/audaspace/plugins/wasapi/WASAPIDevice.h +++ b/extern/audaspace/plugins/wasapi/WASAPIDevice.h @@ -40,7 +40,7 @@ AUD_NAMESPACE_BEGIN /** * This device plays back through WASAPI, the Windows audio API. */ -class AUD_PLUGIN_API WASAPIDevice : public ThreadedDevice +class AUD_PLUGIN_API WASAPIDevice : IMMNotificationClient, public ThreadedDevice { private: int m_buffersize; @@ -48,6 +48,8 @@ private: IMMDevice* m_imm_device; IAudioClient* m_audio_client; WAVEFORMATEXTENSIBLE m_wave_format_extensible; + bool m_default_device_changed; + LONG m_reference_count; AUD_LOCAL HRESULT setupRenderClient(IAudioRenderClient*& render_client, UINT32& buffer_size); @@ -58,6 +60,17 @@ private: AUD_LOCAL bool setupDevice(DeviceSpecs& specs); + // IUnknown implementation + ULONG STDMETHODCALLTYPE AddRef(); + ULONG STDMETHODCALLTYPE Release(); + HRESULT STDMETHODCALLTYPE QueryInterface(REFIID riid, void **ppvObject); + // IMMNotificationClient implementation + HRESULT STDMETHODCALLTYPE OnDeviceStateChanged(LPCWSTR pwstrDeviceId, DWORD dwNewState); + HRESULT STDMETHODCALLTYPE OnDeviceAdded(LPCWSTR pwstrDeviceId); + HRESULT STDMETHODCALLTYPE OnDeviceRemoved(LPCWSTR pwstrDeviceId); + HRESULT STDMETHODCALLTYPE OnDefaultDeviceChanged(EDataFlow flow, ERole role, LPCWSTR pwstrDeviceId); + HRESULT STDMETHODCALLTYPE OnPropertyValueChanged(LPCWSTR pwstrDeviceId, const PROPERTYKEY key); + // delete copy constructor and operator= WASAPIDevice(const WASAPIDevice&) = delete; WASAPIDevice& operator=(const WASAPIDevice&) = delete; |