From becf604fc3000f61105079ef8ce0f09e66699578 Mon Sep 17 00:00:00 2001 From: tt2468 Date: Fri, 14 May 2021 01:39:06 -0700 Subject: [PATCH] EventHandler: Add missing input event fields --- src/eventhandler/EventHandler_Inputs.cpp | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/src/eventhandler/EventHandler_Inputs.cpp b/src/eventhandler/EventHandler_Inputs.cpp index 1b3129df..e4ea203c 100644 --- a/src/eventhandler/EventHandler_Inputs.cpp +++ b/src/eventhandler/EventHandler_Inputs.cpp @@ -4,8 +4,15 @@ void EventHandler::HandleInputCreated(obs_source_t *source) { + std::string inputKind = obs_source_get_id(source); + OBSDataAutoRelease inputSettings = obs_source_get_settings(source); + OBSDataAutoRelease defaultInputSettings = obs_get_source_defaults(inputKind.c_str()); + json eventData; eventData["inputName"] = obs_source_get_name(source); + eventData["inputKind"] = inputKind; + eventData["inputSettings"] = Utils::Json::ObsDataToJson(inputSettings); + eventData["defaultInputSettings"] = Utils::Json::ObsDataToJson(defaultInputSettings, true); _webSocketServer->BroadcastEvent(EventSubscription::Inputs, "InputCreated", eventData); } @@ -13,6 +20,7 @@ void EventHandler::HandleInputRemoved(obs_source_t *source) { json eventData; eventData["inputName"] = obs_source_get_name(source); + eventData["inputKind"] = obs_source_get_id(source); _webSocketServer->BroadcastEvent(EventSubscription::Inputs, "InputRemoved", eventData); }