Merge pull request #1051 from RytoEX/add-frontend-replay-buffer-save
UI: Add Frontend API function to save replay buffer
This commit is contained in:
commit
a63028dd9c
@ -239,6 +239,11 @@ struct OBSStudioAPI : obs_frontend_callbacks {
|
||||
QMetaObject::invokeMethod(main, "StartReplayBuffer");
|
||||
}
|
||||
|
||||
void obs_frontend_replay_buffer_save(void) override
|
||||
{
|
||||
QMetaObject::invokeMethod(main, "ReplayBufferSave");
|
||||
}
|
||||
|
||||
void obs_frontend_replay_buffer_stop(void) override
|
||||
{
|
||||
QMetaObject::invokeMethod(main, "StopReplayBuffer");
|
||||
|
@ -210,6 +210,11 @@ void obs_frontend_replay_buffer_start(void)
|
||||
if (callbacks_valid()) c->obs_frontend_replay_buffer_start();
|
||||
}
|
||||
|
||||
void obs_frontend_replay_buffer_save(void)
|
||||
{
|
||||
if (callbacks_valid()) c->obs_frontend_replay_buffer_save();
|
||||
}
|
||||
|
||||
void obs_frontend_replay_buffer_stop(void)
|
||||
{
|
||||
if (callbacks_valid()) c->obs_frontend_replay_buffer_stop();
|
||||
|
@ -71,6 +71,7 @@ EXPORT void obs_frontend_recording_stop(void);
|
||||
EXPORT bool obs_frontend_recording_active(void);
|
||||
|
||||
EXPORT void obs_frontend_replay_buffer_start(void);
|
||||
EXPORT void obs_frontend_replay_buffer_save(void);
|
||||
EXPORT void obs_frontend_replay_buffer_stop(void);
|
||||
EXPORT bool obs_frontend_replay_buffer_active(void);
|
||||
|
||||
|
@ -41,6 +41,7 @@ struct obs_frontend_callbacks {
|
||||
virtual bool obs_frontend_recording_active(void)=0;
|
||||
|
||||
virtual void obs_frontend_replay_buffer_start(void)=0;
|
||||
virtual void obs_frontend_replay_buffer_save(void) = 0;
|
||||
virtual void obs_frontend_replay_buffer_stop(void)=0;
|
||||
virtual bool obs_frontend_replay_buffer_active(void)=0;
|
||||
|
||||
|
@ -4650,6 +4650,20 @@ void OBSBasic::ReplayBufferStart()
|
||||
blog(LOG_INFO, REPLAY_BUFFER_START);
|
||||
}
|
||||
|
||||
void OBSBasic::ReplayBufferSave()
|
||||
{
|
||||
if (!outputHandler || !outputHandler->replayBuffer)
|
||||
return;
|
||||
if (!outputHandler->ReplayBufferActive())
|
||||
return;
|
||||
|
||||
calldata_t cd = {0};
|
||||
proc_handler_t *ph = obs_output_get_proc_handler(
|
||||
outputHandler->replayBuffer);
|
||||
proc_handler_call(ph, "save", &cd);
|
||||
calldata_free(&cd);
|
||||
}
|
||||
|
||||
void OBSBasic::ReplayBufferStop(int code)
|
||||
{
|
||||
if (!outputHandler || !outputHandler->replayBuffer)
|
||||
|
@ -380,6 +380,7 @@ public slots:
|
||||
void StopReplayBuffer();
|
||||
|
||||
void ReplayBufferStart();
|
||||
void ReplayBufferSave();
|
||||
void ReplayBufferStopping();
|
||||
void ReplayBufferStop(int code);
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user