mirror of
https://codeberg.org/unspeaker/tek.git
synced 2025-12-07 12:16:42 +01:00
remove vec allocation from plugin callback
This commit is contained in:
parent
828436745c
commit
672d81f353
5 changed files with 150 additions and 116 deletions
32
src/view.rs
32
src/view.rs
|
|
@ -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 {
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue