Remove switcher-data dependency from scene-selection

This commit is contained in:
WarmUpTill 2023-12-25 16:56:36 +01:00 committed by WarmUpTill
parent a86ff4f1f0
commit 07d397bdac
3 changed files with 13 additions and 5 deletions

View File

@ -12,6 +12,11 @@ namespace advss {
static QMetaObject::Connection addPulse;
SceneGroupEditWidget *typeEdit = nullptr;
std::deque<SceneGroup> &GetSceneGroups()
{
return switcher->sceneGroups;
}
void SceneGroup::advanceIdx()
{
currentIdx++;

View File

@ -1,5 +1,5 @@
#pragma once
#include <deque>
#include <vector>
#include <QDialog>
#include <QLabel>
@ -87,5 +87,6 @@ private:
SceneGroup *GetSceneGroupByName(const char *name);
SceneGroup *GetSceneGroupByQString(const QString &name);
std::deque<SceneGroup> &GetSceneGroups();
} // namespace advss

View File

@ -1,5 +1,7 @@
#include "scene-selection.hpp"
#include "switcher-data.hpp"
#include "obs-module-helper.hpp"
#include "scene-group.hpp"
#include "scene-switch-helpers.hpp"
#include "utility.hpp"
namespace advss {
@ -108,9 +110,9 @@ OBSWeakSource SceneSelection::GetScene(bool advance) const
}
return _group->getCurrentScene();
case Type::PREVIOUS:
return switcher->previousScene;
return GetPreviousScene();
case Type::CURRENT:
return switcher->currentScene;
return GetCurrentScene();
case Type::PREVIEW: {
auto s = obs_frontend_get_current_preview_scene();
auto scene = obs_source_get_weak_source(s);
@ -237,7 +239,7 @@ static QStringList getScenesList()
static QStringList getSceneGroupsList()
{
QStringList list;
for (const auto &sg : switcher->sceneGroups) {
for (const auto &sg : GetSceneGroups()) {
list << QString::fromStdString(sg.name);
}
list.sort();