mirror of
https://codeberg.org/unspeaker/tek.git
synced 2025-12-09 05:06:43 +01:00
bye launcher
This commit is contained in:
parent
7bc396e748
commit
2165e5d45d
10 changed files with 451 additions and 862 deletions
|
|
@ -1,51 +0,0 @@
|
|||
use crate::{core::*, model::*, view::*};
|
||||
|
||||
pub fn render (state: &Launcher, buf: &mut Buffer, mut area: Rect) -> Usually<Rect> {
|
||||
//area.width = 80; // DOS mode
|
||||
//area.height = 25;
|
||||
let Rect { x, mut y, width, height } = area;
|
||||
|
||||
y = y + TransportView {
|
||||
timebase: &state.timebase,
|
||||
playing: state.playing,
|
||||
record: state.sequencer().map(|s|s.recording).unwrap_or(false),
|
||||
overdub: state.sequencer().map(|s|s.overdub).unwrap_or(false),
|
||||
monitor: state.sequencer().map(|s|s.monitoring).unwrap_or(false),
|
||||
frame: state.current_frame
|
||||
}.render(buf, area)?.height;
|
||||
|
||||
y = y + SceneGridView {
|
||||
buf,
|
||||
area: Rect { x, y, width, height },
|
||||
mode: false,
|
||||
name: &state.name,
|
||||
focused: state.view.is_tracks(),
|
||||
scenes: &state.scenes,
|
||||
tracks: &state.tracks,
|
||||
cursor: &state.cursor
|
||||
}.draw_vertical()?.height;
|
||||
|
||||
if let Some(chain) = state.chain() {
|
||||
y = y + ChainView {
|
||||
focused: state.view.is_chains(),
|
||||
chain: Some(&*chain),
|
||||
}.render(buf, Rect { x, y, width, height: height/3 })?.height
|
||||
}
|
||||
|
||||
let track = state.track().map(|t|t.1);
|
||||
y = y + SequencerView {
|
||||
focused: state.view.is_sequencer(),
|
||||
ppq: state.timebase.ppq() as usize,
|
||||
track: track,
|
||||
phrase: track.unwrap().sequencer.phrases.get(state.phrase_id().unwrap())
|
||||
}.render(buf, Rect { x, y, width, height: height - y })?.height;
|
||||
|
||||
area.height = y;
|
||||
if state.show_help {
|
||||
let style = Some(Style::default().bold().white().not_dim().on_black().italic());
|
||||
let hide = "[Tab] Mode [Arrows] Move [.,] Value [F1] Toggle help ";
|
||||
hide.blit(buf, x + (width - hide.len() as u16) / 2, height - 1, style);
|
||||
}
|
||||
|
||||
Ok(area)
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue