lanes and grids

This commit is contained in:
🪞👃🪞 2024-06-12 18:38:16 +03:00
parent 788dc1ccde
commit ac865824cc
12 changed files with 213 additions and 112 deletions

View file

@ -106,9 +106,29 @@ impl Sample {
}
pub fn render (state: &Sampler, buf: &mut Buffer, area: Rect) {
pub fn render (state: &Sampler, buf: &mut Buffer, Rect { x, y, width, height }: Rect)
-> Usually<(u16, u16)>
{
let style = Style::default().gray();
draw_box(buf, Rect { x, y: y, width: 40, height: 12 });
buf.set_string(x + 1, y + 1, &format!(" {}", state.name), style.white().bold());
buf.set_string(x + 0, y + 2, &format!("├--------------------------------------┤"), style.dim());
buf.set_string(x + 2, y + 3, &format!("C0 Sample#000"), style.bold());
buf.set_string(x + 2, y + 4, &format!(" {:.03}s",
100000.0/44100.0), style);
buf.set_string(x + 2, y + 5, &format!("C#0 Sample#001"), style.bold());
buf.set_string(x + 2, y + 6, &format!(" {:.03}-{:.03}s",
50000.0/44100.0, 100000.0/44100.0), style);
buf.set_string(x + 2, y + 7, &format!("D0 Sample#002"), style.bold());
buf.set_string(x + 2, y + 8, &format!(" {:.03}-{:.03}/{:.03}s",
0.0, 50000.0/44100.0, 100000.0/44100.0), style);
buf.set_string(x + 2, y + 9, &format!("D#0 Sample#003"), style.bold());
buf.set_string(x + 2, y + 10, &format!(" {:.03}-[{:.03}-{:.03}]/{:.03}s ",
10000.0/44100.0, 25000.0/44100.0, 50000.0/44100.0, 100000.0/44100.0), style);
//buf.set_string(x + 1, y + 7 + 6, &format!(" Inputs... │ Outputs... "), style.dim());
//render_table(state, stdout, offset)?;
//render_meters(state, stdout, offset)?;
Ok((40, 11))
}
//fn render_table (