mirror of
https://codeberg.org/unspeaker/tek.git
synced 2025-12-06 19:56:42 +01:00
apply command! in arranger (8456l)
This commit is contained in:
parent
623fce73a4
commit
417b097c6f
1 changed files with 20 additions and 37 deletions
|
|
@ -124,44 +124,27 @@ audio!(|self: ArrangerTui, client, scope|{
|
|||
Phrases(PhrasesCommand),
|
||||
Editor(PhraseCommand),
|
||||
}
|
||||
impl Command<ArrangerTui> for ArrangerCommand {
|
||||
fn execute (self, state: &mut ArrangerTui) -> Perhaps<Self> {
|
||||
use ArrangerCommand::*;
|
||||
Ok(match self {
|
||||
Focus(cmd) => cmd.execute(state)?.map(Focus),
|
||||
Scene(cmd) => cmd.execute(state)?.map(Scene),
|
||||
Track(cmd) => cmd.execute(state)?.map(Track),
|
||||
Clip(cmd) => cmd.execute(state)?.map(Clip),
|
||||
Phrases(cmd) => cmd.execute(&mut state.phrases)?.map(Phrases),
|
||||
Editor(cmd) => cmd.execute(&mut state.editor)?.map(Editor),
|
||||
Clock(cmd) => cmd.execute(state)?.map(Clock),
|
||||
Zoom(_) => { todo!(); },
|
||||
Select(selected) => {
|
||||
*state.selected_mut() = selected;
|
||||
None
|
||||
},
|
||||
_ => { todo!() }
|
||||
})
|
||||
command!(|self:ArrangerCommand,state:ArrangerTui|{
|
||||
use ArrangerCommand::*;
|
||||
match self {
|
||||
Focus(cmd) => cmd.execute(state)?.map(Focus),
|
||||
Scene(cmd) => cmd.execute(state)?.map(Scene),
|
||||
Track(cmd) => cmd.execute(state)?.map(Track),
|
||||
Clip(cmd) => cmd.execute(state)?.map(Clip),
|
||||
Phrases(cmd) => cmd.execute(&mut state.phrases)?.map(Phrases),
|
||||
Editor(cmd) => cmd.execute(&mut state.editor)?.map(Editor),
|
||||
Clock(cmd) => cmd.execute(state)?.map(Clock),
|
||||
Zoom(_) => { todo!(); },
|
||||
Select(selected) => {
|
||||
*state.selected_mut() = selected;
|
||||
None
|
||||
},
|
||||
_ => { todo!() }
|
||||
}
|
||||
}
|
||||
impl Command<ArrangerTui> for ArrangerSceneCommand {
|
||||
fn execute (self, _state: &mut ArrangerTui) -> Perhaps<Self> {
|
||||
//todo!();
|
||||
Ok(None)
|
||||
}
|
||||
}
|
||||
impl Command<ArrangerTui> for ArrangerTrackCommand {
|
||||
fn execute (self, _state: &mut ArrangerTui) -> Perhaps<Self> {
|
||||
//todo!();
|
||||
Ok(None)
|
||||
}
|
||||
}
|
||||
impl Command<ArrangerTui> for ArrangerClipCommand {
|
||||
fn execute (self, _state: &mut ArrangerTui) -> Perhaps<Self> {
|
||||
//todo!();
|
||||
Ok(None)
|
||||
}
|
||||
}
|
||||
});
|
||||
command!(|self:ArrangerSceneCommand,_state:ArrangerTui|None);
|
||||
command!(|self:ArrangerTrackCommand,_state:ArrangerTui|None);
|
||||
command!(|self:ArrangerClipCommand, _state:ArrangerTui|None);
|
||||
pub trait ArrangerControl: TransportControl<ArrangerFocus> {
|
||||
fn selected (&self) -> ArrangerSelection;
|
||||
fn selected_mut (&mut self) -> &mut ArrangerSelection;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue