#ifndef VOLUMECONTROLLER_H
#define VOLUMECONTROLLER_H

#include "GlobalDefine.h"
#include <QObject>
#include <endpointvolume.h>
#include <Mmdeviceapi.h>

#define EXTERNAL_VOLUME_INCREMENT 1

class CAvReceiver;


class CVolumeController : public QObject, public IAudioEndpointVolumeCallback
{
    Q_OBJECT
public:
    explicit CVolumeController(QObject *parent = 0);
    ~CVolumeController();
    int Init(CAvReceiver *ProgramPtr);
    bool mVolumeControllerActive;
    int SetMasterVolume(float Volume);

    CAvReceiver *mProgramPtr;

private:
    IMMDeviceEnumerator *mDeviceEnumerator ;
    IMMDevice *mAudioDevice ;
    IAudioEndpointVolume *mEndpointVolume;
    GUID mMyGUID;
    float mMasterVolume;
 //   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:
void ExternalVolumeChanged(float);


public slots:
};




#endif // VOLUMECONTROLLER_H
