feat(S9/S8): bank-generation change-detection + instrument-side assignment reader

Extension stamps a monotonic bank_generation counter, bumped at content
mutations; the VST3 instrument polls it off-thread on an editor timer and
consumes assignment requests, refreshing playback hands-free.
This commit is contained in:
2026-07-26 23:46:06 -04:00
parent 725f3e7d3c
commit 66d47fb410
21 changed files with 838 additions and 36 deletions
+13
View File
@@ -32,6 +32,7 @@
#pragma once
#include <cstdint>
#include <string>
#include <vector>
@@ -86,7 +87,19 @@ private:
// as the editor's refreshSampleList does (bridge read + processor accessors, UI thread).
void refresh();
// The S9 dirty-guard over refresh() (the S6 flagged follow-up): read the cheap bank-
// generation stamp; do the EXPENSIVE bank-blob bridge read (refresh()) only when the
// generation changed since the last paint (or on the first paint) — the strip re-read
// per paint was wasteful now that a generation counter exists. The performance map (a
// cheap in-process accessor, edited by the editor independently of bank content) is
// ALWAYS refreshed so a zone edit still reflects immediately. UI thread only.
void maybeRefresh();
ReaSamplerProcessor* processor_ = nullptr;
// The bank generation last folded into samples_ (S9 dirty-guard). -1 forces the first
// maybeRefresh() to do a full read (no generation can be negative — parseBankGeneration
// yields >= 0 — so -1 is an "unprimed" sentinel distinct from a real generation 0).
std::int64_t lastSeenBankGeneration_ = -1;
// Snapshotted for the current paint (refreshed each paint off the audio thread).
std::vector<SampleChoice> samples_;
PerformanceMap map_;