S4 Tier 0: the bank plays — VST3 marshals MIDI to the S3 core, reads the live bank + resolves WAV the M4 way, mono downmix, lock-free load handoff, LICE sample-pick
This commit is contained in:
+38
-58
@@ -22,6 +22,7 @@
|
||||
#include "app_version.h"
|
||||
#include "bank_book.h"
|
||||
#include "bank_model.h"
|
||||
#include "ext_keys.h"
|
||||
#include "owned_manifest.h"
|
||||
#include "prune_reconcile.h"
|
||||
#include "tail_control.h"
|
||||
@@ -29,71 +30,50 @@
|
||||
|
||||
namespace reasampler {
|
||||
|
||||
// The ext-state namespace every ReaSampler key is stored under. CHANNEL-DERIVED (Phase V,
|
||||
// V4): the pure app_version module owns the one channel-qualified string — "reasampler" on
|
||||
// stable (byte-identical to the pre-V4 build) or "reasampler_beta" on the isolated beta
|
||||
// build. FOREVER-STABLE per channel once shipped: changing either orphans every already-
|
||||
// saved project's state. Beta reads/writes ONLY its own namespace — a project saved by
|
||||
// stable shows empty/default state in beta and vice versa; that isolation is the accepted
|
||||
// V4 safety property (no cross-namespace read, migration, or fallback), not a bug.
|
||||
// Returns const char* (not a constexpr literal) because the string is channel-derived at
|
||||
// build time; the accessor is the single call point for all persist reads/writes below.
|
||||
// The ext-state namespace + the WIRE-SHARED key names are the contract between this
|
||||
// extension (writer) and the VST3 instrument (reader), so they live in ext_keys.h
|
||||
// (pure, REAPER-free) and are included above — not duplicated here. The namespace is
|
||||
// CHANNEL-DERIVED (Phase V, V4): ext_keys.h's kProjExtNamespace / this projExtNamespace()
|
||||
// both delegate to app_version's extStateNamespace() — "reasampler" on stable (byte-
|
||||
// identical to the pre-V4 build) or "reasampler_beta" on the isolated beta build. Both
|
||||
// artifacts read the ONE app_version symbol, so the instrument reads exactly the namespace
|
||||
// the extension writes, per channel. Beta reads/writes ONLY its own namespace — a project
|
||||
// saved by stable shows empty/default state in beta and vice versa; that isolation is the
|
||||
// accepted V4 safety property (no cross-namespace read, migration, or fallback), not a bug.
|
||||
// The per-key semantics persist relies on (spellings owned by ext_keys.h):
|
||||
// * kProjExtBanksKey : the whole serialized BankBook (pool + named banks).
|
||||
// AUTHORITATIVE going forward; the VST reads this key to see the live bank.
|
||||
// * kProjExtIndexKey : RETIRED legacy single-bank key. No longer WRITTEN (cleared
|
||||
// on save); READ once on load to migrate a legacy project into the pool.
|
||||
// * kProjExtViewKey : the Design-View ViewModeModel JSON.
|
||||
// * kProjExtTailKey : the docked panel's TailSetting JSON.
|
||||
// * kProjExtGuidKey : the per-project minted GUID (content-based identity; poll()
|
||||
// tells a Save-As from a recycled-pointer project switch by it).
|
||||
// All are FOREVER-STABLE once shipped: changing any strands every already-saved
|
||||
// project's stored state under that key.
|
||||
//
|
||||
// The accessor form of the namespace: ext_keys.h's kProjExtNamespace is the value; this
|
||||
// is the const char* the SetProjExtState/GetProjExtState calls in persist.cpp pass. Kept
|
||||
// as an accessor (not a literal) because the string is channel-derived at build time.
|
||||
inline const char* projExtNamespace() { return extStateNamespace().c_str(); }
|
||||
|
||||
// The RETIRED legacy ext-state key: pre-multi-bank projects stored the whole
|
||||
// serialized BankIndex here (single bank). Phase B2 no longer WRITES it — on save
|
||||
// the key is cleared (SetProjExtState with "" deletes it) and the book is written
|
||||
// under kProjExtBanksKey instead. It is still READ once, on load of a legacy
|
||||
// project, to migrate its single index into the pool (BankBook's parse-time
|
||||
// promotion). FOREVER-STABLE as a read key for that migration path.
|
||||
inline constexpr const char* kProjExtIndexKey = "bank_index";
|
||||
|
||||
// The multi-bank ext-state key (Phase B): one key holds the whole serialized
|
||||
// BankBook — the pool folded in as bank-zero plus every named bank, each with its
|
||||
// own BankIndex, ordinals, and the active-bank id. AUTHORITATIVE going forward;
|
||||
// supersedes kProjExtIndexKey. FOREVER-STABLE once shipped: changing it orphans
|
||||
// every already-saved project's banks.
|
||||
inline constexpr const char* kProjExtBanksKey = "banks";
|
||||
|
||||
// The ext-state key the Design-View ViewModeModel JSON is stored under (one key
|
||||
// holds the whole serialized model: modes + membership + show-both + snapshots +
|
||||
// active mode). Distinct from kProjExtIndexKey — one namespace, two keys.
|
||||
// FOREVER-STABLE: changing it orphans every already-saved project's view state.
|
||||
inline constexpr const char* kProjExtViewKey = "view_state";
|
||||
|
||||
// The ext-state key the docked panel's TailSetting JSON (mode + manualMs) is stored
|
||||
// under, so the tail choice travels inside the .rpp and loads per project. Distinct
|
||||
// from the index/view keys — one namespace, three keys. FOREVER-STABLE: changing it
|
||||
// orphans every already-saved project's tail setting (which then falls back to the
|
||||
// default — graceful, but the user's saved choice would be lost).
|
||||
inline constexpr const char* kProjExtTailKey = "tail_setting";
|
||||
|
||||
// The ext-state key holding the owned-file manifest JSON (the set of project-relative
|
||||
// files the capture path itself created — Phase B B-cap seam, consumed by Phase R
|
||||
// prune to distinguish the bank system's own orphans from hand-dropped files). A
|
||||
// SIBLING key alongside banks/view_state/tail_setting — NOT folded into the `banks`
|
||||
// blob, so it stays decoupled from bank membership (removing an index entry is not a
|
||||
// manifest removal). One namespace, four content keys. FOREVER-STABLE: changing it
|
||||
// strands every already-saved project's ownership record, so Phase R prune could no
|
||||
// longer tell the tool's own files apart (it would fall back to an empty manifest —
|
||||
// The two EXTENSION-ONLY keys — NOT part of the VST wire contract (the instrument
|
||||
// reads only banks/view/tail/guid), so they stay here rather than in ext_keys.h:
|
||||
//
|
||||
// owned_files — the owned-file manifest JSON (project-relative files the capture path
|
||||
// itself created; Phase B B-cap seam, consumed by Phase R prune to tell the bank system's
|
||||
// own orphans from hand-dropped files). A SIBLING key alongside banks/view/tail — NOT
|
||||
// folded into `banks`, so it stays decoupled from membership. FOREVER-STABLE: changing it
|
||||
// strands every saved project's ownership record (prune falls back to an empty manifest —
|
||||
// graceful, but the attribution safety net is lost until the next capture rebuilds it).
|
||||
inline constexpr const char* kProjExtOwnedKey = "owned_files";
|
||||
|
||||
// The ext-state key holding the ReaSampler version that last WROTE this project
|
||||
// (Phase V, V1). Written on every save alongside the banks/view/tail keys, so every
|
||||
// saved .rpp records which build produced its state — the seam a future within-channel
|
||||
// forward migration keys off ("this was written by 0.9.01, I am 0.9.05"). An absent
|
||||
// key is the explicit pre-versioning case (a project saved before this shipped), read
|
||||
// silently, never an error. FOREVER-STABLE key string once shipped.
|
||||
// version — the ReaSampler version that last WROTE this project (Phase V, V1). Written on
|
||||
// every save, so every saved .rpp records which build produced its state — the seam a
|
||||
// future within-channel forward migration keys off. An absent key is the explicit
|
||||
// pre-versioning case, read silently, never an error. FOREVER-STABLE key string.
|
||||
inline constexpr const char* kProjExtVersionKey = "version";
|
||||
|
||||
// The ext-state key holding a GUID we mint per project to establish CONTENT-BASED
|
||||
// project identity (REAPER exposes no stable per-project GUID). poll() uses it to
|
||||
// tell a genuine Save-As (same GUID, new .rpp path) apart from a project switch
|
||||
// onto a recycled ReaProject* pointer (different GUID). FOREVER-STABLE: changing
|
||||
// it strands the identity of every already-saved project. See persist.cpp.
|
||||
inline constexpr const char* kProjExtGuidKey = "project_guid";
|
||||
|
||||
// Owns the session's BankBook (Phase B: pool + named banks) and drives persistence
|
||||
// against the active REAPER project. One instance lives for the extension's
|
||||
// lifetime (main.cpp). It tracks
|
||||
|
||||
Reference in New Issue
Block a user