wip: refactor command definitions

This commit is contained in:
🪞👃🪞 2025-05-05 23:13:47 +03:00
parent 1b926b0338
commit 9f9de3fafb
9 changed files with 489 additions and 343 deletions

View file

@ -80,6 +80,7 @@ impl Sampler {
Tui::fg_bg(fg, bg, format!("{note:3} {}", self.view_list_item(note, compact)))
}))
}
pub fn view_list_item (&self, note: usize, compact: bool) -> String {
if compact {
String::default()
@ -87,6 +88,7 @@ impl Sampler {
draw_list_item(&self.mapped[note])
}
}
pub fn view_sample (&self, note_pt: usize) -> impl Content<TuiOut> + use<'_> {
Outer(true, Style::default().fg(Tui::g(96))).enclose(draw_viewer(if let Some((_, sample)) = &self.recording {
Some(sample)
@ -96,6 +98,7 @@ impl Sampler {
None
}))
}
pub fn status (&self, index: usize) -> impl Content<TuiOut> {
draw_status(self.mapped[index].as_ref())
}