Cut core/capture and core/version comment bloat ~45% (comments only, zero code change)

This commit is contained in:
2026-07-29 20:49:23 -04:00
parent 1f24c4b095
commit 12ffe377e5
16 changed files with 475 additions and 991 deletions
+15 -17
View File
@@ -1,34 +1,32 @@
#pragma once
// insert_plan — the REAPER-free logic behind the `insert` shell (M6): computing
// the InsertMedia `mode` bitmask from a small options struct.
// insert_plan — the REAPER-free logic behind the `insert` shell: computing the
// InsertMedia `mode` bitmask from a small options struct.
//
// PURE MODULE (CLAUDE.md §load-bearing split): NO REAPER types, NO SWELL, NO
// vendor/ includes. Standard library only. The one genuinely testable-outside-DAW
// piece of insert is the mode-bit arithmetic — the InsertMedia bitfield is easy to
// get wrong and its bits are load-bearing for the "no silent time-stretch"
// invariant, so it is factored here and unit-tested. The REAPER-bound placement
// (InsertMedia call, edit-cursor movement, undo block) lives in insert.cpp and is
// DAW-verified.
// PURE MODULE: NO REAPER types, NO SWELL, NO vendor/ includes. Standard library
// only. The InsertMedia bitfield is easy to get wrong and its bits are
// load-bearing for the "no silent time-stretch" invariant, so it's factored here
// and unit-tested. The REAPER-bound placement (InsertMedia call, edit-cursor
// movement, undo block) lives in insert.cpp and is DAW-verified.
//
// The bit meanings below are transcribed VERBATIM from the authoritative header
// Bit meanings below are transcribed VERBATIM from the authoritative header
// doc-comment (vendor/reaper-sdk/sdk/reaper_plugin_functions.h, InsertMedia):
// mode: 0=add to current track, 1=add new track, 3=add to selected items as
// takes, &4=stretch/loop to fit time sel, &8=try to match tempo 1x,
// &16=try to match tempo 0.5x, &32=try to match tempo 2x,
// &64=don't preserve pitch when matching tempo, ...
// We intentionally use only the base target (0/1) and the tempo-conform bits
// (&8/&16/&32/&64). We NEVER set &4 (stretch/loop to fit time selection) — that is
// the silent-time-stretch path the tool forbids (CONTEXT.md §Non-goals).
// We use only the base target (0/1) and the tempo-conform bits (&8/&16/&32/&64).
// We NEVER set &4 (stretch/loop to fit time selection) — the silent-time-stretch
// path the tool forbids.
#include <cstdint>
namespace reasampler::capture {
// Where InsertMedia drops the item. Maps to the low bits of `mode` (mode&3).
// We expose only the two placement targets M6 needs; "add as takes" (3) is a
// later concern (YAGNI). Both insert AT THE EDIT CURSOR — that is REAPER's
// convention for base modes 0/1 (the header names no explicit edit-cursor bit;
// see the flagged runtime assumption in insert.cpp).
// We expose only the two placement targets needed here; "add as takes" (3) is
// out of scope. Both insert at the edit cursor — REAPER's convention for base
// modes 0/1 (the header names no explicit edit-cursor bit; see the flagged
// runtime assumption in insert.cpp).
enum class InsertTarget {
NewTrack, // mode base 1: add a new track for the item
CurrentTrack, // mode base 0: add to the current/selected track