mirror of
https://github.com/WarmUpTill/SceneSwitcher.git
synced 2026-04-20 09:07:26 -05:00
56 lines
1.3 KiB
C++
56 lines
1.3 KiB
C++
#pragma once
|
|
#include "macro-action-edit.hpp"
|
|
#include "switch-generic.hpp"
|
|
#include "duration-control.hpp"
|
|
|
|
// TODO: Switch to using SceneSelection class and widget instead
|
|
|
|
class MacroActionSwitchScene : public MacroAction, public SceneSwitcherEntry {
|
|
public:
|
|
bool PerformAction();
|
|
void LogAction();
|
|
bool Save(obs_data_t *obj);
|
|
bool Load(obs_data_t *obj);
|
|
std::string GetShortDesc();
|
|
std::string GetId() { return id; };
|
|
|
|
static std::shared_ptr<MacroAction> Create()
|
|
{
|
|
return std::make_shared<MacroActionSwitchScene>();
|
|
}
|
|
Duration _duration;
|
|
|
|
private:
|
|
const char *getType() { return "MacroActionSwitchScene"; }
|
|
|
|
static bool _registered;
|
|
static const std::string id;
|
|
};
|
|
|
|
class MacroActionSwitchSceneEdit : public SwitchWidget {
|
|
Q_OBJECT
|
|
|
|
public:
|
|
MacroActionSwitchSceneEdit(
|
|
QWidget *parent,
|
|
std::shared_ptr<MacroActionSwitchScene> entryData = nullptr);
|
|
static QWidget *Create(QWidget *parent,
|
|
std::shared_ptr<MacroAction> action)
|
|
{
|
|
return new MacroActionSwitchSceneEdit(
|
|
parent,
|
|
std::dynamic_pointer_cast<MacroActionSwitchScene>(
|
|
action));
|
|
}
|
|
|
|
private slots:
|
|
void DurationChanged(double seconds);
|
|
void ChangeHeaderInfo(const QString &);
|
|
signals:
|
|
void HeaderInfoChanged(const QString &);
|
|
|
|
protected:
|
|
DurationSelection *_duration;
|
|
std::shared_ptr<MacroActionSwitchScene> _entryData;
|
|
};
|