Merge pull request #1873 from Palakis/feature/frontend-api-studio-mode-transition

obs-frontend-api: Add method to trigger a Studio Mode transition
master
Jim 2019-05-09 19:24:59 -07:00 committed by GitHub
commit 3a3cfce29d
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
5 changed files with 20 additions and 0 deletions

View File

@ -450,6 +450,11 @@ struct OBSStudioAPI : obs_frontend_callbacks {
main->SetPreviewProgramMode(enable);
}
void obs_frontend_preview_program_trigger_transition(void) override
{
QMetaObject::invokeMethod(main, "TransitionClicked");
}
bool obs_frontend_preview_enabled(void) override
{
return main->previewEnabled;

View File

@ -408,6 +408,12 @@ void obs_frontend_set_preview_program_mode(bool enable)
c->obs_frontend_set_preview_program_mode(enable);
}
void obs_frontend_preview_program_trigger_transition(void)
{
if (callbacks_valid())
c->obs_frontend_preview_program_trigger_transition();
}
void obs_frontend_set_preview_enabled(bool enable)
{
if (callbacks_valid())

View File

@ -171,6 +171,7 @@ EXPORT void obs_frontend_save_streaming_service(void);
EXPORT bool obs_frontend_preview_program_mode_active(void);
EXPORT void obs_frontend_set_preview_program_mode(bool enable);
EXPORT void obs_frontend_preview_program_trigger_transition(void);
EXPORT void obs_frontend_set_preview_enabled(bool enable);
EXPORT bool obs_frontend_preview_enabled(void);

View File

@ -89,6 +89,8 @@ struct obs_frontend_callbacks {
virtual bool obs_frontend_preview_program_mode_active(void)=0;
virtual void obs_frontend_set_preview_program_mode(bool enable)=0;
virtual void obs_frontend_preview_program_trigger_transition(void)=0;
virtual bool obs_frontend_preview_enabled(void)=0;
virtual void obs_frontend_set_preview_enabled(bool enable)=0;

View File

@ -485,6 +485,12 @@ Functions
---------------------------------------
.. function:: void obs_frontend_preview_program_trigger_transition(void)
Triggers a preview-to-program transition if studio mode is active.
---------------------------------------
.. function:: obs_source_t *obs_frontend_get_current_preview_scene(void)
:return: A new reference to the current preview scene if studio mode