mirror of
https://github.com/Palakis/obs-websocket.git
synced 2024-08-30 18:12:16 +00:00
eventhandler: Add SceneTransitionVideoEnded
This commit is contained in:
parent
9ac7c5890e
commit
bbf9c283c0
@ -177,6 +177,7 @@ void EventHandler::ConnectSourceSignals(obs_source_t *source) // Applies to inpu
|
||||
if (sourceType == OBS_SOURCE_TYPE_TRANSITION) {
|
||||
signal_handler_connect(sh, "transition_start", HandleSceneTransitionStarted, this);
|
||||
signal_handler_connect(sh, "transition_stop", HandleSceneTransitionEnded, this);
|
||||
signal_handler_connect(sh, "transition_video_stop", HandleSceneTransitionVideoEnded, this);
|
||||
}
|
||||
|
||||
// Filters
|
||||
@ -245,6 +246,7 @@ void EventHandler::DisconnectSourceSignals(obs_source_t *source)
|
||||
if (sourceType == OBS_SOURCE_TYPE_TRANSITION) {
|
||||
signal_handler_disconnect(sh, "transition_start", HandleSceneTransitionStarted, this);
|
||||
signal_handler_disconnect(sh, "transition_stop", HandleSceneTransitionEnded, this);
|
||||
signal_handler_disconnect(sh, "transition_video_stop", HandleSceneTransitionVideoEnded, this);
|
||||
}
|
||||
|
||||
// Filters
|
||||
|
@ -117,6 +117,7 @@ class EventHandler
|
||||
void HandleCurrentSceneTransitionDurationChanged();
|
||||
static void HandleSceneTransitionStarted(void *param, calldata_t *data); // Direct callback
|
||||
static void HandleSceneTransitionEnded(void *param, calldata_t *data); // Direct callback
|
||||
static void HandleSceneTransitionVideoEnded(void *param, calldata_t *data); // Direct callback
|
||||
|
||||
// Filters
|
||||
static void FilterAddMultiHandler(void *param, calldata_t *data); // Direct callback
|
||||
|
@ -114,3 +114,34 @@ void EventHandler::HandleSceneTransitionEnded(void *param, calldata_t *data)
|
||||
eventData["transitionName"] = obs_source_get_name(source);
|
||||
eventHandler->BroadcastEvent(EventSubscription::Transitions, "SceneTransitionEnded", eventData);
|
||||
}
|
||||
|
||||
/**
|
||||
* A scene transition's video has completed fully.
|
||||
*
|
||||
* Useful for stinger transitions to tell when the video *actually* ends.
|
||||
* `SceneTransitionEnded` only signifies the cut point, not the completion of transition playback.
|
||||
*
|
||||
* Note: Appears to be called by every transition, regardless of relevance.
|
||||
*
|
||||
* @dataField transitionName | String | Scene transition name
|
||||
*
|
||||
* @eventType SceneTransitionVideoEnded
|
||||
* @eventSubscription Transitions
|
||||
* @complexity 2
|
||||
* @rpcVersion -1
|
||||
* @initialVersion 5.0.0
|
||||
* @api events
|
||||
* @category transitions
|
||||
*/
|
||||
void EventHandler::HandleSceneTransitionVideoEnded(void *param, calldata_t *data)
|
||||
{
|
||||
auto eventHandler = static_cast<EventHandler*>(param);
|
||||
|
||||
obs_source_t *source = GetCalldataPointer<obs_source_t>(data, "source");
|
||||
if (!source)
|
||||
return;
|
||||
|
||||
json eventData;
|
||||
eventData["transitionName"] = obs_source_get_name(source);
|
||||
eventHandler->BroadcastEvent(EventSubscription::Transitions, "SceneTransitionVideoEnded", eventData);
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user