mirror of
https://github.com/WarmUpTill/SceneSwitcher.git
synced 2026-03-22 01:44:49 -05:00
The "core" macro conditions and actions have been extracted out to the "base" plugin. The library now mostly contains functionality which is required across all plugins and (e.g. definitions for macro segments). The goal is to reduce the complexity and cross-dependencies and group the source files in a better way. This should relsove the "library limit of 65535 objects exceeded" build issue occuring in some Windows build environments.
61 lines
1.4 KiB
C++
61 lines
1.4 KiB
C++
#pragma once
|
|
#include "obs-dock.hpp"
|
|
#include "variable-string.hpp"
|
|
|
|
#include <QPushButton>
|
|
#include <QTimer>
|
|
#include <QLabel>
|
|
#include <memory>
|
|
#include <chrono>
|
|
|
|
namespace advss {
|
|
|
|
class Macro;
|
|
|
|
class MacroDock : public OBSDock {
|
|
Q_OBJECT
|
|
|
|
public:
|
|
MacroDock(std::weak_ptr<Macro>, QWidget *parent,
|
|
const StringVariable &runButtonText,
|
|
const StringVariable &pauseButtonText,
|
|
const StringVariable &unpauseButtonText,
|
|
const StringVariable &conditionsTrueText,
|
|
const StringVariable &conditionsFalseText,
|
|
bool enableHighlight);
|
|
void SetName(const QString &);
|
|
void ShowRunButton(bool);
|
|
void SetRunButtonText(const StringVariable &);
|
|
void ShowPauseButton(bool);
|
|
void SetPauseButtonText(const StringVariable &);
|
|
void SetUnpauseButtonText(const StringVariable &);
|
|
void ShowStatusLabel(bool);
|
|
void SetConditionsTrueText(const StringVariable &);
|
|
void SetConditionsFalseText(const StringVariable &);
|
|
void EnableHighlight(bool);
|
|
|
|
private slots:
|
|
void RunClicked();
|
|
void PauseToggleClicked();
|
|
void UpdateText();
|
|
void Highlight();
|
|
|
|
private:
|
|
StringVariable _runButtonText;
|
|
StringVariable _pauseButtonText;
|
|
StringVariable _unpauseButtonText;
|
|
StringVariable _conditionsTrueText;
|
|
StringVariable _conditionsFalseText;
|
|
bool _highlight;
|
|
QPushButton *_run;
|
|
QPushButton *_pauseToggle;
|
|
QLabel *_statusText;
|
|
|
|
QTimer _timer;
|
|
std::chrono::high_resolution_clock::time_point _lastHighlightCheckTime{};
|
|
|
|
std::weak_ptr<Macro> _macro;
|
|
};
|
|
|
|
} // namespace advss
|