mirror of
https://codeberg.org/unspeaker/tek.git
synced 2025-12-08 12:46:42 +01:00
start implementing edn loader; remove PhantomData from some tek_layout constructs
This commit is contained in:
parent
f359768ba2
commit
2b07e7963e
20 changed files with 239 additions and 222 deletions
|
|
@ -47,38 +47,27 @@ from_jack!(|jack|SequencerTui {
|
|||
clock,
|
||||
}
|
||||
});
|
||||
render!(Tui: (self: SequencerTui) => {
|
||||
let w =
|
||||
self.size.w();
|
||||
let phrase_w =
|
||||
if w > 60 { 20 } else if w > 40 { 15 } else { 10 };
|
||||
let color = self.player.play_phrase().as_ref().map(|(_,p)|
|
||||
p.as_ref().map(|p|p.read().unwrap().color)
|
||||
).flatten().clone();
|
||||
let toolbar = Tui::when(self.transport,
|
||||
TransportView::new(true, &self.clock));
|
||||
let selectors = Tui::when(self.selectors,
|
||||
Bsp::e(ClipSelected::play_phrase(&self.player), ClipSelected::next_phrase(&self.player)));
|
||||
let pool_w =
|
||||
if self.pool.visible { phrase_w } else { 0 };
|
||||
let pool =
|
||||
Pull::y(1, Fill::y(Align::e(PoolView(self.pool.visible, &self.pool))));
|
||||
let edit_clip =
|
||||
MidiEditClip(&self.editor);
|
||||
self.size.of(Bsp::s(
|
||||
toolbar,
|
||||
Bsp::s(
|
||||
lay!(Align::w(edit_clip), Align::e(selectors)),
|
||||
Bsp::n(
|
||||
Align::x(Fixed::y(1, MidiEditStatus(&self.editor))),
|
||||
Bsp::w(
|
||||
Fixed::x(pool_w, Align::e(Fill::y(PoolView(self.compact, &self.pool)))),
|
||||
Fill::xy(&self.editor),
|
||||
),
|
||||
)
|
||||
)
|
||||
))
|
||||
});
|
||||
render!(Tui: (self: SequencerTui) => self.size.of(
|
||||
Bsp::s(self.toolbar_view(),
|
||||
Bsp::n(self.status_view(),
|
||||
Bsp::w(self.pool_view(), Fill::xy(&self.editor))))));
|
||||
impl SequencerTui {
|
||||
fn toolbar_view (&self) -> impl Content<Tui> + use<'_> {
|
||||
self.transport.then(||TransportView::new(true, &self.clock))
|
||||
}
|
||||
fn status_view (&self) -> impl Content<Tui> + use<'_> {
|
||||
let edit_clip = MidiEditClip(&self.editor);
|
||||
let selectors = When(self.selectors, Bsp::e(ClipSelected::play_phrase(&self.player), ClipSelected::next_phrase(&self.player)));
|
||||
row!(selectors, edit_clip, MidiEditStatus(&self.editor))
|
||||
}
|
||||
fn pool_view (&self) -> impl Content<Tui> + use<'_> {
|
||||
let w = self.size.w();
|
||||
let phrase_w = if w > 60 { 20 } else if w > 40 { 15 } else { 10 };
|
||||
let pool_w = if self.pool.visible { phrase_w } else { 0 };
|
||||
let pool = Pull::y(1, Fill::y(Align::e(PoolView(self.pool.visible, &self.pool))));
|
||||
Fixed::x(pool_w, Align::e(Fill::y(PoolView(self.compact, &self.pool))))
|
||||
}
|
||||
}
|
||||
audio!(|self:SequencerTui, client, scope|{
|
||||
// Start profiling cycle
|
||||
let t0 = self.perf.get_t0();
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue