new status bar enhancements

This commit is contained in:
🪞👃🪞 2025-01-03 15:45:51 +01:00
parent a4e61c087a
commit f359768ba2
6 changed files with 36 additions and 27 deletions

View file

@ -73,7 +73,7 @@ impl TimePoint for MidiEditor {
fn set_time_point (&self, x: usize) { self.mode.set_time_point(x) }
}
impl MidiViewMode for MidiEditor {
impl MidiViewer for MidiEditor {
fn buffer_size (&self, phrase: &MidiClip) -> (usize, usize) {
self.mode.buffer_size(phrase)
}

View file

@ -8,9 +8,8 @@ render!(Tui: (self: MidiEditClip<'a>) => {
(ItemPalette::from(TuiTheme::g(64)), String::new(), 0, false)
};
row!(
FieldV(color, "Edit", name.to_string()),
FieldV(color, "Length", length.to_string()),
FieldV(color, "Loop", looped.to_string())
FieldV(color, "Edit", format!("{name} ({length})")),
FieldV(color, "Loop", looped.to_string())
)
});

View file

@ -1,6 +1,6 @@
use crate::*;
pub trait MidiViewMode: HasSize<Tui> + MidiRange + MidiPoint + Debug + Send + Sync {
pub trait MidiViewer: HasSize<Tui> + MidiRange + MidiPoint + Debug + Send + Sync {
fn buffer_size (&self, phrase: &MidiClip) -> (usize, usize);
fn redraw (&self);
fn phrase (&self) -> &Option<Arc<RwLock<MidiClip>>>;