mirror of
https://github.com/WarmUpTill/SceneSwitcher.git
synced 2026-06-22 04:23:34 -05:00
* move definitions of switcher structs to separate files * remove useless comment * cleanup and silence warnings * add generic switch * removed delay on main thread startup as it served no purpose * clean up ultility.hpp * do not save switchStr to file as it could cause issues when scenes are renamed * rename sceneRoundTrip to sceneSequence * add option to switch if window is maximized to title tab
49 lines
1.0 KiB
C++
49 lines
1.0 KiB
C++
#pragma once
|
|
#include <string>
|
|
#include <obs.hpp>
|
|
|
|
struct SceneSwitcherEntry {
|
|
OBSWeakSource scene;
|
|
OBSWeakSource transition;
|
|
bool usePreviousScene;
|
|
|
|
virtual bool valid()
|
|
{
|
|
return (usePreviousScene || WeakSourceValid(scene)) &&
|
|
WeakSourceValid(transition);
|
|
}
|
|
|
|
virtual const char *getType() = 0;
|
|
|
|
// TODO
|
|
//virtual bool checkMatch() = 0;
|
|
|
|
virtual void logMatch()
|
|
{
|
|
obs_source_t *s = obs_weak_source_get_source(scene);
|
|
const char *sceneName = obs_source_get_name(s);
|
|
obs_source_release(s);
|
|
blog(LOG_INFO,
|
|
"Advanced Scene Switcher match for '%s' - switch to scene '%s'",
|
|
getType(), sceneName);
|
|
}
|
|
|
|
inline SceneSwitcherEntry() : usePreviousScene(false) {}
|
|
|
|
inline SceneSwitcherEntry(OBSWeakSource scene_,
|
|
OBSWeakSource transition_,
|
|
bool usePreviousScene_)
|
|
: scene(scene_),
|
|
transition(transition_),
|
|
usePreviousScene(usePreviousScene_)
|
|
{
|
|
}
|
|
inline SceneSwitcherEntry(OBSWeakSource scene_,
|
|
OBSWeakSource transition_)
|
|
: scene(scene_),
|
|
transition(transition_),
|
|
usePreviousScene(false)
|
|
{
|
|
}
|
|
};
|