mirror of
https://github.com/microsoft/PowerToys.git
synced 2025-12-16 19:57:57 +01:00
* [VCM] Track newly added microphones when [All] is selected in the settings * [VCM] handle case when no mics are left * fixup: fix crashes onNotify * fixup: fix build
31 lines
885 B
C++
31 lines
885 B
C++
#pragma once
|
|
|
|
#include <MMDeviceAPI.h>
|
|
|
|
struct AudioDeviceNotificationClient : IMMNotificationClient
|
|
{
|
|
AudioDeviceNotificationClient();
|
|
~AudioDeviceNotificationClient();
|
|
|
|
bool PullPendingNotifications()
|
|
{
|
|
const bool result = _deviceConfigurationChanged;
|
|
_deviceConfigurationChanged = false;
|
|
return result;
|
|
}
|
|
|
|
private:
|
|
ULONG AddRef() override;
|
|
ULONG Release() override;
|
|
HRESULT QueryInterface(REFIID, void**) override;
|
|
HRESULT OnPropertyValueChanged(LPCWSTR, const PROPERTYKEY) override;
|
|
HRESULT OnDeviceAdded(LPCWSTR) override;
|
|
HRESULT OnDeviceRemoved(LPCWSTR) override;
|
|
HRESULT OnDeviceStateChanged(LPCWSTR, DWORD) override;
|
|
HRESULT OnDefaultDeviceChanged(EDataFlow flow, ERole role, LPCWSTR) override;
|
|
|
|
IMMDeviceEnumerator* _deviceEnumerator = nullptr;
|
|
|
|
bool _deviceConfigurationChanged = false;
|
|
};
|