wip: tek_test again

This commit is contained in:
🪞👃🪞 2024-09-09 22:57:00 +03:00
parent fa8282a9d5
commit 4c23aed40a
16 changed files with 190 additions and 172 deletions

View file

@ -9,13 +9,13 @@ pub fn main () -> Usually<()> {
struct ArrangerStandalone<E: Engine> {
/// Contains all the sequencers.
arranger: Arranger<E>,
arranger: Arranger<E>,
/// Controls the JACK transport.
transport: Option<TransportToolbar>,
transport: Option<TransportToolbar<E>>,
/// This allows the sequencer view to be moved or hidden.
show_sequencer: Option<tek_core::Direction>,
show_sequencer: Option<tek_core::Direction>,
///
focus: usize,
focus: usize,
}
#[derive(Debug, Parser)]
@ -38,7 +38,7 @@ pub struct ArrangerCli {
scenes: usize,
}
impl<E: Engine> ArrangerStandalone<E> {
impl ArrangerStandalone<Tui> {
pub fn from_args () -> Usually<Self> {
let args = ArrangerCli::parse();
let mut arranger = Arranger::new("");
@ -73,10 +73,15 @@ impl<E: Engine> ArrangerStandalone<E> {
}
}
impl Render<Tui> for ArrangerStandalone<Tui> {
impl Widget for ArrangerStandalone<Tui> {
type Engine = Tui;
fn layout (&self, to: [u16;4]) -> Perhaps<[u16;4]> {
Ok(Some(to))
}
fn render (&self, to: &mut Tui) -> Perhaps<[u16;4]> {
let area = to.area();
let sequencer = self.arranger.sequencer();
let sequencer = self.arranger.sequencer()
.map(|t|t as &dyn Widget<Engine = Tui>);
let result = Split::down()
.add_ref(&self.transport)
.add_ref(&self.arranger)