mirror of
https://codeberg.org/unspeaker/tek.git
synced 2026-01-12 19:16:41 +01:00
wip: replacing Rect with [u16;4] in mixer and sequencer
This commit is contained in:
parent
fa739a49b2
commit
06f8bd1116
14 changed files with 106 additions and 106 deletions
|
|
@ -1,13 +1,13 @@
|
|||
use crate::*;
|
||||
|
||||
impl Render<Tui> for Sampler {
|
||||
fn render (&self, to: &mut Tui) -> Perhaps<Rect> {
|
||||
fn render (&self, to: &mut Tui) -> Perhaps<[u16;4]> {
|
||||
tui_render_sampler(self, to)
|
||||
}
|
||||
}
|
||||
|
||||
pub fn tui_render_sampler (sampler: &Sampler, to: &mut Tui) -> Perhaps<Rect> {
|
||||
let Rect { x, y, height, .. } = to.area();
|
||||
pub fn tui_render_sampler (sampler: &Sampler, to: &mut Tui) -> Perhaps<[u16;4]> {
|
||||
let [x, y, _, height] = to.area();
|
||||
let style = Style::default().gray();
|
||||
let title = format!(" {} ({})", sampler.name, sampler.voices.read().unwrap().len());
|
||||
to.blit(&title, x+1, y, Some(style.white().bold().not_dim()))?;
|
||||
|
|
@ -29,7 +29,7 @@ pub fn tui_render_sampler (sampler: &Sampler, to: &mut Tui) -> Perhaps<Rect> {
|
|||
j = j + 1;
|
||||
}
|
||||
let height = ((2 + y1) as u16).min(height);
|
||||
Ok(Some(Rect { x, y, width: (width as u16).min(to.area().width), height }))
|
||||
Ok(Some([x, y, (width as u16).min(to.area().w()), height]))
|
||||
}
|
||||
|
||||
fn draw_sample (
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue