Commit Graph

300 Commits

Author SHA1 Message Date
daniel 78a31ff215 fix(view): lane-separate a content-bearing folder's own media when it's derived-visible in >1 mode
planLaneMinting now takes the model + folder tree and splits a track visible in
2+ modes that carries own media (own-item span OR folder derived-visibility),
fixing an item dropped on a cross-mode folder leaking into every mode. Show-both
tracks are never force-split.
2026-07-24 05:08:18 -04:00
daniel 85993ebc3e feat(persist): persist BankBook under banks key, retire legacy bank_index, route capture to active bank (B2) 2026-07-23 20:26:15 -04:00
daniel b3be9799e0 fix: apply dB compression to waveform thumbnail display
Linear amplitude-to-pixel mapping made -20 dBFS content reach only
10% of cell height and -40 dBFS round to zero. Replace with a dB
scale (floor kDisplayFloorDb = -60 dB, in bank_grid.h) so quiet
content is visible. Pure helper compressAmplitudeForDisplay() lives
in bank_grid; drawThumbnail() calls it. Five new unit tests cover
full-scale, zero, mid-levels, floor clamping, and sign preservation.
2026-07-23 20:21:55 -04:00
daniel b182146f9a feat(view): mint managed lanes to separate cross-mode content per stance (D2 W3-A)
Pure planLaneMinting decides which tracks hold >1 mode's content and which managed
lane each item lands on; view.cpp applies it (I_FREEMODE/I_NUMFIXEDLANES/P_LANENAME/
I_FIXEDLANE) under one undo block, driven off the auto-tag detection tick. Manual lanes
and their items are never touched. Load-time reconcile rebuilds ownership from durable
lane names before reapplying active-mode visibility.
2026-07-23 20:08:38 -04:00
daniel fed70c0a80 Merge: fix reload-in-Design mis-tagging Arrange tracks into Design 2026-07-23 19:31:29 -04:00
daniel 02b6350dc9 fix(bank_panel): drive new-content baseline re-arm from persist's load signal
The detector re-armed its GuidBaseline on a pointer compare (proj != lastProject),
a weaker signal than persist's GUID-primary identity. On a load onto a recycled
ReaProject* the baseline never reset, so the just-loaded project's pre-existing
tracks diffed against the previous project and were mass-tagged into the active
mode — opening a Design-saved project mis-tagged its Arrange tracks. Re-arm now
rides persist's authoritative load signal via bankPanelNotifyProjectLoaded().
2026-07-23 19:26:06 -04:00
daniel 37affc6a70 Add tail manual fine-adjust (scroll) + per-project tail persistence
Relocate TailSetting into ReaSamplerSession; persist serializes it to
a new forever-stable "tail_setting" ext-state key (load-per-project,
save-on-save). Footer scroll-wheel adjusts Manual length in 250ms
steps; label now shows "Tail: Manual X.Xs". Pure step/label/JSON
round-trip covered by tests.
2026-07-23 19:12:12 -04:00
daniel d8725210e7 feat(banks): pure bank_book registry — pool + named banks, move/copy, JSON round-trip (B1) 2026-07-23 18:32:57 -04:00
daniel ae0e76bff7 Merge T2: realtime capture tail trimming 2026-07-23 18:27:27 -04:00
daniel f2bfe466ec T2: realtime capture tail trimming
Auto/Manual/Off tail handling for realtime track-tap capture. Auto scans
recorded PCM backward for last frame above -72 dB and truncates the wav
header-aware (8 s cap); Manual pads a fixed tail; Off is byte-identical.
wav_trim rejects WAVE_FORMAT_EXTENSIBLE with non-float SubFormat GUID.
2026-07-23 18:25:45 -04:00
daniel 85a03fbd13 Merge dev (tail-toggle panel refactor) into D2 Wave 2
# Conflicts:
#	src/bank_panel.cpp
2026-07-23 18:13:18 -04:00
daniel ebdb4eae66 fix(D2-W2): correct manual-lane exemption, drop read-only item C_LANEPLAYS write
isOnManualLane predicate now correctly treats unnamed fixed-lane lanes as manual;
item-side C_LANEPLAYS loop removed (SDK read-only); explicit #include <set> in
view_mode_model.cpp; undo-block omission in detectNewContent documented as intentional.
2026-07-23 17:51:55 -04:00
daniel e3d126c177 Merge Milestone T1: offline capture tail (auto/manual) + docked-panel toggle 2026-07-23 17:33:15 -04:00
daniel af34143107 feat(view): D2 Wave 2 — apply managed-lane ops + timer-diff auto-tag new content
Drives fixed-lane C_LANEPLAYS for managed lanes only (name-keyed, ordinal-renumber
safe) in the view shell; diffs live track/item GUIDs on the panel timer to auto-tag
new content to the active mode, first-poll-guarded. Pure guid_diff + lane_keys
modules unit-tested; folds in Wave-1 polish.
2026-07-23 17:32:22 -04:00
daniel 9a9339b90b refactor(capture): expose offline tail as docked-panel toggle
Replace the ...-with-tail variant actions with a pure tail_control module +
a docked-panel footer toggle (Off/Auto/Manual) read by CAPTURE_ITEM/TRACK.
Default None (byte-identical); Manual fixed 2s, in-memory session lifetime.
Tail mechanism unchanged; retired the variant ids.
2026-07-23 17:32:19 -04:00
daniel 2d225258b4 feat(capture): offline auto/manual tail via pure TailMode mapping
Add TailMode{None,Auto,Manual} + derived -72dB TRIMEND + 8s cap in render_settings;
wire into OfflineRenderBackend with snapshot/restore of the tail settings; add
CAPTURE_ITEM_TAIL/CAPTURE_TRACK_TAIL variant actions (plain actions stay exact-bounds).
2026-07-23 17:08:24 -04:00
daniel 6e901c198c feat(view_mode_model): add D2 pure lane model (ownership index, lane ops, auto-tag)
Extends the REAPER-free view_mode_model for per-item mode membership via fixed
lanes: lane->mode C_LANEPLAYS mapping, managed-vs-manual lane-ownership index,
managed-only item-lane ops in the toggle planner, "which lanes may this toggle
touch" query, auto-tag decision (manual-lane items exempt), and JSON round-trip
of the lane index. D1 behavior and tests unchanged.
2026-07-23 16:56:36 -04:00
daniel 4ef41cf705 refactor(capture): drop master scope; realtime taps selected track
Capture is now item + track only (master removed as a scope; still bypassed
as out-of-scope chain). Realtime records the selected track's own output via
per-track post-fader sends into a hidden temp track, fixing the silent file.
2026-07-23 16:34:02 -04:00
daniel bd187d4f89 feat(capture): M8 async realtime-record backend (master scope)
Timer-driven realtime capture behind ICaptureBackend (begin/tick/abort via
OnTimer, non-blocking). Records master into a hidden temp track, moved to the
bank non-destructively with idempotent restore across every terminal path.
Pure phase machine unit-tested. Track/item deferred; realtime is non-deterministic.
2026-07-23 15:16:36 -04:00
daniel c18f8aaff0 Merge FX-scope capture: three scope actions + full parent-chain independence 2026-07-23 13:36:13 -04:00
daniel f9af111c7a Reconcile orphaned Design View snapshots on track delete
Add ViewModeModel::reconcile(liveGuids) to prune snapshots of deleted
tracks; wire it into applyMode before planning. Keep membership so
undo-delete (same GUID) preserves the Design tag.
2026-07-23 13:27:42 -04:00
daniel df03b5e759 Rework capture into three FX-scope actions with inferred range
Replace the four capture modes with item/track/master scope actions. Each infers
its range (razor-else-time) and enforces FX scope via non-destructive
FX-bypass-around-render (RAII I_FXEN snapshot/restore over ancestors + master).
Corrects the defect of items captured through parent FX.
2026-07-23 13:12:36 -04:00
daniel 314c3331da Add D5 Design-View mode switch to bank panel
New pure mode_switch module (header-rect -> N equal segment rects + point hit-test, unit-tested) plus a segmented switch in the bank_panel header: one lit segment per registered mode, click activates via view::applyMode. Grid offset below the header.
2026-07-23 12:35:46 -04:00
daniel 9ff123e5e1 Merge M7: bindable capture action family (master/tracks/items/razor, wet) 2026-07-23 10:22:24 -04:00
daniel 7b530193b2 feat(capture): bindable capture family — master/tracks/items/razor (M7)
Four wet capture actions route to OfflineRenderBackend (snapshot/restore
RENDER_*, 32-bit float), produce a Sample, add to the bank, persist. Pure
render_settings maps source mode to RENDER_SETTINGS and parses P_RAZOREDITS
(tested). No arrange insertion. True dry deferred to M10.
2026-07-23 10:01:34 -04:00
daniel 8d08279bdb Fix parent visibility: parent visible by own membership OR derived from children
visibleTracks pass 1 now evaluates every node (parent or leaf) by its own
membership, so an untagged folder carrying its own FX/media shows in Arrange
(its default) as well as any mode derived from its children. Adds case-matrix
tests; updates the nested-Arrange assertion to the corrected rule.
2026-07-23 06:17:34 -04:00
daniel 4f1231ea81 Merge M6 change: insert onto selected track(s) at edit cursor 2026-07-23 05:59:11 -04:00
daniel 2536b4bedb fix: insert onto selected track(s) at edit cursor, not a new track
Wire both insert actions to CurrentTrack (InsertMedia base 0). Per selected
track: SetOnlyTrackSelected, reset cursor to snapshot, InsertMedia; then restore
original selection + cursor. No-op when no track selected. Corrected stale
extraflags / new-track / preservePitch comments.
2026-07-23 05:56:25 -04:00
daniel dfd5d4477f fix(view): snapshot-once park guard + correct per-mode undo label
Only capture a track's pre-park snapshot when none exists, so a re-park while
already parked no longer overwrites it with hidden-state zeros (leaves vanished
after toggling twice). Undo label now names the actual target mode.
2026-07-23 05:50:19 -04:00
daniel 59e3c5907f Merge M6: insert selected bank sample at edit cursor via InsertMedia 2026-07-23 05:25:13 -04:00
daniel 172d5902c8 feat: add M6 insert — place selected bank sample at edit cursor
InsertMedia-driven placement reading the bank panel selection, undo-wrapped.
Native length by default; conform-to-tempo is an explicit second action, never
a silent stretch. Pure mode-bit logic (insert_plan) unit-tested.
2026-07-23 05:23:37 -04:00
daniel 4bf394b89c fix(view): park untagged leaves in non-Arrange modes; refresh TCP/MCP on apply
planToggle now enumerates all leaves in the FolderTree instead of only tagged
membership entries, so untagged (Arrange-member) tracks park in Design and
restore in Arrange. applyMode calls TrackList_AdjustWindows + UpdateArrange so
changes render immediately. Correct the stale "tagged-only" invariant comments.
2026-07-23 04:59:50 -04:00
daniel affde0ef53 fix: layer GUID-primary project identity so reopened/new projects reload the bank
classifyProjectTransition now checks the stored GUID first, then the pointer,
fixing the w10 regression where a recycled ReaProject* address stopped the bank
reloading. poll()'s fork re-GUID gate is bound to !sameProjectObject. Full
transition matrix pinned in tests.
2026-07-23 04:46:36 -04:00
daniel e03728bdf7 Merge Phase D4: Design View action family + reapply-on-open wiring 2026-07-22 22:06:06 -04:00
daniel fc54472d3e feat(bank_panel): audition, multi-select, and keyboard nav (M5 Wave B)
Pure bank_grid gains hit-test, selection-update, and arrow-nav math with
tests; the panel wires mouse multi-select, keyboard nav via an accelerator
hook, and stock PlayPreview/StopPreview audition with a leak-free preview
lifecycle. Read-only: no arrange insertion, no project/bank mutation.
2026-07-22 21:55:16 -04:00
daniel ae41cad4f5 feat(view): D4 Design View action family + reapply-on-open wiring
Register toggle/activate/tag/untag/show-both actions driving the D2
shell and D3 model; reapply saved active mode on project load via a
persist load-signal seam. Shared guidString helper; pure nextModeId
unit-tested.
2026-07-22 21:46:58 -04:00
daniel 5ff029ba1d Merge fix: project-object identity stops forked-bank cross-contamination 2026-07-22 21:29:50 -04:00
daniel 36270e2064 fix(persist): use project-object identity to stop forked-bank cross-contamination
M4's GUID-only classifier read a tab-switch between two Save-As forks (shared
copied GUID, different paths) as a Save-As and clobbered a bank. Thread
sameProjectObject into classifyProjectTransition: a different object always
Loads, never relocates; a forked sibling gets re-GUID'd to diverge.
2026-07-22 21:28:54 -04:00
daniel 36dd5fd0f6 Merge dev (M5 bank_panel) into view-shell branch
# Conflicts:
#	CMakeLists.txt
2026-07-22 21:26:11 -04:00
daniel aa8b963fb3 Merge dev (Phase D1) into p1-w9-bank-panel
# Conflicts:
#	CMakeLists.txt
2026-07-22 21:07:59 -04:00
daniel 71a3b26a47 feat(bank_panel): docked bank grid with LICE waveform thumbnails (M5 Wave A)
Docked SWELL window toggled by a new action, drawing the current bank as
per-sample min/max thumbnails (PCM_source + peaks) with an in-memory cache.
Pure grid-layout/cache-key math in bank_grid (tested). Renames peaks::Sample
-> AudioSample to avoid colliding with bank_model::Sample.
2026-07-22 21:02:22 -04:00
daniel c068279aac feat(view): D2 view shell — apply mode toggle plan to live project
Reads I_FOLDERDEPTH into a FolderTree (pure view_tree helper, unit-tested),
snapshots to-be-parked tracks before parking, runs the D1 planner, and applies
park/restore flag + per-FX-offline writes under an undo block. Master and
mute/solo untouched; acts only on tagged tracks.
2026-07-22 20:55:50 -04:00
daniel 25cfb62d46 rename view_model -> view_mode_model; add shell-expands-FX test and parse-site comments 2026-07-22 20:37:17 -04:00
daniel 33ffb45a45 Add pure view_model core (Phase D1): N-mode registry, GUID-keyed membership, folder-tree visibility derivation, snapshot-based park/restore planner, JSON round-trip; new view_model_tests CTest target 2026-07-22 20:21:14 -04:00
daniel 53da916917 feat(persist): M4 bank persistence + Save-As relocation
Serialize BankIndex to project ext state ('reasampler'), reload on project
load, resolve paths project-relative. Save-As copies the bank to the new .rpp;
identity keyed off a minted GUID (not the recycled ReaProject*) so project
switches don't clobber banks. Pure classifyProjectTransition tested.
2026-07-22 19:55:09 -04:00
daniel a14d33aa75 Fix M3 capture: render format, project rate, unsaved-project handling
RENDER_FORMAT now uses the base64 float-WAV config (raw bytes were rejected
into a 16-bit/44.1 fallback); RENDER_SRATE pinned to the project rate.
Unsaved projects prompt Save then refuse if cancelled — no default-location
fallback. Harden deriveBankPaths against empty projectDir.
2026-07-22 17:02:15 -04:00
daniel d9ad8e4adf M3: offline-render capture spike (master-mix / time-selection)
ICaptureBackend/CaptureRequest seam + OfflineRenderBackend driving snapshotted
RENDER_* with dither/normalize forced off for bit-identical output, RenderFailed
via filesystem check, and a pure capture_paths lib with tests. Spike action registered.
2026-07-22 13:07:31 -04:00
daniel 4cb40f6e34 peaks: pure per-channel min/max envelope from interleaved PCM
New STATIC lib + peaks_tests (CTest), mirroring bank_model. Float samples,
per-channel (no fold); exact integer bin spans handle remainder, short
buffers, and degenerate inputs with no OOB. Bin-span math guarded against
size_t overflow for pathological binCount.
2026-07-22 09:23:03 -04:00
daniel 2862e1c865 Implement M1 bank_model: Sample + BankIndex, hash-dedup, tiers, JSON round-trip
Pure dependency-free core with self-contained JSON writer/parser. Absolute
paths (incl. drive-relative) rejected at the add boundary; \uXXXX decoded to
UTF-8 with surrogate pairs; malformed input returns nullopt.
2026-07-21 22:54:21 -04:00
daniel acfc9daabc Retire MPE scaffold; stand up reaper_reasampler pure-core skeleton
Rename CMake project/module to reaper_reasampler, delete mpe_model/mpe_view,
add minimal pure bank_model lib + placeholder CTest. main.cpp loads, logs to
console, keeps the action-registration seam commented with the forever-stable
CEREBELLUM_REASAMPLER_ action-id prefix.
2026-07-21 21:18:51 -04:00