Q-W6: registration table (OCP) in main.cpp; bank verbs -> shell/bank_ops(Session&); persist.h + wav_trim + namespaces.h shims deleted; 61/61
capture.h realtime seam split to capture_realtime_shell.h; GetProjExtState grow-loop rehomed to core/wire/ext_state_read; stale persist.cpp/bank_panel.cpp comment refs fixed; CLAUDE.md persist/bank_book/actions bullets updated. Command-id suffixes, display phrases, and undo labels byte-identical.
This commit is contained in:
@@ -36,7 +36,7 @@
|
||||
|
||||
#include "core/capture/capture_paths.h" // projectDirOfRpp (pure path arithmetic)
|
||||
#include "core/instrument/map/bank_sync.h" // parseBankGeneration / formatBankGeneration (SHARED with the instrument reader)
|
||||
#include "core/instrument/map/bridge_marshal.h" // readProjExtStateGrowing (T2-04: the ONE grow-loop policy)
|
||||
#include "core/wire/ext_state_read.h" // readProjExtStateGrowing (T2-04: the ONE grow-loop policy)
|
||||
#include "core/version/app_version.h"
|
||||
|
||||
#define REAPERAPI_MINIMAL
|
||||
@@ -77,15 +77,15 @@ std::string projectDirOf(const std::string& rppPath) {
|
||||
|
||||
// GetProjExtState needs a caller-supplied buffer; the index JSON can be large
|
||||
// (many samples). The grow-until-strict-fit retry policy is the SHARED pure
|
||||
// instrument::map::readProjExtStateGrowing (Q-W5 rider T2-04 — the same policy the
|
||||
// usage_scan and VST-bridge reads run); this wrapper binds the REAPER call and
|
||||
// wire::readProjExtStateGrowing (T2-04 — the same policy the usage_scan and
|
||||
// VST-bridge reads run); this wrapper binds the REAPER call and
|
||||
// folds the terminal cases persist's callers expect: "" for an absent key (a valid
|
||||
// empty bank, not an error) and a console warning + "" for a value exceeding the
|
||||
// 16 MB ceiling, so an over-large value reads as "too large to load", not silent
|
||||
// data loss (mirrors the malformed-JSON warning in loadFromProject).
|
||||
std::string getProjExtStateString(void* proj, const char* ns, const char* key) {
|
||||
using instrument::map::GrowingExtStateRead;
|
||||
const GrowingExtStateRead read = instrument::map::readProjExtStateGrowing(
|
||||
using wire::GrowingExtStateRead;
|
||||
const GrowingExtStateRead read = wire::readProjExtStateGrowing(
|
||||
[&](char* buf, int cap) {
|
||||
return GetProjExtState(static_cast<ReaProject*>(proj), ns, key, buf, cap);
|
||||
});
|
||||
|
||||
@@ -29,8 +29,8 @@ std::string projectDirOf(const std::string& rppPath);
|
||||
// Growing GetProjExtState read for `key` in namespace `ns` against `proj`. Returns
|
||||
// "" when the key is absent (a valid empty bank, not an error) and warns on the
|
||||
// console for a value exceeding the 16 MB read ceiling (unreadable whole, ignored).
|
||||
// The retry policy itself is the shared pure instrument::map::readProjExtStateGrowing
|
||||
// (Q-W5 rider, T2-04); this wrapper binds the REAPER call + persist's fold.
|
||||
// The retry policy itself is the shared pure wire::readProjExtStateGrowing
|
||||
// (T2-04; rehomed to core/wire in Q-W6); this wrapper binds the REAPER call + persist's fold.
|
||||
std::string getProjExtStateString(void* proj, const char* ns, const char* key);
|
||||
|
||||
// The GUID we mint per project, formatted "{XXXXXXXX-....}" by guidToString.
|
||||
|
||||
@@ -1,4 +1,3 @@
|
||||
#include "core/namespaces.h"
|
||||
// usage_scan.cpp — see usage_scan.h. The REAPER reads behind the pS-usage prune
|
||||
// protection; every decision is in the pure sample_usage module, this TU only reads.
|
||||
//
|
||||
@@ -27,7 +26,7 @@
|
||||
#include <vector>
|
||||
|
||||
#include "core/version/app_version.h" // vstPluginName / vstOutputName (channel name needles)
|
||||
#include "core/instrument/map/bridge_marshal.h" // readProjExtStateGrowing (T2-04: the ONE grow-loop policy)
|
||||
#include "core/wire/ext_state_read.h" // readProjExtStateGrowing (T2-04: the ONE grow-loop policy)
|
||||
#include "ext_keys.h" // kProjExtNamespace / kProjExtUsageKeyPrefix
|
||||
#include "core/wire/instrument_drop.h" // vstClassIdHex — the frozen channel class-UID hex
|
||||
#include "core/wire/sample_usage.h" // identityMatches, foldUsageRecords (the pure decisions)
|
||||
@@ -53,6 +52,14 @@
|
||||
|
||||
namespace reasampler {
|
||||
|
||||
// Real-namespace-home using-directive (Q-W6: the namespaces.h shim is retired):
|
||||
// this TU speaks the sample_usage wire vocabulary wholesale (UsageRecord /
|
||||
// decodeUsageRecord / foldUsageRecords / identityMatches / toUpperAscii) plus the
|
||||
// channel-identity accessors + the preset class-id hex.
|
||||
using namespace reasampler::wire;
|
||||
using version::vstOutputName;
|
||||
using version::vstPluginName;
|
||||
|
||||
namespace {
|
||||
|
||||
// The three UPPERCASED channel needles identityMatches (pure, sample_usage) checks
|
||||
@@ -169,16 +176,15 @@ bool itemHasInstance(MediaItem* item, const FxIdentityNeedles& id) {
|
||||
|
||||
// Growing GetProjExtState read: the usage record scales with the hold count, so a
|
||||
// fixed buffer risks a truncated decode. The retry policy is the SHARED pure
|
||||
// instrument::map::readProjExtStateGrowing (Q-W5 rider T2-04 — one loop for persist,
|
||||
// this prune-safety-adjacent read, and the VST bridge; the rules cannot drift).
|
||||
// wire::readProjExtStateGrowing (T2-04 — one loop for persist, this
|
||||
// prune-safety-adjacent read, and the VST bridge; the rules cannot drift).
|
||||
// Returns nullopt when the key cannot be read WHOLE — absent-after-enumeration
|
||||
// (rv <= 0) or pathologically large (> 16 MB give-up). The caller only queries keys
|
||||
// the enumeration just listed, so a nullopt here is a PRESENT-BUT-UNREADABLE record:
|
||||
// it folds to abortPrune (fail-safe — silently reduced protection is the delete
|
||||
// direction).
|
||||
std::optional<std::string> readExtStateValue(ReaProject* proj, const char* key) {
|
||||
using instrument::map::GrowingExtStateRead;
|
||||
const GrowingExtStateRead read = instrument::map::readProjExtStateGrowing(
|
||||
const GrowingExtStateRead read = readProjExtStateGrowing(
|
||||
[&](char* buf, int cap) {
|
||||
return GetProjExtState(proj, kProjExtNamespace(), key, buf, cap);
|
||||
});
|
||||
|
||||
@@ -1,5 +1,4 @@
|
||||
#pragma once
|
||||
#include "core/namespaces.h"
|
||||
// usage_scan — the EXTENSION-side shell of the pS-usage seam (see sample_usage.h for
|
||||
// the pure core, the fail-safe folds, and the full design note). At prune-scan time it
|
||||
// answers ONE question: which project-relative bank paths are held by a LIVE ReaSampler
|
||||
|
||||
Reference in New Issue
Block a user