SoundField stacks (top on a distance pole on a sub), DSP selection as drop-down
- a top dropped onto a free sub stands on it (same spot, pole height); the stack moves as one, is drawn as one symbol and can be detached in the editor; "+ Stack" and a ground-stack quick start; centre cluster and height suggestions know about stacks - the DSP tabs became one button with a drop-down menu (status dots of the other DSPs), so many devices fit Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
1 parent
eb647f62a9
commit
f87e6cad70
6 files changed
+173
-31
No files matched your search
+32
-12
@@ -533,20 +533,38 @@ requestAnimationFrame(meterFrame);
|
||||
|
||||
// ------------------------------------------------------------------ header / status
|
||||
|
||||
// DSP selection: one button with the current DSP, the others in a drop-down menu (room for many devices)
|
||||
function renderTabs() {
|
||||
const tabs = $("#devtabs");
|
||||
const order = [...S.order].sort((a, b) => !!S.devices[b].demo - !!S.devices[a].demo); // demo tab first
|
||||
tabs.replaceChildren(...order.map(id => {
|
||||
const d = S.devices[id];
|
||||
const model = d.detected_model || (d.model !== "auto" ? d.model : "");
|
||||
const paused = S.demo.enabled && !d.demo; // demo mode: the real DSPs are disconnected
|
||||
return h("button", { class: "devtab" + (id === S.cur && !S.settings ? " active" : "") + (paused ? " paused" : "") + (d.demo ? " demo" : ""),
|
||||
title: paused ? t("Disconnected while demo mode is on") : d.demo ? t("Demo mode – simulated DSP") : `${d.name} · ${where(d)}`,
|
||||
disabled: paused, onclick: () => { S.cur = id; S.settings = false; store.set("dsp.cur", id); render(); } },
|
||||
h("span", { class: "dot " + d.status }), h("span", { class: "dn" }, d.name),
|
||||
testOn(d) ? h("small", { class: "test-badge" }, "TEST") : d.demo ? h("small", { class: "demo-badge" }, "DEMO") : model ? h("small", {}, model) : null);
|
||||
}));
|
||||
const order = [...S.order].sort((a, b) => !!S.devices[b].demo - !!S.devices[a].demo); // demo first
|
||||
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;
|
||||
};
|
||||
const cur = S.devices[S.cur];
|
||||
if (!cur) {
|
||||
S.devMenu = false;
|
||||
tabs.replaceChildren(h("button", { class: "devtab devpick", onclick: () => { S.settings = true; render(); } }, h("span", { class: "dn" }, t("Add a DSP…"))));
|
||||
} else {
|
||||
const others = order.filter(id => id !== S.cur).slice(0, 8);
|
||||
const pick = h("button", { class: "devtab devpick" + (S.settings ? "" : " active") + (cur.demo ? " demo" : ""), "aria-haspopup": "listbox",
|
||||
"aria-expanded": String(!!S.devMenu), title: cur.demo ? t("Demo mode – simulated DSP") : `${cur.name} · ${where(cur)}`,
|
||||
onclick: e => { e.stopPropagation(); S.devMenu = !S.devMenu; renderTabs(); } },
|
||||
h("span", { class: "dot " + cur.status }), h("span", { class: "dn" }, cur.name), badge(cur),
|
||||
others.length ? h("span", { class: "minidots", "aria-hidden": "true" }, others.map(id => h("i", { class: "dot " + S.devices[id].status }))) : null,
|
||||
h("span", { class: "chev" }, S.devMenu ? "▴" : "▾"));
|
||||
const menu = S.devMenu ? h("div", { class: "devmenu", role: "listbox" }, order.map(id => {
|
||||
const d = S.devices[id], paused = S.demo.enabled && !d.demo; // demo mode: the real DSPs are disconnected
|
||||
return h("button", { class: "devitem" + (id === S.cur ? " on" : "") + (paused ? " paused" : ""), role: "option", "aria-selected": String(id === S.cur),
|
||||
disabled: paused || (testLock && id !== S.cur),
|
||||
title: paused ? t("Disconnected while demo mode is on") : `${d.name} · ${where(d)}`,
|
||||
onclick: () => { S.devMenu = false; S.cur = id; S.settings = false; store.set("dsp.cur", id); render(); } },
|
||||
h("span", { class: "dot " + d.status }), h("span", { class: "dn" }, d.name),
|
||||
h("span", { class: "where" }, d.demo ? t("simulated") : STATUS_TEXT[d.status] || d.status), badge(d));
|
||||
})) : null;
|
||||
tabs.replaceChildren(...[pick, menu].filter(Boolean));
|
||||
}
|
||||
document.body.classList.toggle("testlock", testLock);
|
||||
$("#btn-settings").classList.toggle("on", S.settings);
|
||||
$("#btn-settings").disabled = testLock;
|
||||
@@ -554,8 +572,10 @@ function renderTabs() {
|
||||
b.classList.toggle("active", !S.settings && b.dataset.view === S.view);
|
||||
b.disabled = testLock && b.dataset.view !== "test";
|
||||
});
|
||||
if (testLock) tabs.querySelectorAll(".devtab:not(.active)").forEach(b => (b.disabled = true));
|
||||
}
|
||||
// close the DSP menu on a click elsewhere or Escape
|
||||
document.addEventListener("pointerdown", e => { if (S.devMenu && !e.target.closest("#devtabs")) { S.devMenu = false; renderTabs(); } });
|
||||
document.addEventListener("keydown", e => { if (S.devMenu && e.key === "Escape") { S.devMenu = false; renderTabs(); } });
|
||||
|
||||
const STATUS_TEXT = { disconnected: t("Disconnected"), connecting: t("Connecting…"), loading: t("Loading configuration…"),
|
||||
locked: t("Locked with a code"), online: "Online", error: t("Error") };
|
||||
|
||||
Reference in new issue
Block a user