From 24ffea5a7f25b179a8b2fb7f3605a4977c854069 Mon Sep 17 00:00:00 2001 From: "Danilo M." Date: Tue, 10 Nov 2026 11:32:06 +0100 Subject: feat(obs): pause, Studio Mode, and working transition tiles The transition tiles listed transition kinds (fade_transition), which SetCurrentSceneTransition rejects and which never matched the current one, so every tile looked inactive. Read GetSceneTransitionList instead. Add a Pause/Resume button, shown while recording, and a Studio toggle. With Studio Mode on, a scene tap cues it in Preview (dashed tile) and the Transition button, shown only then, sends it to Program. Co-Authored-By: Claude Opus 5.5 --- deckit/modules/obs.py | 26 ++++++++++++++++++++------ 1 file changed, 20 insertions(+), 6 deletions(-) (limited to 'deckit/modules') diff --git a/deckit/modules/obs.py b/deckit/modules/obs.py index 491f45f..b50b0af 100644 --- a/deckit/modules/obs.py +++ b/deckit/modules/obs.py @@ -70,9 +70,10 @@ def make(cfg: dict) -> Module: scenes = req("GetSceneList") rec = req("GetRecordStatus") stream = req("GetStreamStatus") - trans = req("GetCurrentSceneTransition") - kinds = req("GetTransitionKindList").get("transitionKinds", []) + # Names, not kinds: SetCurrentSceneTransition takes "Fade", not "fade_transition". + trans = req("GetSceneTransitionList") current = scenes.get("currentProgramSceneName") + studio = req("GetStudioModeEnabled").get("studioModeEnabled", False) sources = [] if current: for item in req("GetSceneItemList", {"sceneName": current}).get("sceneItems", []): @@ -96,11 +97,14 @@ def make(cfg: dict) -> Module: "connected": True, "scenes": [s["sceneName"] for s in scenes.get("scenes", [])], "currentScene": current, + "studio": studio, + "previewScene": scenes.get("currentPreviewSceneName") if studio else None, "recording": rec.get("outputActive", False), + "paused": rec.get("outputPaused", False), "recordingTime": rec.get("outputDuration", 0) / 1000, "streaming": stream.get("outputActive", False), - "transitions": kinds, - "transition": trans.get("transitionName"), + "transitions": [t["transitionName"] for t in trans.get("transitions", [])], + "transition": trans.get("currentSceneTransitionName"), "sources": sources, "inputs": inputs, } @@ -109,7 +113,11 @@ def make(cfg: dict) -> Module: name = body.get("scene") if not isinstance(name, str) or not name: raise ModuleError("scene required") - req("SetCurrentProgramScene", {"sceneName": name}) + # In Studio Mode a tap cues the scene; Transition sends it live. + if req("GetStudioModeEnabled").get("studioModeEnabled"): + req("SetCurrentPreviewScene", {"sceneName": name}) + else: + req("SetCurrentProgramScene", {"sceneName": name}) def flag(body): on = body.get("on") @@ -120,6 +128,12 @@ def make(cfg: dict) -> Module: def record(body): req("StartRecord" if flag(body) else "StopRecord") + def studio(body): + req("SetStudioModeEnabled", {"studioModeEnabled": flag(body)}) + + def pause(body): + req("PauseRecord" if flag(body) else "ResumeRecord") + def stream(body): req("StartStream" if flag(body) else "StopStream") @@ -149,7 +163,7 @@ def make(cfg: dict) -> Module: return Module( name="obs", title="OBS", state=state, - actions={"scene": scene, "record": record, "stream": stream, "mute": mute, + actions={"scene": scene, "record": record, "pause": pause, "studio": studio, "stream": stream, "mute": mute, "volume": volume, "transition": transition, "trigger": trigger, "source": source, "properties": properties}, start=lambda: threading.Thread(target=connect_loop, daemon=True).start(), -- cgit v1.2.3