mirror of
https://github.com/WarmUpTill/SceneSwitcher.git
synced 2026-06-19 15:20:47 -05:00
Extending a scene sequence allows for more complex switching setups, but should also simplify some setups. Sequences like "A -> B -> A -> C", which previously were only possible by creating a copy of A, can now be specified in a single entry. To extend a sequence either select the sequence you want to modify and click the extend sequence button or simply double click the entry.
91 lines
2.4 KiB
C++
91 lines
2.4 KiB
C++
#pragma once
|
|
#include <obs.hpp>
|
|
#include <QComboBox>
|
|
|
|
struct SceneSwitcherEntry {
|
|
SwitchTargetType targetType = SwitchTargetType::Scene;
|
|
SceneGroup *group = nullptr;
|
|
OBSWeakSource scene = nullptr;
|
|
OBSWeakSource transition = nullptr;
|
|
bool usePreviousScene = false;
|
|
bool useCurrentTransition = false;
|
|
|
|
virtual const char *getType() = 0;
|
|
virtual bool initialized();
|
|
virtual bool valid();
|
|
virtual void logMatchScene();
|
|
virtual void logMatchSceneGroup();
|
|
virtual void logMatch();
|
|
virtual OBSWeakSource getScene();
|
|
virtual void save(obs_data_t *obj,
|
|
const char *targetTypeSaveName = "targetType",
|
|
const char *targetSaveName = "target",
|
|
const char *transitionSaveName = "transition");
|
|
virtual void load(obs_data_t *obj,
|
|
const char *targetTypeLoadName = "targetType",
|
|
const char *targetLoadName = "target",
|
|
const char *transitionLoadName = "transition");
|
|
|
|
inline SceneSwitcherEntry() {}
|
|
|
|
inline SceneSwitcherEntry(OBSWeakSource scene_,
|
|
OBSWeakSource transition_,
|
|
bool usePreviousScene_ = false)
|
|
: scene(scene_),
|
|
transition(transition_),
|
|
usePreviousScene(usePreviousScene_)
|
|
{
|
|
}
|
|
|
|
inline SceneSwitcherEntry(SceneGroup *group_, OBSWeakSource transition_,
|
|
bool usePreviousScene_ = false)
|
|
: group(group_),
|
|
transition(transition_),
|
|
usePreviousScene(usePreviousScene_)
|
|
{
|
|
}
|
|
|
|
inline SceneSwitcherEntry(SwitchTargetType targetType_,
|
|
SceneGroup *group_, OBSWeakSource scene_,
|
|
OBSWeakSource transition_,
|
|
bool usePreviousScene_ = false)
|
|
: targetType(targetType_),
|
|
group(group_),
|
|
scene(scene_),
|
|
transition(transition_),
|
|
usePreviousScene(usePreviousScene_)
|
|
{
|
|
}
|
|
|
|
virtual ~SceneSwitcherEntry() {}
|
|
};
|
|
|
|
class SwitchWidget : public QWidget {
|
|
Q_OBJECT
|
|
|
|
public:
|
|
SwitchWidget(QWidget *parent, SceneSwitcherEntry *s,
|
|
bool usePreviousScene = true, bool addSceneGroup = false,
|
|
bool addCurrentTransition = true);
|
|
virtual SceneSwitcherEntry *getSwitchData();
|
|
virtual void setSwitchData(SceneSwitcherEntry *s);
|
|
void showSwitchData();
|
|
|
|
static void swapSwitchData(SwitchWidget *s1, SwitchWidget *s2);
|
|
|
|
protected slots:
|
|
void SceneChanged(const QString &text);
|
|
void TransitionChanged(const QString &text);
|
|
void SceneGroupAdd(const QString &name);
|
|
void SceneGroupRemove(const QString &name);
|
|
void SceneGroupRename(const QString &oldName, const QString &newName);
|
|
|
|
protected:
|
|
bool loading = true;
|
|
|
|
QComboBox *scenes;
|
|
QComboBox *transitions;
|
|
|
|
SceneSwitcherEntry *switchData;
|
|
};
|