EventHandler: Add ReplayBufferSaved

This commit is contained in:
tt2468 2021-06-12 20:34:24 -07:00
parent 4503b6ed05
commit ca26f679c8
3 changed files with 11 additions and 0 deletions

View File

@ -229,6 +229,9 @@ void EventHandler::OnFrontendEvent(enum obs_frontend_event event, void *private_
case OBS_FRONTEND_EVENT_VIRTUALCAM_STOPPED:
eventHandler->HandleVirtualcamStateChanged(OBS_WEBSOCKET_OUTPUT_STOPPED);
break;
case OBS_FRONTEND_EVENT_REPLAY_BUFFER_SAVED:
eventHandler->HandleReplayBufferSaved();
break;
default:
break;

View File

@ -106,6 +106,7 @@ class EventHandler
void HandleRecordStateChanged(ObsOutputState state);
void HandleReplayBufferStateChanged(ObsOutputState state);
void HandleVirtualcamStateChanged(ObsOutputState state);
void HandleReplayBufferSaved();
// Media Inputs
static void HandleMediaInputPlaybackStarted(void *param, calldata_t *data); // Direct callback

View File

@ -62,3 +62,10 @@ void EventHandler::HandleVirtualcamStateChanged(ObsOutputState state)
eventData["outputState"] = GetOutputStateString(state);
_webSocketServer->BroadcastEvent(EventSubscription::Outputs, "VirtualcamStateChanged", eventData);
}
void EventHandler::HandleReplayBufferSaved()
{
json eventData;
eventData["savedReplayPath"] = Utils::Obs::StringHelper::GetLastReplayBufferFilePath();
_webSocketServer->BroadcastEvent(EventSubscription::Outputs, "ReplayBufferSaved", eventData);
}