From 420f9e5490dca3be89871af3b5f7c9cef8fac81b Mon Sep 17 00:00:00 2001 From: Penwywern Date: Mon, 22 May 2023 10:49:04 +0200 Subject: [PATCH] frontend: Add replay buffer saving frontend event --- docs/sphinx/reference-frontend-api.rst | 4 ++++ frontend/api/obs-frontend-api.h | 2 ++ frontend/widgets/OBSBasic_ReplayBuffer.cpp | 2 ++ 3 files changed, 8 insertions(+) diff --git a/docs/sphinx/reference-frontend-api.rst b/docs/sphinx/reference-frontend-api.rst index 6ef7854d1..b4983669b 100644 --- a/docs/sphinx/reference-frontend-api.rst +++ b/docs/sphinx/reference-frontend-api.rst @@ -150,6 +150,10 @@ Structures/Enumerations Triggered when the replay buffer has fully stopped. + - **OBS_FRONTEND_EVENT_REPLAY_BUFFER_SAVING** + + Triggered when the replay buffer is saving. + - **OBS_FRONTEND_EVENT_REPLAY_BUFFER_SAVED** Triggered when the replay buffer has been saved. diff --git a/frontend/api/obs-frontend-api.h b/frontend/api/obs-frontend-api.h index 46713fbcb..c6648d28f 100644 --- a/frontend/api/obs-frontend-api.h +++ b/frontend/api/obs-frontend-api.h @@ -65,6 +65,8 @@ enum obs_frontend_event { OBS_FRONTEND_EVENT_CANVAS_ADDED, OBS_FRONTEND_EVENT_CANVAS_REMOVED, + + OBS_FRONTEND_EVENT_REPLAY_BUFFER_SAVING, }; /* ------------------------------------------------------------------------- */ diff --git a/frontend/widgets/OBSBasic_ReplayBuffer.cpp b/frontend/widgets/OBSBasic_ReplayBuffer.cpp index bfd339bd8..cfd06073e 100644 --- a/frontend/widgets/OBSBasic_ReplayBuffer.cpp +++ b/frontend/widgets/OBSBasic_ReplayBuffer.cpp @@ -160,6 +160,8 @@ void OBSBasic::ReplayBufferSave() return; } + OnEvent(OBS_FRONTEND_EVENT_REPLAY_BUFFER_SAVING); + calldata_t cd = {0}; proc_handler_t *ph = obs_output_get_proc_handler(outputHandler->replayBuffer); proc_handler_call(ph, "save", &cd);