gitadora: arena cab volume change prevention (#478)

## 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.
This commit is contained in:
bicarus-dev
2025-12-29 03:23:58 -08:00
committed by GitHub
parent 07a0df5fdc
commit 21f469b260
10 changed files with 130 additions and 3 deletions
@@ -8,6 +8,7 @@
#include "hooks/audio/audio_private.h"
#include "hooks/audio/backends/mmdevice/audio_endpoint_volume.h"
#include "hooks/audio/backends/wasapi/audio_client.h"
#include "util/utils.h"
#define PRINT_FAILED_RESULT(name, ret) \
do { \
@@ -56,6 +57,7 @@ ULONG STDMETHODCALLTYPE WrappedIMMDevice::Release() {
ULONG refs = pReal != nullptr ? pReal->Release() : 0;
if (refs == 0) {
log_misc("audio::mmdevice", "WrappedIMMDevice::Release");
delete this;
}
@@ -69,7 +71,7 @@ HRESULT STDMETHODCALLTYPE WrappedIMMDevice::Activate(
PROPVARIANT *pActivationParams,
void **ppInterface)
{
log_misc("audio::mmdevice", "WrappedIMMDevice::Activate");
log_misc("audio::mmdevice", "WrappedIMMDevice::Activate {}", guid2s(iid));
// call original
HRESULT ret = pReal->Activate(iid, dwClsCtx, pActivationParams, ppInterface);