extract clip_auto_create; add clip_auto_remove

This commit is contained in:
🪞👃🪞 2025-04-26 13:48:23 +03:00
parent 2c59b1acfd
commit a9cfaf9767
3 changed files with 51 additions and 27 deletions

View file

@ -61,6 +61,13 @@ impl MidiClip {
color: color.unwrap_or_else(ItemPalette::random)
}
}
pub fn count_midi_messages (&self) -> usize {
let mut count = 0;
for tick in self.notes.iter() {
count += tick.len();
}
count
}
pub fn set_length (&mut self, length: usize) {
self.length = length;
self.notes = vec![Vec::with_capacity(16);length];