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:
@@ -336,3 +336,29 @@ void obs_frontend_save_streaming_service(void)
|
||||
if (callbacks_valid())
|
||||
c->obs_frontend_save_streaming_service();
|
||||
}
|
||||
|
||||
bool obs_frontend_preview_program_mode_active(void)
|
||||
{
|
||||
return !!callbacks_valid()
|
||||
? c->obs_frontend_preview_program_mode_active()
|
||||
: false;
|
||||
}
|
||||
|
||||
void obs_frontend_set_preview_program_mode(bool enable)
|
||||
{
|
||||
if (callbacks_valid())
|
||||
c->obs_frontend_set_preview_program_mode(enable);
|
||||
}
|
||||
|
||||
obs_source_t *obs_frontend_get_current_preview_scene(void)
|
||||
{
|
||||
return !!callbacks_valid()
|
||||
? c->obs_frontend_get_current_preview_scene()
|
||||
: nullptr;
|
||||
}
|
||||
|
||||
void obs_frontend_set_current_preview_scene(obs_source_t *scene)
|
||||
{
|
||||
if (callbacks_valid())
|
||||
c->obs_frontend_set_current_preview_scene(scene);
|
||||
}
|
||||
|
@@ -103,7 +103,11 @@ enum obs_frontend_event {
|
||||
OBS_FRONTEND_EVENT_REPLAY_BUFFER_STARTING,
|
||||
OBS_FRONTEND_EVENT_REPLAY_BUFFER_STARTED,
|
||||
OBS_FRONTEND_EVENT_REPLAY_BUFFER_STOPPING,
|
||||
OBS_FRONTEND_EVENT_REPLAY_BUFFER_STOPPED
|
||||
OBS_FRONTEND_EVENT_REPLAY_BUFFER_STOPPED,
|
||||
|
||||
OBS_FRONTEND_EVENT_STUDIO_MODE_ENABLED,
|
||||
OBS_FRONTEND_EVENT_STUDIO_MODE_DISABLED,
|
||||
OBS_FRONTEND_EVENT_PREVIEW_SCENE_CHANGED
|
||||
};
|
||||
|
||||
typedef void (*obs_frontend_event_cb)(enum obs_frontend_event event,
|
||||
@@ -141,6 +145,12 @@ EXPORT void obs_frontend_set_streaming_service(obs_service_t *service);
|
||||
EXPORT obs_service_t* obs_frontend_get_streaming_service(void);
|
||||
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 obs_source_t *obs_frontend_get_current_preview_scene(void);
|
||||
EXPORT void obs_frontend_set_current_preview_scene(obs_source_t *scene);
|
||||
|
||||
/* ------------------------------------------------------------------------- */
|
||||
|
||||
#ifdef __cplusplus
|
||||
|
@@ -75,6 +75,12 @@ struct obs_frontend_callbacks {
|
||||
virtual obs_service_t *obs_frontend_get_streaming_service(void)=0;
|
||||
virtual void obs_frontend_save_streaming_service()=0;
|
||||
|
||||
virtual bool obs_frontend_preview_program_mode_active(void)=0;
|
||||
virtual void obs_frontend_set_preview_program_mode(bool enable)=0;
|
||||
|
||||
virtual obs_source_t *obs_frontend_get_current_preview_scene(void)=0;
|
||||
virtual void obs_frontend_set_current_preview_scene(obs_source_t *scene)=0;
|
||||
|
||||
virtual void on_load(obs_data_t *settings)=0;
|
||||
virtual void on_save(obs_data_t *settings)=0;
|
||||
virtual void on_event(enum obs_frontend_event event)=0;
|
||||
|
Reference in New Issue
Block a user