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

Function set

static/mobile/app.js:777–785  ·  view source on GitHub ↗
(cx)

Source from the content-addressed store, hash-verified

775 const knob = el.querySelector(".fader-knob");
776 const rect = el.getBoundingClientRect();
777 const set = (cx) => {
778 let v = (cx - rect.left) / rect.width;
779 v = Math.max(0, Math.min(1, v));
780 state.vols[id] = v;
781 const pct = Math.round(v * 100) + "%";
782 fill.style.width = pct;
783 knob.style.left = pct;
784 if (engine && laneActive(id)) engine.setGain(id, v);
785 };
786 set(e.clientX);
787 el.setPointerCapture(e.pointerId);
788 const mv = (ev) => set(ev.clientX);

Callers 9

wireFadersFunction · 0.85
mvFunction · 0.85
lifespanFunction · 0.85
_local_ipsFunction · 0.85
restoreFunction · 0.85
_parse_lane_gainsFunction · 0.85
get_all_stems_zipFunction · 0.85
downloadFunction · 0.85
test_multiple_stemsFunction · 0.85

Calls 1

laneActiveFunction · 0.85

Tested by 1

test_multiple_stemsFunction · 0.68