mirror of
https://github.com/Palakis/obs-websocket.git
synced 2024-08-30 18:12:16 +00:00
EventHandler: Add missing input event fields
This commit is contained in:
parent
e4fbebb3b4
commit
becf604fc3
@ -4,8 +4,15 @@
|
|||||||
|
|
||||||
void EventHandler::HandleInputCreated(obs_source_t *source)
|
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;
|
json eventData;
|
||||||
eventData["inputName"] = obs_source_get_name(source);
|
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);
|
_webSocketServer->BroadcastEvent(EventSubscription::Inputs, "InputCreated", eventData);
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -13,6 +20,7 @@ void EventHandler::HandleInputRemoved(obs_source_t *source)
|
|||||||
{
|
{
|
||||||
json eventData;
|
json eventData;
|
||||||
eventData["inputName"] = obs_source_get_name(source);
|
eventData["inputName"] = obs_source_get_name(source);
|
||||||
|
eventData["inputKind"] = obs_source_get_id(source);
|
||||||
_webSocketServer->BroadcastEvent(EventSubscription::Inputs, "InputRemoved", eventData);
|
_webSocketServer->BroadcastEvent(EventSubscription::Inputs, "InputRemoved", eventData);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user