-
-
Notifications
You must be signed in to change notification settings - Fork 29
/
audio-monitor-dock.hpp
68 lines (58 loc) · 2.09 KB
/
audio-monitor-dock.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
67
68
#pragma once
#include <QDockWidget>
#include <QHBoxLayout>
#include <QScrollArea>
#include <QStackedWidget>
#include "obs.h"
#include "audio-control.hpp"
#include "audio-monitor-filter.h"
#include <obs-frontend-api.h>
class AudioMonitorDock : public QStackedWidget {
Q_OBJECT
private:
QGridLayout *mainLayout;
QMap<QString, QString> audioDevices;
void addAudioControl(obs_source_t *source, int column, obs_source_t *filter);
void moveAudioControl(int fromColumn, int toColumn);
void addFilter(int column, obs_source_t *filter);
void addOutputTrack(int i, obs_data_t *obs_data = nullptr);
QString GetTrackName(int i);
static void OBSSignal(void *data, const char *signal, calldata_t *calldata);
void RemoveAllSources();
static void OBSFrontendEvent(enum obs_frontend_event event, void *data);
static void OBSFilterAdd(void *data, calldata_t *calldata);
static void OBSFilterRemove(void *data, calldata_t *calldata);
static bool OBSAddAudioDevice(void *data, const char *name, const char *id);
static bool OBSAddAudioSource(void *, obs_source_t *);
static void OBSFilterAdd(obs_source_t *parent, obs_source_t *child, void *data);
bool showOutputMeter;
bool showOutputSlider;
bool showOnlyActive;
bool showSliderNames;
void ConfigClicked();
void RemoveSourcesWithoutSliders();
private slots:
void MeterOutputChanged();
void OutputSliderChanged();
void OnlyActiveChanged();
void SliderNamesChanged();
void AddAudioSource(OBSSource source);
void RemoveAudioControl(const QString &sourceName);
void RenameAudioControl(QString new_name, QString prev_name);
void AddFilter(OBSSource source, OBSSource filter);
void RemoveFilter(QString sourceName, QString filterName);
void LoadTrackMenu();
void ShowOutputChanged();
void OutputDeviceChanged();
void UpdateTrackNames();
public:
AudioMonitorDock(QWidget *parent = nullptr);
~AudioMonitorDock();
};
class HScrollArea : public QScrollArea {
Q_OBJECT
public:
inline HScrollArea(QWidget *parent = nullptr) : QScrollArea(parent) { setVerticalScrollBarPolicy(Qt::ScrollBarAlwaysOff); }
protected:
virtual void resizeEvent(QResizeEvent *event) override;
};