reenable immediate mode arranger

This commit is contained in:
🪞👃🪞 2025-03-04 19:06:49 +02:00
parent 8794b2e05b
commit 9d88a7361f

View file

@ -1,6 +1,13 @@
use crate::*;
impl Tek {
pub fn view_arranger (&self) -> impl Content<TuiOut> + use<'_> {
Bsp::s(self.view_inputs(),
Bsp::s(self.view_tracks(),
Bsp::n(self.view_outputs(),
self.view_scenes())))
}
// FIXME: The memoized arranger is too complex.
// Just render a slice of the arranger for now,
// starting from tracks[scroll_offset] and ending
@ -14,7 +21,7 @@ impl Tek {
/// This function is called on every frame, but is relatively cheap
/// as the rendering logic of [redraw_arranger] is only invoked on
/// changes to the content.
pub fn view_arranger (&self) -> impl Content<TuiOut> + use<'_> {
pub fn view_arranger_todo (&self) -> impl Content<TuiOut> + use<'_> {
Fill::xy(ThunkRender::new(move|to: &mut TuiOut|{
let [x0, y0, w, h] = to.area().xywh();
let source = self.arranger.read().unwrap();
@ -22,11 +29,11 @@ impl Tek {
for (source_y, target_y) in (y0..y0+h).enumerate() {
let target_pos = Position::from((target_x, target_y));
if let Some(target) = to.buffer.cell_mut(target_pos) {
target.set_bg(Color::Rgb(128,0,0));
//target.set_bg(Color::Rgb(128,0,0));
let source_pos = Position::from((source_x as u16, source_y as u16));
if let Some(source) = source.cell(source_pos) {
*target = source.clone();
target.set_bg(Color::Rgb(0,128,0));
//target.set_bg(Color::Rgb(0,128,0));
}
}
}
@ -40,6 +47,7 @@ impl Tek {
/// i.e. not on scroll. Scrolling just determines which part
/// of the arranger buffer to blit in [view_arranger].
pub fn redraw_arranger (&self) {
return;
let width = self.w_tracks();
let height = self.h_scenes() + self.h_inputs() + self.h_outputs();
let buffer = Buffer::empty(ratatui::prelude::Rect { x: 0, y: 0, width, height });