From a589e80bdb2fb9668c51dbfc71ff2c3b0f2f6db7 Mon Sep 17 00:00:00 2001 From: tt2468 Date: Mon, 22 Apr 2024 18:38:19 -0700 Subject: [PATCH] utils: Implement helper to get current module config path --- src/utils/Obs.h | 1 + src/utils/Obs_StringHelper.cpp | 9 +++++++++ 2 files changed, 10 insertions(+) diff --git a/src/utils/Obs.h b/src/utils/Obs.h index 6fa239d7..5174efa3 100644 --- a/src/utils/Obs.h +++ b/src/utils/Obs.h @@ -227,6 +227,7 @@ namespace Utils { namespace Obs { namespace StringHelper { std::string GetObsVersion(); + std::string GetModuleConfigPath(std::string &fileName); std::string GetCurrentSceneCollection(); std::string GetCurrentProfile(); std::string GetCurrentProfilePath(); diff --git a/src/utils/Obs_StringHelper.cpp b/src/utils/Obs_StringHelper.cpp index fc541ec6..acecf06d 100644 --- a/src/utils/Obs_StringHelper.cpp +++ b/src/utils/Obs_StringHelper.cpp @@ -20,6 +20,8 @@ with this program. If not, see #include #include +#include + #include #include "Obs.h" @@ -42,6 +44,13 @@ std::string Utils::Obs::StringHelper::GetObsVersion() return combined.toStdString(); } +std::string Utils::Obs::StringHelper::GetModuleConfigPath(std::string &fileName) +{ + BPtr configPath = obs_module_config_path(fileName.c_str()); + std::string ret = configPath.Get(); + return ret; +} + std::string Utils::Obs::StringHelper::GetCurrentSceneCollection() { BPtr sceneCollectionName = obs_frontend_get_current_scene_collection();