mirror of
https://codeberg.org/unspeaker/tek.git
synced 2025-12-08 20:56:43 +01:00
wip: global enter
This commit is contained in:
parent
2105d86428
commit
9b770c468f
6 changed files with 43 additions and 28 deletions
|
|
@ -2,12 +2,7 @@ use crate::*;
|
|||
|
||||
#[derive(Clone, PartialEq)]
|
||||
pub enum ArrangerCommand {
|
||||
FocusNext,
|
||||
FocusPrev,
|
||||
FocusUp,
|
||||
FocusDown,
|
||||
FocusLeft,
|
||||
FocusRight,
|
||||
Focus(FocusCommand),
|
||||
Transport(TransportCommand),
|
||||
Phrases(PhrasePoolCommand),
|
||||
Editor(PhraseEditorCommand),
|
||||
|
|
@ -41,13 +36,18 @@ pub enum ArrangementCommand {
|
|||
impl<E: Engine> Command<Arranger<E>> for ArrangerCommand {
|
||||
fn execute (self, state: &mut Arranger<E>) -> Perhaps<Self> {
|
||||
use ArrangerCommand::*;
|
||||
use FocusCommand::*;
|
||||
match self {
|
||||
FocusNext => { state.focus_next(); },
|
||||
FocusPrev => { state.focus_prev(); },
|
||||
FocusUp => { state.focus_up(); },
|
||||
FocusDown => { state.focus_down(); },
|
||||
FocusLeft => { state.focus_left(); },
|
||||
FocusRight => { state.focus_right(); },
|
||||
Focus(command) => match command {
|
||||
Next => { state.focus_next(); },
|
||||
Prev => { state.focus_prev(); },
|
||||
Up => { state.focus_up(); },
|
||||
Down => { state.focus_down(); },
|
||||
Left => { state.focus_left(); },
|
||||
Right => { state.focus_right(); },
|
||||
Enter => { unimplemented!() },
|
||||
Exit => { unimplemented!() },
|
||||
},
|
||||
Transport(cmd) => if let Some(ref transport) = state.transport {
|
||||
return cmd.execute(&mut*transport.write().unwrap()).map(|x|x.map(Transport))
|
||||
},
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue