mirror of
https://codeberg.org/unspeaker/tek.git
synced 2025-12-07 12:16:42 +01:00
wip: "multiple cascading refactors"
https://loglog.games/blog/leaving-rust-gamedev/#orphan-rule-should-be-optional is on point
This commit is contained in:
parent
20afc397ea
commit
fa8282a9d5
18 changed files with 175 additions and 222 deletions
|
|
@ -30,12 +30,13 @@ impl<E: Engine> Process for Mixer<E> {
|
|||
Control::Continue
|
||||
}
|
||||
}
|
||||
impl Render<Tui> for Mixer<Tui> {
|
||||
fn render (&self, to: &mut Tui) -> Perhaps<[u16;4]> {
|
||||
impl Content for Mixer<Tui> {
|
||||
type Engine = Tui;
|
||||
fn content (&self) -> impl Widget<Engine = Tui> {
|
||||
let mut tracks = Split::right();
|
||||
for channel in self.tracks.iter() {
|
||||
tracks = tracks.add_ref(channel)
|
||||
}
|
||||
tracks.render(to)
|
||||
tracks
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1,13 +1,9 @@
|
|||
use crate::*;
|
||||
use tek_core::Direction;
|
||||
|
||||
impl Layout<Tui> for Track<Tui> {
|
||||
fn layout (&self, area: [u16;4]) -> Perhaps<[u16;4]> {
|
||||
todo!()
|
||||
}
|
||||
}
|
||||
impl Render<Tui> for Track<Tui> {
|
||||
fn render (&self, to: &mut Tui) -> Perhaps<[u16;4]> {
|
||||
impl Content for Track<Tui> {
|
||||
type Engine = Tui;
|
||||
fn content (&self) -> impl Widget<Engine = Tui> {
|
||||
TrackView {
|
||||
chain: Some(&self),
|
||||
direction: tek_core::Direction::Right,
|
||||
|
|
@ -26,7 +22,7 @@ impl Render<Tui> for Track<Tui> {
|
|||
//pub output_ports: Vec<Port<AudioOut>>,
|
||||
//pub post_fader_meter: f64,
|
||||
//pub route: String,
|
||||
}.render(to)
|
||||
}
|
||||
}
|
||||
}
|
||||
pub struct TrackView<'a, E: Engine> {
|
||||
|
|
@ -35,7 +31,11 @@ pub struct TrackView<'a, E: Engine> {
|
|||
pub focused: bool,
|
||||
pub entered: bool,
|
||||
}
|
||||
impl<'a> Render<Tui> for TrackView<'a, Tui> {
|
||||
impl<'a> Widget for TrackView<'a, Tui> {
|
||||
type Engine = Tui;
|
||||
fn layout (&self, area: [u16;4]) -> Perhaps<[u16;4]> {
|
||||
todo!()
|
||||
}
|
||||
fn render (&self, to: &mut Tui) -> Perhaps<[u16;4]> {
|
||||
todo!();
|
||||
//let mut area = to.area();
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue