mirror of
https://codeberg.org/unspeaker/tek.git
synced 2025-12-08 12:46:42 +01:00
use keymap! in more places
This commit is contained in:
parent
8dedc8fd5f
commit
a82f73d475
6 changed files with 200 additions and 268 deletions
|
|
@ -41,14 +41,16 @@ impl Groovebox {
|
|||
player,
|
||||
sampler,
|
||||
_jack: jack.clone(),
|
||||
|
||||
pool: crate::pool::PoolModel::from(&phrase),
|
||||
editor: crate::midi::MidiEditor::from(&phrase),
|
||||
|
||||
compact: true,
|
||||
status: true,
|
||||
size: Measure::new(),
|
||||
midi_buf: vec![vec![];65536],
|
||||
note_buf: vec![],
|
||||
perf: PerfModel::default(),
|
||||
status: true,
|
||||
compact: true,
|
||||
})
|
||||
}
|
||||
}
|
||||
|
|
@ -144,7 +146,7 @@ pub enum GrooveboxCommand {
|
|||
}
|
||||
|
||||
handle!(<Tui>|self: Groovebox, input|GrooveboxCommand::execute_with_state(self, input.event()));
|
||||
keymap!(KEYS_GROOVEBOX: |state: Groovebox, input: Event| GrooveboxCommand {
|
||||
keymap!(KEYS_GROOVEBOX = |state: Groovebox, input: Event| GrooveboxCommand {
|
||||
// Tab: Toggle compact mode
|
||||
key(Tab) => Cmd::Compact(!state.compact),
|
||||
// q: Enqueue currently edited phrase
|
||||
|
|
@ -179,13 +181,13 @@ keymap!(KEYS_GROOVEBOX: |state: Groovebox, input: Event| GrooveboxCommand {
|
|||
} else {
|
||||
return None
|
||||
},
|
||||
}, Some(if let Some(command) = MidiEditCommand::input_to_command(&state.editor, input) {
|
||||
}, if let Some(command) = MidiEditCommand::input_to_command(&state.editor, input) {
|
||||
Cmd::Editor(command)
|
||||
} else if let Some(command) = PoolCommand::input_to_command(&state.pool, input) {
|
||||
Cmd::Pool(command)
|
||||
} else {
|
||||
return None
|
||||
}));
|
||||
});
|
||||
|
||||
command!(|self: GrooveboxCommand, state: Groovebox|match self {
|
||||
Self::Enqueue(phrase) => {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue