Add scene groups and rework save and load (#103)

This commit is contained in:
WarmUpTill
2021-01-23 17:39:35 +01:00
committed by GitHub
parent 1f4679433e
commit d989c2b570
38 changed files with 2182 additions and 636 deletions

View File

@@ -9,6 +9,13 @@
#include <obs-module.h>
#include <obs-frontend-api.h>
static inline bool SceneGroupValid(SceneGroup *group)
{
if (group)
return group->name != invalid_scene_group_name;
return false;
}
static inline bool WeakSourceValid(obs_weak_source_t *ws)
{
obs_source_t *source = obs_weak_source_get_source(ws);
@@ -30,6 +37,25 @@ static inline std::string GetWeakSourceName(obs_weak_source_t *weak_source)
return name;
}
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());
}
static inline OBSWeakSource GetWeakSourceByName(const char *name)
{
OBSWeakSource weak;