mirror of
https://codeberg.org/unspeaker/tek.git
synced 2025-12-08 12:46:42 +01:00
rudimentary input quantizer
This commit is contained in:
parent
665885f6ff
commit
f6a7cbf38e
8 changed files with 108 additions and 54 deletions
|
|
@ -7,6 +7,7 @@ pub struct TransportView<'a> {
|
|||
pub overdub: bool,
|
||||
pub monitor: bool,
|
||||
pub frame: usize,
|
||||
pub quant: usize,
|
||||
}
|
||||
|
||||
impl<'a> Render for TransportView<'a> {
|
||||
|
|
@ -16,7 +17,7 @@ impl<'a> Render for TransportView<'a> {
|
|||
draw_rec(buf, x + 12, y, self.record);
|
||||
draw_dub(buf, x + 19, y, self.overdub);
|
||||
draw_mon(buf, x + 26, y, self.monitor);
|
||||
draw_bpm(buf, x + 33, y, self.timebase.bpm() as usize);
|
||||
draw_bpm(buf, x + 33, y, self.timebase.bpm() as usize, self.quant);
|
||||
draw_timer(buf, x + width - 1, y, &self.timebase, self.frame);
|
||||
Ok(Rect { x, y, width, height: 1 })
|
||||
}
|
||||
|
|
@ -77,7 +78,7 @@ pub fn draw_mon (buf: &mut Buffer, x: u16, y: u16, on: bool) {
|
|||
}))
|
||||
}
|
||||
|
||||
pub fn draw_bpm (buf: &mut Buffer, x: u16, y: u16, bpm: usize) {
|
||||
pub fn draw_bpm (buf: &mut Buffer, x: u16, y: u16, bpm: usize, quant: usize) {
|
||||
let style = Style::default().not_dim();
|
||||
"BPM"
|
||||
.blit(buf, x, y, Some(style));
|
||||
|
|
@ -89,7 +90,6 @@ pub fn draw_bpm (buf: &mut Buffer, x: u16, y: u16, bpm: usize) {
|
|||
.blit(buf, x + 18, y, Some(style.bold()));
|
||||
"QUANT"
|
||||
.blit(buf, x + 23, y, Some(style));
|
||||
"1/16"
|
||||
ppq_to_name(quant)
|
||||
.blit(buf, x + 29, y, Some(style.bold()));
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue