frontend: Migrate scene collection usage to new SceneCollection class

This commit is contained in:
PatTheMav
2025-01-22 20:44:35 +01:00
committed by Ryan Foster
parent ca44e3037d
commit cce189011e
6 changed files with 290 additions and 212 deletions

View File

@@ -1,5 +1,6 @@
#include "OBSStudioAPI.hpp"
#include <models/SceneCollection.hpp>
#include <widgets/OBSBasic.hpp>
#include <widgets/OBSProjector.hpp>
@@ -129,8 +130,14 @@ void OBSStudioAPI::obs_frontend_get_scene_collections(std::vector<std::string> &
char *OBSStudioAPI::obs_frontend_get_current_scene_collection()
{
const OBSSceneCollection &currentCollection = main->GetCurrentSceneCollection();
return bstrdup(currentCollection.name.c_str());
try {
const OBS::SceneCollection &currentCollection = main->GetCurrentSceneCollection();
return bstrdup(currentCollection.getName().c_str());
} catch (const std::exception &error) {
blog(LOG_DEBUG, "%s", error.what());
blog(LOG_ERROR, "Failed to get current scene collection name");
return nullptr;
}
}
void OBSStudioAPI::obs_frontend_set_current_scene_collection(const char *collection)