-
Notifications
You must be signed in to change notification settings - Fork 0
/
VolumeCallback.h
33 lines (22 loc) · 913 Bytes
/
VolumeCallback.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
//---------------------------------------------------------------------------
#ifndef VolumeCallbackH
#define VolumeCallbackH
//---------------------------------------------------------------------------
#include <objbase.h>
#include <Endpointvolume.h>
typedef void (__closure *TOnVolumeChange)(GUID EventContext, bool bMuted, float MasterVolume, unsigned NrChannels, float ChannelVolumes[]);
class TVolumeCallback: public IAudioEndpointVolumeCallback
{
public:
TVolumeCallback(TOnVolumeChange OnVolumeChange);
// IUnknown
virtual HRESULT STDMETHODCALLTYPE QueryInterface(const IID &iid, void **ppv);
virtual ULONG STDMETHODCALLTYPE AddRef();
virtual ULONG STDMETHODCALLTYPE Release();
// IAudioEndpointVolumeCallback
virtual HRESULT STDMETHODCALLTYPE OnNotify(AUDIO_VOLUME_NOTIFICATION_DATA *pNotificationData);
private:
ULONG m_RefCount;
TOnVolumeChange m_OnVolumeChange;
};
#endif