pS-usage: captures held by live ReaSampler 9000 instances are un-prunable — instances publish usage_<guid> ext-state records (ComponentState v11), prune unions live holds into referenced

This commit is contained in:
2026-07-28 12:56:36 -04:00
parent f988ded543
commit 5886ae1456
19 changed files with 1282 additions and 10 deletions
+19
View File
@@ -69,4 +69,23 @@ inline constexpr const char* kProjExtBankGenKey = "bank_generation";
// changing this spelling strands any pending request an already-shipped instrument watches.
inline constexpr const char* kProjExtAssignKey = "assign_request";
// The pS-usage PER-INSTANCE USAGE-RECORD key prefix. The INSTRUMENT writes one key per
// instance — "usage_<instanceGuid>" — carrying the sample_usage wire record of every
// capture that instance holds; the EXTENSION enumerates the prefix at prune-scan time
// and folds live instances' holds into the prune's `referenced` set so a held capture
// can never be pruned. This is the ONE sanctioned instrument-side ext-state write
// (Daniel's ruling — the VST publishes its OWN usage; it never mutates banks/view/
// tail/assign, and the bridge's write entry point structurally accepts only this
// prefix). WIRE-SHARED in the write->read direction the other keys reverse. FOREVER-
// STABLE once shipped: changing the prefix strands every saved project's usage records
// (prune falls back to bank-references-only until instances republish — graceful, but
// the instance-hold protection lapses for stale-saved projects).
inline constexpr const char* kProjExtUsageKeyPrefix = "usage_";
// The full per-instance usage key for a minted instance GUID (the one composition
// point, shared by the instrument's writer and the extension's enumerator).
inline std::string usageKeyFor(const std::string& instanceGuid) {
return std::string(kProjExtUsageKeyPrefix) + instanceGuid;
}
} // namespace reasampler