From f40426efa10f7c6e15c123abd1e3dfb750dc7e31 Mon Sep 17 00:00:00 2001 From: tt2468 Date: Thu, 18 Jan 2024 16:56:20 -0800 Subject: [PATCH] utils: Implement input, scene, and transition UUID support --- src/utils/Obs_ArrayHelper.cpp | 4 ++++ src/utils/Obs_VolumeMeter.cpp | 1 + 2 files changed, 5 insertions(+) diff --git a/src/utils/Obs_ArrayHelper.cpp b/src/utils/Obs_ArrayHelper.cpp index 999fc6ef5..48a1c499c 100644 --- a/src/utils/Obs_ArrayHelper.cpp +++ b/src/utils/Obs_ArrayHelper.cpp @@ -96,6 +96,7 @@ std::vector Utils::Obs::ArrayHelper::GetSceneList() json sceneJson; sceneJson["sceneName"] = obs_source_get_name(scene); + sceneJson["sceneUuid"] = obs_source_get_uuid(scene); sceneJson["sceneIndex"] = sceneList.sources.num - i - 1; ret.push_back(sceneJson); @@ -150,6 +151,7 @@ std::vector Utils::Obs::ArrayHelper::GetSceneItemList(obs_scene_t *scene, item["sceneItemBlendMode"] = obs_sceneitem_get_blending_mode(sceneItem); OBSSource itemSource = obs_sceneitem_get_source(sceneItem); item["sourceName"] = obs_source_get_name(itemSource); + item["sourceUuid"] = obs_source_get_uuid(itemSource); item["sourceType"] = obs_source_get_type(itemSource); if (obs_source_get_type(itemSource) == OBS_SOURCE_TYPE_INPUT) item["inputKind"] = obs_source_get_id(itemSource); @@ -195,6 +197,7 @@ std::vector Utils::Obs::ArrayHelper::GetInputList(std::string inputKind) json inputJson; inputJson["inputName"] = obs_source_get_name(input); + inputJson["inputUuid"] = obs_source_get_uuid(input); inputJson["inputKind"] = inputKind; inputJson["unversionedInputKind"] = obs_source_get_unversioned_id(input); @@ -281,6 +284,7 @@ std::vector Utils::Obs::ArrayHelper::GetSceneTransitionList() obs_source_t *transition = transitionList.sources.array[i]; json transitionJson; transitionJson["transitionName"] = obs_source_get_name(transition); + transitionJson["transitionUuid"] = obs_source_get_uuid(transition); transitionJson["transitionKind"] = obs_source_get_id(transition); transitionJson["transitionFixed"] = obs_transition_fixed(transition); transitionJson["transitionConfigurable"] = obs_source_configurable(transition); diff --git a/src/utils/Obs_VolumeMeter.cpp b/src/utils/Obs_VolumeMeter.cpp index 52eae6670..0aa718b4d 100644 --- a/src/utils/Obs_VolumeMeter.cpp +++ b/src/utils/Obs_VolumeMeter.cpp @@ -93,6 +93,7 @@ json Utils::Obs::VolumeMeter::Meter::GetMeterData() l.unlock(); ret["inputName"] = obs_source_get_name(input); + ret["inputUuid"] = obs_source_get_uuid(input); ret["inputLevelsMul"] = levels; return ret;