From 9d88a7361f25ccd362ebdd7e55df00b1615da580 Mon Sep 17 00:00:00 2001 From: unspeaker Date: Tue, 4 Mar 2025 19:06:49 +0200 Subject: [PATCH] reenable immediate mode arranger --- app/src/view/view_arranger.rs | 14 +++++++++++--- 1 file changed, 11 insertions(+), 3 deletions(-) diff --git a/app/src/view/view_arranger.rs b/app/src/view/view_arranger.rs index 0fb33ce0..bd06a8fe 100644 --- a/app/src/view/view_arranger.rs +++ b/app/src/view/view_arranger.rs @@ -1,6 +1,13 @@ use crate::*; impl Tek { + pub fn view_arranger (&self) -> impl Content + 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 + use<'_> { + pub fn view_arranger_todo (&self) -> impl Content + 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 });