mirror of
https://github.com/WarmUpTill/SceneSwitcher.git
synced 2026-04-09 10:45:56 -05:00
Moving files from the "src/" folder into "src/legacy", "src/macro-core", and "src/utils" was necessary as it was becoming a bit too cluttered.
59 lines
1.3 KiB
C++
59 lines
1.3 KiB
C++
#pragma once
|
|
#include "macro.hpp"
|
|
#include <QWidget>
|
|
#include <QComboBox>
|
|
|
|
enum class PluginStateCondition {
|
|
SCENE_SWITCHED,
|
|
RUNNING,
|
|
SHUTDOWN,
|
|
};
|
|
|
|
class MacroConditionPluginState : public MacroCondition {
|
|
public:
|
|
MacroConditionPluginState(Macro *m) : MacroCondition(m) {}
|
|
~MacroConditionPluginState();
|
|
bool CheckCondition();
|
|
bool Save(obs_data_t *obj);
|
|
bool Load(obs_data_t *obj);
|
|
std::string GetId() { return id; };
|
|
static std::shared_ptr<MacroCondition> Create(Macro *m)
|
|
{
|
|
return std::make_shared<MacroConditionPluginState>(m);
|
|
}
|
|
|
|
PluginStateCondition _condition = PluginStateCondition::SCENE_SWITCHED;
|
|
|
|
private:
|
|
static bool _registered;
|
|
static const std::string id;
|
|
};
|
|
|
|
class MacroConditionPluginStateEdit : public QWidget {
|
|
Q_OBJECT
|
|
|
|
public:
|
|
MacroConditionPluginStateEdit(
|
|
QWidget *parent,
|
|
std::shared_ptr<MacroConditionPluginState> cond = nullptr);
|
|
void UpdateEntryData();
|
|
static QWidget *Create(QWidget *parent,
|
|
std::shared_ptr<MacroCondition> cond)
|
|
{
|
|
return new MacroConditionPluginStateEdit(
|
|
parent,
|
|
std::dynamic_pointer_cast<MacroConditionPluginState>(
|
|
cond));
|
|
}
|
|
|
|
private slots:
|
|
void ConditionChanged(int cond);
|
|
|
|
protected:
|
|
QComboBox *_condition;
|
|
std::shared_ptr<MacroConditionPluginState> _entryData;
|
|
|
|
private:
|
|
bool _loading = true;
|
|
};
|