Commit the limiter's audible state on the click and defer only the host's latency restart

setInstrumentParams now arms a sticky pending restart that flushLatencyRestart drains from the sync tick; setState and the bake's adopt flush at their own tails.
This commit is contained in:
2026-08-02 11:45:47 -04:00
parent 41876674e4
commit b956fe0d5a
7 changed files with 76 additions and 44 deletions
+5 -6
View File
@@ -68,12 +68,11 @@ bool ReaSamplerEditor::mouseDownDeck(const FaceLayout& fl, int x, int y) {
const bool on = (hit.segment == 1);
if (on != params_.limiterEnabled) {
params_.limiterEnabled = on;
// ARMED here, run on the sync tick — the same treatment the bake gets, and
// for the same reason: the processor's funnel requests the host's latency
// restart, whose deactivate/reactivate calls setActive(true) and re-decodes
// the WAV. Inline, that whole cycle would run nested inside this mouse
// handler with SetCapture held.
limiterPending_ = on;
// Commits the audible state and the persisted state together, here, because
// this is a control the user A/Bs. The funnel only ARMS the host's latency
// restart — the sync tick delivers it — so nothing on this path calls into
// the host from inside a mouse handler.
processor_->setLimiterEnabled(on);
}
invalidate();
break;