mirror of
https://codeberg.org/unspeaker/tek.git
synced 2025-12-07 12:16:42 +01:00
wip: refactor command definitions
This commit is contained in:
parent
1b926b0338
commit
9f9de3fafb
9 changed files with 489 additions and 343 deletions
|
|
@ -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())
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue