Update automation lanes too

This commit is contained in:
Skyler Lehmkuhl
2026-04-01 10:17:52 -04:00
parent 3fc4773ec3
commit ae146533d9
7 changed files with 150 additions and 20 deletions
@@ -290,12 +290,13 @@ impl Action for ChangeBpmAction {
}
}
// Sync beat/frame representations and rescale MIDI clip durations in the backend
// Sync beat/frame representations, rescale MIDI clip durations, and rescale
// automation keyframe times in the backend
let fps = document.framerate;
let midi_durations: Vec<(u32, f64)> = self.midi_snapshots.iter()
.map(|s| (s.midi_clip_id, s.new_clip_duration))
.collect();
controller.apply_bpm_change(self.new_bpm, fps, midi_durations);
controller.apply_bpm_change(self.old_bpm, self.new_bpm, fps, midi_durations);
Ok(())
}
@@ -337,12 +338,13 @@ impl Action for ChangeBpmAction {
}
}
// Sync beat/frame representations and restore MIDI clip durations in the backend
// Sync beat/frame representations, restore MIDI clip durations, and restore
// automation keyframe times in the backend
let fps = document.framerate;
let midi_durations: Vec<(u32, f64)> = self.midi_snapshots.iter()
.map(|s| (s.midi_clip_id, s.old_clip_duration))
.collect();
controller.apply_bpm_change(self.old_bpm, fps, midi_durations);
controller.apply_bpm_change(self.new_bpm, self.old_bpm, fps, midi_durations);
Ok(())
}