Fix .beam save quirks: real sample rate, drop dead fields
Address the code smells flagged in the .beam format spec: - Write the project's actual sample rate on save instead of a hardcoded 48000 (add AudioProject::sample_rate()). - Remove the vestigial RasterKeyframe.media_path field (it was only used by the legacy ZIP loader, which now derives "media/raster/<id>.png" from the keyframe id) and the dead buffer_path_at_time accessor. Backward-compatible: older files carrying media_path deserialize fine (the field is ignored). - Drop the unused SaveSettings fields auto_embed_threshold_bytes / force_embed_all / force_link_all; only large_media_mode was ever consulted. Un-prefix the now-used `settings` parameter. Update BEAM_FILE_FORMAT.md to match. The remaining notes (reserved MediaKind::Video, exact-match version check) are design choices, left as-is.
This commit is contained in:
@@ -41,6 +41,11 @@ impl Project {
|
||||
}
|
||||
}
|
||||
|
||||
/// The project's system sample rate in Hz.
|
||||
pub fn sample_rate(&self) -> u32 {
|
||||
self.sample_rate
|
||||
}
|
||||
|
||||
/// Generate a new unique track ID
|
||||
fn next_id(&mut self) -> TrackId {
|
||||
let id = self.next_track_id;
|
||||
|
||||
Reference in New Issue
Block a user