Dashboard levels: link groups as a thin line with a small name

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
GivouandClaude Opus 5.5 committed 2026-11-02 17:34:40 +01:00
1 parent b82a6b90c6
commit 936d7f64a9
2 files changed
+19 -8

No files matched your search

+16 -1
View File
@@ -55,6 +55,21 @@ function dashChannelNav(m, d, s) {
h("button", { class: "small", "data-view-ok": "", "aria-label": t("Next channel"), onclick: () => go(1) }, "›"));
}
// link groups in the level meters: a thin line with a small name (the mixer has the big brackets)
function dashGroups(d, kind) {
const out = [];
linkedGroups(d, kind).forEach(g => {
const color = custColor(d, kind, g[0]) || linkInfo(d, kind, g[0]).color, name = linkName(d, kind, g);
g.forEach((j, n) => {
if (n && g[n - 1] === j - 1) return;
let len = 1;
while (g.includes(j + len)) len++;
out.push(h("div", { class: "dgrp", style: `--lc:${color};grid-column:${j + 1} / span ${len}`, title: (name ? name + " · " : "") + g.map(i => chLabel(kind, i)).join(" + ") }, name));
});
});
return out;
}
const DASH_MODULES = {
status: {
title: () => t("DSP overview"), w: 4, min: [3, 3], max: [12, 14], h: () => 2 + Math.ceil(dashDevs().length * 1.2), global: true,
@@ -75,7 +90,7 @@ const DASH_MODULES = {
body(m, d) {
const col = (k, i) => h("div", { class: "dm" + (chans(d, k)[i].mute ? " muted" : ""), title: chTitle(d, k, i), style: `${ccStyle(d, k, i)};grid-column:${i + 1}` },
ledMeter(d.id, k, i), k === "out" ? limLed(d.id, i) : h("span", { class: "limled ph", "aria-hidden": "true" }), h("small", {}, chLabel(k, i).replace("Out ", "").replace("In ", "")));
const group = (k, label) => h("div", { class: "dmgroup", style: `flex-grow:${chans(d, k).length}` }, h("div", { class: "sub" }, label), h("div", { class: "dms", style: `--n:${chans(d, k).length}` }, linkBands(d, k), chans(d, k).map((_, i) => col(k, i))));
const group = (k, label) => h("div", { class: "dmgroup", style: `flex-grow:${chans(d, k).length}` }, h("div", { class: "sub" }, label), h("div", { class: "dms", style: `--n:${chans(d, k).length}` }, dashGroups(d, k), chans(d, k).map((_, i) => col(k, i))));
const bands = linkedGroups(d, "in").length + linkedGroups(d, "out").length > 0;
return h("div", { class: "dmeters" + (bands ? " hasbands" : "") }, group("in", t("Inputs")), group("out", t("Outputs")));
},