0
0
mirror of https://github.com/obsproject/obs-studio.git synced 2024-09-20 13:08:50 +02:00
obs-studio/UI/window-projector.hpp
Shaolin 864caee16c UI: Add Single/Double click options to Multiview
The click to select scenes follows the same rules
as the main UI. The double click respects the option
under Settings -> General -> Studio -> Transition
to scene when Double Clicked.
2018-01-05 19:25:08 -02:00

51 lines
1.3 KiB
C++

#pragma once
#include <obs.hpp>
#include "qt-display.hpp"
#include "window-basic-main.hpp"
class QMouseEvent;
class OBSProjector : public OBSQTDisplay {
Q_OBJECT
private:
OBSSource source;
OBSSignal removedSignal;
static void OBSRenderMultiview(void *data, uint32_t cx, uint32_t cy);
static void OBSRender(void *data, uint32_t cx, uint32_t cy);
static void OBSSourceRemoved(void *data, calldata_t *params);
void mousePressEvent(QMouseEvent *event) override;
void mouseDoubleClickEvent(QMouseEvent *event) override;
int savedMonitor = 0;
bool isWindow = false;
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();
private slots:
void EscapeTriggered();
public:
OBSProjector(QWidget *parent, obs_source_t *source, bool window);
~OBSProjector();
void Init(int monitor, bool window, QString title,
ProjectorType type = ProjectorType::Source);
static void UpdateMultiviewProjectors();
};