mirror of
https://codeberg.org/unspeaker/tek.git
synced 2025-12-06 11:46:41 +01:00
pass thru arranger commands to embedded sequencer
This commit is contained in:
parent
9ba0f3401e
commit
e2492a1326
1 changed files with 18 additions and 14 deletions
|
|
@ -134,21 +134,19 @@ input_to_command!(ArrangerCommand: <Tui>|state:ArrangerTui,input|{
|
|||
use ArrangerCommand::*;
|
||||
// WSAD navigation, Q launches, E edits, PgUp/Down pool, Arrows editor
|
||||
match input.event() {
|
||||
// TODO: u: undo
|
||||
key_pat!(Char('u')) => { todo!("undo") },
|
||||
// TODO: Shift-U: redo
|
||||
key_pat!(Char('U')) => { todo!("redo") },
|
||||
// TODO: k: toggle on-screen keyboard
|
||||
key_pat!(Ctrl-Char('k')) => { todo!("keyboard") },
|
||||
|
||||
// Transport: Play/pause
|
||||
key_pat!(Char(' ')) =>
|
||||
Clock(if state.clock().is_stopped() { Play(None) } else { Pause(None) }),
|
||||
// Transport: Play from start or rewind to start
|
||||
key_pat!(Shift-Char(' ')) =>
|
||||
Clock(if state.clock().is_stopped() { Play(Some(0)) } else { Pause(Some(0)) }),
|
||||
// TODO: u: undo
|
||||
key_pat!(Char('u')) =>
|
||||
{ todo!("undo") },
|
||||
// TODO: Shift-U: redo
|
||||
key_pat!(Char('U')) =>
|
||||
{ todo!("redo") },
|
||||
// TODO: k: toggle on-screen keyboard
|
||||
key_pat!(Ctrl-Char('k')) =>
|
||||
{ todo!("keyboard") },
|
||||
key_pat!(Char('e')) =>
|
||||
Editor(PhraseCommand::Show(Some(state.phrases.phrase().clone()))),
|
||||
key_pat!(Char('l')) =>
|
||||
|
|
@ -170,11 +168,17 @@ input_to_command!(ArrangerCommand: <Tui>|state:ArrangerTui,input|{
|
|||
Selected::Clip(t, s) => return None,
|
||||
},
|
||||
_ => match state.selected() {
|
||||
Selected::Mix => to_arranger_mix_command(input)?,
|
||||
Selected::Track(t) => to_arranger_track_command(input, t)?,
|
||||
Selected::Scene(s) => to_arranger_scene_command(input, s)?,
|
||||
Selected::Clip(t, s) => to_arranger_clip_command(input, t, s)?,
|
||||
}
|
||||
Selected::Mix => to_arranger_mix_command(input),
|
||||
Selected::Track(t) => to_arranger_track_command(input, t),
|
||||
Selected::Scene(s) => to_arranger_scene_command(input, s),
|
||||
Selected::Clip(t, s) => to_arranger_clip_command(input, t, s),
|
||||
}.or_else(||if let Some(command) = PhraseCommand::input_to_command(&state.editor, input) {
|
||||
Some(Editor(command))
|
||||
} else if let Some(command) = PhrasesCommand::input_to_command(&state.phrases, input) {
|
||||
Some(Phrases(command))
|
||||
} else {
|
||||
None
|
||||
})?
|
||||
}
|
||||
});
|
||||
fn to_arranger_mix_command (input: &TuiInput) -> Option<ArrangerCommand> {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue