editor: reverse highlight

This commit is contained in:
🪞👃🪞 2025-05-14 21:02:00 +03:00
parent 4a9e9132f3
commit b7152ef807
4 changed files with 38 additions and 23 deletions

View file

@ -95,34 +95,36 @@ use crate::*;
#[tengri_proc::command(MidiEditor)] impl MidiEditCommand {
fn append_note (editor: &mut MidiEditor, advance: bool) -> Perhaps<Self> {
editor.put_note(advance);
editor.redraw();
Ok(None)
}
fn delete_note (_editor: &mut MidiEditor) -> Perhaps<Self> {
fn delete_note (editor: &mut MidiEditor) -> Perhaps<Self> {
editor.redraw();
todo!()
}
fn set_note_pos (editor: &mut MidiEditor, pos: usize) -> Perhaps<Self> {
editor.set_note_pos(pos.min(127));
editor.redraw();
Ok(None)
}
fn set_note_len (editor: &mut MidiEditor, value: usize) -> Perhaps<Self> {
//let note_len = editor.get_note_len();
//let time_zoom = editor.get_time_zoom();
editor.set_note_len(value);
//if note_len / time_zoom != x / time_zoom {
editor.redraw();
//}
editor.redraw();
Ok(None)
}
fn set_note_scroll (editor: &mut MidiEditor, value: usize) -> Perhaps<Self> {
editor.set_note_lo(value.min(127));
editor.redraw();
Ok(None)
}
fn set_time_pos (editor: &mut MidiEditor, value: usize) -> Perhaps<Self> {
editor.set_time_pos(value);
editor.redraw();
Ok(None)
}
fn set_time_scroll (editor: &mut MidiEditor, value: usize) -> Perhaps<Self> {
editor.set_time_start(value);
editor.redraw();
Ok(None)
}
fn set_time_zoom (editor: &mut MidiEditor, value: usize) -> Perhaps<Self> {
@ -132,10 +134,12 @@ use crate::*;
}
fn set_time_lock (editor: &mut MidiEditor, value: bool) -> Perhaps<Self> {
editor.set_time_lock(value);
editor.redraw();
Ok(None)
}
fn show (editor: &mut MidiEditor, clip: Option<Arc<RwLock<MidiClip>>>) -> Perhaps<Self> {
editor.set_clip(clip.as_ref());
editor.redraw();
Ok(None)
}
// TODO: 1-9 seek markers that by default start every 8th of the clip