54 lines
952 B
Plaintext
54 lines
952 B
Plaintext
#ifndef VOLUMECONTROLLER_H
|
|
#define VOLUMECONTROLLER_H
|
|
|
|
#include "GlobalDefine.h"
|
|
#include <QObject>
|
|
#include <endpointvolume.h>
|
|
#include <Mmdeviceapi.h>
|
|
|
|
class CAvReceiver;
|
|
|
|
|
|
class CVolumeController : public QObject, public IAudioEndpointVolumeCallback
|
|
{
|
|
Q_OBJECT
|
|
public:
|
|
explicit CVolumeController(QObject *parent = 0);
|
|
~CVolumeController();
|
|
int Init();
|
|
|
|
CAvReceiver *mProgramPtr;
|
|
|
|
private:
|
|
IMMDeviceEnumerator *mDeviceEnumerator ;
|
|
IMMDevice *mAudioDevice ;
|
|
IAudioEndpointVolume *mEndpointVolume;
|
|
// CAudioNotificationCallback *mAudioNotificationObject;
|
|
|
|
|
|
public:
|
|
STDMETHODIMP QueryInterface(REFIID riid, void **ppv) {
|
|
return E_NOINTERFACE;
|
|
}
|
|
|
|
STDMETHODIMP_(ULONG) AddRef() {return 2;}
|
|
|
|
STDMETHODIMP_(ULONG) Release() {return 1;}
|
|
|
|
STDMETHODIMP OnNotify(PAUDIO_VOLUME_NOTIFICATION_DATA pNotify);
|
|
|
|
public:
|
|
|
|
|
|
signals:
|
|
|
|
|
|
|
|
public slots:
|
|
};
|
|
|
|
|
|
|
|
|
|
#endif // VOLUMECONTROLLER_H
|