tek/crates/tek_tui/src/tui_sequencer.rs

27 lines
799 B
Rust

use crate::*;
use std::cmp::PartialEq;
/// Root level object for standalone `tek_sequencer`.
/// Also embeddable, in which case the `player` is used for preview.
pub struct SequencerView<E: Engine> {
/// Controls the JACK transport.
pub transport: TransportView<E>,
/// Width of phrase pool
pub split: u16,
/// Pool of all phrases available to the sequencer
pub phrases: PhrasePoolView<E>,
/// Phrase editor view
pub editor: PhraseEditor<E>,
/// Phrase player
pub player: MIDIPlayer,
}
impl Content for SequencerView<Tui> {
type Engine = Tui;
fn content (&self) -> impl Widget<Engine = Tui> {
col!(
self.transport,
Split::right(20, widget(&self.phrases), widget(&self.editor)).min_y(20)
)
}
}