(knobEl, v)
| 80 | } |
| 81 | |
| 82 | export function updateLaneKnobVisual(knobEl, v) { |
| 83 | const frac = Math.max(0, Math.min(1, v / LANE_VOLUME_MAX)); |
| 84 | knobEl.style.setProperty("--lane-pos", frac.toFixed(3)); |
| 85 | knobEl.setAttribute("aria-valuenow", v.toFixed(2)); |
| 86 | const input = knobEl.querySelector(".mx-fader-input"); |
| 87 | if (input) { |
| 88 | input.value = String(v); |
| 89 | // Set --lane-pos directly on the input so ::webkit-slider-runnable-track |
| 90 | // can see it — WebKit shadow DOM pseudo-elements don't inherit vars from ancestors. |
| 91 | input.style.setProperty("--lane-pos", frac.toFixed(3)); |
| 92 | } |
| 93 | const val = knobEl.closest(".lane-header")?.querySelector(".mx-val"); |
| 94 | if (val) { |
| 95 | const db = v <= 0 ? "-∞" : (20 * Math.log10(v)).toFixed(1); |
| 96 | val.textContent = db === "-∞" ? "-∞" : `${parseFloat(db) > 0 ? "+" : ""}${db}`; |
| 97 | } |
| 98 | } |
| 99 | |
| 100 | export function setLaneVolume(name, v) { |
| 101 | const state = mixerState[name]; |
no outgoing calls
no test coverage detected