add --bpm flag

This commit is contained in:
🪞👃🪞 2025-01-02 16:38:04 +01:00
parent 42e2ef2a50
commit 94491a323a
11 changed files with 78 additions and 57 deletions

25
src/midi/midi_status.rs Normal file
View file

@ -0,0 +1,25 @@
use crate::*;
pub struct MidiEditStatus<'a>(pub &'a MidiEditor);
render!(Tui: (self: MidiEditStatus<'a>) => {
let (color, name, length, looped) = if let Some(phrase) = self.0.phrase().as_ref().map(|p|p.read().unwrap()) {
(phrase.color, phrase.name.clone(), phrase.length, phrase.looped)
} else {
(ItemPalette::from(TuiTheme::g(64)), String::new(), 0, false)
};
let time_point = self.0.time_point();
let time_start = self.0.time_start();
let time_end = self.0.time_end();
let time_axis = self.0.time_axis().get();
let time_zoom = self.0.time_zoom().get();
let time_lock = if self.0.time_lock().get() { "[lock]" } else { " " };
let time_field = Field(color, "Time", format!("{length}/{time_zoom}+{time_point} {time_lock}"));
Tui::bg(color.darkest.rgb, Fill::x(Tui::fg(color.lightest.rgb, Bsp::e(
time_field,
Field(color, "Note", format!("{} ({}) {} | {}-{} ({})",
self.0.note_point(), Note::pitch_to_name(self.0.note_point()), self.0.note_len(),
Note::pitch_to_name(self.0.note_lo().get()), Note::pitch_to_name(self.0.note_hi()),
self.0.note_axis().get()))
))))
});