aboutsummaryrefslogtreecommitdiffstats
path: root/static/modules/obs.js
diff options
context:
space:
mode:
authorDanilo M. <danix@danix.xyz>2026-11-10 11:32:06 +0100
committerDanilo M. <danix@danix.xyz>2026-11-10 11:32:06 +0100
commit24ffea5a7f25b179a8b2fb7f3605a4977c854069 (patch)
tree537d0d784325f7704cccac7e83113b8b57c1bd8b /static/modules/obs.js
parentb5b56e4c1854314fb519d13af9dda80a10ee0b8a (diff)
downloaddeck-it-24ffea5a7f25b179a8b2fb7f3605a4977c854069.tar.gz
deck-it-24ffea5a7f25b179a8b2fb7f3605a4977c854069.zip
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 <noreply@anthropic.com>
Diffstat (limited to 'static/modules/obs.js')
-rw-r--r--static/modules/obs.js25
1 files changed, 20 insertions, 5 deletions
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: '<path d="M11 5 6 9H2v6h4l5 4V5Z"/><path d="m22 9-6 6"/><path d="m16 9 6 6"/>',
eye: '<path d="M2 12s3.5-7 10-7 10 7 10 7-3.5 7-10 7S2 12 2 12Z"/><circle cx="12" cy="12" r="3"/>',
eyeOff: '<path d="m2 2 20 20"/><path d="M6.7 6.7C4.1 8.4 2 12 2 12s3.5 7 10 7c1.7 0 3.2-.4 4.5-1"/><path d="M9.9 4.2C10.6 4.1 11.3 4 12 4c6.5 0 10 7 10 7a18 18 0 0 1-2.2 3.2"/>',
+ pause: '<path d="M9 5v14"/><path d="M15 5v14"/>',
+ resume: '<path d="m7 4 13 8-13 8V4Z"/>',
+ studio: '<rect x="2" y="5" width="9" height="12" rx="1"/><rect x="13" y="5" width="9" height="12" rx="1"/><path d="M8 21h8"/>',
transition: '<path d="M2 7h14l-3-3"/><path d="M22 17H8l3 3"/>',
};
@@ -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) : ""}<span></span>${onLong ? '<i class="gear">⚙</i>' : ""}`;
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"),