From e15acf90650cb039f93a2624079fbe071cde77f1 Mon Sep 17 00:00:00 2001 From: tt2468 Date: Mon, 7 Jun 2021 01:11:51 -0700 Subject: [PATCH] Utils: Add helpers to get some current data --- src/utils/Obs.cpp | 16 ++++++++++++++++ src/utils/Utils.h | 2 ++ 2 files changed, 18 insertions(+) diff --git a/src/utils/Obs.cpp b/src/utils/Obs.cpp index db9198d2..8e812065 100644 --- a/src/utils/Obs.cpp +++ b/src/utils/Obs.cpp @@ -38,6 +38,22 @@ std::string Utils::Obs::StringHelper::GetObsVersionString() return combined.toStdString(); } +std::string Utils::Obs::StringHelper::GetCurrentSceneCollection() +{ + char *sceneCollectionName = obs_frontend_get_current_scene_collection(); + std::string ret = sceneCollectionName; + bfree(sceneCollectionName); + return ret; +} + +std::string Utils::Obs::StringHelper::GetCurrentProfile() +{ + char *profileName = obs_frontend_get_current_profile(); + std::string ret = profileName; + bfree(profileName); + return ret; +} + std::string Utils::Obs::StringHelper::GetSourceTypeString(obs_source_t *source) { obs_source_type sourceType = obs_source_get_type(source); diff --git a/src/utils/Utils.h b/src/utils/Utils.h index 10beb24d..b6862190 100644 --- a/src/utils/Utils.h +++ b/src/utils/Utils.h @@ -30,6 +30,8 @@ namespace Utils { namespace Obs { namespace StringHelper { std::string GetObsVersionString(); + std::string GetCurrentSceneCollection(); + std::string GetCurrentProfile(); std::string GetSourceTypeString(obs_source_t *source); std::string GetInputMonitorTypeString(obs_source_t *input); std::string GetMediaInputStateString(obs_source_t *input);