From d3ec3e99d57486f93734d7879aac0ac9dd62972f Mon Sep 17 00:00:00 2001 From: hgonomeg Date: Sun, 11 Oct 2020 02:53:13 +0200 Subject: [PATCH] UI: Add replay buffer saved event to the frontend api (#3592) * obs-frontend-api: add the event of saving replay buffer Add OBS_FRONTEND_EVENT_REPLAY_BUFFER_SAVED as given by RFC 33 * UI: Emit the replay buffer saved event to the api Send the OBS_FRONTEND_EVENT_REPLAY_BUFFER_SAVED to api (as in rfc33) * docs/sphinx: Add replay buffer saved event Documentation provided for OBS_FRONTEND_EVENT_REPLAY_BUFFER_SAVED (RFC33) --- UI/obs-frontend-api/obs-frontend-api.h | 1 + UI/window-basic-main.cpp | 2 ++ docs/sphinx/reference-frontend-api.rst | 4 ++++ 3 files changed, 7 insertions(+) diff --git a/UI/obs-frontend-api/obs-frontend-api.h b/UI/obs-frontend-api/obs-frontend-api.h index 83dd9c766..0e28bf075 100644 --- a/UI/obs-frontend-api/obs-frontend-api.h +++ b/UI/obs-frontend-api/obs-frontend-api.h @@ -37,6 +37,7 @@ enum obs_frontend_event { OBS_FRONTEND_EVENT_REPLAY_BUFFER_STARTED, OBS_FRONTEND_EVENT_REPLAY_BUFFER_STOPPING, OBS_FRONTEND_EVENT_REPLAY_BUFFER_STOPPED, + OBS_FRONTEND_EVENT_REPLAY_BUFFER_SAVED, OBS_FRONTEND_EVENT_STUDIO_MODE_ENABLED, OBS_FRONTEND_EVENT_STUDIO_MODE_DISABLED, diff --git a/UI/window-basic-main.cpp b/UI/window-basic-main.cpp index 3ccf287db..142d64641 100644 --- a/UI/window-basic-main.cpp +++ b/UI/window-basic-main.cpp @@ -6141,6 +6141,8 @@ void OBSBasic::ReplayBufferSave() obs_output_get_proc_handler(outputHandler->replayBuffer); proc_handler_call(ph, "save", &cd); calldata_free(&cd); + if (api) + api->on_event(OBS_FRONTEND_EVENT_REPLAY_BUFFER_SAVED); } void OBSBasic::ReplayBufferStop(int code) diff --git a/docs/sphinx/reference-frontend-api.rst b/docs/sphinx/reference-frontend-api.rst index 4cac164f8..87a01b2c8 100644 --- a/docs/sphinx/reference-frontend-api.rst +++ b/docs/sphinx/reference-frontend-api.rst @@ -105,6 +105,10 @@ Structures/Enumerations Triggered when the replay buffer has fully stopped. + - **OBS_FRONTEND_EVENT_REPLAY_BUFFER_SAVED** + + Triggered when the replay buffer has been saved. + - **OBS_FRONTEND_EVENT_STUDIO_MODE_ENABLED** Triggered when the user has turned on studio mode.