Builds the obs_data blob for a scene-switch action, matching MacroActionSwitchScene::Save(). { "segmentSettings": { "enabled": true, "version": 2 }, "id": "scene_switch", "action": 0, "sceneSelection": { "type": 0, "name": " ", "canvasSelection": "Main" }, "transitionType": 1, // scene's default transition "blockUntilTransitionDone": true, "sceneType": 0 }
| 74 | // "sceneType": 0 |
| 75 | // } |
| 76 | static OBSDataAutoRelease buildSceneSwitchData(const QString &scene) |
| 77 | { |
| 78 | OBSDataAutoRelease seg = obs_data_create(); |
| 79 | obs_data_set_bool(seg, "enabled", true); |
| 80 | obs_data_set_int(seg, "version", 2); |
| 81 | |
| 82 | OBSDataAutoRelease sceneSel = obs_data_create(); |
| 83 | obs_data_set_int(sceneSel, "type", 0); |
| 84 | obs_data_set_string(sceneSel, "name", scene.toUtf8().constData()); |
| 85 | obs_data_set_string(sceneSel, "canvasSelection", "Main"); |
| 86 | |
| 87 | OBSDataAutoRelease data = obs_data_create(); |
| 88 | obs_data_set_obj(data, "segmentSettings", seg); |
| 89 | obs_data_set_string(data, "id", "scene_switch"); |
| 90 | obs_data_set_int(data, "action", 0); |
| 91 | obs_data_set_obj(data, "sceneSelection", sceneSel); |
| 92 | obs_data_set_int(data, "transitionType", 1); |
| 93 | obs_data_set_bool(data, "blockUntilTransitionDone", true); |
| 94 | obs_data_set_int(data, "sceneType", 0); |
| 95 | |
| 96 | return data; |
| 97 | } |
| 98 | |
| 99 | // Builds the obs_data blob for a wait action, matching MacroActionWait::Save(). |
| 100 | // |