DJ Brake: warn a few dB before the real limiter
The page moves its limit down by a chosen margin. The limiter itself does not change and the page never reveals the setting. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
1 parent
d6be627f32
commit
910cf3fc17
6 files changed
+39
-9
No files matched your search
+15
-2
@@ -2385,10 +2385,23 @@ function djBrakeCard() {
|
||||
} }, 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 ? djLimiters() : null,
|
||||
S.djbrake ? djMarginOption() : null,
|
||||
S.djbrake ? djHintOptions() : 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 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.")));
|
||||
}
|
||||
|
||||
function djHintOptions() {
|
||||
const save = async (key, on) => {
|
||||
try {
|
||||
@@ -2670,7 +2683,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.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;
|
||||
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]));
|
||||
@@ -2706,7 +2719,7 @@ function connectEvents() {
|
||||
case "dashboard":
|
||||
dashRemote(ev.data); break;
|
||||
case "djbrake":
|
||||
S.djbrake = ev.enabled; S.djIgnore = ev.ignore; S.djHint = ev.hint; S.djHintEn = ev.hint_en; if (S.settings && !S.busy) render(); break;
|
||||
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;
|
||||
case "logo":
|
||||
S.logo = ev.data; showLogo(); if (S.settings) render(); break;
|
||||
case "muteall":
|
||||
|
||||
@@ -683,6 +683,8 @@ const DE = {
|
||||
"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.",
|
||||
};
|
||||
|
||||
const DE_PATTERNS = [
|
||||
|
||||
@@ -993,3 +993,4 @@ body.dashonly .dlink { cursor: default; }
|
||||
.djch.on { opacity: 1; border-color: var(--accent); box-shadow: inset 0 0 0 1px var(--accent); }
|
||||
.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; }
|
||||
Reference in new issue
Block a user