diff --git a/static/app.js b/static/app.js index 329619f..a19cbf8 100644 --- a/static/app.js +++ b/static/app.js @@ -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(" + ") }, 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) { return path.split(".").reduce((o, k) => o[Array.isArray(o) ? +k : k], obj); @@ -757,7 +760,7 @@ function strip(d, kind, i) { }); el.append( 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 h("div", { class: "faderbox" }, ledMeter(d.id, kind, i), f), db, @@ -968,24 +971,30 @@ function peqCard(d, kind, idx) { const redraw = () => drawCurve(canvas, chans(dev(), kind)[idx], S.band); const body = h("div", { class: "bandparams" }); const bandBtns = h("div", { class: "bands", role: "tablist" }); - const renderBand = () => { - const c = chans(dev(), kind)[idx], b = c.peq[S.band], p = `peq.${S.band}`; + const renderBtns = () => { + const c = chans(dev(), kind)[idx]; 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" : ""), role: "tab", "aria-selected": String(i === S.band), onclick: () => { S.band = i; renderBand(); redraw(); } }, h("b", {}, String(i + 1)), h("small", {}, fmtHzShort(freqHz(bb.freq))), 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(); }; + // sliders must not rebuild themselves while being dragged (the mouse would lose them): buttons + curve only + const light = () => { renderBtns(); redraw(); }; body.replaceChildren( h("div", { class: "row bandhead" }, h("label", { class: "inline" }, t("Type"), paramSelect(kind, idx, p + ".type", PEQ_TYPES, both, t("Filter type"))), toggleBtn("Bypass", kind, idx, p + ".bypass", "", both), hasGain(b.type) ? h("button", { onclick: () => { setParam(kind, idx, p + ".gain", 120); both(); } }, "0 dB") : null), h("div", { class: "pgrid" }, - paramSlider(t("Frequency"), kind, idx, p + ".freq", "freq", both), - hasGain(b.type) ? paramSlider("Gain", kind, idx, p + ".gain", "eqgain", both) : null, - hasQ(b.type) ? paramSlider("Q", kind, idx, p + ".q", "q", both) : null)); + paramSlider(t("Frequency"), kind, idx, p + ".freq", "freq", light), + hasGain(b.type) ? paramSlider("Gain", kind, idx, p + ".gain", "eqgain", light) : null, + hasQ(b.type) ? paramSlider("Q", kind, idx, p + ".q", "q", light) : null)); }; // drag points on the curve (gain snaps to 0 dB) let drag = null; diff --git a/static/i18n.js b/static/i18n.js index d09958d..39dfa31 100644 --- a/static/i18n.js +++ b/static/i18n.js @@ -344,6 +344,7 @@ const DE = { "Overlay": "Einblenden", "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.", + "Phase inverted": "Phase invertiert", }; const DE_PATTERNS = [ diff --git a/static/style.css b/static/style.css index 35c79bb..72c23c7 100644 --- a/static/style.css +++ b/static/style.css @@ -509,3 +509,5 @@ button.chip.ov.on i { background: var(--oc); } 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; } .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; }