Beta models DSP 206 and FIR DSP 408 (without the FIR filters), read-only until allowed

Never tested on real hardware, so they are only selectable by hand and send no
changes until the user has compared the shown values with the DSP.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
GivouandClaude Opus 5.5 committed 2026-11-02 16:47:56 +01:00
1 parent 0a1f282c63
commit 86ee492ec3
11 files changed
+121 -21

No files matched your search

+32 -10
View File
@@ -137,6 +137,8 @@ const chTitle = (d, kind, i) => { const n = chans(d, kind)[i].name; return n ? `
// Channel links (see protocol.py): a free channel's mask is its own bit, the first channel of a
// group holds all members' bits, the others 0. The DSP mirrors changes within a group itself.
const MODEL_LABEL = { "204": "DSP 204", "408": "DSP 408", "206": "DSP 206", "408fir": "FIR DSP 408" };
const MODEL_CH = { "204": [2, 4], "408": [4, 8], "206": [2, 6], "408fir": [4, 8] }; // inputs, outputs (before a DSP has connected)
const LINK_COLORS = ["#f59e0b", "#22d3ee", "#a3e635", "#f472b6"];
function linkGroups(list) {
const seen = new Set(), groups = [];
@@ -173,7 +175,7 @@ const CH_PALETTE = ["#ef4444", "#f97316", "#f59e0b", "#eab308", "#84cc16", "#22c
// channel groups of one kind: linked channels together, the others on their own
function chanGroups(d, kind) {
if (d.state) return linkGroups(chans(d, kind));
const n = kind === "in" ? d.n_in || (d.model === "408" ? 4 : 2) : d.n_out || (d.model === "408" ? 8 : 4);
const n = (kind === "in" ? d.n_in : d.n_out) || (MODEL_CH[d.model] || MODEL_CH["204"])[kind === "in" ? 0 : 1];
return Array.from({ length: n }, (_, i) => [i]);
}
// the colour chosen for a channel; linked channels show their group's colour
@@ -592,7 +594,8 @@ function renderTabs() {
const testLock = testOn(dev());
const badge = d => {
const model = d.detected_model || (d.model !== "auto" ? d.model : "");
return testOn(d) ? h("small", { class: "test-badge" }, "TEST") : d.demo ? h("small", { class: "demo-badge" }, "DEMO") : model ? h("small", {}, model) : null;
return testOn(d) ? h("small", { class: "test-badge" }, "TEST") : d.demo ? h("small", { class: "demo-badge" }, "DEMO")
: model ? h("small", {}, (MODEL_LABEL[model] || model).replace("DSP ", "") + (d.beta ? " β" : "")) : null;
};
const cur = S.devices[S.cur];
if (!cur) {
@@ -796,8 +799,8 @@ async function presetFileDialog(d) {
"active state – stored presets (U01 …) stay unchanged.", { name: q(d.state.preset_name || "—") })),
last ? h("p", { class: "dlg-text" }, t("A backup is made automatically before every import. Last backup: {last}.", { last })) : null),
actions: [{ label: t("Close") },
...(last && !S.locked ? [{ label: t("Undo import"), value: () => "undo" }] : []),
...(S.locked ? [] : [{ label: t("Import…"), value: () => "import" }]),
...(last && !viewOnly() ? [{ label: t("Undo import"), value: () => "undo" }] : []),
...(viewOnly() ? [] : [{ label: t("Import…"), value: () => "import" }]),
{ label: t("Export"), primary: true, value: () => "export" }],
});
try {
@@ -1945,7 +1948,8 @@ function deviceForm(d) {
name: h("input", { type: "text", value: d.name, placeholder: t("e.g. DSP 204 stage") }),
host: h("input", { type: "text", value: d.host, placeholder: "192.168.1.101", inputmode: "decimal" }),
port: h("input", { type: "number", value: d.port }),
model: h("select", {}, [["auto", t("Automatic")], ["204", "DSP 204"], ["408", "DSP 408"]]
model: h("select", {}, [["auto", t("Automatic")], ["204", "DSP 204"], ["408", "DSP 408"],
["206", "DSP 206 (Beta)"], ["408fir", "FIR DSP 408 (Beta)"]]
.map(([v, label]) => h("option", { value: v, selected: d.model === v }, label))),
autoconnect: h("input", { type: "checkbox", checked: d.autoconnect }),
addr: h("input", { type: "number", min: 1, max: 250, value: d.addr || 1, class: "short" }),
@@ -2181,7 +2185,7 @@ async function scanDialog() {
const list = await api("POST", "/api/scan");
const used = new Set(S.order.map(id => S.devices[id].host));
box.replaceChildren(...(list.length ? list.map(x => {
const title = x.model ? `DSP ${x.model}` : t("Unknown device");
const title = MODEL_LABEL[x.model] || t("Unknown device");
const add = async b => {
b.disabled = true;
try {
@@ -2232,6 +2236,21 @@ function viewSettings() {
// ------------------------------------------------------------------ render
const H_SCROLL = ".mixer, .bands, .geq, .routing";
// beta models (never seen on a real device): read-only until the shown values were compared with the DSP
function betaBanner(d) {
const model = MODEL_LABEL[d.detected_model] || d.detected_model;
const set = async enabled => {
if (enabled && !await askConfirm(t("Allow changes"), t("Only continue if the values shown here match the DSP (names, gains, filters, routing). If they don't, a change can send wrong values – keep the amplifiers off while testing."), t("Allow changes"), true)) return;
try { await api("POST", `/api/devices/${d.id}/betawrite`, { enabled }); }
catch (e) { toast(t("Error: ") + trMsg(e.message)); }
};
return h("div", { class: "betabar" + (d.read_only ? " ro" : "") },
h("div", { class: "grow" }, h("b", {}, t("{model} – Beta", { model })), " ",
d.read_only ? t("Not tested on a real device yet, so changes are off. Compare the shown values with the DSP. If they don't match, send the file from File… → Export to the developer.")
: t("Not tested on a real device yet. Changes are on – keep the amplifiers off while testing.")),
h("button", { class: "small" + (d.read_only ? " on" : ""), "data-view-ok": "", onclick: () => set(d.read_only) }, d.read_only ? t("Allow changes") : t("Turn changes off")));
}
function render() {
if (S.busy) { S.dirty = true; return; }
if ($("#app").hidden) return;
@@ -2252,6 +2271,7 @@ function render() {
const d = dev();
const field = !S.settings && S.view === "soundfield"; // the room plan works without a connected DSP
document.body.dataset.view = field ? "soundfield" : S.settings || !d ? "settings" : S.view;
document.body.classList.toggle("locked", viewOnly());
if (field) content = viewSoundField();
else if (S.settings || !d) content = viewSettings();
else if (d.status !== "online" || !d.state)
@@ -2262,7 +2282,7 @@ function render() {
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, limiter: viewLimiter, test: viewTest }[S.view] || viewMixer)(d);
main.replaceChildren(...[content].flat().filter(Boolean));
main.replaceChildren(...[!field && !S.settings && d && d.beta ? betaBanner(d) : null, content].flat().filter(Boolean));
main.querySelectorAll(H_SCROLL).forEach((e, i) => { if (xs[i]) e.scrollLeft = xs[i]; });
window.scrollTo(0, y);
collectMeters();
@@ -2302,10 +2322,12 @@ new ResizeObserver(() => document.documentElement.style.setProperty("--sb", $("#
// ------------------------------------------------------------------ lock (desktop app window: look, don't touch)
const viewOnly = () => !!S.locked || (!S.settings && S.view !== "soundfield" && !!(dev() && dev().read_only));
function showLock() {
const b = $("#btn-lock");
b.hidden = !S.isApp;
document.body.classList.toggle("locked", !!S.locked);
document.body.classList.toggle("locked", viewOnly());
b.classList.toggle("on", !!S.locked);
b.title = S.locked ? t("Locked – click to unlock") : t("Lock (view only)");
b.setAttribute("aria-label", b.title);
@@ -2337,14 +2359,14 @@ $("#btn-lock").addEventListener("click", async () => {
const VIEW_OK = ".chsel, .nav, .strip-head, .xout, .band, #btn-muteall, [data-view-ok]";
for (const type of ["pointerdown", "mousedown", "click", "dblclick", "keydown", "wheel"]) {
document.addEventListener(type, e => {
if (!S.locked || !(e.target instanceof Element)) return;
if (!viewOnly() || !(e.target instanceof Element)) return;
const tgt = e.target;
if (!tgt.closest("#main, #statusbar") || tgt.closest(VIEW_OK)) return;
if (type === "wheel" && !tgt.closest(".fader, input, select")) return; // page scrolling stays
if (type === "keydown" && !tgt.closest("button, input, select, textarea, .fader, [tabindex]")) return;
if (type === "pointerdown" && !tgt.closest("button, input, select, textarea, .fader, canvas, a")) return;
e.preventDefault(); e.stopPropagation();
if (type === "click" && Date.now() - (S.lockToast || 0) > 1500) { S.lockToast = Date.now(); toast(t("Locked – unlock at the top right to make changes")); }
if (type === "click" && Date.now() - (S.lockToast || 0) > 1500) { S.lockToast = Date.now(); toast(S.locked ? t("Locked – unlock at the top right to make changes") : t("Beta model: changes are off")); }
}, { capture: true, passive: false });
}