break down sampler into modules and align with sequencer

This commit is contained in:
🪞👃🪞 2024-12-27 23:06:19 +01:00
parent 774af02e5e
commit a4835e2c81
13 changed files with 644 additions and 602 deletions

View file

@ -6,7 +6,6 @@ pub struct SequencerStatus {
pub(crate) width: usize,
pub(crate) cpu: Option<String>,
pub(crate) size: String,
pub(crate) res: String,
pub(crate) playing: bool,
}
from!(|state:&SequencerTui|SequencerStatus = {
@ -19,7 +18,6 @@ from!(|state:&SequencerTui|SequencerStatus = {
playing: state.clock.is_rolling(),
cpu: state.perf.percentage().map(|cpu|format!("{cpu:.01}%")),
size: format!("{}x{}│", width, state.size.h()),
res: format!("│{}s│{:.1}kHz│{:.1}ms│", samples, rate / 1000., buffer * 1000.),
}
});
render!(<Tui>|self: SequencerStatus|Fixed::h(2, lay!([
@ -47,6 +45,6 @@ impl SequencerStatus {
]))
}
fn stats (&self) -> impl Render<Tui> + use<'_> {
row!([&self.cpu, &self.res, &self.size])
row!([&self.cpu, &self.size])
}
}