mirror of
https://github.com/spice2x/spice2x.github.io.git
synced 2026-08-02 06:40:42 -07:00
2dae86a6f2
## Link to GitHub Issue or related Pull Request, if one exists #730, #718 ## Description of change Part 1) When ASIO is in use, the game also looks for a Realtek device so that it can open a WASAPI Exclusive mode stream for headphones. Add an option to fake that, in case the user doesn't have a Realtek device. Part 2) `-gdaasio` wasn't workign properly - fix the logic. ## Testing Seems to work with FlexASIO, and Xonar with no real Realtek device.
34 lines
1.1 KiB
C++
34 lines
1.1 KiB
C++
#pragma once
|
|
|
|
#include <initguid.h>
|
|
#include <mmdeviceapi.h>
|
|
|
|
struct WrappedIMMDeviceCollection : IMMDeviceCollection {
|
|
WrappedIMMDeviceCollection(IMMDeviceCollection *orig, EDataFlow dataFlow)
|
|
: pReal(orig), data_flow(dataFlow) {
|
|
}
|
|
|
|
WrappedIMMDeviceCollection(const WrappedIMMDeviceCollection &) = delete;
|
|
WrappedIMMDeviceCollection &operator=(const WrappedIMMDeviceCollection &) = delete;
|
|
|
|
virtual ~WrappedIMMDeviceCollection() = default;
|
|
|
|
#pragma region IUnknown
|
|
virtual HRESULT STDMETHODCALLTYPE QueryInterface(REFIID riid, void **ppvObj) override;
|
|
virtual ULONG STDMETHODCALLTYPE AddRef() override;
|
|
virtual ULONG STDMETHODCALLTYPE Release() override;
|
|
#pragma endregion
|
|
|
|
#pragma region IMMDeviceCollection
|
|
virtual HRESULT STDMETHODCALLTYPE GetCount(UINT *pcDevices) override;
|
|
virtual HRESULT STDMETHODCALLTYPE Item(UINT nDevice, IMMDevice **ppDevice) override;
|
|
#pragma endregion
|
|
|
|
private:
|
|
// whether the synthetic fake Realtek render device should be appended to this collection
|
|
bool should_inject_fake_realtek() const;
|
|
|
|
IMMDeviceCollection *const pReal;
|
|
const EDataFlow data_flow;
|
|
};
|