mirror of
https://github.com/obsproject/obs-studio.git
synced 2026-07-14 17:24:17 -04:00
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:
@@ -369,6 +369,37 @@ struct OBSStudioAPI : obs_frontend_callbacks {
|
||||
main->SaveService();
|
||||
}
|
||||
|
||||
bool obs_frontend_preview_program_mode_active(void) override
|
||||
{
|
||||
return main->IsPreviewProgramMode();
|
||||
}
|
||||
|
||||
void obs_frontend_set_preview_program_mode(bool enable) override
|
||||
{
|
||||
main->SetPreviewProgramMode(enable);
|
||||
}
|
||||
|
||||
obs_source_t *obs_frontend_get_current_preview_scene(void) override
|
||||
{
|
||||
OBSSource source = nullptr;
|
||||
|
||||
if (main->IsPreviewProgramMode()) {
|
||||
source = main->GetCurrentSceneSource();
|
||||
obs_source_addref(source);
|
||||
}
|
||||
|
||||
return source;
|
||||
}
|
||||
|
||||
void obs_frontend_set_current_preview_scene(obs_source_t *scene) override
|
||||
{
|
||||
if (main->IsPreviewProgramMode()) {
|
||||
QMetaObject::invokeMethod(main, "SetCurrentScene",
|
||||
Q_ARG(OBSSource, OBSSource(scene)),
|
||||
Q_ARG(bool, false));
|
||||
}
|
||||
}
|
||||
|
||||
void on_load(obs_data_t *settings) override
|
||||
{
|
||||
for (auto cb : saveCallbacks)
|
||||
|
||||
Reference in New Issue
Block a user