yolobs-studio/UI/adv-audio-control.hpp

96 lines
2.5 KiB
C++
Raw Normal View History

2016-02-23 23:16:51 +00:00
#pragma once
#include <obs.hpp>
#include <QWidget>
#include <QPointer>
2019-07-27 12:47:10 +00:00
#include <QDoubleSpinBox>
2020-03-25 08:07:22 +00:00
#include <QStackedWidget>
2019-07-27 12:47:10 +00:00
#include "balance-slider.hpp"
2016-02-23 23:16:51 +00:00
class QGridLayout;
class QLabel;
class QSpinBox;
class QCheckBox;
2017-04-19 19:54:15 +00:00
class QComboBox;
2016-02-23 23:16:51 +00:00
2020-03-25 08:07:22 +00:00
enum class VolumeType {
dB,
Percent,
};
2016-02-23 23:16:51 +00:00
class OBSAdvAudioCtrl : public QObject {
Q_OBJECT
private:
2019-09-22 21:19:10 +00:00
OBSSource source;
2016-02-23 23:16:51 +00:00
2020-03-25 08:07:22 +00:00
QPointer<QWidget> activeContainer;
2019-09-22 21:19:10 +00:00
QPointer<QWidget> forceMonoContainer;
QPointer<QWidget> mixerContainer;
QPointer<QWidget> balanceContainer;
2016-02-23 23:16:51 +00:00
2020-03-25 08:07:22 +00:00
QPointer<QLabel> iconLabel;
2019-09-22 21:19:10 +00:00
QPointer<QLabel> nameLabel;
2020-03-25 08:07:22 +00:00
QPointer<QLabel> active;
QPointer<QStackedWidget> stackedWidget;
QPointer<QSpinBox> percent;
2019-07-27 12:47:10 +00:00
QPointer<QDoubleSpinBox> volume;
2019-09-22 21:19:10 +00:00
QPointer<QCheckBox> forceMono;
QPointer<BalanceSlider> balance;
QPointer<QLabel> labelL;
QPointer<QLabel> labelR;
QPointer<QSpinBox> syncOffset;
QPointer<QComboBox> monitoringType;
QPointer<QCheckBox> mixer1;
QPointer<QCheckBox> mixer2;
QPointer<QCheckBox> mixer3;
QPointer<QCheckBox> mixer4;
QPointer<QCheckBox> mixer5;
QPointer<QCheckBox> mixer6;
2016-02-23 23:16:51 +00:00
2019-09-22 21:19:10 +00:00
OBSSignal volChangedSignal;
OBSSignal syncOffsetSignal;
OBSSignal flagsSignal;
OBSSignal mixersSignal;
2020-03-25 08:07:22 +00:00
OBSSignal activateSignal;
OBSSignal deactivateSignal;
2016-02-23 23:16:51 +00:00
2020-03-25 08:07:22 +00:00
static void OBSSourceActivated(void *param, calldata_t *calldata);
static void OBSSourceDeactivated(void *param, calldata_t *calldata);
2016-02-23 23:16:51 +00:00
static void OBSSourceFlagsChanged(void *param, calldata_t *calldata);
static void OBSSourceVolumeChanged(void *param, calldata_t *calldata);
static void OBSSourceSyncChanged(void *param, calldata_t *calldata);
static void OBSSourceMixersChanged(void *param, calldata_t *calldata);
public:
OBSAdvAudioCtrl(QGridLayout *layout, obs_source_t *source_);
virtual ~OBSAdvAudioCtrl();
2019-09-22 21:19:10 +00:00
inline obs_source_t *GetSource() const { return source; }
2018-12-16 16:14:58 +00:00
void ShowAudioControl(QGridLayout *layout);
2016-02-23 23:16:51 +00:00
2020-03-25 08:07:22 +00:00
void SetVolumeWidget(VolumeType type);
void SetIconVisible(bool visible);
2016-02-23 23:16:51 +00:00
public slots:
2020-03-25 08:07:22 +00:00
void SourceActiveChanged(bool active);
2016-02-23 23:16:51 +00:00
void SourceFlagsChanged(uint32_t flags);
void SourceVolumeChanged(float volume);
void SourceSyncChanged(int64_t offset);
void SourceMixersChanged(uint32_t mixers);
2019-07-27 12:47:10 +00:00
void volumeChanged(double db);
2020-03-25 08:07:22 +00:00
void percentChanged(int percent);
2016-02-23 23:16:51 +00:00
void downmixMonoChanged(bool checked);
2019-07-27 12:47:10 +00:00
void balanceChanged(int val);
2016-02-23 23:16:51 +00:00
void syncOffsetChanged(int milliseconds);
2017-04-19 19:54:15 +00:00
void monitoringTypeChanged(int index);
2016-02-23 23:16:51 +00:00
void mixer1Changed(bool checked);
void mixer2Changed(bool checked);
void mixer3Changed(bool checked);
void mixer4Changed(bool checked);
2017-04-19 19:54:15 +00:00
void mixer5Changed(bool checked);
void mixer6Changed(bool checked);
2019-07-27 12:47:10 +00:00
void ResetBalance();
2016-02-23 23:16:51 +00:00
};