EventHandler: Add sceneItemIndex to certain events

This commit is contained in:
tt2468 2021-06-13 02:43:00 -07:00
parent 230d25fc8b
commit 945816ce92

View File

@ -18,6 +18,7 @@ void EventHandler::HandleSceneItemCreated(void *param, calldata_t *data)
eventData["sceneName"] = obs_source_get_name(obs_scene_get_source(scene));
eventData["inputName"] = obs_source_get_name(obs_sceneitem_get_source(sceneItem));
eventData["sceneItemId"] = obs_sceneitem_get_id(sceneItem);
eventData["sceneItemIndex"] = obs_sceneitem_get_order_position(sceneItem);
eventHandler->_webSocketServer->BroadcastEvent(EventSubscription::SceneItems, "SceneItemCreated", eventData);
}
@ -37,6 +38,7 @@ void EventHandler::HandleSceneItemRemoved(void *param, calldata_t *data)
eventData["sceneName"] = obs_source_get_name(obs_scene_get_source(scene));
eventData["inputName"] = obs_source_get_name(obs_sceneitem_get_source(sceneItem));
eventData["sceneItemId"] = obs_sceneitem_get_id(sceneItem);
eventData["sceneItemIndex"] = obs_sceneitem_get_order_position(sceneItem);
eventHandler->_webSocketServer->BroadcastEvent(EventSubscription::SceneItems, "SceneItemRemoved", eventData);
}