Lightningbeam/lightningbeam-ui
Skyler Lehmkuhl c747126759 Timeline: display audio/MIDI clips from the doc, not a backend snapshot
The timeline was the only place that reconstructed audio-layer clip instances
from a backend snapshot (build_audio_clip_cache) instead of reading the
document like every other layer type. But the document is the actual source of
truth: clip actions mutate *Layer::clip_instances, it's what persists to .beam,
and it drives the backend on load. The snapshot is downstream of it.

That dual source caused the second-recording preview bug: a recording clip
lives only in the document (its backend clip has a temporary pool index of 0,
so the snapshot can't represent it). layer_clips() only fell back to the doc
when the snapshot cache was *empty*, so the first recording previewed but the
second — once the layer already had a finalized clip — was dropped and showed
as zero-length until finalized.

Fix: make layer_clips() read <layer>.clip_instances for audio too, and delete
build_audio_clip_cache + the audio_cache plumbing threaded through ~7 methods
and ~25 call sites. Recording clips grow via the existing RecordingProgress /
MidiRecordingProgress mirror to the doc; finalized clips come from the actions;
both states now live in one place.

Root fix this exposed: get_clip_duration() wrapped every audio clip's duration
as Seconds, but MIDI clips store their duration in BEATS (they share AudioClip
with sampled clips). The snapshot had masked this by always forcing a MIDI
clip's timeline_duration; reading from the doc requires the value to be right,
so get_clip_duration now converts a MIDI clip's beats duration to seconds.

Net -120 lines. Whole workspace compiles; 299 core tests pass. The piano roll
still uses the snapshot for its own MIDI editor (separate pane, out of scope).
2026-07-11 17:07:55 -04:00
..
beamdsp Code cleanup 2026-02-19 11:19:44 -05:00
egui_node_graph2 highlight node connections directly 2026-02-20 11:13:34 -05:00
gpu-video-encoder Address code-review findings across export, decode, and data model 2026-06-26 17:47:32 -04:00
lightningbeam-core Timeline: display audio/MIDI clips from the doc, not a backend snapshot 2026-07-11 17:07:55 -04:00
lightningbeam-editor Timeline: display audio/MIDI clips from the doc, not a backend snapshot 2026-07-11 17:07:55 -04:00
.gitignore Add text layers 2026-06-27 18:14:47 -04:00
Cargo.lock SVG export: emit text layers as real glyph outlines 2026-07-09 07:10:59 -04:00
Cargo.toml Add animated GIF export 2026-07-09 06:02:47 -04:00
GPU_VIDEO_DECODE_PLAN.md export: cache the static background + bilinear video, add render profiling 2026-06-25 23:30:51 -04:00
build-static.sh Video export 2025-12-07 13:17:21 -05:00
build-windows.bat windows build fixes 2026-02-24 14:40:16 -05:00