utils: Implement helper to get current module config path

This commit is contained in:
tt2468 2024-04-22 18:38:19 -07:00
parent 305afd763d
commit a589e80bdb
2 changed files with 10 additions and 0 deletions

View File

@ -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();

View File

@ -20,6 +20,8 @@ with this program. If not, see <https://www.gnu.org/licenses/>
#include <inttypes.h>
#include <QString>
#include <obs-module.h>
#include <util/util.hpp>
#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<char> configPath = obs_module_config_path(fileName.c_str());
std::string ret = configPath.Get();
return ret;
}
std::string Utils::Obs::StringHelper::GetCurrentSceneCollection()
{
BPtr<char> sceneCollectionName = obs_frontend_get_current_scene_collection();