DJ Brake only shows the limiter acting; presets without a look start empty
The distance to the limiter, its bar, the warn-earlier slider and the learning are gone: the page follows the DSP's limiter bits, with one second hold. Left out limiters stay. A preset without colours and group names of its own no longer inherits the ones from the preset before. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
1 parent
63b3c17fb7
commit
4a6eb2f513
9 files changed
+110
-304
No files matched your search
+3
-21
@@ -2422,26 +2422,8 @@ function djBrakeCard() {
|
||||
try { await navigator.clipboard.writeText(url); toast(t("Address copied")); } catch { toast(url); }
|
||||
} }, t("Copy")))) : null,
|
||||
S.djbrake && reachable ? djLimiters() : null,
|
||||
S.djbrake && reachable ? djMarginOption() : null,
|
||||
S.djbrake && reachable ? djHintOptions() : null,
|
||||
S.djbrake && reachable ? 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 djMarginOption() {
|
||||
const val = h("b", {}, `${S.djMargin} dB`);
|
||||
const input = h("input", { type: "range", min: 0, max: 12, step: 1, value: S.djMargin, "aria-label": t("Warn earlier"),
|
||||
oninput: () => { val.textContent = `${input.value} dB`; },
|
||||
onchange: async () => {
|
||||
try { S.djMargin = (await api("PUT", "/api/djbrake", { margin: +input.value })).margin; }
|
||||
catch (e) { toast(t("Error: ") + trMsg(e.message)); render(); }
|
||||
} });
|
||||
return h("div", { class: "djlim" }, h("div", { class: "row" }, h("b", { class: "grow" }, t("Warn earlier")), val), input,
|
||||
h("p", { class: "info" }, t("The page acts as if the limiter came this much earlier, so the DJ stays below the real one. The limiter itself does not change and the page does not show this setting.")),
|
||||
h("p", { class: "info" }, t("With every real limiter hit the page learns where the limiter sits on the meter, so the distance gets more accurate.")),
|
||||
h("button", { class: "small", onclick: async () => {
|
||||
try { await api("PUT", "/api/djbrake", { relearn: true }); toast(t("Learned limiter levels forgotten")); }
|
||||
catch (e) { toast(t("Error: ") + trMsg(e.message)); }
|
||||
} }, t("Forget learned levels")));
|
||||
S.djbrake && reachable ? h("p", { class: "info" }, t("Anyone in your network can open it without a PIN. It shows only the light and changes nothing.")) : null);
|
||||
}
|
||||
|
||||
function djHintOptions() {
|
||||
@@ -2726,7 +2708,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.djIgnore = ev.dj_ignore || {}; S.djHint = ev.dj_hint !== false; S.djHintEn = ev.dj_hint_en !== false; S.djMargin = ev.dj_margin || 0;
|
||||
S.djbrake = !!ev.djbrake; S.djIgnore = ev.dj_ignore || {}; S.djHint = ev.dj_hint !== false; S.djHintEn = ev.dj_hint_en !== false;
|
||||
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]));
|
||||
@@ -2764,7 +2746,7 @@ function connectEvents() {
|
||||
case "reset":
|
||||
appWasReset(); break;
|
||||
case "djbrake":
|
||||
S.djbrake = ev.enabled; S.djIgnore = ev.ignore; S.djHint = ev.hint; S.djHintEn = ev.hint_en; S.djMargin = ev.margin; if (S.settings && !S.busy) render(); break;
|
||||
S.djbrake = ev.enabled; S.djIgnore = ev.ignore; S.djHint = ev.hint; S.djHintEn = ev.hint_en; if (S.settings && !S.busy) render(); break;
|
||||
case "logo":
|
||||
S.logo = ev.data; showLogo(); if (S.settings) render(); break;
|
||||
case "muteall":
|
||||
|
||||
+18
-70
@@ -10,45 +10,26 @@
|
||||
<style>
|
||||
html { touch-action: manipulation; }
|
||||
html, body { height: 100%; margin: 0; background: #050608; color: #fff; font-family: system-ui, -apple-system, "Segoe UI", sans-serif; overflow: hidden; }
|
||||
body { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 4vmin; text-align: center; -webkit-user-select: none; user-select: none; }
|
||||
body { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 5vmin; text-align: center; -webkit-user-select: none; user-select: none; }
|
||||
|
||||
/* comes on fast, goes out slowly: the eye catches it and it never flickers */
|
||||
#wash, #halo, #core { transition: opacity .7s ease-out; opacity: 0; }
|
||||
/* on at once, off quickly: the server already holds it for a second after the limiter */
|
||||
#wash, #halo, #core { transition: opacity .25s ease-out; opacity: 0; }
|
||||
body.on #wash, body.on #halo, body.on #core { transition: opacity .09s ease-out; opacity: 1; }
|
||||
|
||||
#wash { position: fixed; inset: 0; background: radial-gradient(circle at 50% 46%, #6e0a0a 0%, #2a0505 42%, #050608 78%); }
|
||||
#lamp { position: relative; width: 52vmin; height: 52vmin; display: grid; place-items: center; }
|
||||
#lamp { position: relative; width: 64vmin; height: 64vmin; display: grid; place-items: center; }
|
||||
#halo, #core, #glass, #ring { position: absolute; inset: 0; border-radius: 50%; }
|
||||
#glass { background: radial-gradient(circle at 50% 38%, #171a20, #0b0d11 70%); box-shadow: inset 0 0 0 1px #ffffff14; }
|
||||
#core { background: radial-gradient(circle at 50% 36%, #ff6a5c 0%, #f4201c 46%, #b80c0f 100%); box-shadow: inset 0 0 0 1px #ffb3a8, inset 0 -3vmin 7vmin #5e000380; }
|
||||
#halo { inset: -7vmin; background: radial-gradient(circle, #ff2a1f 44%, #ff2a1f00 70%); filter: blur(3vmin); }
|
||||
#ring { border: .5vmin solid #ff5a4c; opacity: 0; pointer-events: none; }
|
||||
#word { position: relative; font-size: 8.6vmin; font-weight: 800; letter-spacing: .03em; line-height: 1; color: #4b5260; transition: color .5s; }
|
||||
#sub { position: relative; min-height: 1.3em; font-size: 4.4vmin; font-weight: 500; color: #8b93a1; transition: color .5s; font-variant-numeric: tabular-nums; }
|
||||
|
||||
/* distance to the limiter: the colours belong to the scale, the dark cover shows what is still left */
|
||||
#gauge { position: relative; width: min(88vw, 130vmin); }
|
||||
#track { position: relative; height: 3.6vmin; border-radius: 1.8vmin; overflow: hidden; box-shadow: 0 0 0 1px #ffffff1c;
|
||||
background: linear-gradient(90deg, #17a34a 0%, #22c55e 55%, #eab308 78%, #f97316 90%, #ef2b24 100%); }
|
||||
#cover { position: absolute; top: 0; right: 0; bottom: 0; width: 100%; background: #12151a; }
|
||||
#peak { position: absolute; top: 0; bottom: 0; left: 0; width: .7vmin; margin-left: -.35vmin; border-radius: .35vmin; background: #fff; box-shadow: 0 0 1vmin #0009; opacity: 0; transition: left .5s ease-out, opacity .3s; }
|
||||
#ticks { position: absolute; inset: 0; background: repeating-linear-gradient(90deg, transparent 0 calc(20% - 2px), #050608b0 calc(20% - 2px) 20%); }
|
||||
#scale { position: relative; height: 3vmin; margin-top: 1vmin; font-size: 2.3vmin; color: #6b7280; font-variant-numeric: tabular-nums; }
|
||||
#scale span { position: absolute; transform: translateX(-50%); white-space: nowrap; }
|
||||
#scale span:first-child { transform: none; }
|
||||
#scale span:last-child { transform: translateX(-100%); }
|
||||
body.on #scale { color: #ffc9c4; }
|
||||
#word { position: relative; font-size: 10.5vmin; font-weight: 800; letter-spacing: .03em; line-height: 1; color: #4b5260; transition: color .25s; }
|
||||
#sub { position: relative; min-height: 1.3em; font-size: 4.4vmin; font-weight: 500; color: #8b93a1; transition: color .25s; }
|
||||
#hint { position: relative; max-width: 88vw; font-size: 2.8vmin; color: #6b7280; transition: color .25s; }
|
||||
body.on #word { color: #fff; transition: color .09s; }
|
||||
body.on #sub { color: #ffd9d4; transition: color .09s; }
|
||||
#hint { position: relative; max-width: 88vw; font-size: 2.8vmin; color: #6b7280; transition: color .5s; }
|
||||
body.on #hint { color: #ffc9c4; transition: color .09s; }
|
||||
|
||||
/* nearly there: warned in time, without the alarm */
|
||||
body.near #word { color: #f59e0b; }
|
||||
body.near #sub { color: #fbbf24; }
|
||||
#glass { transition: box-shadow .5s; }
|
||||
body.near #glass { box-shadow: inset 0 0 0 1px #f59e0b99, 0 0 5vmin #f59e0b33; }
|
||||
|
||||
/* while it lasts: slow breathing, one ring on each new hit, no hard flashing */
|
||||
body.on #halo { animation: breathe 2.2s ease-in-out infinite; }
|
||||
body.on #ring { animation: ripple .9s cubic-bezier(.2, .6, .3, 1); }
|
||||
@@ -66,68 +47,35 @@
|
||||
<div id="core"></div>
|
||||
<div id="word">—</div>
|
||||
</div>
|
||||
<div id="gauge">
|
||||
<div id="track"><div id="cover"></div><div id="ticks"></div><div id="peak"></div></div>
|
||||
<div id="scale"><span style="left:0">−30</span><span style="left:20%">−24</span><span style="left:40%">−18</span><span style="left:60%">−12</span><span style="left:80%">−6</span><span style="left:100%">0 dB</span></div>
|
||||
</div>
|
||||
<div id="sub"></div>
|
||||
<div id="hint"></div>
|
||||
<script>
|
||||
// Red light for the DJ: comes on while a limiter of a connected DSP is working.
|
||||
// Red light for the DJ: comes on when a limiter of a connected DSP acts.
|
||||
// On its own on purpose: this page needs no PIN and gets nothing but this one state from the server.
|
||||
(function () {
|
||||
var de = /^de/i.test(navigator.language || "");
|
||||
var text = de
|
||||
? { on: "LIMITER", more: "Mehr Gas bringt nichts", lost: "Keine Verbindung", none: "Kein Limiter überwacht", quiet: "Kein Signal", left: " dB bis zum Limiter", close: "KNAPP" }
|
||||
: { on: "LIMITER", more: "More gain won't help", lost: "No connection", none: "No limiter being watched", quiet: "No signal", left: " dB to the limiter", close: "CLOSE" };
|
||||
var word = document.getElementById("word"), sub = document.getElementById("sub"), cover = document.getElementById("cover"), peak = document.getElementById("peak");
|
||||
var hint = document.getElementById("hint");
|
||||
? { on: "LIMITER", more: "Mehr Gas bringt nichts", lost: "Keine Verbindung", none: "Kein Limiter überwacht" }
|
||||
: { on: "LIMITER", more: "More gain won't help", lost: "No connection", none: "No limiter being watched" };
|
||||
var word = document.getElementById("word"), sub = document.getElementById("sub"), hint = document.getElementById("hint");
|
||||
var notes = { en: "The limiter is a safety net, not the target. Stay below it.", de: "Der Limiter ist die Sicherung, nicht das Ziel. Bleib darunter." };
|
||||
var RANGE = 30, gap = 100, state = null, closest = null;
|
||||
document.documentElement.lang = de ? "de" : "en";
|
||||
|
||||
// rises at once, falls slowly, like a level meter
|
||||
function bar(room) {
|
||||
var next = room == null ? 100 : Math.min(100, room / RANGE * 100);
|
||||
cover.style.transition = "width " + (next < gap ? ".08s" : ".6s") + " ease-out";
|
||||
cover.style.width = next + "%";
|
||||
gap = next;
|
||||
}
|
||||
|
||||
// the white mark: the recent peaks, falling slowly. The bar: the average of the last seconds
|
||||
function mark(room) {
|
||||
peak.style.opacity = room == null ? 0 : 1;
|
||||
if (room != null) peak.style.left = 100 - Math.min(100, room / RANGE * 100) + "%";
|
||||
}
|
||||
|
||||
function show(on, main, small, near) {
|
||||
document.body.className = on ? "on" : near ? "near" : "";
|
||||
function show(on, main, small) {
|
||||
document.body.className = on ? "on" : "";
|
||||
word.textContent = main;
|
||||
sub.textContent = small;
|
||||
}
|
||||
|
||||
function draw() {
|
||||
var s = state;
|
||||
if (!s) return;
|
||||
if (s.on) show(true, text.on, text.more);
|
||||
else if (s.ready) show(false, closest != null && closest <= 3 ? text.close : "OK", closest == null ? text.quiet : closest.toFixed(1) + text.left, closest != null && closest <= 3);
|
||||
else show(false, "—", text.none);
|
||||
closest = s.room;
|
||||
}
|
||||
|
||||
var es = new EventSource("/djbrake/state");
|
||||
es.onmessage = function (e) {
|
||||
var s = JSON.parse(e.data), was = state && state.on;
|
||||
state = s;
|
||||
bar(s.avg);
|
||||
mark(s.on ? 0 : s.room);
|
||||
var s = JSON.parse(e.data);
|
||||
hint.textContent = !s.hint ? "" : s.hint === "auto" && de ? notes.de : notes.en;
|
||||
if (s.room != null && (closest == null || s.room < closest)) closest = s.room;
|
||||
if (s.on !== was || !s.ready) draw();
|
||||
if (s.on) show(true, text.on, text.more);
|
||||
else if (s.ready) show(false, "OK", "");
|
||||
else show(false, "—", text.none);
|
||||
};
|
||||
es.onerror = function () { state = null; bar(null); mark(null); show(false, "—", text.lost); };
|
||||
// the number shows the closest value of the last moment: a figure jumping ten times a second can't be read
|
||||
setInterval(draw, 500);
|
||||
es.onerror = function () { show(false, "—", text.lost); };
|
||||
|
||||
// keep the screen on where the browser allows it
|
||||
function awake() { if (navigator.wakeLock) navigator.wakeLock.request("screen").catch(function () {}); }
|
||||
|
||||
+1
-6
@@ -677,12 +677,9 @@ const DE = {
|
||||
"Share the page /djbrake": "Seite /djbrake freigeben",
|
||||
"Address copied": "Adresse kopiert",
|
||||
"Only reachable while remote access is on.": "Nur erreichbar, solange der Fernzugriff an ist.",
|
||||
"Anyone in your network can open it without a PIN. It shows only the light and the distance to the limiter and changes nothing.": "Jeder in deinem Netzwerk kann sie ohne PIN öffnen. Sie zeigt nur das Licht und den Abstand zum Limiter und ändert nichts.",
|
||||
"Connect a DSP to choose.": "Verbinde einen DSP, um auszuwählen.",
|
||||
"Show a short note that the limiter is not the goal": "Kurzen Hinweis anzeigen, dass der Limiter nicht das Ziel ist",
|
||||
"Note always in English": "Hinweis immer auf Englisch",
|
||||
"Warn earlier": "Früher warnen",
|
||||
"The page acts as if the limiter came this much earlier, so the DJ stays below the real one. The limiter itself does not change and the page does not show this setting.": "Die Seite tut so, als käme der Limiter um diesen Wert früher, damit der DJ unter dem echten bleibt. Der Limiter selbst ändert sich nicht, und die Seite zeigt diese Einstellung nicht.",
|
||||
"Overview": "Überblick",
|
||||
"Correcting": "Korrigieren",
|
||||
"Comparing": "Vergleichen",
|
||||
@@ -702,9 +699,6 @@ const DE = {
|
||||
"The “Delays” table: distance and delay per speaker, next to what is set on the DSP now.": "Die Tabelle „Delays“: Abstand und Delay pro Lautsprecher, daneben der aktuelle Wert auf dem DSP.",
|
||||
"Leave out these limiters": "Diese Limiter ausnehmen",
|
||||
"All others count. Muted outputs never count.": "Alle anderen zählen. Stummgeschaltete Ausgänge zählen nie.",
|
||||
"With every real limiter hit the page learns where the limiter sits on the meter, so the distance gets more accurate.": "Bei jedem echten Limiter-Treffer lernt die Seite, wo der Limiter auf dem Meter sitzt. So wird der Abstand genauer.",
|
||||
"Learned limiter levels forgotten": "Gelernte Limiter-Pegel vergessen",
|
||||
"Forget learned levels": "Gelernte Pegel vergessen",
|
||||
"Colours and group names belong to the loaded preset (by its name) and come back when you load it.": "Farben und Gruppennamen gehören zum geladenen Preset (über seinen Namen) und kommen beim Laden wieder.",
|
||||
"Widget settings": "Widget-Einstellungen",
|
||||
"Reset all app settings…": "Alle App-Einstellungen zurücksetzen…",
|
||||
@@ -727,6 +721,7 @@ const DE = {
|
||||
"All settings in the DSPs": "Alle Einstellungen in den DSPs",
|
||||
"Presets in the DSPs": "Presets in den DSPs",
|
||||
"A copy of the old app settings": "Eine Kopie der alten App-Einstellungen",
|
||||
"Anyone in your network can open it without a PIN. It shows only the light and changes nothing.": "Jeder in deinem Netzwerk kann sie ohne PIN öffnen. Sie zeigt nur das Licht und ändert nichts.",
|
||||
};
|
||||
|
||||
const DE_PATTERNS = [
|
||||
|
||||
@@ -1012,7 +1012,6 @@ body.dashonly .dlink { cursor: default; }
|
||||
.djch.out small { color: inherit; }
|
||||
.djlim label.chk { display: flex; align-items: flex-start; gap: 8px; margin-top: 8px; }
|
||||
.djlim label.chk input { flex: none; margin: 3px 0 0; }
|
||||
.djlim input[type=range] { width: 100%; margin: 8px 0 4px; }
|
||||
.row.djurl button.small { flex: 0 0 auto; width: auto; padding-inline: 14px; }
|
||||
.row.djurl code { flex: 1 1 auto; }
|
||||
/* ---- UI pass: controls of one kind line up and have one size */
|
||||
@@ -1044,7 +1043,6 @@ label.chk input { flex: none; width: 18px; height: 18px; margin: 1px 0 0; accent
|
||||
@media (max-width: 600px) { .cards .card > h3 { flex-wrap: wrap; row-gap: 6px; height: auto; } .cards .card > h3 > * { min-width: 0; } }
|
||||
.docui { padding: 0 4px; }
|
||||
html { touch-action: pan-x pan-y; }
|
||||
.djlim > button.small { margin-top: 8px; }
|
||||
.dialog:has(> .resetbody) { width: min(520px, 100%); padding: 22px; }
|
||||
.dialog:has(> .resetbody) > h2 { display: flex; align-items: center; gap: 12px; margin-bottom: 10px; font-size: 19px; }
|
||||
.dialog:has(> .resetbody) > h2::before { content: "!"; flex: none; display: grid; place-items: center; width: 34px; height: 34px; border-radius: 50%; font-size: 19px; font-weight: 800;
|
||||
|
||||
Reference in new issue
Block a user