wip: enabling standalone arranger

This commit is contained in:
🪞👃🪞 2024-08-10 14:23:51 +03:00
parent b6da43e93e
commit 7685072e4c
16 changed files with 445 additions and 370 deletions

View file

@ -0,0 +1,45 @@
use crate::*;
handle!(Sequencer |self, e| handle_keymap(self, e, KEYMAP_SEQUENCER));
/// Key bindings for phrase editor.
pub const KEYMAP_SEQUENCER: &'static [KeyBinding<Sequencer>] = keymap!(Sequencer {
[Up, NONE, "seq_cursor_up", "move cursor up", |sequencer: &mut Sequencer| {
match sequencer.entered {
true => { sequencer.note_axis.point_dec(); },
false => { sequencer.note_axis.start_dec(); },
}
Ok(true)
}],
[Down, NONE, "seq_cursor_down", "move cursor down", |sequencer: &mut Sequencer| {
match sequencer.entered {
true => { sequencer.note_axis.point_inc(); },
false => { sequencer.note_axis.start_inc(); },
}
Ok(true)
}],
[Left, NONE, "seq_cursor_left", "move cursor up", |sequencer: &mut Sequencer| {
match sequencer.entered {
true => { sequencer.time_axis.point_dec(); },
false => { sequencer.time_axis.start_dec(); },
}
Ok(true)
}],
[Right, NONE, "seq_cursor_right", "move cursor up", |sequencer: &mut Sequencer| {
match sequencer.entered {
true => { sequencer.time_axis.point_inc(); },
false => { sequencer.time_axis.start_inc(); },
}
Ok(true)
}],
[Char('`'), NONE, "seq_mode_switch", "switch the display mode", |sequencer: &mut Sequencer| {
sequencer.mode = !sequencer.mode;
Ok(true)
}],
/*
[Char('a'), NONE, "note_add", "Add note", note_add],
[Char('z'), NONE, "note_del", "Delete note", note_del],
[CapsLock, NONE, "advance", "Toggle auto advance", nop],
[Char('w'), NONE, "rest", "Advance by note duration", nop],
*/
});