MCPcopy Index your code
hub / github.com/stemdeckapp/stemdeck / updateLaneKnobVisual

Function updateLaneKnobVisual

static/js/mixer.js:82–98  ·  view source on GitHub ↗
(knobEl, v)

Source from the content-addressed store, hash-verified

80}
81
82export 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
100export function setLaneVolume(name, v) {
101 const state = mixerState[name];

Callers 3

setLaneVolumeFunction · 0.85
refreshMixerVisualsFunction · 0.85
renderMixerRowFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected