MCPcopy
hub / github.com/stemdeckapp/stemdeck / updateStopVisual

Function updateStopVisual

static/js/player.js:959–966  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

957 // the ruler also update the visual without extra plumbing.
958 const STOP_TOLERANCE_SEC = 0.15;
959 const updateStopVisual = () => {
960 const src = audioEngine ?? mt;
961 const t = src.getCurrentTime?.() ?? 0;
962 const startPos = loopEnabled ? loopStart : 0;
963 const atStart = Math.abs(t - startPos) < STOP_TOLERANCE_SEC;
964 const stopped = !src.isPlaying() && atStart;
965 stopBtn.classList.toggle("stopped", stopped);
966 };
967
968 mt.once("canplay", () => {
969 setWaveformLoading(false);

Callers 2

wireUpAudioFunction · 0.85
driveTransportUiFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected