25 lines
501 B
C
25 lines
501 B
C
|
#ifndef SOUNDCONTROLLER_H
|
||
|
#define SOUNDCONTROLLER_H
|
||
|
|
||
|
#include <QObject>
|
||
|
#include <QSlider>
|
||
|
#include <mmdeviceapi.h>
|
||
|
#include <endpointvolume.h>
|
||
|
|
||
|
class SoundController : public QObject
|
||
|
{
|
||
|
Q_OBJECT
|
||
|
public:
|
||
|
explicit SoundController(QObject *parent = nullptr);
|
||
|
|
||
|
int getSystemVolume();
|
||
|
bool setSystemVolume(int volume);
|
||
|
|
||
|
private:
|
||
|
IMMDeviceEnumerator *deviceEnumerator = NULL;
|
||
|
IMMDevice *device = NULL;
|
||
|
IAudioEndpointVolume *endpointVolume = NULL;
|
||
|
};
|
||
|
|
||
|
#endif // SOUNDCONTROLLER_H
|