modularize core

This commit is contained in:
🪞👃🪞 2024-06-30 22:47:17 +03:00
parent a4061535b5
commit 2837ffff4a
43 changed files with 629 additions and 770 deletions

View file

@ -1,12 +1,13 @@
use crate::prelude::*;
use crate::core::*;
use crate::layout::*;
use crate::device::*;
mod grid;
pub use self::grid::*;
mod handle;
pub use self::grid::*; mod handle;
pub use self::handle::*;
pub struct Launcher {
name: String,
timebase: Arc<Timebase>,
transport: Transport,
transport: ::jack::Transport,
playing: TransportState,
monitoring: bool,
recording: bool,
@ -185,10 +186,10 @@ pub fn render (state: &Launcher, buf: &mut Buffer, mut area: Rect) -> Usually<Re
//area.width = 80; // DOS mode
//area.height = 25;
let Rect { x, y, width, height } = area;
crate::device::sequencer::draw_play_stop(buf, x + 1, y, &state.playing);
crate::device::sequencer::draw_rec(buf, x + 12, y, state.recording);
crate::device::sequencer::draw_mon(buf, x + 19, y, state.monitoring);
crate::device::sequencer::draw_dub(buf, x + 26, y, state.overdub);
crate::device::transport::draw_play_stop(buf, x + 1, y, &state.playing);
crate::device::transport::draw_rec(buf, x + 12, y, state.recording);
crate::device::transport::draw_mon(buf, x + 19, y, state.monitoring);
crate::device::transport::draw_dub(buf, x + 26, y, state.overdub);
draw_bpm(buf, x + 33, y, state.timebase.tempo());
draw_timer(buf, x + width - 1, y, &state.timebase, state.position);
let mut y = y + 1;