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:
2026-07-29 13:40:09 -04:00
parent 4831e0e172
commit f3be4d8cce
81 changed files with 970 additions and 1085 deletions
+1
View File
@@ -22,6 +22,7 @@
namespace reasampler::vst {
using namespace reasampler::instrument::map; // ZonePlaySeconds vocabulary + trigger_seam converters
using instrument::ui::EnvMode; // envelope_overlay's mode enum (Q-W6: shim retired)
using instrument::engine::formatMasterGainLabel;
using instrument::engine::masterGainLinearFromNorm;
using instrument::engine::masterGainNormFromLinear;
+1 -1
View File
@@ -209,7 +209,7 @@ LRESULT CALLBACK ReaSamplerEditor::wndProc(HWND hwnd, UINT msg, WPARAM wParam,
// Capture stolen mid-drag (modal dialog, alt-tab, etc.) — restore map_ to its
// pre-grab snapshot so the in-flight live-drag mutation is rolled back, then reset
// the drag state machine so stale capture-less WM_MOUSEMOVEs don't keep editing.
// Mirror of bank_panel.cpp's WM_CAPTURECHANGED handler.
// Mirror of the panel shell's WM_CAPTURECHANGED handler (panel_window.cpp).
if (self) {
// A held preview note must be released here too (peer of WM_LBUTTONUP) — capture
// loss otherwise leaves the momentary-key voice hung with no note-off.
+1 -1
View File
@@ -15,7 +15,7 @@
#include "core/audio/peaks.h" // computeEnvelope (the cached peak thumbnail)
#include "core/capture/capture_paths.h" // resolveBankFile (shared M4 path resolution)
#include "core/capture/wav_trim.h" // parseWavLayout, extractFloatFrames
#include "core/capture/wav_codec.h" // parseWavLayout, extractFloatFrames
#include "core/ui/bank_grid.h" // ThumbnailKey / thumbnailKeyString (T2-10: the pure key)
#include "core/util/file_bytes.h" // shared whole-file loader (Q-W1, T2-03)
#include "ext_keys.h"
+7 -1
View File
@@ -19,7 +19,7 @@
#include <vector>
#include "core/capture/capture_paths.h" // resolveBankFile (shared M4 path resolution)
#include "core/capture/wav_trim.h" // parseWavLayout, extractFloatFrames (shared WAV parse)
#include "core/capture/wav_codec.h" // parseWavLayout, extractFloatFrames (shared WAV parse)
#include "core/instrument/map/bank_sync.h" // S9/S8 pure decisions: parseBankGeneration, consumeDecision
#include "core/instrument/map/sample_map.h" // refs resolve, buildZonedKeymap (pS self-contained)
#include "core/util/file_bytes.h" // shared whole-file loader (Q-W1, T2-03)
@@ -31,6 +31,12 @@ namespace reasampler::vst {
using namespace instrument::map; // resolution + bank-sync vocabulary this TU drives
using namespace reasampler::wire; // assignment_request + sample_usage wire records
// Q-W6 (shim retired): the shared WAV parse + file loader by their real homes.
using capture::extractFloatFrames;
using capture::parseWavLayout;
using capture::resolveBankFile;
using capture::WavLayout;
using util::readFileBytes;
namespace {
+1
View File
@@ -24,6 +24,7 @@ using namespace Steinberg::Vst;
namespace reasampler::vst {
using namespace instrument::map; // the codec + resolution vocabulary this TU marshals
using instrument::engine::masterGainMaxLinear; // FB1 taper ceiling (Q-W6: shim retired)
tresult PLUGIN_API ReaSamplerProcessor::setState(IBStream* state) {
if (!state) return kResultFalse;
+12 -7
View File
@@ -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).
+2 -2
View File
@@ -16,7 +16,6 @@
// reaper_vst3_interfaces.h + reaper_plugin_functions.h at the spike.
#pragma once
#include "core/namespaces.h"
#include <optional>
#include <string>
@@ -87,7 +86,8 @@ private:
int valOut_sz);
// EnumProjects(-1, projfnOut, sz) -> active project + its .rpp path (SDK line
// ~1264). The instrument uses idx=-1 (current tab) so it follows the active project,
// and reads the .rpp path from the out-buffer exactly as persist.cpp does.
// and reads the .rpp path from the out-buffer exactly as the persist shell
// (ext_state_io.cpp) does.
using EnumProjectsFn = void* (*)(int idx, char* projfnOut, int projfnOut_sz);
// SetProjExtState(proj, extname, key, value) -> int (SDK line ~6290). Used ONLY by
// writeUsageExtState (prefix-guarded) — see the read-only-bank note there.
+9 -2
View File
@@ -1,4 +1,3 @@
#include "core/namespaces.h"
// reasampler_embed.cpp — see reasampler_embed.h. The IReaperUIEmbedInterface shell.
// Windows-only (D5); guarded so a non-Windows build degrades to a stub that reports
// "not supported" and draws nothing.
@@ -43,6 +42,14 @@ DEF_CLASS_IID(Steinberg::IReaperUIEmbedInterface)
namespace reasampler::vst {
// Real-namespace-home using-directives (Q-W6: the namespaces.h shim is retired):
// the embed strip speaks the map vocabulary (listSamples / parseBankGeneration) and
// the pure UI layout (embed_strip / editor_geometry Rect) wholesale.
using namespace reasampler::instrument::map;
using namespace reasampler::instrument::ui;
using reasampler::ui::spectralColor;
using version::vstPluginName;
namespace {
#ifdef _WIN32
// Kit adapter (Phase L, L3): the embed shell's Rect (editor_geometry) -> the kit's KitBox
@@ -201,7 +208,7 @@ bool ReaSamplerEmbed::paint(TPtrInt bitmap, TPtrInt drawInfo) {
// reads as "present, no zones" — the default single-capture face lives in the editor.
LICE_FillRect(bmp, layout.keymap.x, layout.keymap.y, layout.keymap.width,
layout.keymap.height, toLice(roleColor(Role::BgCell)), 0.5f, 0);
const std::string label = reasampler::vstPluginName() + // channel-derived (S18)
const std::string label = version::vstPluginName() + // channel-derived (S18)
(samples_.empty() ? " (bank empty)" : " (no zones)");
const Rect labelR = Rect::ltrb(layout.keymap.x + 4, layout.keymap.y, layout.keymap.right(),
layout.keymap.bottom());
+4 -1
View File
@@ -31,7 +31,6 @@
// REAPER's messages to/from it and draws with the same LICE idiom as reasampler_editor.
#pragma once
#include "core/namespaces.h"
#include <cstdint>
#include <string>
@@ -52,6 +51,10 @@ namespace reasampler::vst {
class ReaSamplerProcessor;
// Real-namespace-home using-declarations (Q-W6: the namespaces.h shim is retired).
using instrument::map::PerformanceMap;
using instrument::map::SampleChoice;
// Implements IReaperUIEmbedInterface. Lifetime is OWNED by the processor (the processor
// holds the sole unique_ptr and hands out AddRef'd references from queryInterface); the
// back-pointer to the processor is therefore always valid while this lives.
-1
View File
@@ -18,7 +18,6 @@
// binary UID identity — the string identity lives in the pure module).
#pragma once
#include "core/namespaces.h"
#include "pluginterfaces/base/funknown.h"
+2 -3
View File
@@ -1,4 +1,3 @@
#include "core/namespaces.h"
// vst_entry.cpp — the VST3 module class factory (Phase S1). Enumerates the one class
// this module offers (the ReaSampler instrument) via the SDK's factory macros. The
// Windows module exports — GetPluginFactory (here, via BEGIN_FACTORY) and
@@ -74,10 +73,10 @@ DEF_CLASS2(INLINE_UID(REASAMPLER_ACTIVE_UID_1, REASAMPLER_ACTIVE_UID_2,
REASAMPLER_ACTIVE_UID_3, REASAMPLER_ACTIVE_UID_4),
Steinberg::PClassInfo::kManyInstances, // cardinality
kVstAudioEffectClass, // component category (fixed)
reasampler::vstPluginName().c_str(), // plug-in display name (channel-derived)
reasampler::version::vstPluginName().c_str(), // plug-in display name (channel-derived)
0, // single-component => 0
Steinberg::Vst::PlugType::kInstrumentSynthSampler, // subcategory
reasampler::appVersion().c_str(), // plug-in version (channel: -beta render)
reasampler::version::appVersion().c_str(), // plug-in version (channel: -beta render)
kVstVersionString, // VST3 SDK version (fixed)
reasampler::vst::ReaSamplerProcessor::createInstance)