-
-
Notifications
You must be signed in to change notification settings - Fork 9
/
multistream.hpp
83 lines (63 loc) · 2.09 KB
/
multistream.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
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
#pragma once
#include "config-dialog.hpp"
#include <obs.h>
#include <obs-frontend-api.h>
#include <QFrame>
#include <QPushButton>
#include <QString>
#include <QTimer>
#include <QVBoxLayout>
class OBSBasicSettings;
class MultistreamDock : public QFrame {
Q_OBJECT
private:
OBSBasicSettings *configDialog = nullptr;
obs_data_t *current_config = nullptr;
QVBoxLayout *mainLayout = nullptr;
QVBoxLayout *mainCanvasLayout = nullptr;
QVBoxLayout *mainCanvasOutputLayout = nullptr;
QVBoxLayout *verticalCanvasLayout = nullptr;
QVBoxLayout *verticalCanvasOutputLayout = nullptr;
QPushButton *mainStreamButton = nullptr;
QPushButton *configButton = nullptr;
QLabel *mainPlatformIconLabel = nullptr;
QString mainPlatformUrl;
QString newer_version_available;
QTimer videoCheckTimer;
video_t *mainVideo = nullptr;
std::vector<video_t *> oldVideo;
std::vector<std::tuple<std::string, obs_output_t *, QPushButton *>> outputs;
obs_data_array_t *vertical_outputs = nullptr;
bool exiting = false;
void LoadSettingsFile();
void LoadSettings();
void LoadOutput(obs_data_t *data, bool vertical);
void SaveSettings();
bool StartOutput(obs_data_t *settings, QPushButton *streamButton);
void outputButtonStyle(QPushButton *button);
void storeMainStreamEncoders();
QIcon streamActiveIcon = QIcon(":/aitum/media/streaming.svg");
QIcon streamInactiveIcon = QIcon(":/aitum/media/stream.svg");
static void frontend_event(enum obs_frontend_event event, void *private_data);
static void stream_output_stop(void *data, calldata_t *calldata);
static void stream_output_start(void *data, calldata_t *calldata);
private slots:
void ApiInfo(QString info);
public:
MultistreamDock(QWidget *parent = nullptr);
~MultistreamDock();
void LoadVerticalOutputs(bool firstLoad = true);
};
class AspectRatioPixmapLabel : public QLabel {
Q_OBJECT
public:
explicit AspectRatioPixmapLabel(QWidget *parent = 0);
virtual int heightForWidth(int width) const;
virtual QSize sizeHint() const;
QPixmap scaledPixmap() const;
public slots:
void setPixmap(const QPixmap &);
void resizeEvent(QResizeEvent *);
private:
QPixmap pix;
};