wip: zoom lock

This commit is contained in:
🪞👃🪞 2025-01-02 17:20:37 +01:00
parent 94491a323a
commit 44c28183de
11 changed files with 107 additions and 89 deletions

View file

@ -1,5 +1,19 @@
use crate::*;
pub struct MidiEditClip<'a>(pub &'a MidiEditor);
render!(Tui: (self: MidiEditClip<'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)
};
Fixed::y(1, row!(
Field(color, "Edit", name.to_string()),
Field(color, "Length", length.to_string()),
Field(color, "Loop", looped.to_string())
))
});
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()) {