Utils: Add helpers to get some current data

This commit is contained in:
tt2468 2021-06-07 01:11:51 -07:00
parent 136a270473
commit e15acf9065
2 changed files with 18 additions and 0 deletions

View File

@ -38,6 +38,22 @@ std::string Utils::Obs::StringHelper::GetObsVersionString()
return combined.toStdString(); 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) std::string Utils::Obs::StringHelper::GetSourceTypeString(obs_source_t *source)
{ {
obs_source_type sourceType = obs_source_get_type(source); obs_source_type sourceType = obs_source_get_type(source);

View File

@ -30,6 +30,8 @@ namespace Utils {
namespace Obs { namespace Obs {
namespace StringHelper { namespace StringHelper {
std::string GetObsVersionString(); std::string GetObsVersionString();
std::string GetCurrentSceneCollection();
std::string GetCurrentProfile();
std::string GetSourceTypeString(obs_source_t *source); std::string GetSourceTypeString(obs_source_t *source);
std::string GetInputMonitorTypeString(obs_source_t *input); std::string GetInputMonitorTypeString(obs_source_t *input);
std::string GetMediaInputStateString(obs_source_t *input); std::string GetMediaInputStateString(obs_source_t *input);