move all port connections to constructors (port: impl AsRef<str>)

This commit is contained in:
🪞👃🪞 2024-12-29 20:15:12 +01:00
parent e8b97bed37
commit 6607491f16
9 changed files with 215 additions and 129 deletions

View file

@ -11,7 +11,7 @@ pub struct SamplerTui {
/// Lowest note displayed
pub note_lo: AtomicUsize,
pub note_pt: AtomicUsize,
color: ItemPalette
pub color: ItemPalette
}
impl SamplerTui {
@ -31,18 +31,18 @@ impl SamplerTui {
}
}
from_jack!(|jack|SamplerTui{
Self {
cursor: (0, 0),
editing: None,
mode: None,
size: Measure::new(),
note_lo: 36.into(),
note_pt: 36.into(),
color: ItemPalette::from(Color::Rgb(64, 128, 32)),
state: Sampler::new(jack, "sampler")?,
}
});
//from_jack!(|jack|SamplerTui{
//Self {
//cursor: (0, 0),
//editing: None,
//mode: None,
//size: Measure::new(),
//note_lo: 36.into(),
//note_pt: 36.into(),
//color: ItemPalette::from(Color::Rgb(64, 128, 32)),
//state: Sampler::new(jack, &"sampler", &[], &[&[], &[]], &[&[], &[]])?,
//}
//});
render!(<Tui>|self: SamplerTui|{
let keys_width = 5;