Fix PEQ sliders losing the mouse drag, show inverted polarity in the mixer

- PEQ sliders no longer rebuild themselves on every change (the browser lost
  the drag); only the band buttons and the curve are updated while dragging
- mixer strips show a "Ø" badge next to the link symbol when the polarity is inverted

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
GivouandClaude Opus 5.5 committed 2026-11-01 22:14:46 +01:00
1 parent 96640c5bff
commit 58492e985f
3 files changed
+18 -6

No files matched your search

+15 -6
View File
@@ -157,6 +157,9 @@ const linkBadge = (d, kind, i) => {
return l ? h("span", { class: "lnk", style: `--lc:${l.color}`, title: t("Linked: ") + l.group.map(j => chLabel(kind, j)).join(" + ") }, return l ? h("span", { class: "lnk", style: `--lc:${l.color}`, title: t("Linked: ") + l.group.map(j => chLabel(kind, j)).join(" + ") },
svgIcon(ICON.link)) : null; svgIcon(ICON.link)) : null;
}; };
// polarity inverted ("Phase Ø" in the channel view)
const polBadge = (d, kind, i) => chans(d, kind)[i].polarity
? h("span", { class: "pol", title: t("Phase inverted") }, "Ø") : null;
function getPath(obj, path) { function getPath(obj, path) {
return path.split(".").reduce((o, k) => o[Array.isArray(o) ? +k : k], obj); return path.split(".").reduce((o, k) => o[Array.isArray(o) ? +k : k], obj);
@@ -757,7 +760,7 @@ function strip(d, kind, i) {
}); });
el.append( el.append(
h("button", { class: "strip-head", onclick: () => openChannel(kind, i), title: t("Edit channel") }, h("button", { class: "strip-head", onclick: () => openChannel(kind, i), title: t("Edit channel") },
h("span", { class: "kind" }, chLabel(kind, i), linkBadge(d, kind, i)), h("span", { class: "nm" }, ch.name || " "), h("span", { class: "kind" }, chLabel(kind, i), linkBadge(d, kind, i), polBadge(d, kind, i)), h("span", { class: "nm" }, ch.name || " "),
kind === "out" ? limLed(d.id, i) : h("span", { class: "limled ph", "aria-hidden": "true" })), // keeps faders level with the outputs kind === "out" ? limLed(d.id, i) : h("span", { class: "limled ph", "aria-hidden": "true" })), // keeps faders level with the outputs
h("div", { class: "faderbox" }, ledMeter(d.id, kind, i), f), h("div", { class: "faderbox" }, ledMeter(d.id, kind, i), f),
db, db,
@@ -968,24 +971,30 @@ function peqCard(d, kind, idx) {
const redraw = () => drawCurve(canvas, chans(dev(), kind)[idx], S.band); const redraw = () => drawCurve(canvas, chans(dev(), kind)[idx], S.band);
const body = h("div", { class: "bandparams" }); const body = h("div", { class: "bandparams" });
const bandBtns = h("div", { class: "bands", role: "tablist" }); const bandBtns = h("div", { class: "bands", role: "tablist" });
const renderBand = () => { const renderBtns = () => {
const c = chans(dev(), kind)[idx], b = c.peq[S.band], p = `peq.${S.band}`; const c = chans(dev(), kind)[idx];
bandBtns.replaceChildren(...c.peq.map((bb, i) => h("button", { bandBtns.replaceChildren(...c.peq.map((bb, i) => h("button", {
class: "band" + (i === S.band ? " on" : "") + (bb.bypass ? " bypassed" : "") + (hasGain(bb.type) && bb.gain !== 120 ? " active" : ""), class: "band" + (i === S.band ? " on" : "") + (bb.bypass ? " bypassed" : "") + (hasGain(bb.type) && bb.gain !== 120 ? " active" : ""),
role: "tab", "aria-selected": String(i === S.band), role: "tab", "aria-selected": String(i === S.band),
onclick: () => { S.band = i; renderBand(); redraw(); } }, onclick: () => { S.band = i; renderBand(); redraw(); } },
h("b", {}, String(i + 1)), h("small", {}, fmtHzShort(freqHz(bb.freq))), h("b", {}, String(i + 1)), h("small", {}, fmtHzShort(freqHz(bb.freq))),
h("small", {}, hasGain(bb.type) ? sign(eqDb(bb.gain)) : PEQ_SHORT[bb.type])))); h("small", {}, hasGain(bb.type) ? sign(eqDb(bb.gain)) : PEQ_SHORT[bb.type]))));
};
const renderBand = () => {
const c = chans(dev(), kind)[idx], b = c.peq[S.band], p = `peq.${S.band}`;
renderBtns();
const both = () => { renderBand(); redraw(); }; const both = () => { renderBand(); redraw(); };
// sliders must not rebuild themselves while being dragged (the mouse would lose them): buttons + curve only
const light = () => { renderBtns(); redraw(); };
body.replaceChildren( body.replaceChildren(
h("div", { class: "row bandhead" }, h("div", { class: "row bandhead" },
h("label", { class: "inline" }, t("Type"), paramSelect(kind, idx, p + ".type", PEQ_TYPES, both, t("Filter type"))), h("label", { class: "inline" }, t("Type"), paramSelect(kind, idx, p + ".type", PEQ_TYPES, both, t("Filter type"))),
toggleBtn("Bypass", kind, idx, p + ".bypass", "", both), toggleBtn("Bypass", kind, idx, p + ".bypass", "", both),
hasGain(b.type) ? h("button", { onclick: () => { setParam(kind, idx, p + ".gain", 120); both(); } }, "0 dB") : null), hasGain(b.type) ? h("button", { onclick: () => { setParam(kind, idx, p + ".gain", 120); both(); } }, "0 dB") : null),
h("div", { class: "pgrid" }, h("div", { class: "pgrid" },
paramSlider(t("Frequency"), kind, idx, p + ".freq", "freq", both), paramSlider(t("Frequency"), kind, idx, p + ".freq", "freq", light),
hasGain(b.type) ? paramSlider("Gain", kind, idx, p + ".gain", "eqgain", both) : null, hasGain(b.type) ? paramSlider("Gain", kind, idx, p + ".gain", "eqgain", light) : null,
hasQ(b.type) ? paramSlider("Q", kind, idx, p + ".q", "q", both) : null)); hasQ(b.type) ? paramSlider("Q", kind, idx, p + ".q", "q", light) : null));
}; };
// drag points on the curve (gain snaps to 0 dB) // drag points on the curve (gain snaps to 0 dB)
let drag = null; let drag = null;
+1
View File
@@ -344,6 +344,7 @@ const DE = {
"Overlay": "Einblenden", "Overlay": "Einblenden",
"Phase": "Phase", "Phase": "Phase",
"The rest of the app is locked until the analog input is selected again.": "Der Rest der App ist gesperrt, bis wieder der Analog-Eingang gewählt ist.", "The rest of the app is locked until the analog input is selected again.": "Der Rest der App ist gesperrt, bis wieder der Analog-Eingang gewählt ist.",
"Phase inverted": "Phase invertiert",
}; };
const DE_PATTERNS = [ const DE_PATTERNS = [
+2
View File
@@ -509,3 +509,5 @@ button.chip.ov.on i { background: var(--oc); }
font: 700 34px system-ui; color: #ef444499; pointer-events: none; } font: 700 34px system-ui; color: #ef444499; pointer-events: none; }
body.testlock #viewtabs button:disabled, body.testlock #btn-settings:disabled, body.testlock .devtab:disabled { opacity: .35; cursor: not-allowed; } body.testlock #viewtabs button:disabled, body.testlock #btn-settings:disabled, body.testlock .devtab:disabled { opacity: .35; cursor: not-allowed; }
.testbanner small { display: block; font-weight: 400; margin-top: 2px; color: var(--dim); } .testbanner small { display: block; font-weight: 400; margin-top: 2px; color: var(--dim); }
.pol { display: inline-block; margin-left: 4px; padding: 0 4px; border-radius: 4px; font-size: 11px; font-weight: 700; line-height: 15px;
color: #1a0f00; background: #e879f9; vertical-align: 1px; }