transport master

This commit is contained in:
🪞👃🪞 2024-06-21 13:32:20 +03:00
parent 185c6b5b34
commit be2c2df92b
4 changed files with 85 additions and 62 deletions

View file

@ -44,21 +44,21 @@ pub fn render (state: &Plugin, buf: &mut Buffer, Rect { x, y, .. }: Rect)
let style = Style::default().gray();
buf.set_string(x + 1, y + 1, &format!(" {}", state.name), style.white().bold());
buf.set_string(x + 13, y + 1, &format!("│ ...{}...", &HELM[13..30]), style.not_dim());
buf.set_string(x + 0, y + 2, &format!("├--------------------------------------"), style.dim());
buf.set_string(x + 0, y + 2, &format!("├------------------------------------------------"), style.dim());
match &state.plugin {
Some(PluginKind::LV2(ports, instance)) => {
let mut height = 3;
for (i, port) in ports.iter().skip(state.parameter_offset).enumerate() {
if i >= 10 {
if i >= 20 {
break
}
buf.set_string(x + 2, y + 3 + i as u16, &format!("{:20} = {:03}",
buf.set_string(x + 2, y + 3 + i as u16, &format!("{:30} = {:03}",
port.name,
port.default_value
), Style::default());
height = height + 1;
}
Ok(draw_box(buf, Rect { x, y, width: 40, height: height.max(10) }))
Ok(draw_box(buf, Rect { x, y, width: 50, height: height.max(20) }))
},
_ => {
buf.set_string(x + 1, y + 3, &format!(" Parameter 1 0.0"), style);