Lightningbeam/lightningbeam-ui
Skyler Lehmkuhl 8ed2320dca Type AudioClip duration by clip kind; fix MIDI clips growing too fast
The MIDI-clip-end-grows-too-fast bug was a units confusion: AudioClip.duration
is documented "seconds" but MIDI clips store their length in BEATS (they share
the AudioClip struct with sampled clips). The timeline's effective_clip_duration
read it as raw seconds, so at 120 BPM a MIDI clip rendered ~2x too long. The old
backend-snapshot display had hidden this by forcing timeline_duration in beats.

Root fix — make the domain explicit and unforgeable:
- `duration` is now a private field. Reading it in the wrong unit is impossible
  because access goes through typed accessors: AudioClip::content_duration() ->
  ClipDuration (a Seconds|Beats enum tagged by clip_type) and
  set_content_duration(). serde still serializes the private field, so the .beam
  format is unchanged (bare number).
- ClipDuration::to_seconds(tempo_map) for display/sizing; ::native() for code
  that already works in the clip's native domain (trim math shares it).
- get_clip_duration + the timeline-endpoint calc go through to_seconds, so MIDI
  is converted correctly; effective_clip_duration delegates to get_clip_duration.
- Recording mirrors (audio/MIDI progress + finalize) write via set_content_duration
  (debug-asserts the value's domain matches the clip type).

Every former raw read/write of the field (core actions, timeline, piano roll,
infopanel, asset library, recording handlers) now goes through the accessors.
Whole workspace compiles; 299 core tests pass.
2026-07-11 19:23:37 -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 Type AudioClip duration by clip kind; fix MIDI clips growing too fast 2026-07-11 19:23:37 -04:00
lightningbeam-editor Type AudioClip duration by clip kind; fix MIDI clips growing too fast 2026-07-11 19:23:37 -04:00
.gitignore Add text layers 2026-06-27 18:14:47 -04:00
Cargo.lock Type AudioClip duration by clip kind; fix MIDI clips growing too fast 2026-07-11 19:23:37 -04:00
Cargo.toml Add animated GIF export 2026-07-09 06:02:47 -04:00
GPU_VIDEO_DECODE_PLAN.md Type AudioClip duration by clip kind; fix MIDI clips growing too fast 2026-07-11 19:23:37 -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