fix: close round-3 review findings — smallest-target-first, residue test fix, extraction

Waveform overlay now resolves node/tab/marker click collisions by target area instead of check order; residue test now uses a distinguishing fixture; Gate-unavailable-while-drawn logic extracted to one pure helper shared by resolvePlay and applyControl.
This commit is contained in:
2026-07-31 23:44:05 -04:00
parent c3d67bc3da
commit 757e1585d6
11 changed files with 255 additions and 87 deletions
+11
View File
@@ -195,6 +195,17 @@ bool splineActive(const Play& p) {
(p.filter.enabled && p.filterSpline.mode == EnvMode::Spline);
}
// The one enforcement of the rule above: forces `p` to Trigger the instant it goes
// splineActive. Every path that can leave `p` in a state splineActive() would newly return true
// for — resolving stored params toward the engine, or an editor control edit that can flip a
// mode/enable toggle — routes through this, so none of them can reopen the Gate+spline hole
// splineActive's own doc comment describes. Header-inline and allocation-free: play_params.h
// sits on the per-voice-per-sample include path.
template <class Play>
void enforceGateUnavailableWhileDrawn(Play& p) {
if (splineActive(p)) p.playMode = PlayMode::Trigger;
}
// [start, end) frames, half-open. A zero-length loop (start == end) is the "no sustain loop"
// marker — a held note past the sample end goes silent rather than looping a zero span.
struct SampleLoop {