Q-W3: main.cpp → pointers+entry+dispatch via 4 capture hoists; one pure wav_codec RIFF owner; ICaptureBackend deleted; capture_realtime rename + finalize split; shared stampCaptureSample; makeUniqueTag gains monotonic counter (fixes same-second batch collisions). 60/60 green.

This commit is contained in:
2026-07-29 10:56:11 -04:00
parent d7d7f7e084
commit 09f7173db2
29 changed files with 2972 additions and 2426 deletions
+43 -28
View File
@@ -310,30 +310,40 @@ add_library(prune_button STATIC src/core/ui/prune_button.cpp)
target_include_directories(prune_button PUBLIC src)
# ---------------------------------------------------------------------------
# 2g) Pure realtime_record library — NO REAPER, NO SWELL. The M8 realtime-record
# logic: capture scope + FX-tap point -> I_RECMODE / I_RECMODE_FLAGS values,
# wet/dry -> tap point, and the recorded-file -> Sample mapping. Split out so
# the fiddly record-mode bit values + Sample population are unit-tested outside
# the DAW; the transport/temp-track/send/file-move recipe stays in capture.cpp.
# 2g) Pure capture_realtime library — NO REAPER, NO SWELL. (Renamed from
# realtime_record in Q-W3 — the Q-9 naming rider: pure module takes the stem,
# the shell takes the suffix, matching drag_out <-> drag_out_win.) The M8
# realtime-record logic: capture scope + FX-tap point -> I_RECMODE /
# I_RECMODE_FLAGS values, wet/dry -> tap point, the recorded-file -> Sample
# mapping, and the async record-phase state machine. Split out so the fiddly
# record-mode bit values + Sample population + phase transitions are
# unit-tested outside the DAW; the transport/temp-track/send recipe stays in
# capture_realtime_shell.cpp (+ the file-side capture_realtime_finalize.cpp).
# Depends on bank_model for the pure Sample / SourceMode types.
# ---------------------------------------------------------------------------
add_library(realtime_record STATIC src/core/capture/realtime_record.cpp)
target_include_directories(realtime_record PUBLIC src)
target_link_libraries(realtime_record PUBLIC bank_model)
add_library(capture_realtime STATIC src/core/capture/capture_realtime.cpp)
target_include_directories(capture_realtime PUBLIC src)
target_link_libraries(capture_realtime PUBLIC bank_model)
# ---------------------------------------------------------------------------
# 2h) Pure wav_trim library — NO REAPER, NO SWELL. The realtime tail's (T2) PCM
# decay-scan trim needs to TRUNCATE the recorded 32-bit-float WAV at a frame
# boundary without corrupting the RIFF container. This module holds the fiddly,
# easy-to-get-wrong part unit-tested outside the DAW: parse the WAV geometry
# (fmt/data chunk walk + 32-bit-float verification), extract the tail-region
# floats to scan, and compute the truncate plan (kept byte length + the two
# patched RIFF/data size fields). The file read/write/truncate I/O stays in the
# realtime shell. Depends on peaks for the AudioSample float alias.
# 2h) Pure wav_codec library — NO REAPER, NO SWELL. The ONE owner of the WAV/RIFF
# byte format (Q-W3, audit §4e: T2-08 / T4-10 / T4-23 consolidation): the RIFF
# chunk walker + layout parse (formerly wav_trim), the tail-trim truncate plan +
# size-field patch (formerly duplicated in capture_realtime), the float32 WAV
# build (formerly hand-rolled in ingest), and the WAV-aware content hashes
# (formerly in capture_paths). The dedup-by-hash and null-test invariants rest
# on this one implementation. File I/O stays in the shells. Depends on peaks
# for the AudioSample float alias.
# `wav_trim` remains as a TRANSITIONAL alias (forwarding header + INTERFACE
# target) so the Q-W2v-owned TUs (sample_map, VST editor/processor) build
# untouched in their parallel wave; retire both once Q-W2v lands.
# ---------------------------------------------------------------------------
add_library(wav_trim STATIC src/core/capture/wav_trim.cpp)
target_include_directories(wav_trim PUBLIC src)
target_link_libraries(wav_trim PUBLIC peaks)
add_library(wav_codec STATIC src/core/capture/wav_codec.cpp)
target_include_directories(wav_codec PUBLIC src)
target_link_libraries(wav_codec PUBLIC peaks)
add_library(wav_trim INTERFACE)
target_link_libraries(wav_trim INTERFACE wav_codec)
# ---------------------------------------------------------------------------
# 2i) Pure app_version library — NO REAPER, NO SWELL. The Phase V (V1) version-identity
@@ -649,9 +659,9 @@ add_executable(tail_control_tests tests/test_tail_control.cpp)
target_link_libraries(tail_control_tests PRIVATE tail_control)
add_test(NAME tail_control_tests COMMAND tail_control_tests)
add_executable(realtime_record_tests tests/test_realtime_record.cpp)
target_link_libraries(realtime_record_tests PRIVATE realtime_record)
add_test(NAME realtime_record_tests COMMAND realtime_record_tests)
add_executable(capture_realtime_tests tests/test_capture_realtime.cpp)
target_link_libraries(capture_realtime_tests PRIVATE capture_realtime)
add_test(NAME capture_realtime_tests COMMAND capture_realtime_tests)
add_executable(bank_book_tests tests/test_bank_book.cpp)
target_link_libraries(bank_book_tests PRIVATE bank_book)
@@ -661,9 +671,9 @@ add_executable(slot_map_tests tests/test_slot_map.cpp)
target_link_libraries(slot_map_tests PRIVATE slot_map json)
add_test(NAME slot_map_tests COMMAND slot_map_tests)
add_executable(wav_trim_tests tests/test_wav_trim.cpp)
target_link_libraries(wav_trim_tests PRIVATE wav_trim)
add_test(NAME wav_trim_tests COMMAND wav_trim_tests)
add_executable(wav_codec_tests tests/test_wav_codec.cpp)
target_link_libraries(wav_codec_tests PRIVATE wav_codec)
add_test(NAME wav_codec_tests COMMAND wav_codec_tests)
add_executable(owned_manifest_tests tests/test_owned_manifest.cpp)
target_link_libraries(owned_manifest_tests PRIVATE owned_manifest)
@@ -1083,8 +1093,13 @@ set(LICE_SRC
add_library(reaper_reasampler MODULE
src/app/main.cpp
src/shell/capture/capture.cpp
src/shell/capture/capture_realtime.cpp
src/core/capture/realtime_record.cpp
src/shell/capture/capture_orchestrator.cpp
src/shell/capture/capture_batch.cpp
src/shell/capture/scope_resolve.cpp
src/shell/capture/realtime_lifecycle.cpp
src/shell/capture/capture_realtime_shell.cpp
src/shell/capture/capture_realtime_finalize.cpp
src/core/capture/capture_realtime.cpp
src/persist.cpp
src/shell/panel/panel_audition.cpp
src/shell/panel/panel_bank_ops.cpp
@@ -1123,7 +1138,7 @@ add_library(reaper_reasampler MODULE
src/core/ui/card_drag.cpp
src/shell/persist/usage_scan.cpp
)
target_link_libraries(reaper_reasampler PRIVATE json wire file_bytes bank_model capture_paths peaks bank_grid mode_switch tab_strip view_mode_model insert_plan render_settings batch_capture tail_control realtime_record bank_book wav_trim owned_manifest prune_reconcile prune_button app_version provenance drag_out instrument_drop theme component_geometry action_bar footer_bar overflow_menu mode_enable tooltip card_meta card_drag assignment_request bank_sync sample_usage)
target_link_libraries(reaper_reasampler PRIVATE json wire file_bytes bank_model capture_paths peaks bank_grid mode_switch tab_strip view_mode_model insert_plan render_settings batch_capture tail_control capture_realtime bank_book wav_codec owned_manifest prune_reconcile prune_button app_version provenance drag_out instrument_drop theme component_geometry action_bar footer_bar overflow_menu mode_enable tooltip card_meta card_drag assignment_request bank_sync sample_usage)
target_include_directories(reaper_reasampler PRIVATE ${SDK_INC} ${WDL_INC})
# OUTPUT_NAME is channel-derived (Phase V, V4): "reaper_reasampler" (stable, default) or
# "reaper_reasampler_beta" (beta). REAPER dlopen's any reaper_* module, so both channels'