mirror of
https://github.com/spice2x/spice2x.github.io.git
synced 2026-08-02 06:40:42 -07:00
21f469b260
## Link to GitHub Issue, if one exists #477 ## Description of change Arena cab has two sound cards and it uses `WrappedIMMDeviceCollection` to set the volume to 100% on boot on both, instead of the typical `GetDefaultAudioEndpoint`. ## Testing Testing Delta, testing other games as well as they are affected.
29 lines
942 B
C++
29 lines
942 B
C++
#pragma once
|
|
|
|
#include <initguid.h>
|
|
#include <mmdeviceapi.h>
|
|
|
|
struct WrappedIMMDeviceCollection : IMMDeviceCollection {
|
|
explicit WrappedIMMDeviceCollection(IMMDeviceCollection *orig) : pReal(orig) {
|
|
}
|
|
|
|
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:
|
|
IMMDeviceCollection *const pReal;
|
|
};
|