grid -> arranger

This commit is contained in:
🪞👃🪞 2024-07-08 19:50:18 +03:00
parent d99a08bcf7
commit f1f812d0fb
5 changed files with 131 additions and 191 deletions

View file

@ -1,18 +1,16 @@
pub mod chain;
pub mod grid;
pub mod arranger;
pub mod layout;
pub mod sampler;
pub mod sequencer;
pub mod transport;
pub mod plugin;
pub mod focus;
pub mod border;
pub use self::border::*;
pub use self::layout::*;
pub use self::transport::TransportView;
pub use self::grid::*;
pub use self::focus::*;
pub use self::arranger::*;
pub use self::chain::ChainView;
pub use self::sequencer::SequencerView;
@ -22,23 +20,23 @@ render!(App |self, buf, area| {
let Rect { x, y, width, height } = area;
let transport = self.draw_transport(buf, area)?;
let y = y + transport.height;
let grid = if self.grid_mode {
self.draw_grid_horizontal(buf, Rect {
let arranger = if self.arranger_mode {
self.draw_arranger_horizontal(buf, Rect {
x, y, width, height: height / 3
})?
} else {
self.draw_grid_vertical(buf, Rect {
self.draw_arranger_vertical(buf, Rect {
x, y, width, height: height / 3
})?
};
if self.section == AppSection::Grid {
if self.section == AppSection::Arranger {
QuarterV(if self.entered {
Style::default().green()
} else {
Style::default().green().dim()
}).draw(buf, grid)
}).draw(buf, arranger)
}
let y = y + grid.height;
let y = y + arranger.height;
if self.track_cursor > 0 {
let chain = self.draw_chain(buf, Rect {
x, y: y + height - height / 3 - 1, width, height: height / 3
@ -48,7 +46,7 @@ render!(App |self, buf, area| {
Style::default().green()
} else {
Style::default().green().dim()
}).draw(buf, chain)
}).draw(buf, Rect { width, ..chain })
}
let phrase = self.draw_phrase(buf, Rect {
x, y, width, height: height - height / 3
@ -101,22 +99,22 @@ impl App {
quant: self.quant,
}.render(buf, area)
}
fn draw_grid_horizontal (&self, buf: &mut Buffer, area: Rect) -> Usually<Rect> {
SceneGridViewHorizontal {
fn draw_arranger_horizontal (&self, buf: &mut Buffer, area: Rect) -> Usually<Rect> {
ArrangerViewHorizontal {
buf,
area,
focused: self.section == AppSection::Grid,
focused: self.section == AppSection::Arranger,
entered: self.entered,
scenes: &self.scenes,
tracks: &self.tracks,
cursor: &(self.track_cursor, self.scene_cursor),
}.draw()
}
fn draw_grid_vertical (&self, buf: &mut Buffer, area: Rect) -> Usually<Rect> {
SceneGridViewVertical {
fn draw_arranger_vertical (&self, buf: &mut Buffer, area: Rect) -> Usually<Rect> {
ArrangerViewVertical {
buf,
area,
focused: self.section == AppSection::Grid,
focused: self.section == AppSection::Arranger,
entered: self.entered,
scenes: &self.scenes,
tracks: &self.tracks,