MCPcopy Create free account
hub / github.com/WarmUpTill/SceneSwitcher / enableStudioMode

Function enableStudioMode

plugins/base/macro-action-studio-mode.cpp:29–41  ·  view source on GitHub ↗

Calling obs_frontend_set_preview_program_mode() directly from a thread that is not the main OBS UI thread will lead to undefined behaviour, so we have to use this helper function instead - copied from obs-websocket plugin

Source from the content-addressed store, hash-verified

27// is not the main OBS UI thread will lead to undefined behaviour, so we have
28// to use this helper function instead - copied from obs-websocket plugin
29static void enableStudioMode(bool enable)
30{
31 if (obs_frontend_preview_program_mode_active() != enable) {
32 obs_queue_task(
33 OBS_TASK_UI,
34 [](void *param) {
35 auto studioModeEnabled = (bool *)param;
36 obs_frontend_set_preview_program_mode(
37 *studioModeEnabled);
38 },
39 &enable, true);
40 }
41}
42
43bool MacroActionSudioMode::PerformAction()
44{

Callers 1

PerformActionMethod · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected