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
+7
View File
@@ -458,6 +458,10 @@ void doImportFromMediaExplorer() {
// zero flag so REAPER discards the undo entry (the house pattern from actions.cpp).
if (r.added) {
Undo_BeginBlock2(nullptr);
// S9: an ingest import adds a sample to the active bank -> bump inside the block so
// the stamped generation refreshes the assigned instance hands-free (and undo rolls
// the generation back with the banks/assign_request keys).
g_session->bumpBankGeneration();
const bool persisted = g_session->saveToActiveProject();
// Assign request inside the same block: undo rolls back both keys together.
ingestAssignActiveInstance(g_session->book().activeBankId(), r.sampleId);
@@ -531,6 +535,9 @@ void ingestDroppedFiles(const std::vector<std::string>& absolutePaths) {
if (!firstAssignId.empty()) {
if (importedNew > 0) {
Undo_BeginBlock2(nullptr);
// S9: one coalesced bump for the whole drop (>=1 new sample landed) inside the
// block so the generation refreshes the assigned instance and undo rolls it back.
g_session->bumpBankGeneration();
const bool persisted = g_session->saveToActiveProject();
// Assign inside the block: undo restores both keys atomically.
ingestAssignActiveInstance(firstAssignBank, firstAssignId);