Skip to content

Commit

Permalink
utils: Implement input, scene, and transition UUID support
Browse files Browse the repository at this point in the history
  • Loading branch information
tt2468 committed Jan 19, 2024
1 parent 830f7eb commit f40426e
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 0 deletions.
4 changes: 4 additions & 0 deletions src/utils/Obs_ArrayHelper.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -96,6 +96,7 @@ std::vector<json> 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);
Expand Down Expand Up @@ -150,6 +151,7 @@ std::vector<json> 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);
Expand Down Expand Up @@ -195,6 +197,7 @@ std::vector<json> 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);

Expand Down Expand Up @@ -281,6 +284,7 @@ std::vector<json> 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);
Expand Down
1 change: 1 addition & 0 deletions src/utils/Obs_VolumeMeter.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down

0 comments on commit f40426e

Please sign in to comment.