-
-
Notifications
You must be signed in to change notification settings - Fork 29
/
Copy pathaudio-control.hpp
66 lines (54 loc) · 1.87 KB
/
audio-control.hpp
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
#pragma once
#include <QCheckBox>
#include <qgridlayout.h>
#include <QLabel>
#include <QSlider>
#include <QWidget>
#include "volume-meter.hpp"
#include "obs.h"
#include "obs.hpp"
class AudioControl : public QWidget {
Q_OBJECT
private:
const int lockRow = 0;
const int sliderRow = 1;
const int muteRow = 2;
const int nameRow = 3;
OBSWeakSource source;
VolumeMeter *volMeter;
obs_volmeter_t *obs_volmeter;
QGridLayout *mainLayout;
bool showSliderNames;
bool changing_output_volume = false;
bool changing_monitor_volume = false;
static void OBSVolumeLevel(void *data, const float magnitude[MAX_AUDIO_CHANNELS], const float peak[MAX_AUDIO_CHANNELS],
const float inputPeak[MAX_AUDIO_CHANNELS]);
static void OBSVolume(void *data, calldata_t *calldata);
static void OBSMute(void *data, calldata_t *calldata);
static void OBSFilterRename(void *data, calldata_t *calldata);
static void OBSFilterUpdated(void *data, calldata_t *calldata);
static void OBSFilterEnable(void *data, calldata_t *calldata);
void addFilterColumn(int i, obs_source_t *filter);
private slots:
void LockVolumeControl(bool lock);
void MuteVolumeControl(bool mute);
void SliderChanged(int vol);
void SetOutputVolume(double volume);
void SetMute(bool muted);
void RenameFilter(QString prev_name, QString new_name);
void FilterUpdated(QString name, double volume, bool locked, bool custom_color, QColor color);
void FilterEnable(QString name, bool enabled);
signals:
public:
explicit AudioControl(OBSWeakSource source);
~AudioControl();
inline obs_weak_source *GetSource() const { return source; }
void AddFilter(obs_source_t *filter);
void RemoveFilter(QString filterName);
bool HasSliders();
void ShowOutputMeter(bool output);
void ShowOutputSlider(bool output);
void ShowSliderNames(bool show);
//void SetMeterDecayRate(qreal q);
//void setPeakMeterType(enum obs_peak_meter_type peakMeterType);
};