25 lines
501 B
C
Raw Normal View History

2024-11-25 17:15:44 +08:00
#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