mirror of
https://codeberg.org/unspeaker/tek.git
synced 2025-12-06 19:56:42 +01:00
66 lines
1.9 KiB
Rust
66 lines
1.9 KiB
Rust
pub mod chain;
|
|
pub mod grid;
|
|
pub mod layout;
|
|
pub mod mixer;
|
|
pub mod sampler;
|
|
pub mod sequencer;
|
|
pub mod transport;
|
|
pub mod plugin;
|
|
|
|
pub use self::layout::*;
|
|
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_or(&TransportState::Stopped),
|
|
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).unwrap();
|
|
|
|
ChainView { focused: self.section == 1, track: Some(track) }
|
|
.render(buf, Rect { x, y: y + height - height / 3 - 1, width, height: height / 3 })?.height;
|
|
|
|
y = y + SequencerView {
|
|
focused: self.section == 2,
|
|
ppq: self.timebase.ppq() as usize,
|
|
now: self.timebase.frames_pulses(self.playhead as f64) as usize,
|
|
phrase: track.phrases.get(0),
|
|
time_cursor: self.time_cursor,
|
|
time_start: self.time_start,
|
|
time_zoom: self.time_zoom,
|
|
note_cursor: self.note_cursor,
|
|
note_start: self.note_start,
|
|
}.render(buf, Rect { x, y, width, height: height - height / 3 })?.height;
|
|
}
|
|
|
|
if let Some(ref modal) = self.modal {
|
|
modal.render(buf, area)?;
|
|
}
|
|
|
|
Ok(area)
|
|
});
|