88 lines
1.4 KiB
C
88 lines
1.4 KiB
C
|
#ifndef SOUNDDIALOG_H
|
||
|
#define SOUNDDIALOG_H
|
||
|
|
||
|
#include <QDialog>
|
||
|
#include <QMediaPlayer>
|
||
|
#include <QAudioOutput>
|
||
|
|
||
|
#include <windows.h>
|
||
|
#include <mmdeviceapi.h>
|
||
|
#include <endpointvolume.h>
|
||
|
#include <audioclient.h>
|
||
|
#include "SoundController.h"
|
||
|
|
||
|
namespace Ui {
|
||
|
class SoundDialog;
|
||
|
}
|
||
|
|
||
|
class SoundDialog : public QDialog
|
||
|
{
|
||
|
Q_OBJECT
|
||
|
|
||
|
public:
|
||
|
explicit SoundDialog(QWidget *parent = nullptr);
|
||
|
~SoundDialog();
|
||
|
|
||
|
void setTitleAndUnit(QString title,QString unit);
|
||
|
|
||
|
int getValue();
|
||
|
|
||
|
void setValue(int value);
|
||
|
|
||
|
void setRange(int min,int max);
|
||
|
|
||
|
|
||
|
// void testFunction();
|
||
|
|
||
|
//void SetWindowsSound(int new_volume);
|
||
|
|
||
|
// void GetWindowsSound();
|
||
|
|
||
|
void SetSystemVolume(int); /*设置系统音量*/
|
||
|
|
||
|
int GetCurrentVolume(); /*获取系统当前的音量*/
|
||
|
|
||
|
int GetSystemVolume2();
|
||
|
|
||
|
bool SetSystemVolume2(int volume);
|
||
|
|
||
|
protected:
|
||
|
void paintEvent(QPaintEvent *event);
|
||
|
|
||
|
virtual void changeEvent(QEvent* event);
|
||
|
// virtual void showeEnvent(QEvent* event);
|
||
|
private slots:
|
||
|
void on_cancel_Btn_clicked();
|
||
|
|
||
|
void on_slider_sliderMoved(int position);
|
||
|
|
||
|
void on_confirm_Btn_clicked();
|
||
|
|
||
|
void on_minus_Btn_clicked();
|
||
|
|
||
|
void on_plus_Btn_clicked();
|
||
|
|
||
|
void on_slider_valueChanged(int value);
|
||
|
|
||
|
private:
|
||
|
|
||
|
|
||
|
static int m_value;
|
||
|
|
||
|
private:
|
||
|
Ui::SoundDialog *ui;
|
||
|
SoundController *soundController = NULL;
|
||
|
|
||
|
};
|
||
|
|
||
|
#endif // SOUNDDIALOG_H
|
||
|
|
||
|
|
||
|
|
||
|
|
||
|
|
||
|
|
||
|
|
||
|
|
||
|
|