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 --- static/modules/obs.js | 25 ++++++++++++++++++++----- 1 file changed, 20 insertions(+), 5 deletions(-) (limited to 'static/modules') diff --git a/static/modules/obs.js b/static/modules/obs.js index 5005ffc..6842522 100644 --- a/static/modules/obs.js +++ b/static/modules/obs.js @@ -27,6 +27,9 @@ const ICONS = { muted: '', eye: '', eyeOff: '', + pause: '', + resume: '', + studio: '', transition: '', }; @@ -63,18 +66,29 @@ function renderTransport(box, s) { const rec = bigButton("rec", "record", s.recording ? "Stop" : "Record", s.recording, s.recording ? clock(s.recordingTime) : ""); rec.onclick = () => post("record", { on: !s.recording }); + box.append(rec); + if (s.recording) { + const pause = bigButton("pause", s.paused ? "resume" : "pause", s.paused ? "Resume" : "Pause", s.paused); + pause.onclick = () => post("pause", { on: !s.paused }); + box.append(pause); + } const stream = bigButton("live", "stream", s.streaming ? "Stop stream" : "Stream", s.streaming); stream.onclick = () => post("stream", { on: !s.streaming }); - const trigger = bigButton("trig", "transition", "Transition", false); - trigger.onclick = () => post("trigger"); - box.append(rec, stream, trigger); + const studio = bigButton("studio", "studio", "Studio", s.studio); + studio.onclick = () => post("studio", { on: !s.studio }); + box.append(stream, studio); + if (s.studio) { + const trigger = bigButton("trig", "transition", "Transition", false); + trigger.onclick = () => post("trigger"); + box.append(trigger); + } } function renderTiles(box, items, onPick, onLong) { box.textContent = ""; for (const item of items) { const b = document.createElement("button"); - b.className = `tile${item.on ? " on" : ""}`; + b.className = `tile${item.on ? " on" : ""}${item.cue ? " cue" : ""}`; b.innerHTML = `${item.icon ? icon(item.icon) : ""}${onLong ? '⚙' : ""}`; b.querySelector("span").textContent = item.label; let timer = null; @@ -170,7 +184,8 @@ export default { } renderTransport(transport, state); renderTiles(el.querySelector(".scenes"), - (state.scenes ?? []).map((name) => ({ label: name, icon: "scene", on: name === state.currentScene })), + (state.scenes ?? []).map((name) => ({ label: name, icon: "scene", on: name === state.currentScene, + cue: state.studio && name === state.previewScene && name !== state.currentScene })), (item) => post("scene", { scene: item.label })); if (!el._pressing) { renderTiles(el.querySelector(".sources"), -- cgit v1.2.3