DJ Brake: choose which limiters count, horizontal distance to the limiter

Outputs can be left out per device, muted outputs never count. The page also
shows how far the closest watched output is from its limiter threshold.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
GivouandClaude Opus 5.5 committed 2026-11-02 18:42:56 +01:00
1 parent e56524a8cd
commit 8919f0016c
7 files changed
+136 -30

No files matched your search

+21 -3
View File
@@ -2384,7 +2384,25 @@ function djBrakeCard() {
try { await navigator.clipboard.writeText(url); toast(t("Address copied")); } catch { toast(url); }
} }, t("Copy"))) : null,
S.djbrake && !url ? h("p", { class: "info djwarn" }, t("Switch on remote access below so other devices can reach it.")) : null,
S.djbrake ? h("p", { class: "info" }, t("Anyone in your network can open it without a PIN. It shows only the light, watches all outputs of all connected DSPs and changes nothing.")) : null);
S.djbrake ? djLimiters() : null,
S.djbrake ? h("p", { class: "info" }, t("Anyone in your network can open it without a PIN. It shows only the light and the distance to the limiter and changes nothing.")) : null);
}
function djLimiters() {
const devs = S.order.map(id => S.devices[id]).filter(d => d.state && !d.demo);
const toggle = async (id, i) => {
const cur = S.djIgnore[id] || [];
const ignore = { ...S.djIgnore, [id]: cur.includes(i) ? cur.filter(x => x !== i) : [...cur, i] };
try { S.djIgnore = (await api("PUT", "/api/djbrake", { ignore })).ignore; render(); }
catch (e) { toast(t("Error: ") + trMsg(e.message)); }
};
return h("div", { class: "djlim" }, h("b", {}, t("Limiters that count")),
devs.length ? devs.map(d => h("div", { class: "djdev" }, devs.length > 1 ? h("small", {}, d.name) : null,
h("div", { class: "djchs" }, chans(d, "out").map((c, i) => {
const on = !(S.djIgnore[d.id] || []).includes(i);
return h("button", { class: "djch" + (on ? " on" : ""), "aria-pressed": String(on), onclick: () => toggle(d.id, i) },
chLabel("out", i), c.name ? h("small", {}, c.name) : null);
})))) : h("p", { class: "info" }, t("Connect a DSP to choose.")));
}
function langCard() {
@@ -2637,7 +2655,7 @@ function connectEvents() {
if (ev.muteall) { S.muteAll = ev.muteall.active; showMuteAll(); }
if (ev.soundfield) S.sf = ev.soundfield;
if ("dashboard" in ev) S.dash = ev.dashboard && ev.dashboard.modules;
S.djbrake = !!ev.djbrake;
S.djbrake = !!ev.djbrake; S.djIgnore = ev.dj_ignore || {};
if ("logo" in ev) { S.logo = ev.logo; showLogo(); }
if (S.demo.enabled && S.devices.demo && !S.devices[S.cur]?.demo) S.cur = "demo";
S.order.forEach(id => maybeAskUnlock(S.devices[id]));
@@ -2673,7 +2691,7 @@ function connectEvents() {
case "dashboard":
dashRemote(ev.data); break;
case "djbrake":
S.djbrake = ev.enabled; if (S.settings) render(); break;
S.djbrake = ev.enabled; S.djIgnore = ev.ignore; if (S.settings && !S.busy) render(); break;
case "logo":
S.logo = ev.data; showLogo(); if (S.settings) render(); break;
case "muteall":