mirror of
https://codeberg.org/unspeaker/tek.git
synced 2025-12-07 04:06:45 +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
|
|
@ -6,7 +6,7 @@ pub struct Arranger<E: Engine> {
|
|||
/// Name of arranger
|
||||
pub name: Arc<RwLock<String>>,
|
||||
/// Collection of tracks.
|
||||
pub tracks: Vec<Sequencer>,
|
||||
pub tracks: Vec<Sequencer<E>>,
|
||||
/// Collection of scenes.
|
||||
pub scenes: Vec<Scene>,
|
||||
/// Currently selected element.
|
||||
|
|
@ -45,12 +45,12 @@ impl<E: Engine> Arranger<E> {
|
|||
_ => {}
|
||||
}
|
||||
}
|
||||
pub fn sequencer (&self) -> Option<&Sequencer> {
|
||||
pub fn sequencer (&self) -> Option<&Sequencer<E>> {
|
||||
self.selected.track()
|
||||
.map(|track|self.tracks.get(track))
|
||||
.flatten()
|
||||
}
|
||||
pub fn sequencer_mut (&mut self) -> Option<&mut Sequencer> {
|
||||
pub fn sequencer_mut (&mut self) -> Option<&mut Sequencer<E>> {
|
||||
self.selected.track()
|
||||
.map(|track|self.tracks.get_mut(track))
|
||||
.flatten()
|
||||
|
|
@ -99,13 +99,11 @@ impl ArrangerViewMode {
|
|||
}
|
||||
}
|
||||
}
|
||||
impl Layout<Tui> for Arranger<Tui> {
|
||||
impl Widget for Arranger<Tui> {
|
||||
type Engine = Tui;
|
||||
fn layout (&self, area: [u16;4]) -> Perhaps<[u16;4]> {
|
||||
todo!()
|
||||
}
|
||||
}
|
||||
/// Render arranger to terminal
|
||||
impl Render<Tui> for Arranger<Tui> {
|
||||
fn render (&self, to: &mut Tui) -> Perhaps<[u16;4]> {
|
||||
let area = (|to|match self.mode {
|
||||
ArrangerViewMode::Horizontal =>
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue