mirror of
https://codeberg.org/unspeaker/tek.git
synced 2025-12-07 12:16:42 +01:00
bye launcher
This commit is contained in:
parent
7bc396e748
commit
2165e5d45d
10 changed files with 451 additions and 862 deletions
48
src/view.rs
48
src/view.rs
|
|
@ -1,7 +1,6 @@
|
|||
pub mod chain;
|
||||
pub mod grid;
|
||||
pub mod layout;
|
||||
pub mod launcher;
|
||||
pub mod mixer;
|
||||
pub mod sampler;
|
||||
pub mod sequencer;
|
||||
|
|
@ -13,3 +12,50 @@ pub use self::transport::TransportView;
|
|||
pub use self::grid::SceneGridView;
|
||||
pub use self::chain::{ChainView, ChainViewMode};
|
||||
pub use self::sequencer::SequencerView;
|
||||
|
||||
use crate::{render, App, core::*};
|
||||
|
||||
render!(App |self, buf, area| {
|
||||
let Rect { x, mut y, width, height } = area;
|
||||
|
||||
y = y + TransportView {
|
||||
timebase: &self.timebase,
|
||||
playing: *self.playing.as_ref().unwrap(),
|
||||
record: false,
|
||||
overdub: false,
|
||||
monitor: false,
|
||||
frame: self.playhead,
|
||||
}.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;
|
||||
|
||||
if self.track_cursor > 0 {
|
||||
let track = self.tracks.get(self.track_cursor - 1);
|
||||
y = y + ChainView {
|
||||
focused: self.section == 1,
|
||||
chain: track.map(|t|&t.chain),
|
||||
}.render(buf, Rect { x, y, width, height: height / 3 })?.height;
|
||||
|
||||
y = y + SequencerView {
|
||||
focused: self.section == 2,
|
||||
ppq: self.timebase.ppq() as usize,
|
||||
track: track,
|
||||
phrase: track.map(|t|&t.sequencer.phrases[0]),
|
||||
}.render(buf, Rect { x, y, width, height })?.height;
|
||||
}
|
||||
|
||||
if let Some(ref modal) = self.modal {
|
||||
modal.render(buf, area)?;
|
||||
}
|
||||
|
||||
Ok(area)
|
||||
});
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue