yolobs-studio/UI/window-projector.hpp

51 lines
1.3 KiB
C++
Raw Normal View History

2016-02-23 23:16:51 +00:00
#pragma once
#include <obs.hpp>
#include "qt-display.hpp"
2017-04-19 19:54:15 +00:00
#include "window-basic-main.hpp"
2016-02-23 23:16:51 +00:00
class QMouseEvent;
class OBSProjector : public OBSQTDisplay {
Q_OBJECT
private:
OBSSource source;
OBSSignal removedSignal;
2018-02-19 19:54:37 +00:00
static void OBSRenderMultiview(void *data, uint32_t cx, uint32_t cy);
2016-02-23 23:16:51 +00:00
static void OBSRender(void *data, uint32_t cx, uint32_t cy);
static void OBSSourceRemoved(void *data, calldata_t *params);
void mousePressEvent(QMouseEvent *event) override;
2018-02-19 19:54:37 +00:00
void mouseDoubleClickEvent(QMouseEvent *event) override;
2016-02-23 23:16:51 +00:00
2017-04-19 19:54:15 +00:00
int savedMonitor = 0;
2017-06-29 19:01:10 +00:00
bool isWindow = false;
2018-02-19 19:54:37 +00:00
ProjectorType type = ProjectorType::Source;
OBSWeakSource multiviewScenes[8];
OBSSource multiviewLabels[10];
gs_vertbuffer_t *outerBox = nullptr;
gs_vertbuffer_t *innerBox = nullptr;
gs_vertbuffer_t *leftVLine = nullptr;
gs_vertbuffer_t *rightVLine = nullptr;
gs_vertbuffer_t *leftLine = nullptr;
gs_vertbuffer_t *topLine = nullptr;
gs_vertbuffer_t *rightLine = nullptr;
bool ready = false;
void UpdateMultiview();
2017-04-19 19:54:15 +00:00
2016-02-23 23:16:51 +00:00
private slots:
void EscapeTriggered();
public:
2017-06-29 19:01:10 +00:00
OBSProjector(QWidget *parent, obs_source_t *source, bool window);
2016-02-23 23:16:51 +00:00
~OBSProjector();
2018-02-19 19:54:37 +00:00
void Init(int monitor, bool window, QString title,
ProjectorType type = ProjectorType::Source);
static void UpdateMultiviewProjectors();
2016-02-23 23:16:51 +00:00
};