Lightningbeam/daw-backend/src/audio
Skyler Lehmkuhl d001ca1083 Fix save crash on zero/sparse-audio projects (phantom pool placeholder)
`AudioPool::load_from_serialized` sizes the slot Vec by pool_index and fills gaps
with empty `AudioFile::new(PathBuf::new(), …)` placeholders. Two bugs let a
placeholder reach the next save and abort it with "Is a directory":

- Off-by-one: `entries.max().unwrap_or(0) + 1` made an *empty* pool length 1, so a
  project with no audio still got one placeholder. Size by `max(pool_index + 1)`
  → empty entries yield length 0.
- `serialize()` emitted placeholder slots: an empty path round-trips to
  `relative_path = Some("")`, which `save_beam` resolves to the project directory
  (`join("")`) and tries to read as media. Skip empty-path / no-packed-media slots.
- Defense in `save_beam`: gate referenced-media packing on `full.is_file()` (not
  `exists()`), so any blank/dir path falls through to embedded data instead of
  reading a directory.

Pre-existing; surfaced by a save → reload → save cycle on a raster-only project.
2026-06-20 18:46:19 -04:00
..
node_graph Massive tempo refactor - make beats canonical time rep and allow them to be non constant 2026-04-02 10:26:01 -04:00
automation.rs Phase 5: fix broken unit tests; cargo test --lib green again 2026-06-19 16:45:23 -04:00
bpm_detector.rs add BPM detection 2025-11-02 09:53:34 -05:00
buffer_pool.rs Use buffer pool 2025-10-18 23:45:27 -04:00
clip.rs Massive tempo refactor - make beats canonical time rep and allow them to be non constant 2026-04-02 10:26:01 -04:00
disk_reader.rs Stream audio & video from .beam container; waveform LOD pyramid + persistence 2026-06-17 13:52:38 -04:00
engine.rs Stream audio & video from .beam container; waveform LOD pyramid + persistence 2026-06-17 13:52:38 -04:00
export.rs Phase 2: bound video frame cache + stream the export mux 2026-06-17 14:30:32 -04:00
metronome.rs Add count-in 2026-03-20 20:51:50 -04:00
midi.rs Massive tempo refactor - make beats canonical time rep and allow them to be non constant 2026-04-02 10:26:01 -04:00
midi_pool.rs Massive tempo refactor - make beats canonical time rep and allow them to be non constant 2026-04-02 10:26:01 -04:00
mod.rs Stream audio & video from .beam container; waveform LOD pyramid + persistence 2026-06-17 13:52:38 -04:00
pool.rs Fix save crash on zero/sparse-audio projects (phantom pool placeholder) 2026-06-20 18:46:19 -04:00
project.rs Massive tempo refactor - make beats canonical time rep and allow them to be non constant 2026-04-02 10:26:01 -04:00
recording.rs Massive tempo refactor - make beats canonical time rep and allow them to be non constant 2026-04-02 10:26:01 -04:00
sample_loader.rs Add automation inputs for audio graphs 2026-03-18 11:25:48 -04:00
track.rs Make beats canonical representation rather than seconds 2026-06-02 13:06:36 -04:00
waveform_cache.rs Clean up build warnings 2026-02-14 11:07:32 -05:00
waveform_pyramid.rs Stream audio & video from .beam container; waveform LOD pyramid + persistence 2026-06-17 13:52:38 -04:00