From 7bb91da1d094efc8f00a8d1aa26f4b6198bcd775 Mon Sep 17 00:00:00 2001 From: tt2468 Date: Fri, 15 May 2020 16:30:01 -0700 Subject: [PATCH] Events: Add sourceType string to SourceRenamed Since sources in OBS are also scenes, provide the user a string so that they can differentiate. --- src/WSEvents.cpp | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/WSEvents.cpp b/src/WSEvents.cpp index 37ada8ee..4cf069d3 100644 --- a/src/WSEvents.cpp +++ b/src/WSEvents.cpp @@ -1177,6 +1177,7 @@ void WSEvents::OnSourceAudioMixersChanged(void* param, calldata_t* data) { * * @return {String} `previousName` Previous source name * @return {String} `newName` New source name + * @return {String} `sourceType` Type of source (input, scene, filter, transition) * * @api events * @name SourceRenamed @@ -1201,6 +1202,8 @@ void WSEvents::OnSourceRename(void* param, calldata_t* data) { OBSDataAutoRelease fields = obs_data_create(); obs_data_set_string(fields, "previousName", previousName); obs_data_set_string(fields, "newName", newName); + obs_data_set_string(fields, "sourceType", + sourceTypeToString(obs_source_get_type(source))); // TODO: Split into dedicated events for source/scene. Only doing it this way for backwards compatability until 5.0 self->broadcastUpdate("SourceRenamed", fields); }