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:
@@ -1,4 +1,3 @@
|
||||
#include "core/namespaces.h"
|
||||
// reaper_bridge.cpp — see reaper_bridge.h. The DAW-facing edge; keep it thin.
|
||||
|
||||
#include "shell/instrument/reaper_bridge.h"
|
||||
@@ -6,6 +5,7 @@
|
||||
#include <vector>
|
||||
|
||||
#include "core/instrument/map/bridge_marshal.h"
|
||||
#include "core/wire/ext_state_read.h" // readProjExtStateGrowing (T2-04 grow-loop policy)
|
||||
#include "core/capture/capture_paths.h" // projectDirOfRpp (shared M4 project-dir derivation)
|
||||
#include "ext_keys.h" // kProjExtNamespace (shared wire contract)
|
||||
|
||||
@@ -39,6 +39,10 @@ DEF_CLASS_IID(Steinberg::IReaperHostApplication)
|
||||
|
||||
namespace reasampler::vst {
|
||||
|
||||
// Real-namespace-home using-declarations (Q-W6: the namespaces.h shim is retired).
|
||||
using capture::projectDirOfRpp;
|
||||
using instrument::map::decodeGetProjExtState;
|
||||
|
||||
bool ReaperBridge::connect(Steinberg::FUnknown* context) {
|
||||
getProjExtState_ = nullptr;
|
||||
enumProjExtState_ = nullptr;
|
||||
@@ -63,7 +67,8 @@ bool ReaperBridge::connect(Steinberg::FUnknown* context) {
|
||||
enumProjExtState_ = reinterpret_cast<EnumProjExtStateFn>(
|
||||
reaper->getReaperApi("EnumProjExtState"));
|
||||
// EnumProjects(-1, ...) yields the active project AND its .rpp path — the same call
|
||||
// persist.cpp uses, so the instrument derives the project directory identically.
|
||||
// the persist shell (ext_state_io.cpp) uses, so the instrument derives the project
|
||||
// directory identically.
|
||||
enumProjects_ = reinterpret_cast<EnumProjectsFn>(
|
||||
reaper->getReaperApi("EnumProjects"));
|
||||
// pS-usage: the (prefix-guarded) usage publish write + the track-identity pair the
|
||||
@@ -93,17 +98,17 @@ std::optional<std::string> ReaperBridge::readReasamplerExtState(const std::strin
|
||||
|
||||
// GetProjExtState writes into a caller buffer; the bank blob can be large (many
|
||||
// samples), so grow the buffer until the value fits rather than risk a silent
|
||||
// truncation. The retry policy is the SHARED pure
|
||||
// instrument::map::readProjExtStateGrowing (Q-W5 rider T2-04 — one loop for the
|
||||
// truncation. The retry policy is the SHARED pure wire::readProjExtStateGrowing
|
||||
// (T2-04 — one loop for the
|
||||
// extension's persist/usage reads and this bridge read; the rules cannot drift):
|
||||
// absent (rv <= 0) and the >16 MB ceiling both fold to nullopt here, and a
|
||||
// complete value still runs through decodeGetProjExtState (the stale/empty-buffer
|
||||
// guard) exactly as before.
|
||||
const auto read = instrument::map::readProjExtStateGrowing(
|
||||
const auto read = wire::readProjExtStateGrowing(
|
||||
[&](char* buf, int cap) {
|
||||
return getProjExtState_(proj, kProjExtNamespace(), key.c_str(), buf, cap);
|
||||
});
|
||||
if (read.status != instrument::map::GrowingExtStateRead::Status::Complete)
|
||||
if (read.status != wire::GrowingExtStateRead::Status::Complete)
|
||||
return std::nullopt; // absent / empty key, or pathologically large (>16 MB)
|
||||
return decodeGetProjExtState(read.apiReturn, read.value);
|
||||
}
|
||||
@@ -147,7 +152,7 @@ std::string ReaperBridge::currentTrackGuid() {
|
||||
std::string ReaperBridge::activeProjectDir() {
|
||||
if (!enumProjects_) return {};
|
||||
// idx=-1 is the current project tab; the out-buffer receives the full .rpp path,
|
||||
// EMPTY for a never-saved project. Same call + convention as persist.cpp; the pure
|
||||
// EMPTY for a never-saved project. Same call + convention as the persist shell; the pure
|
||||
// projectDirOfRpp turns the .rpp path into the project directory (parent, forward-
|
||||
// slashed) and keeps an unsaved project's empty path empty (no default-location
|
||||
// fallback — the tool's invariant).
|
||||
|
||||
Reference in New Issue
Block a user