UI: Add Studio Mode features in the Frontend API

With these new functions, plugin developers can enable, disable and
get the status of Studio Mode, as well as get and set the current
preview scene and transition the current preview to Program

Here is a list of the Studio Mode events:
   - Studio Mode enabled
   - Studio Mode disabled
   - Previewed scene in Studio Mode changed
This commit is contained in:
Palakis 2017-05-03 23:17:52 +02:00
commit 2e3888abd4
5 changed files with 83 additions and 1 deletions

View file

@ -576,6 +576,9 @@ void OBSBasic::SetCurrentScene(OBSSource scene, bool force)
break;
}
}
if (api && IsPreviewProgramMode())
api->on_event(OBS_FRONTEND_EVENT_PREVIEW_SCENE_CHANGED);
}
UpdateSceneSelection(scene);
@ -975,6 +978,9 @@ void OBSBasic::SetPreviewProgramMode(bool enabled)
ui->previewLayout->addWidget(program);
program->show();
if (api)
api->on_event(OBS_FRONTEND_EVENT_STUDIO_MODE_ENABLED);
blog(LOG_INFO, "Switched to Preview/Program mode");
blog(LOG_INFO, "-----------------------------"
"-------------------");
@ -1005,6 +1011,9 @@ void OBSBasic::SetPreviewProgramMode(bool enabled)
if (!previewEnabled)
EnablePreviewDisplay(false);
if (api)
api->on_event(OBS_FRONTEND_EVENT_STUDIO_MODE_DISABLED);
blog(LOG_INFO, "Switched to regular Preview mode");
blog(LOG_INFO, "-----------------------------"
"-------------------");