2015-04-04 00:37:02 -07:00
|
|
|
#pragma once
|
|
|
|
|
|
|
|
#include <obs.hpp>
|
|
|
|
#include "qt-display.hpp"
|
2022-01-08 01:02:55 -06:00
|
|
|
#include "multiview.hpp"
|
2018-02-28 00:57:54 -03:00
|
|
|
|
|
|
|
enum class ProjectorType {
|
|
|
|
Source,
|
2018-02-28 15:01:31 -03:00
|
|
|
Scene,
|
2018-02-28 00:57:54 -03:00
|
|
|
Preview,
|
|
|
|
StudioProgram,
|
|
|
|
Multiview,
|
|
|
|
};
|
2015-04-04 00:37:02 -07:00
|
|
|
|
2015-04-13 14:31:36 -07:00
|
|
|
class QMouseEvent;
|
|
|
|
|
2015-04-04 00:37:02 -07:00
|
|
|
class OBSProjector : public OBSQTDisplay {
|
|
|
|
Q_OBJECT
|
|
|
|
|
|
|
|
private:
|
|
|
|
OBSSource source;
|
|
|
|
OBSSignal removedSignal;
|
|
|
|
|
2017-10-21 15:51:01 -02:00
|
|
|
static void OBSRenderMultiview(void *data, uint32_t cx, uint32_t cy);
|
2015-04-04 00:37:02 -07:00
|
|
|
static void OBSRender(void *data, uint32_t cx, uint32_t cy);
|
|
|
|
static void OBSSourceRemoved(void *data, calldata_t *params);
|
|
|
|
|
2015-04-13 14:31:36 -07:00
|
|
|
void mousePressEvent(QMouseEvent *event) override;
|
2017-12-12 18:45:15 -02:00
|
|
|
void mouseDoubleClickEvent(QMouseEvent *event) override;
|
2019-10-08 00:43:10 -05:00
|
|
|
void closeEvent(QCloseEvent *event) override;
|
2015-04-13 14:31:36 -07:00
|
|
|
|
2020-04-27 23:26:20 +02:00
|
|
|
bool isAlwaysOnTop;
|
|
|
|
bool isAlwaysOnTopOverridden = false;
|
2019-10-08 00:43:10 -05:00
|
|
|
int savedMonitor = -1;
|
2017-10-21 15:51:01 -02:00
|
|
|
ProjectorType type = ProjectorType::Source;
|
2018-03-20 03:20:45 -03:00
|
|
|
|
2022-01-08 01:02:55 -06:00
|
|
|
Multiview *multiview = nullptr;
|
2017-10-21 15:51:01 -02:00
|
|
|
|
2022-01-08 01:02:55 -06:00
|
|
|
bool ready = false;
|
2018-03-08 16:04:22 -03:00
|
|
|
|
2017-10-21 15:51:01 -02:00
|
|
|
void UpdateMultiview();
|
2018-02-28 21:43:07 -03:00
|
|
|
void UpdateProjectorTitle(QString name);
|
2016-12-29 09:21:53 -06:00
|
|
|
|
2019-10-08 00:43:10 -05:00
|
|
|
QRect prevGeometry;
|
|
|
|
void SetMonitor(int monitor);
|
|
|
|
|
2020-05-28 21:21:04 -05:00
|
|
|
QScreen *screen = nullptr;
|
|
|
|
|
2015-04-04 00:37:02 -07:00
|
|
|
private slots:
|
|
|
|
void EscapeTriggered();
|
2019-10-08 00:43:10 -05:00
|
|
|
void OpenFullScreenProjector();
|
2020-04-10 20:47:06 +10:00
|
|
|
void ResizeToContent();
|
2019-10-08 00:43:10 -05:00
|
|
|
void OpenWindowedProjector();
|
2020-04-27 23:26:20 +02:00
|
|
|
void AlwaysOnTopToggled(bool alwaysOnTop);
|
2020-05-28 21:21:04 -05:00
|
|
|
void ScreenRemoved(QScreen *screen_);
|
2015-04-04 00:37:02 -07:00
|
|
|
|
|
|
|
public:
|
2018-02-28 23:34:11 -03:00
|
|
|
OBSProjector(QWidget *widget, obs_source_t *source_, int monitor,
|
2019-10-08 00:43:10 -05:00
|
|
|
ProjectorType type_);
|
2015-04-04 00:37:02 -07:00
|
|
|
~OBSProjector();
|
|
|
|
|
2018-02-28 15:34:17 -03:00
|
|
|
OBSSource GetSource();
|
|
|
|
ProjectorType GetProjectorType();
|
|
|
|
int GetMonitor();
|
2017-10-21 15:51:01 -02:00
|
|
|
static void UpdateMultiviewProjectors();
|
2019-10-08 00:43:10 -05:00
|
|
|
void RenameProjector(QString oldName, QString newName);
|
2020-06-13 21:00:55 -05:00
|
|
|
void SetHideCursor();
|
2020-04-27 23:26:20 +02:00
|
|
|
|
|
|
|
bool IsAlwaysOnTop() const;
|
|
|
|
bool IsAlwaysOnTopOverridden() const;
|
|
|
|
void SetIsAlwaysOnTop(bool isAlwaysOnTop, bool isOverridden);
|
2015-04-04 00:37:02 -07:00
|
|
|
};
|