diff --git a/src/headers/scene-group.hpp b/src/headers/scene-group.hpp index 2e79f3e6..5aaa9580 100644 --- a/src/headers/scene-group.hpp +++ b/src/headers/scene-group.hpp @@ -82,3 +82,6 @@ private: SceneGroup *sceneGroup = nullptr; }; + +SceneGroup *GetSceneGroupByName(const char *name); +SceneGroup *GetSceneGroupByQString(const QString &name); diff --git a/src/scene-group.cpp b/src/scene-group.cpp index fe18da9d..dbdac5ac 100644 --- a/src/scene-group.cpp +++ b/src/scene-group.cpp @@ -684,3 +684,23 @@ void SceneGroupEditWidget::RepeatChanged(int state) std::lock_guard lock(switcher->m); sceneGroup->repeat = state; } + +SceneGroup *GetSceneGroupByName(const char *name) +{ + if (!switcher) { + return nullptr; + } + + for (SceneGroup &sg : switcher->sceneGroups) { + if (sg.name == name) { + return &sg; + } + } + + return nullptr; +} + +SceneGroup *GetSceneGroupByQString(const QString &name) +{ + return GetSceneGroupByName(name.toUtf8().constData()); +} diff --git a/src/switch-generic.cpp b/src/switch-generic.cpp index ef4863b5..1e9a0023 100644 --- a/src/switch-generic.cpp +++ b/src/switch-generic.cpp @@ -9,26 +9,6 @@ static inline bool SceneGroupValid(SceneGroup *group) return false; } -static inline SceneGroup *GetSceneGroupByName(const char *name) -{ - if (!switcher) { - return nullptr; - } - - for (SceneGroup &sg : switcher->sceneGroups) { - if (sg.name == name) { - return &sg; - } - } - - return nullptr; -} - -static inline SceneGroup *GetSceneGroupByQString(const QString &name) -{ - return GetSceneGroupByName(name.toUtf8().constData()); -} - bool SceneSwitcherEntry::initialized() { return (usePreviousScene || WeakSourceValid(scene) ||