2024-06-13 11:58:07 +02:00
|
|
|
#pragma once
|
|
|
|
|
2024-06-13 17:17:25 +02:00
|
|
|
#include "config-dialog.hpp"
|
|
|
|
#include <obs.h>
|
|
|
|
#include <obs-frontend-api.h>
|
2024-06-13 11:58:07 +02:00
|
|
|
#include <QFrame>
|
|
|
|
#include <QPushButton>
|
2024-06-13 17:17:25 +02:00
|
|
|
#include <QVBoxLayout>
|
2024-07-16 09:52:05 +02:00
|
|
|
#include <QTimer>
|
2024-07-16 15:16:40 +02:00
|
|
|
#include <QString>
|
2024-06-13 11:58:07 +02:00
|
|
|
|
|
|
|
class OBSBasicSettings;
|
|
|
|
|
|
|
|
class MultistreamDock : public QFrame {
|
|
|
|
Q_OBJECT
|
|
|
|
|
|
|
|
private:
|
|
|
|
OBSBasicSettings *configDialog = nullptr;
|
|
|
|
|
|
|
|
obs_data_t *current_config = nullptr;
|
|
|
|
|
|
|
|
QVBoxLayout *mainCanvasLayout = nullptr;
|
2024-07-16 16:10:46 +02:00
|
|
|
QVBoxLayout *mainCanvasOutputLayout = nullptr;
|
2024-07-11 13:54:58 +02:00
|
|
|
QVBoxLayout *verticalCanvasLayout = nullptr;
|
2024-07-16 16:10:46 +02:00
|
|
|
QVBoxLayout *verticalCanvasOutputLayout = nullptr;
|
2024-06-13 11:58:07 +02:00
|
|
|
QPushButton *mainStreamButton = nullptr;
|
2024-06-18 08:34:29 +02:00
|
|
|
QPushButton *configButton = nullptr;
|
2024-07-17 08:09:30 +02:00
|
|
|
QLabel *mainPlatformIconLabel = nullptr;
|
|
|
|
QString mainPlatformUrl;
|
2024-06-18 08:34:29 +02:00
|
|
|
|
|
|
|
QString newer_version_available;
|
2024-06-13 11:58:07 +02:00
|
|
|
|
2024-07-16 09:52:05 +02:00
|
|
|
QTimer videoCheckTimer;
|
|
|
|
video_t *mainVideo = nullptr;
|
|
|
|
std::vector<video_t *> oldVideo;
|
|
|
|
|
2024-07-30 08:34:01 +02:00
|
|
|
std::vector<std::tuple<std::string, obs_output_t *, QPushButton *>> outputs;
|
2024-07-30 13:02:53 +02:00
|
|
|
bool exiting = false;
|
2024-06-13 11:58:07 +02:00
|
|
|
|
|
|
|
void LoadSettingsFile();
|
|
|
|
void LoadSettings();
|
2024-07-11 13:54:58 +02:00
|
|
|
void LoadOutput(obs_data_t *data, bool vertical);
|
2024-06-13 11:58:07 +02:00
|
|
|
void SaveSettings();
|
|
|
|
|
|
|
|
bool StartOutput(obs_data_t *settings, QPushButton *streamButton);
|
|
|
|
|
2024-07-15 14:18:54 +02:00
|
|
|
void outputButtonStyle(QPushButton *button);
|
|
|
|
|
2024-07-26 10:25:38 +02:00
|
|
|
void storeMainStreamEncoders();
|
|
|
|
|
2024-06-13 11:58:07 +02:00
|
|
|
QIcon streamActiveIcon = QIcon(":/aitum/media/streaming.svg");
|
|
|
|
QIcon streamInactiveIcon = QIcon(":/aitum/media/stream.svg");
|
2024-07-23 09:28:13 +02:00
|
|
|
|
2024-06-13 11:58:07 +02:00
|
|
|
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);
|
|
|
|
|
2024-06-18 08:34:29 +02:00
|
|
|
private slots:
|
|
|
|
void NewerVersionAvailable(QString version);
|
|
|
|
|
2024-06-13 11:58:07 +02:00
|
|
|
public:
|
|
|
|
MultistreamDock(QWidget *parent = nullptr);
|
|
|
|
~MultistreamDock();
|
2024-07-16 15:16:40 +02:00
|
|
|
void LoadVerticalOutputs(bool firstLoad = true);
|
2024-06-13 11:58:07 +02:00
|
|
|
};
|