From 306844e42d38610b4c9b47053c6c540ffa82c310 Mon Sep 17 00:00:00 2001 From: tt2468 Date: Thu, 26 Aug 2021 18:41:53 -0700 Subject: [PATCH] Utils: Add helper to get current profile file path --- src/utils/Obs.cpp | 8 ++++++++ src/utils/Utils.h | 1 + 2 files changed, 9 insertions(+) diff --git a/src/utils/Obs.cpp b/src/utils/Obs.cpp index a3e3d702..63fc5da9 100644 --- a/src/utils/Obs.cpp +++ b/src/utils/Obs.cpp @@ -55,6 +55,14 @@ std::string Utils::Obs::StringHelper::GetCurrentProfile() return ret; } +std::string Utils::Obs::StringHelper::GetCurrentProfilePath() +{ + char *profilePath = obs_frontend_get_current_profile_path(); + std::string ret = profilePath; + bfree(profilePath); + 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 b1c0906e..3790e50e 100644 --- a/src/utils/Utils.h +++ b/src/utils/Utils.h @@ -34,6 +34,7 @@ namespace Utils { std::string GetObsVersionString(); std::string GetCurrentSceneCollection(); std::string GetCurrentProfile(); + std::string GetCurrentProfilePath(); std::string GetSourceTypeString(obs_source_t *source); std::string GetInputMonitorTypeString(obs_source_t *input); std::string GetMediaInputStateString(obs_source_t *input);