Looks per preset, steadier DJ Brake, no zoom on phones, simple dashboard on touch
Colours and link group names now belong to the preset (by name, the DSP has no IDs) and travel in preset files. DJ Brake: limiters are left out instead of chosen; a slowly falling peak mark, an average bar, a warning before the limit, and it learns from real hits where the limiter sits on the meter. Pinch and double tap zoom are off. On touchscreens the dashboard only offers widget settings. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
1 parent
99613327f8
commit
cf35a1faa1
11 files changed
+232
-48
No files matched your search
+11
-4
@@ -1678,6 +1678,7 @@ function colorCard(d) {
|
||||
g.length > 1 ? h("span", { class: "lnk" }, svgIcon(ICON.link)) : null);
|
||||
};
|
||||
return h("div", { class: "card wide colorbox" }, h("h3", {}, t("Channel colours")),
|
||||
h("p", { class: "info" }, t("Colours and group names belong to the loaded preset (by its name) and come back when you load it.")),
|
||||
h("p", { class: "info" }, t("Shown on the mixer strips and in the channel view. Linked channels share one colour; every colour can only be used once per DSP.")),
|
||||
h("div", { class: "colgrid" },
|
||||
h("div", {}, h("div", { class: "sub" }, t("Inputs")), chanGroups(d, "in").map(g => row("in", g))),
|
||||
@@ -2401,7 +2402,12 @@ function djMarginOption() {
|
||||
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("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")));
|
||||
}
|
||||
|
||||
function djHintOptions() {
|
||||
@@ -2426,11 +2432,12 @@ function djLimiters() {
|
||||
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")),
|
||||
return h("div", { class: "djlim" }, h("b", {}, t("Leave out these limiters")),
|
||||
h("p", { class: "info" }, t("All others count. Muted outputs never 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) },
|
||||
const out = (S.djIgnore[d.id] || []).includes(i);
|
||||
return h("button", { class: "djch" + (out ? " out" : ""), "aria-pressed": String(out), 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.")));
|
||||
}
|
||||
|
||||
+8
-6
@@ -10,6 +10,8 @@ const DASH_DEFAULT = () => [
|
||||
].map((m, i) => ({ id: `m${i}`, cfg: {}, ...m }));
|
||||
|
||||
let dashEdit = false, dashTimer = 0, dashSaveTimer = 0;
|
||||
// dragging modules around is no good on a touchscreen: there only their settings can be changed
|
||||
const dashTouch = () => matchMedia("(pointer: coarse)").matches;
|
||||
const dashBrowse = new Map(); // module id -> { kind, idx, band }
|
||||
|
||||
const dashMods = () => S.dash || (S.dash = DASH_DEFAULT());
|
||||
@@ -377,15 +379,15 @@ function dashModule(m) {
|
||||
const controls = dashEdit ? (() => {
|
||||
return h("div", { class: "dctl" },
|
||||
h("button", { class: "small", "aria-label": t("Module settings"), title: t("Module settings"), onclick: () => dashSettings(m) }, "⚙"),
|
||||
h("button", { class: "small danger", "aria-label": t("Remove"), title: t("Remove"), onclick: () => {
|
||||
dashTouch() ? null : h("button", { class: "small danger", "aria-label": t("Remove"), title: t("Remove"), onclick: () => {
|
||||
dashMods().splice(dashMods().indexOf(m), 1); dashSave(); render();
|
||||
} }, "×"));
|
||||
})() : null;
|
||||
const head = h("h3", { title: dashEdit ? t("Drag to move") : null }, svgIcon(def.icon), h("span", { class: "grow dtitle" }, m.cfg.title || def.title()),
|
||||
const head = h("h3", { title: dashEdit && !dashTouch() ? t("Drag to move") : null }, svgIcon(def.icon), h("span", { class: "grow dtitle" }, m.cfg.title || def.title()),
|
||||
d && dashDevs().length > 1 ? h("small", { class: "ddev" }, d.name) : null, controls);
|
||||
const el = h("section", { class: `card dmod dt-${m.type}`, style: dashSizeStyle(m.w, dashHeight(m, d)) },
|
||||
head, h("div", { class: "dbody" }, body));
|
||||
if (dashEdit) {
|
||||
if (dashEdit && !dashTouch()) {
|
||||
head.addEventListener("pointerdown", e => { if (!e.target.closest("button")) dashDrag(e, { mod: m }, head); });
|
||||
const handle = (axes, cls, arrow, label) => {
|
||||
const g = h("span", { class: "dgrab " + cls, title: label }, arrow);
|
||||
@@ -403,9 +405,9 @@ function viewDash() {
|
||||
const mods = dashMods();
|
||||
return [
|
||||
h("div", { class: "dhead" }, h("h2", {}, "Dashboard"),
|
||||
viewOnly() ? null : h("button", { class: dashEdit ? "on" : "", onclick: () => { dashEdit = !dashEdit; render(); } }, dashEdit ? t("Done") : t("Customise"))),
|
||||
dashEdit ? dashPalette() : null,
|
||||
mods.length ? h("div", { class: "dash" + (dashEdit ? " editing" : "") }, mods.map(dashModule))
|
||||
viewOnly() ? null : h("button", { class: dashEdit ? "on" : "", onclick: () => { dashEdit = !dashEdit; render(); } }, dashEdit ? t("Done") : dashTouch() ? t("Widget settings") : t("Customise"))),
|
||||
dashEdit && !dashTouch() ? dashPalette() : null,
|
||||
mods.length ? h("div", { class: "dash" + (dashEdit && !dashTouch() ? " editing" : "") }, mods.map(dashModule))
|
||||
: h("div", { class: "dash" + (dashEdit ? " editing" : "") }, h("div", { class: "dmod dblank", style: dashSizeStyle(12, 4) }, t("Nothing here yet – press “Customise” and add modules."))),
|
||||
];
|
||||
}
|
||||
|
||||
+25
-10
@@ -2,12 +2,13 @@
|
||||
<html>
|
||||
<head>
|
||||
<meta charset="utf-8">
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1, viewport-fit=cover">
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1, user-scalable=no, viewport-fit=cover">
|
||||
<meta name="theme-color" content="#000000">
|
||||
<meta name="mobile-web-app-capable" content="yes">
|
||||
<meta name="apple-mobile-web-app-capable" content="yes">
|
||||
<title>DJ Brake</title>
|
||||
<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; }
|
||||
|
||||
@@ -30,6 +31,7 @@
|
||||
#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; }
|
||||
@@ -41,6 +43,12 @@
|
||||
#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); }
|
||||
@@ -59,7 +67,7 @@
|
||||
<div id="word">—</div>
|
||||
</div>
|
||||
<div id="gauge">
|
||||
<div id="track"><div id="cover"></div><div id="ticks"></div></div>
|
||||
<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>
|
||||
@@ -70,9 +78,9 @@
|
||||
(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" }
|
||||
: { on: "LIMITER", more: "More gain won't help", lost: "No connection", none: "No limiter being watched", quiet: "No signal", left: " dB to the limiter" };
|
||||
var word = document.getElementById("word"), sub = document.getElementById("sub"), cover = document.getElementById("cover");
|
||||
? { 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");
|
||||
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;
|
||||
@@ -86,8 +94,14 @@
|
||||
gap = next;
|
||||
}
|
||||
|
||||
function show(on, main, small) {
|
||||
document.body.className = on ? "on" : "";
|
||||
// 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" : "";
|
||||
word.textContent = main;
|
||||
sub.textContent = small;
|
||||
}
|
||||
@@ -96,7 +110,7 @@
|
||||
var s = state;
|
||||
if (!s) return;
|
||||
if (s.on) show(true, text.on, text.more);
|
||||
else if (s.ready) show(false, "OK", closest == null ? text.quiet : closest.toFixed(1) + text.left);
|
||||
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;
|
||||
}
|
||||
@@ -105,12 +119,13 @@
|
||||
es.onmessage = function (e) {
|
||||
var s = JSON.parse(e.data), was = state && state.on;
|
||||
state = s;
|
||||
bar(s.on ? 0 : s.room);
|
||||
bar(s.avg);
|
||||
mark(s.on ? 0 : s.room);
|
||||
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();
|
||||
};
|
||||
es.onerror = function () { state = null; bar(null); show(false, "—", text.lost); };
|
||||
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);
|
||||
|
||||
|
||||
+7
-1
@@ -678,7 +678,6 @@ const DE = {
|
||||
"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.",
|
||||
"Limiters that count": "Diese Limiter zählen",
|
||||
"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",
|
||||
@@ -701,6 +700,13 @@ const DE = {
|
||||
"“Sub”: where the subs add up and where they cancel at the chosen frequency.": "„Sub“: wo sich die Subs bei der gewählten Frequenz addieren und wo sie sich auslöschen.",
|
||||
"“Timing”: marked areas mean a delay arrives before the mains or more than 30 ms late.": "„Timing“: Markierte Flächen bedeuten, dass ein Delay vor den Mains oder mehr als 30 ms zu spät ankommt.",
|
||||
"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",
|
||||
};
|
||||
|
||||
const DE_PATTERNS = [
|
||||
|
||||
+6
-1
@@ -2,7 +2,7 @@
|
||||
<html lang="en">
|
||||
<head>
|
||||
<meta charset="utf-8">
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1, viewport-fit=cover">
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1, user-scalable=no, viewport-fit=cover">
|
||||
<meta name="theme-color" content="#0b0c0f">
|
||||
<meta name="mobile-web-app-capable" content="yes">
|
||||
<meta name="apple-mobile-web-app-capable" content="yes">
|
||||
@@ -12,6 +12,11 @@
|
||||
<link rel="icon" href="data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 32 32'%3E%3Crect width='32' height='32' rx='6' fill='%23111418'/%3E%3Cpath d='M7 22V10M13 22V6M19 22V14M25 22V9' stroke='%2338bdf8' stroke-width='3' stroke-linecap='round'/%3E%3C/svg%3E">
|
||||
</head>
|
||||
<body>
|
||||
<script>
|
||||
// no zoom on phones and tablets: it breaks the faders. Safari ignores the viewport tag for this
|
||||
["gesturestart", "gesturechange", "gestureend"].forEach(function (t) { document.addEventListener(t, function (e) { e.preventDefault(); }); });
|
||||
document.addEventListener("touchmove", function (e) { if (e.touches.length > 1) e.preventDefault(); }, { passive: false });
|
||||
</script>
|
||||
<div id="splash" aria-hidden="true">
|
||||
<svg viewBox="0 0 32 32" width="72" height="72"><path d="M7 22V10"/><path d="M13 22V6"/><path d="M19 22V14"/><path d="M25 22V9"/></svg>
|
||||
<b>DSP Control</b><small>VK-Audio</small>
|
||||
|
||||
+5
-2
@@ -1006,9 +1006,10 @@ body.dashonly .dlink { cursor: default; }
|
||||
.djdev { margin-top: 8px; }
|
||||
.djdev > small { display: block; margin-bottom: 4px; color: var(--dim); }
|
||||
.djchs { display: flex; flex-wrap: wrap; gap: 6px; }
|
||||
.djch { display: flex; flex-direction: column; align-items: center; min-width: 58px; padding: 5px 8px; line-height: 1.2; opacity: .55; }
|
||||
.djch { display: flex; flex-direction: column; align-items: center; min-width: 58px; padding: 5px 8px; line-height: 1.2; }
|
||||
.djch small { font-size: 10px; color: var(--dim); }
|
||||
.djch.on { opacity: 1; border-color: var(--accent); box-shadow: inset 0 0 0 1px var(--accent); }
|
||||
.djch.out { border-color: var(--warn); color: var(--warn); background: color-mix(in srgb, var(--warn) 12%, transparent); text-decoration: line-through; }
|
||||
.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; }
|
||||
@@ -1042,3 +1043,5 @@ 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; }
|
||||
Reference in new issue
Block a user