wip: big flat pt.9: down to 141, looking good!

This commit is contained in:
🪞👃🪞 2024-12-30 20:43:22 +01:00
parent e958b4a2d2
commit d01aa7481b
7 changed files with 39 additions and 12 deletions

View file

@ -30,8 +30,11 @@ pub enum PhraseCommand {
}
event_map_input_to_command!(Tui: MidiEditor: PhraseCommand: MidiEditor::KEYS);
pub(crate) type KeyMapping<const N: usize, E, T, U> = [(E, &'static dyn Fn(&T)->U);N];
impl MidiEditor {
const KEYS: KeyMapping<31, Self> = [
const KEYS: KeyMapping<31, Event, Self, PhraseCommand> = [
(kexp!(Ctrl-Alt-Up), &|s: &Self|SetNoteScroll(s.note_point() + 3)),
(kexp!(Ctrl-Alt-Down), &|s: &Self|SetNoteScroll(s.note_point().saturating_sub(3))),
(kexp!(Ctrl-Alt-Left), &|s: &Self|SetTimeScroll(s.time_point().saturating_sub(s.time_zoom().get()))),