mirror of
https://codeberg.org/unspeaker/tek.git
synced 2025-12-10 21:56:42 +01:00
wip: midi import/export browser, pt.6
This commit is contained in:
parent
4adb8d45fe
commit
f12a1dc2ca
3 changed files with 25 additions and 26 deletions
|
|
@ -265,37 +265,33 @@ pub enum FileBrowserCommand {
|
|||
impl<T: PhrasesControl> Command<T> for FileBrowserCommand {
|
||||
fn execute (self, state: &mut T) -> Perhaps<Self> {
|
||||
use FileBrowserCommand::*;
|
||||
match state.phrases_mode_mut().clone() {
|
||||
Some(PhrasesMode::Import(index, browser)) => match self {
|
||||
let mode = state.phrases_mode_mut();
|
||||
match mode {
|
||||
Some(PhrasesMode::Import(index, ref mut browser)) => match self {
|
||||
Cancel => {
|
||||
*state.phrases_mode_mut() = None;
|
||||
*mode = None;
|
||||
},
|
||||
Chdir(cwd) => {
|
||||
*state.phrases_mode_mut() = Some(PhrasesMode::Import(
|
||||
index, FileBrowser::new(Some(cwd))?
|
||||
));
|
||||
*mode = Some(PhrasesMode::Import(*index, FileBrowser::new(Some(cwd))?));
|
||||
},
|
||||
Select(index) => {
|
||||
*state.phrases_mode_mut() = Some(PhrasesMode::Import(
|
||||
index, browser
|
||||
))
|
||||
browser.index = index;
|
||||
},
|
||||
Confirm => {
|
||||
todo!("import midi to phrase");
|
||||
},
|
||||
_ => todo!(),
|
||||
_ => unreachable!()
|
||||
},
|
||||
Some(PhrasesMode::Export(index, browser)) => match self {
|
||||
Some(PhrasesMode::Export(index, ref mut browser)) => match self {
|
||||
Cancel => {
|
||||
*state.phrases_mode_mut() = None;
|
||||
*mode = None;
|
||||
},
|
||||
Chdir(cwd) => {
|
||||
*state.phrases_mode_mut() = Some(PhrasesMode::Export(
|
||||
index, FileBrowser::new(Some(cwd))?
|
||||
));
|
||||
*mode = Some(PhrasesMode::Export(*index, FileBrowser::new(Some(cwd))?));
|
||||
},
|
||||
Select(index) => {
|
||||
*state.phrases_mode_mut() = Some(PhrasesMode::Import(
|
||||
index, browser
|
||||
))
|
||||
browser.index = index;
|
||||
},
|
||||
_ => unreachable!()
|
||||
},
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue