Cut shell/capture comment bloat ~33% (comments only, zero code change)

This commit is contained in:
2026-07-29 20:48:59 -04:00
parent 1f24c4b095
commit 54f5f24506
22 changed files with 699 additions and 1215 deletions
+19 -24
View File
@@ -1,18 +1,15 @@
#pragma once
// scope_resolve — scope/source resolution for the capture action family (Q-W3
// hoist out of main.cpp). The three concerns every capture entry point shares:
// * RANGE inference — razor union else time selection (razor-else-time),
// orthogonal to scope;
// * SOURCE-TRACK collection — the selected tracks (Track scope) or the selected
// items' owning tracks (Item scope), deduped, with canonical GUIDs;
// * PROVENANCE ASSEMBLY inputs — the M10 resample-from-sample detection + the
// thin capture-recipe fingerprint built from the LIVE (un-bypassed) chain.
// Scope/source resolution shared by every capture entry point. Three concerns:
// * range inference — razor union else time selection, orthogonal to scope;
// * source-track collection — selected tracks (Track scope) or selected items'
// owning tracks (Item scope), deduped, with canonical GUIDs;
// * provenance-assembly inputs — resample-from-sample detection + the thin
// capture-recipe fingerprint built from the live (un-bypassed) chain.
//
// All reads are non-destructive: selection, razor, and time selection are read,
// never mutated. REAPER-facing: the .cpp includes reaper_plugin_functions.h
// WITHOUT REAPERAPI_IMPLEMENT (main.cpp owns the API pointers — CLAUDE.md
// §contract). MediaTrack is forward-declared (via capture.h) so this header stays
// SDK-lite.
// never mutated. The .cpp includes reaper_plugin_functions.h WITHOUT
// REAPERAPI_IMPLEMENT (main.cpp owns the API pointers). MediaTrack is forward-
// declared (via capture.h) so this header stays SDK-lite.
#include <optional>
#include <string>
@@ -35,18 +32,16 @@ struct ResolvedSource
{
double startSeconds = 0.0;
double endSeconds = 0.0;
std::vector<MediaTrack*> sourceTracks; // item-owning tracks / selected tracks
std::vector<std::string> trackGuids; // canonical GUIDs of sourceTracks
std::vector<MediaTrack*> sourceTracks;
std::vector<std::string> trackGuids;
};
// Reads every track's P_RAZOREDITS, parses the track-audio areas (pure
// parseRazorEdits), and returns the union bound. Reads only — never clears the
// razor selection. Returns false when no track-audio razor area exists on any track.
// Reads every track's P_RAZOREDITS and returns the union of parsed track-audio
// areas. Reads only — never clears the razor selection.
bool resolveRazorRange(double& start, double& end);
// Infers the render RANGE for any scope: razor union when a razor area is present,
// else the time selection (pure inferRangeSource decides which). Orthogonal to
// scope. Returns false (with a reason) when neither yields a non-empty range.
// Infers the render range for any scope: razor union when present, else the time
// selection. Returns false with a reason when neither yields a non-empty range.
bool resolveRange(double& start, double& end, std::string& why);
// Collects the selected tracks (Track scope) into out.sourceTracks + GUIDs.
@@ -60,10 +55,10 @@ bool ResolveScopeSource(CaptureScope scope, ResolvedSource& out, std::string& wh
// slash. Empty for an unsaved project (no false parentage). Read-only.
std::string currentProjectDir();
// Builds the M10 provenance for a capture IF it genuinely resamples from a bank
// sample (detectParent over `book`'s resolved file refs), else returns nullopt (the
// common, non-resample case). Must run BEFORE the FxBypassGuard neutralizes the
// in-scope chain — the source FX-chain identity is read from the LIVE chain.
// Builds the provenance for a capture if it genuinely resamples from a bank sample
// (detectParent over `book`'s resolved file refs), else returns nullopt (the common,
// non-resample case). Must run BEFORE the FxBypassGuard neutralizes the in-scope
// chain — the source FX-chain identity is read from the live chain.
std::optional<model::Provenance> buildCaptureProvenance(
const BankBook& book, const CaptureRequest& req,
CaptureScope scope, const ResolvedSource& src);