document stuff; Thunk suffix -> prefix

This commit is contained in:
🪞👃🪞 2025-01-19 21:31:16 +01:00
parent f9f9051eb7
commit 9d250daa04
16 changed files with 162 additions and 125 deletions

View file

@ -1,17 +1,15 @@
mod midi_clip; pub use midi_clip::*;
mod midi_launch; pub use midi_launch::*;
mod midi_player; pub use midi_player::*;
mod midi_edit; pub use midi_edit::*;
mod midi_in; pub use midi_in::*;
mod midi_launch; pub use midi_launch::*;
mod midi_out; pub use midi_out::*;
mod midi_pitch; pub use midi_pitch::*;
mod midi_range; pub use midi_range::*;
mod midi_player; pub use midi_player::*;
mod midi_point; pub use midi_point::*;
mod midi_pool; pub use midi_pool::*;
mod midi_range; pub use midi_range::*;
mod midi_view; pub use midi_view::*;
mod midi_pool; pub use midi_pool::*;
mod midi_edit; pub use midi_edit::*;
mod piano_h; pub use self::piano_h::*;
mod piano_h; pub use self::piano_h::*;
pub(crate) use ::tek_time::*;
pub(crate) use ::tek_jack::{*, jack::*};
@ -20,7 +18,6 @@ pub(crate) use ::tek_tui::{
tek_input::*,
tek_output::*,
tek_edn::*,
crossterm::event::*,
ratatui::style::{Style, Stylize, Color}
};

View file

@ -1,5 +1,4 @@
use crate::*;
use Value::*;
pub trait HasEditor {
fn editor (&self) -> &Option<MidiEditor>;
fn editor_mut (&mut self) -> &Option<MidiEditor>;

View file

@ -121,7 +121,7 @@ impl PianoHorizontal {
let note_lo = self.note_lo().get();
let note_hi = self.note_hi();
let buffer = self.buffer.clone();
RenderThunk::new(move|to: &mut TuiOut|{
ThunkRender::new(move|to: &mut TuiOut|{
let source = buffer.read().unwrap();
let [x0, y0, w, _h] = to.area().xywh();
//if h as usize != note_axis {
@ -156,7 +156,7 @@ impl PianoHorizontal {
let time_pos = self.time_pos();
let time_start = self.time_start().get();
let time_zoom = self.time_zoom().get();
RenderThunk::new(move|to: &mut TuiOut|{
ThunkRender::new(move|to: &mut TuiOut|{
let [x0, y0, w, _] = to.area().xywh();
for (_area_y, screen_y, note) in note_y_iter(note_lo, note_hi, y0) {
if note == note_pos {
@ -187,7 +187,7 @@ impl PianoHorizontal {
let key_style = Some(Style::default().fg(Color::Rgb(192, 192, 192)).bg(Color::Rgb(0, 0, 0)));
let off_style = Some(Style::default().fg(TuiTheme::g(160)));
let on_style = Some(Style::default().fg(TuiTheme::g(255)).bg(color.base.rgb).bold());
Fill::y(Fixed::x(self.keys_width, RenderThunk::new(move|to: &mut TuiOut|{
Fill::y(Fixed::x(self.keys_width, ThunkRender::new(move|to: &mut TuiOut|{
let [x, y0, _w, _h] = to.area().xywh();
for (_area_y, screen_y, note) in note_y_iter(note_lo, note_hi, y0) {
to.blit(&to_key(note), x, screen_y, key_style);
@ -203,7 +203,7 @@ impl PianoHorizontal {
})))
}
fn timeline (&self) -> impl Content<TuiOut> + '_ {
Fill::x(Fixed::y(1, RenderThunk::new(move|to: &mut TuiOut|{
Fill::x(Fixed::y(1, ThunkRender::new(move|to: &mut TuiOut|{
let [x, y, w, _h] = to.area();
let style = Some(Style::default().dim());
let length = self.clip.as_ref().map(|p|p.read().unwrap().length).unwrap_or(1);