Bound the automation hold to the window the model has not caught up on, and make that authority model stated, enforced and tested

This commit is contained in:
2026-08-02 17:16:02 -04:00
parent de5654fb6f
commit 1fd38bbd57
35 changed files with 1155 additions and 302 deletions
+23
View File
@@ -136,6 +136,28 @@ static void testTheHostAndTheEditorAgreeOnEveryDefaultPosition() {
}
}
// The criterion names the editor's DOUBLE-CLICK, and that gesture is resetDeckParam, not
// deckParamNorm over a default-constructed set. Asserted directly: reset a DIALLED set and its
// stored field must read back at exactly the normalized value the host resets to. (The two
// instance scalars have no resetDeckParam entry — the shell resets those from InstrumentParams,
// which the test above covers at the same position.)
static void testADoubleClickResetLandsOnTheHostsDefaultNormalized() {
using reasampler::instrument::ui::deckParamNorm;
using reasampler::instrument::ui::resetDeckParam;
using reasampler::instrument::ui::setDeckParam;
for (const ParamRow& row : exposedParams()) {
if (valueHomeFor(row.deck) == ValueHome::InstanceScalar) continue;
PlaySeconds dialled;
// Away from the default first, so a reset that did nothing at all cannot pass.
setDeckParam(row.deck, dialled, 0.37, /*segment=*/0);
CHECK_ID(deckParamNorm(row.deck, dialled) != defaultNormalized(row.deck) ||
defaultNormalized(row.deck) == 0.37,
row.id);
resetDeckParam(row.deck, dialled);
CHECK_ID(deckParamNorm(row.deck, dialled) == defaultNormalized(row.deck), row.id);
}
}
static void testTheFiltersFourTakeTheirStoredNormVerbatim() {
// Their stored value IS the normalized one, so no taper may participate in their default:
// this fails the moment someone routes them through toNormalized(toPlain(x)).
@@ -218,6 +240,7 @@ int main() {
testEveryUnitStringAndRangeMatchesTheSpecifiedTable();
testEveryDefaultHasAnExactNormalizedPreimage();
testTheHostAndTheEditorAgreeOnEveryDefaultPosition();
testADoubleClickResetLandsOnTheHostsDefaultNormalized();
testTheFiltersFourTakeTheirStoredNormVerbatim();
testToPlainIsMonotoneAcrossTheWholeTravel();
testTheEndpointsAreTheDeclaredPlainRange();