mirror of
https://codeberg.org/unspeaker/tek.git
synced 2025-12-06 19:56:42 +01:00
separate Input and Output impls
This commit is contained in:
parent
a6efde40f8
commit
0e821e098f
77 changed files with 465 additions and 454 deletions
|
|
@ -5,7 +5,7 @@ pub(crate) fn note_y_iter (note_lo: usize, note_hi: usize, y0: u16) -> impl Iter
|
|||
(note_lo..=note_hi).rev().enumerate().map(move|(y, n)|(y, y0 + y as u16, n))
|
||||
}
|
||||
|
||||
render!(Tui: (self: PianoHorizontal) => Bsp::s(
|
||||
render!(TuiOut: (self: PianoHorizontal) => Bsp::s(
|
||||
Fixed::y(1, Bsp::e(
|
||||
Fixed::x(self.keys_width, ""),
|
||||
Fill::x(PianoHorizontalTimeline(self)),
|
||||
|
|
@ -81,7 +81,7 @@ impl PianoHorizontal {
|
|||
}
|
||||
}
|
||||
|
||||
has_size!(<Tui>|self:PianoHorizontal|&self.size);
|
||||
has_size!(<TuiOut>|self:PianoHorizontal|&self.size);
|
||||
|
||||
impl TimeRange for PianoHorizontal {
|
||||
fn time_len (&self) -> &AtomicUsize { self.range.time_len() }
|
||||
|
|
|
|||
|
|
@ -2,7 +2,7 @@ use crate::*;
|
|||
use super::*;
|
||||
|
||||
pub struct PianoHorizontalCursor<'a>(pub(crate) &'a PianoHorizontal);
|
||||
render!(Tui: |self: PianoHorizontalCursor<'a>, render|{
|
||||
render!(TuiOut: |self: PianoHorizontalCursor<'a>, render|{
|
||||
let style = Some(Style::default().fg(self.0.color.lightest.rgb));
|
||||
let note_hi = self.0.note_hi();
|
||||
let note_len = self.0.note_len();
|
||||
|
|
|
|||
|
|
@ -3,7 +3,7 @@ use super::*;
|
|||
|
||||
pub struct PianoHorizontalKeys<'a>(pub(crate) &'a PianoHorizontal);
|
||||
|
||||
render!(Tui: |self: PianoHorizontalKeys<'a>, to|{
|
||||
render!(TuiOut: |self: PianoHorizontalKeys<'a>, to|{
|
||||
let state = self.0;
|
||||
let color = state.color;
|
||||
let note_lo = state.note_lo().get();
|
||||
|
|
|
|||
|
|
@ -3,7 +3,7 @@ use super::*;
|
|||
|
||||
pub struct PianoHorizontalNotes<'a>(pub(crate) &'a PianoHorizontal);
|
||||
|
||||
render!(Tui: |self: PianoHorizontalNotes<'a>, render|{
|
||||
render!(TuiOut: |self: PianoHorizontalNotes<'a>, render|{
|
||||
let time_start = self.0.time_start().get();
|
||||
let note_axis = self.0.note_axis().get();
|
||||
let note_lo = self.0.note_lo().get();
|
||||
|
|
|
|||
|
|
@ -2,7 +2,7 @@ use crate::*;
|
|||
use super::*;
|
||||
|
||||
pub struct PianoHorizontalTimeline<'a>(pub(crate) &'a PianoHorizontal);
|
||||
render!(Tui: |self: PianoHorizontalTimeline<'a>, render|{
|
||||
render!(TuiOut: |self: PianoHorizontalTimeline<'a>, render|{
|
||||
let [x, y, w, h] = render.area();
|
||||
let style = Some(Style::default().dim());
|
||||
let length = self.0.phrase.as_ref().map(|p|p.read().unwrap().length).unwrap_or(1);
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue