#pragma once

#include <memory>
#include <mmdeviceapi.h>

class AudioData;
class ApplicationData;
class AudioNotificationListener : public IMMNotificationClient {
public:
	std::shared_ptr<AudioData> audioData;
	long refCount = 1;

	AudioNotificationListener(std::shared_ptr<AudioData> audioData);

	virtual HRESULT __stdcall OnDeviceStateChanged(LPCWSTR pwstrDeviceId, DWORD dwNewState) override;
	virtual HRESULT __stdcall OnDeviceAdded(LPCWSTR pwstrDeviceId) override;
	virtual HRESULT __stdcall OnDeviceRemoved(LPCWSTR pwstrDeviceId) override;
	virtual HRESULT __stdcall OnDefaultDeviceChanged(EDataFlow flow, ERole role, LPCWSTR pwstrDefaultDeviceId) override;
	virtual HRESULT __stdcall OnPropertyValueChanged(LPCWSTR pwstrDeviceId, const PROPERTYKEY key) override;

	virtual HRESULT __stdcall QueryInterface(REFIID riid, void** ppvObject) override;
	virtual ULONG __stdcall AddRef(void) override;
	virtual ULONG __stdcall Release(void) override;
};

