mirror of
https://codeberg.org/unspeaker/tek.git
synced 2025-12-06 19:56:42 +01:00
extract clip_auto_create; add clip_auto_remove
This commit is contained in:
parent
2c59b1acfd
commit
a9cfaf9767
3 changed files with 51 additions and 27 deletions
|
|
@ -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];
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue