Lock option: only show dashboard while locked; Sound Lab only in the desktop apps

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
GivouandClaude Opus 5.5 committed 2026-11-02 18:23:35 +01:00
1 parent 9203cab4df
commit f043e1a261
10 files changed
+58 -19

No files matched your search

+24 -3
View File
@@ -626,6 +626,7 @@ function renderTabs() {
$("#btn-settings").disabled = testLock;
document.querySelectorAll("#viewtabs button").forEach(b => {
if (b.dataset.view === "fir") b.hidden = !(dev() && dev().fir);
if (b.dataset.view === "lab") b.hidden = !S.isApp;
b.classList.toggle("active", !S.settings && b.dataset.view === S.view);
b.disabled = testLock && b.dataset.view !== "test";
});
@@ -1359,7 +1360,7 @@ function peqCard(d, kind, idx) {
const card = h("div", { class: "card wide" + (ch.peq_bypass ? " eq-off" : "") },
h("h3", {}, h("span", { class: "grow" }, t("Parametric EQ")), modeSeg,
d.fir ? null : toggleBtn("EQ Bypass", kind, idx, "peq_bypass", "small bypass", v => { card.classList.toggle("eq-off", v); renderBand(); redraw(); }),
h("button", { class: "small rewbtn", "data-view-ok": "", title: t("Open this channel in Sound Lab (REW)"), onclick: () => openLab(kind, idx) }, "REW"),
S.isApp ? h("button", { class: "small", "data-view-ok": "", title: t("Open this channel in Sound Lab (REW)"), onclick: () => openLab(kind, idx) }, "REW") : null,
h("button", { class: "small", onclick: async () => {
if (!await askConfirm(t("Reset EQ"), t("Set all PEQ bands of this channel to 0 dB and clear bypass?"), t("All flat"))) return;
chans(dev(), kind)[idx].peq.forEach((bb, i) => {
@@ -2232,6 +2233,16 @@ function backupCard() {
}
// Desktop app only: let phones/tablets on the LAN use this PC as server (they need the PIN)
function lockOptionCard() {
const box = h("input", { type: "checkbox", checked: !!S.lockDash, onchange: async () => {
try { S.lockDash = (await api("POST", "/api/lock-dash", { enabled: box.checked })).enabled; }
catch (e) { box.checked = !!S.lockDash; toast(t("Error: ") + trMsg(e.message)); }
} });
return h("div", { class: "card" }, h("h3", {}, t("Lock")),
h("label", { class: "chk" }, box, t("Only show dashboard while locked")),
h("p", { class: "info" }, t("With the lock on, this window then shows just your dashboard, until it is unlocked with the PIN.")));
}
function remoteCard() {
const r = S.remote || { enabled: false, port: 8080, urls: [] };
const port = h("input", { type: "number", min: 1, max: 65535, value: r.port, class: "short", "aria-label": "Port" });
@@ -2397,7 +2408,7 @@ function viewSettings() {
["devices", t("Devices"), t("Several DSPs can be connected at the same time – pick one at the top. A DSP accepts only one connection: close the Thomann editor first."),
"wide", [...S.order.filter(id => !S.devices[id].demo).map(id => deviceForm(S.devices[id])), scanCard(), addDeviceCard()]],
["access", S.isApp ? t("Remote access") : t("Security"), S.isApp ? t("Let phones and tablets in your network control this computer – they log in with the PIN.") : t("Who may use this web interface."),
"wide", [S.isApp ? remoteCard() : null, pinCard()]],
"wide", [S.isApp ? remoteCard() : null, S.isApp ? lockOptionCard() : null, pinCard()]],
["backup", t("Backup"), t("Save and restore the settings of this app."), "wide", [backupCard()]],
];
const nav = h("nav", { class: "setnav", "aria-label": t("Settings") }, sections.map(([id, title]) =>
@@ -2429,6 +2440,11 @@ function render() {
if (S.busy) { S.dirty = true; return; }
if ($("#app").hidden) return;
if (!S.devices[S.cur]) S.cur = S.order[0] || null;
// locked with "only show dashboard": back to where it was after unlocking
if (dashOnly() && !testOn(S.devices[S.cur])) {
if (S.view !== "dash" || S.settings) { S.beforeLock = S.beforeLock || { view: S.view, settings: S.settings }; S.view = "dash"; S.settings = false; }
} else if (S.beforeLock) { S.view = S.beforeLock.view; S.settings = S.beforeLock.settings; S.beforeLock = null; }
document.body.classList.toggle("dashonly", dashOnly() && !testOn(S.devices[S.cur]));
if (testOn(S.devices[S.cur])) { S.view = "test"; S.settings = false; } // stays in the audio test until the analog input is back
// keep focus on a text field (e.g. while typing a device name) – re-rendering would steal it
const ae = document.activeElement;
@@ -2457,7 +2473,7 @@ function render() {
: d.status === "locked" ? h("div", {}, h("p", {}, t("This DSP is locked with a code.")),
h("button", { class: "on", onclick: () => unlockDialog(d) }, t("Enter code")))
: S.demo.enabled && !d.demo ? t("Disconnected while demo mode is on") : t("Not connected."));
else content = ({ mixer: viewMixer, channel: viewChannel, routing: viewRouting, link: viewLink, fir: d.fir ? viewFir : viewMixer, lab: window.innerWidth < 760 ? viewMixer : viewLab, limiter: viewLimiter, test: viewTest }[S.view] || viewMixer)(d);
else content = ({ mixer: viewMixer, channel: viewChannel, routing: viewRouting, link: viewLink, fir: d.fir ? viewFir : viewMixer, lab: S.isApp ? viewLab : viewMixer, limiter: viewLimiter, test: viewTest }[S.view] || viewMixer)(d);
main.replaceChildren(...[content].flat().filter(Boolean));
main.querySelectorAll(H_SCROLL).forEach((e, i) => { if (xs[i]) e.scrollLeft = xs[i]; });
window.scrollTo(0, y);
@@ -2501,6 +2517,7 @@ new ResizeObserver(() => document.documentElement.style.setProperty("--sb", $("#
// Phones and tablets on the web UI start read-only, so nothing changes by touching it by accident.
// Only a safety catch in this browser tab: it is not stored and the server knows nothing about it.
const viewOnly = () => !!S.locked || !!S.guard;
const dashOnly = () => !!S.locked && !!S.lockDash;
function showGuard() {
const b = $("#btn-guard"), used = !S.isApp && S.guardUsed;
b.hidden = !used;
@@ -2640,6 +2657,9 @@ function connectEvents() {
case "lock":
if (S.isApp) { S.locked = ev.locked; showLock(); render(); }
break;
case "lockdash":
if (S.isApp) { S.lockDash = ev.enabled; render(); }
break;
case "meters":
updateMeters(ev); break;
case "limiter":
@@ -2729,6 +2749,7 @@ async function startApp() {
if (store.get("dsp.lang") === a.lang) return location.reload();
}
S.locked = !!a.locked;
S.lockDash = !!a.lock_dash;
S.guardUsed = !S.isApp && matchMedia("(max-width: 759px), (pointer: coarse)").matches;
S.guard = S.guardUsed;
showGuard();
+1 -1
View File
@@ -91,7 +91,7 @@ const DASH_MODULES = {
const list = dashDevs();
if (!list.length) return offline();
return h("div", { class: "dlist" }, list.map(d => h("button", { class: "drow dlink", "data-view-ok": "", title: t("Open in the mixer"),
onclick: () => { S.cur = d.id; S.view = "mixer"; store.set("dsp.view", "mixer"); render(); window.scrollTo(0, 0); } },
onclick: () => { if (dashOnly()) return; S.cur = d.id; S.view = "mixer"; store.set("dsp.view", "mixer"); render(); window.scrollTo(0, 0); } },
h("span", { class: "dot " + d.status }),
h("span", { class: "grow dname" }, h("b", {}, d.name), h("small", {}, [MODEL_LABEL[d.detected_model || d.model] || "", d.state ? d.state.preset_name : (STATUS_TEXT[d.status] || d.status)].filter(Boolean).join(" · "))),
d.state && dashChannels(d).some(([k, i]) => chans(d, k)[i].mute) ? h("span", { class: "dtag mute" }, "MUTE") : null)));
+2 -2
View File
@@ -10,7 +10,7 @@ const DOC_LAB = () => ({
t("Install REW on the computer running this app and connect a measuring microphone."),
t("In REW: Preferences → API → start the API, and tick that it starts with REW."),
t("Open Sound Lab and press “Check”. The dot turns green and shows the REW version."),
], p: t("REW's API only answers on its own computer. With the app on a Raspberry Pi, use the filter file instead.") },
], p: t("REW's API only answers on its own computer, so Sound Lab is part of the Windows and macOS apps only.") },
{ h: t("Example: correcting a top in a hall"), steps: [
t("Export a preset first (File… → Export), so you can go back."),
t("Mute everything except the speaker you are measuring and set a low level. Put the microphone at ear height in the audience area."),
@@ -29,7 +29,7 @@ const DOC_LAB = () => ({
t("In REW's EQ window change the filters and watch the predicted result. Nothing changes on the DSP."),
t("If you like it, press “Take filters” in Sound Lab, check and apply."),
] },
{ h: t("Without a connection (app on a Raspberry Pi)"), steps: [
{ h: t("Without the API"), steps: [
t("In REW's EQ window: File → Export → Filter settings as text."),
t("In Sound Lab press “Load REW filter file…”, check and apply."),
] },
+4 -2
View File
@@ -630,7 +630,7 @@ const DE = {
"Install REW on the computer running this app and connect a measuring microphone.": "REW auf dem Computer installieren, auf dem diese App läuft, und ein Messmikrofon anschließen.",
"In REW: Preferences → API → start the API, and tick that it starts with REW.": "In REW: Preferences → API → die API starten und anhaken, dass sie mit REW startet.",
"Open Sound Lab and press “Check”. The dot turns green and shows the REW version.": "Das Sound Lab öffnen und „Prüfen“ drücken. Der Punkt wird grün und zeigt die REW-Version.",
"REW's API only answers on its own computer. With the app on a Raspberry Pi, use the filter file instead.": "Die API von REW antwortet nur auf dem eigenen Computer. Mit der App auf einem Raspberry Pi nimmst du stattdessen die Filterdatei.",
"REW's API only answers on its own computer, so Sound Lab is part of the Windows and macOS apps only.": "Die API von REW antwortet nur auf dem eigenen Computer, darum gibt es das Sound Lab nur in den Apps für Windows und macOS.",
"Example: correcting a top in a hall": "Beispiel: ein Top in einer Halle korrigieren",
"Export a preset first (File… → Export), so you can go back.": "Zuerst ein Preset exportieren (Datei… → Export), damit du zurück kannst.",
"Mute everything except the speaker you are measuring and set a low level. Put the microphone at ear height in the audience area.": "Alles außer dem gemessenen Lautsprecher stummschalten und einen niedrigen Pegel einstellen. Das Mikrofon auf Ohrhöhe in den Publikumsbereich stellen.",
@@ -647,7 +647,7 @@ const DE = {
"Choose a measurement and press “Send filters to the chosen measurement”. This replaces the filters of that measurement in REW.": "Eine Messung wählen und „Filter an die gewählte Messung senden“ drücken. Das ersetzt die Filter dieser Messung in REW.",
"In REW's EQ window change the filters and watch the predicted result. Nothing changes on the DSP.": "Im EQ-Fenster von REW die Filter ändern und die Vorhersage beobachten. Am DSP ändert sich dabei nichts.",
"If you like it, press “Take filters” in Sound Lab, check and apply.": "Wenn es passt, im Sound Lab „Filter holen“ drücken, prüfen und übernehmen.",
"Without a connection (app on a Raspberry Pi)": "Ohne Verbindung (App auf einem Raspberry Pi)",
"Without the API": "Ohne die API",
"In REW's EQ window: File → Export → Filter settings as text.": "Im EQ-Fenster von REW: File → Export → Filter settings as text.",
"In Sound Lab press “Load REW filter file…”, check and apply.": "Im Sound Lab „REW-Filterdatei laden…“ drücken, prüfen und übernehmen.",
"SoundField is a top view of the room for planning before you set up: where speakers go, how evenly the room is covered, and which delays they need. It calculates a free field without reflections, so it is a planning aid, not a measurement.": "SoundField ist eine Draufsicht auf den Raum zum Planen vor dem Aufbau: wo die Lautsprecher hinkommen, wie gleichmäßig der Raum abgedeckt ist und welche Delays sie brauchen. Es rechnet im Freifeld ohne Reflexionen, ist also eine Planungshilfe und keine Messung.",
@@ -672,6 +672,8 @@ const DE = {
"Select a speaker and tick which DSP outputs feed it.": "Einen Lautsprecher wählen und anhaken, welche DSP-Ausgänge ihn speisen.",
"In the “Delays” table press “Apply” for one speaker, or “Apply all”. The column “Now on DSP” shows what is set.": "In der Tabelle „Delays“ für einen Lautsprecher „Übernehmen“ drücken, oder „Alle übernehmen“. Die Spalte „Jetzt im DSP“ zeigt, was gesetzt ist.",
"Check the result by ear or with a measurement: temperature, reflections and real speakers differ from the model.": "Das Ergebnis mit dem Ohr oder per Messung prüfen: Temperatur, Reflexionen und echte Lautsprecher weichen vom Modell ab.",
"Only show dashboard while locked": "Während der Sperre nur das Dashboard zeigen",
"With the lock on, this window then shows just your dashboard, until it is unlocked with the PIN.": "Bei aktiver Sperre zeigt dieses Fenster dann nur dein Dashboard, bis es mit der PIN entsperrt wird.",
};
const DE_PATTERNS = [
+1 -1
View File
@@ -42,7 +42,7 @@
<button data-view="fir" hidden><svg viewBox="0 0 24 24"><path d="M2 12h3l2-7 3 14 3-11 2 6 2-3 1 1h4"/></svg><span>FIR</span></button>
<button data-view="limiter"><svg viewBox="0 0 24 24"><path d="M2 7h20" stroke-dasharray="2.5 2.5"/><path d="M2 14c2 0 3-7 5-7h3c2 0 3 11 6 11s3-5 6-5"/></svg><span>Limiter</span></button>
<button data-view="soundfield"><svg viewBox="0 0 24 24"><rect x="3" y="3" width="18" height="18" rx="2"/><path d="M8 7l-2 2 2 2M16 7l2 2-2 2"/><path d="M7 15.5a7 7 0 0 1 10 0" stroke-dasharray="2 2"/><circle cx="12" cy="18" r="1.2" class="f"/></svg><span>SoundField</span><span class="short">Field</span></button>
<button data-view="lab"><svg viewBox="0 0 24 24"><path d="M9.5 3h5M10.5 3v6.5L5 19a1.3 1.3 0 0 0 1.1 2h11.8a1.3 1.3 0 0 0 1.1-2l-5.5-9.5V3"/><path d="M7.5 15h9"/></svg><span>Sound Lab</span><span class="short">Lab</span></button>
<button data-view="lab" hidden><svg viewBox="0 0 24 24"><path d="M9.5 3h5M10.5 3v6.5L5 19a1.3 1.3 0 0 0 1.1 2h11.8a1.3 1.3 0 0 0 1.1-2l-5.5-9.5V3"/><path d="M7.5 15h9"/></svg><span>Sound Lab</span><span class="short">Lab</span></button>
<button data-view="test"><svg viewBox="0 0 24 24"><path d="M4 9v6h4l5 4V5L8 9z"/><path d="M16.5 8.5a5 5 0 0 1 0 7M19 6a8.5 8.5 0 0 1 0 12"/></svg><span data-t="Audio test">Audio test</span><span class="short" data-t="Test">Test</span></button>
</nav>
<button id="btn-muteall" class="icon" aria-label="Mute all" title="Mute all"></button>
+2 -3
View File
@@ -1,9 +1,8 @@
"use strict";
// Sound Lab: working together with REW (Room EQ Wizard). Take filters from a measurement or a filter file, compare them
// with the channel before applying, send a channel's EQ back. REW's API only answers on the computer it runs on, so the
// server of this app talks to it (see rew_call); a filter file also works with the app on a Raspberry Pi.
// Not offered on phones (style.css).
// with the channel before applying, send a channel's EQ back. Desktop apps only: REW's API only answers on the computer
// it runs on, so the server inside the app talks to it (see rew_call).
const REW_IN = { PK: 0, PEAK: 0, LS: 1, LSC: 1, LSQ: 1, HS: 2, HSC: 2, HSQ: 2, HP1: 3, HP: 4, HPQ: 4, LP1: 5, LP: 6, LPQ: 6, AP: 8 };
const REW_OUT = ["PK", "LS", "HS", "HP1", "HP", "LP1", "LP", "AP", "AP"];
+5 -2
View File
@@ -939,5 +939,8 @@ canvas.labcurve { display: block; width: 100%; height: 240px; background: var(--
.docbody p { margin: 5px 0 0; color: var(--dim); }
.docbody ol { margin: 0; padding-left: 20px; }
.docbody li { margin: 3px 0; }
/* Sound Lab is for the computer next to REW, not for phones */
@media (max-width: 759px) { #viewtabs button[data-view=lab], .rewbtn { display: none; } }
/* ---- locked with "only show dashboard" */
body.dashonly #viewtabs, body.dashonly #devtabs, body.dashonly #btn-settings, body.dashonly #statusbar { display: none; }
body.dashonly #main { margin-left: 0; }
body.dashonly #btn-muteall { margin-left: auto; }
body.dashonly .dlink { cursor: default; }