fix: pin the waveform arbitration in a testable predicate, close round-4 review minors

Extracts resolveWaveformClaim (core/instrument/ui/spline_edit) so the shell's node/tab/marker click resolution is unit-tested directly, not just its input geometry; folds the staged-envelope node into it; fixes comment accuracy, a cost regression, and test fidelity issues.
This commit is contained in:
2026-08-01 00:17:06 -04:00
parent 757e1585d6
commit aedcc6976c
10 changed files with 316 additions and 179 deletions
+4 -6
View File
@@ -195,12 +195,10 @@ 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.
// The one enforcement of splineActive's rule (see its doc above). Header-inline and
// allocation-free: play_params.h sits on the per-voice-per-sample include path. Both callers —
// resolvePlay (sample_map.cpp) and the editor's applyControl — route through here, so the two
// cannot drift apart.
template <class Play>
void enforceGateUnavailableWhileDrawn(Play& p) {
if (splineActive(p)) p.playMode = PlayMode::Trigger;