fix note enter; align titles

This commit is contained in:
🪞👃🪞 2025-01-21 00:32:58 +01:00
parent 93462e7501
commit 81a74d79dc
7 changed files with 39 additions and 45 deletions

View file

@ -183,8 +183,9 @@ impl MidiViewer for MidiEditor {
fn set_clip (&mut self, p: Option<&Arc<RwLock<MidiClip>>>) { self.mode.set_clip(p) }
}
atom_command!(MidiEditCommand: |state: MidiEditor| {
("note/put" [_a: bool] Self::PutNote)
("note/del" [_a: bool] Self::PutNote)
("note/append" [] Self::AppendNote)
("note/put" [] Self::PutNote)
("note/del" [] Self::DelNote)
("note/pos" [a: usize] Self::SetNoteCursor(a.expect("no note cursor")))
("note/len" [a: usize] Self::SetNoteLength(a.expect("no note length")))
("time/pos" [a: usize] Self::SetTimeCursor(a.expect("no time cursor")))
@ -196,6 +197,7 @@ atom_command!(MidiEditCommand: |state: MidiEditor| {
// TODO: 1-9 seek markers that by default start every 8th of the clip
AppendNote,
PutNote,
DelNote,
SetNoteCursor(usize),
SetNoteLength(usize),
SetNoteScroll(usize),
@ -218,6 +220,7 @@ impl Command<MidiEditor> for MidiEditCommand {
use MidiEditCommand::*;
match self {
Show(clip) => { state.set_clip(clip.as_ref()); },
DelNote => {},
PutNote => { state.put_note(false); },
AppendNote => { state.put_note(true); },
SetTimeZoom(x) => { state.time_zoom().set(x); state.redraw(); },