mirror of
https://codeberg.org/unspeaker/tek.git
synced 2025-12-07 04:06:45 +01:00
wip: midi import/export browser, pt.7
This commit is contained in:
parent
f12a1dc2ca
commit
86f37fb278
3 changed files with 33 additions and 6 deletions
|
|
@ -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);
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue