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
+17 -22
View File
@@ -1,15 +1,13 @@
#pragma once
// capture_realtime_finalize — the FILE-SIDE half of the realtime-record shell
// (Q-W3, T4-08 split riding the Q-9 rename): discovering the file REAPER actually
// recorded, moving it into the bank, the Auto-tail PCM decay-scan trim, and the
// finished-Sample population. The async record LIFECYCLE (state snapshot/restore,
// begin/tick/abort) lives in capture_realtime_shell.cpp; this half talks to
// wav_codec and the filesystem, not to the transport.
// The file-side half of the realtime-record shell: discovers the file REAPER
// actually recorded, moves it into the bank, runs the Auto-tail decay-scan trim,
// and populates the finished Sample. The async record lifecycle (state
// snapshot/restore, begin/tick/abort) lives in capture_realtime_shell.cpp; this
// half talks to wav_codec and the filesystem, not the transport.
//
// REAPER-facing: the .cpp includes reaper_plugin_functions.h WITHOUT
// REAPERAPI_IMPLEMENT (main.cpp owns the API pointers — CLAUDE.md §contract).
// MediaTrack / ReaProject are forward-declared (via capture.h) so this header
// stays SDK-lite.
// The .cpp includes reaper_plugin_functions.h WITHOUT REAPERAPI_IMPLEMENT
// (main.cpp owns the API pointers). MediaTrack/ReaProject are forward-declared
// (via capture.h) so this header stays SDK-lite.
#include <string>
@@ -18,21 +16,18 @@
namespace reasampler::capture {
// Discovers the file REAPER actually recorded onto the temp track: the first media
// item's active take's source file, forward-slashed. Empty string if nothing was
// recorded (no item / take / source). Also used by the lifecycle's flush wait
// The first media item's active take's source file on the temp track, forward-
// slashed; empty if nothing was recorded. Also used by the lifecycle's flush wait
// (size-stable check) before finalize runs.
std::string recordedFilePath(MediaTrack* temp);
// Builds a CaptureResult for a finalized recording: discover the recorded file,
// move it into the bank at `paths`, Auto-trim the tail decay in place when the
// request asks for it, and populate the Sample (pure sampleFromRecordedCapture +
// the shared stampCaptureSample — both project reads pinned to `proj`, the
// record's OWN project). Returns Ok + Sample on success, or a RenderFailed result.
// Does NOT restore any snapshotted state — the caller restores unconditionally
// afterward (finalize + restore are separate steps so a finalize failure still
// restores). `recordWindowEnd` is the recorded window end in project seconds
// (>= request.endSeconds when a tail was recorded) — the untrimmed-length source.
// Discovers the recorded file, moves it into the bank at `paths`, Auto-trims the
// tail decay in place when requested, and populates the Sample (project reads
// pinned to `proj`, the record's own project). Does NOT restore any snapshotted
// state — the caller restores unconditionally afterward, even on a finalize
// failure, so finalize and restore stay separate steps. `recordWindowEnd` is the
// recorded window end in project seconds (>= request.endSeconds when a tail was
// recorded).
CaptureResult finalizeRecording(ReaProject* proj, MediaTrack* temp,
const CaptureRequest& request,
const BankPaths& paths,