mirror of
https://codeberg.org/unspeaker/tek.git
synced 2025-12-07 12:16:42 +01:00
fix sequencer
This commit is contained in:
parent
647f07c446
commit
c159889ad8
2 changed files with 22 additions and 13 deletions
|
|
@ -6,19 +6,19 @@ use EdnItem::*;
|
||||||
|
|
||||||
const EDN: &'static str = include_str!("groovebox.edn");
|
const EDN: &'static str = include_str!("groovebox.edn");
|
||||||
|
|
||||||
impl Content<TuiOut> for Groovebox {
|
//impl Content<TuiOut> for Groovebox {
|
||||||
fn content (&self) -> impl Render<TuiOut> {
|
//fn content (&self) -> impl Render<TuiOut> {
|
||||||
self.size.of(EdnView::from_source(self, EDN))
|
//self.size.of(EdnView::from_source(self, EDN))
|
||||||
}
|
//}
|
||||||
}
|
//}
|
||||||
|
|
||||||
// this works:
|
// this works:
|
||||||
//render!(TuiOut: (self: Groovebox) => self.size.of(
|
render!(TuiOut: (self: Groovebox) => self.size.of(
|
||||||
//Bsp::s(self.toolbar_view(),
|
Bsp::s(self.toolbar_view(),
|
||||||
//Bsp::n(self.selector_view(),
|
Bsp::n(self.selector_view(),
|
||||||
//Bsp::n(self.sample_view(),
|
Bsp::n(self.sample_view(),
|
||||||
//Bsp::n(self.status_view(),
|
Bsp::n(self.status_view(),
|
||||||
//Bsp::w(self.pool_view(), Fill::xy(Bsp::e(self.sampler_view(), &self.editor)))))))));
|
Bsp::w(self.pool_view(), Fill::xy(Bsp::e(self.sampler_view(), &self.editor)))))))));
|
||||||
|
|
||||||
impl Groovebox {
|
impl Groovebox {
|
||||||
fn toolbar_view (&self) -> impl Content<TuiOut> + use<'_> {
|
fn toolbar_view (&self) -> impl Content<TuiOut> + use<'_> {
|
||||||
|
|
|
||||||
|
|
@ -49,17 +49,26 @@ from_jack!(|jack|Sequencer {
|
||||||
});
|
});
|
||||||
render!(TuiOut: (self: Sequencer) => self.size.of(
|
render!(TuiOut: (self: Sequencer) => self.size.of(
|
||||||
Bsp::s(self.toolbar_view(),
|
Bsp::s(self.toolbar_view(),
|
||||||
|
Bsp::n(self.selector_view(),
|
||||||
Bsp::n(self.status_view(),
|
Bsp::n(self.status_view(),
|
||||||
Bsp::w(self.pool_view(), Fill::xy(&self.editor))))));
|
Bsp::w(self.pool_view(), Fill::xy(&self.editor)))))));
|
||||||
impl Sequencer {
|
impl Sequencer {
|
||||||
fn toolbar_view (&self) -> impl Content<TuiOut> + use<'_> {
|
fn toolbar_view (&self) -> impl Content<TuiOut> + use<'_> {
|
||||||
self.transport.then(||TransportView::new(true, &self.clock))
|
Fill::x(Fixed::y(2, Align::x(TransportView::new(true, &self.player.clock))))
|
||||||
}
|
}
|
||||||
fn status_view (&self) -> impl Content<TuiOut> + use<'_> {
|
fn status_view (&self) -> impl Content<TuiOut> + use<'_> {
|
||||||
let edit_clip = MidiEditClip(&self.editor);
|
let edit_clip = MidiEditClip(&self.editor);
|
||||||
let selectors = When(self.selectors, Bsp::e(ClipSelected::play_phrase(&self.player), ClipSelected::next_phrase(&self.player)));
|
let selectors = When(self.selectors, Bsp::e(ClipSelected::play_phrase(&self.player), ClipSelected::next_phrase(&self.player)));
|
||||||
row!(selectors, edit_clip, MidiEditStatus(&self.editor))
|
row!(selectors, edit_clip, MidiEditStatus(&self.editor))
|
||||||
}
|
}
|
||||||
|
fn selector_view (&self) -> impl Content<TuiOut> + use<'_> {
|
||||||
|
row!(
|
||||||
|
ClipSelected::play_phrase(&self.player),
|
||||||
|
ClipSelected::next_phrase(&self.player),
|
||||||
|
MidiEditClip(&self.editor),
|
||||||
|
MidiEditStatus(&self.editor),
|
||||||
|
)
|
||||||
|
}
|
||||||
fn pool_view (&self) -> impl Content<TuiOut> + use<'_> {
|
fn pool_view (&self) -> impl Content<TuiOut> + use<'_> {
|
||||||
let w = self.size.w();
|
let w = self.size.w();
|
||||||
let phrase_w = if w > 60 { 20 } else if w > 40 { 15 } else { 10 };
|
let phrase_w = if w > 60 { 20 } else if w > 40 { 15 } else { 10 };
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue