wip: midi import/export browser, pt.7

This commit is contained in:
🪞👃🪞 2024-11-24 21:53:25 +01:00
parent f12a1dc2ca
commit 86f37fb278
3 changed files with 33 additions and 6 deletions

View file

@ -1,5 +1,6 @@
use crate::*;
use tek_core::midly::Smf;
use std::path::PathBuf;
pub trait HasPhrases {
fn phrases (&self) -> &Vec<Arc<RwLock<Phrase>>>;
@ -11,8 +12,8 @@ pub enum PhrasePoolCommand {
Add(usize, Phrase),
Delete(usize),
Swap(usize, usize),
Import(usize, String),
Export(usize, String),
Import(usize, PathBuf),
Export(usize, PathBuf),
SetName(usize, String),
SetLength(usize, usize),
SetColor(usize, ItemColor),
@ -54,7 +55,7 @@ impl<T: HasPhrases> Command<T> for PhrasePoolCommand {
}
}
}
let mut phrase = Phrase::new(&path, true, t as usize + 1, None, None);
let mut phrase = Phrase::new("imported", true, t as usize + 1, None, None);
for event in events.iter() {
phrase.notes[event.0 as usize].push(event.2);
}