remove vec allocation from plugin callback

This commit is contained in:
🪞👃🪞 2024-07-06 21:03:36 +03:00
parent 828436745c
commit 672d81f353
5 changed files with 150 additions and 116 deletions

View file

@ -9,7 +9,7 @@ pub mod plugin;
pub use self::layout::*;
pub use self::transport::TransportView;
pub use self::grid::SceneGridView;
pub use self::grid::*;
pub use self::chain::ChainView;
pub use self::sequencer::SequencerView;
@ -17,7 +17,6 @@ use crate::{render, App, core::*};
render!(App |self, buf, area| {
let Rect { x, mut y, width, height } = area;
return Ok(area);
y = y + TransportView {
timebase: &self.timebase,
@ -29,16 +28,25 @@ render!(App |self, buf, area| {
quant: self.quant,
}.render(buf, area)?.height;
y = y + SceneGridView {
buf,
area: Rect { x, y, width, height: height / 3 },
name: "",
mode: self.grid_mode,
focused: self.section == 0,
scenes: &self.scenes,
tracks: &self.tracks,
cursor: &(self.track_cursor, self.scene_cursor),
}.draw()?.height;
y = y + if self.grid_mode {
SceneGridViewHorizontal {
buf,
area: Rect { x, y, width, height: height / 3 },
focused: self.section == 0,
scenes: &self.scenes,
tracks: &self.tracks,
cursor: &(self.track_cursor, self.scene_cursor),
}.draw()?
} else {
SceneGridViewVertical {
buf,
area: Rect { x, y, width, height: height / 3 },
focused: self.section == 0,
scenes: &self.scenes,
tracks: &self.tracks,
cursor: &(self.track_cursor, self.scene_cursor),
}.draw()?
}.height;
if self.track_cursor > 0 {