mirror of
https://codeberg.org/unspeaker/tek.git
synced 2025-12-06 19:56:42 +01:00
reenable sample viewer in groovebox
cleanup unused expose! bindings
This commit is contained in:
parent
f8994d3e2d
commit
e4808f8fc1
8 changed files with 32 additions and 50 deletions
|
|
@ -11,7 +11,4 @@
|
||||||
|
|
||||||
(@q launch)
|
(@q launch)
|
||||||
|
|
||||||
(@shift-I input add)
|
(@r record/begin :note-pos)
|
||||||
(@shift-O output add)
|
|
||||||
|
|
||||||
(@r record/begin :sample)
|
|
||||||
|
|
|
||||||
|
|
@ -1,28 +1,15 @@
|
||||||
use crate::*;
|
use crate::*;
|
||||||
|
|
||||||
expose!([self: Tek] {
|
expose!([self: Tek] {
|
||||||
[bool] => {}
|
[bool] => {}
|
||||||
[u16] => {
|
|
||||||
":h-ins" => self.h_inputs(),
|
|
||||||
":h-outs" => self.h_outputs(),
|
|
||||||
":h-sample" => if self.is_editing() { 0 } else { 5 },
|
|
||||||
":w-samples" => if self.is_editing() { 4 } else { 11 },
|
|
||||||
":w-sidebar" => self.w_sidebar(),
|
|
||||||
":y-ins" => (self.size.h() as u16).saturating_sub(self.h_inputs() + 1),
|
|
||||||
":y-outs" => (self.size.h() as u16).saturating_sub(self.h_outputs() + 1),
|
|
||||||
":y-samples" => if self.is_editing() { 1 } else { 0 },
|
|
||||||
}
|
|
||||||
[usize] => {
|
|
||||||
":scene-last" => self.scenes.len(),
|
|
||||||
":track-last" => self.tracks.len(),
|
|
||||||
}
|
|
||||||
[isize] => {}
|
[isize] => {}
|
||||||
[Option<usize>] => {
|
|
||||||
":scene" => self.selected.scene(),
|
|
||||||
":track" => self.selected.track(),
|
|
||||||
}
|
|
||||||
[Color] => {}
|
[Color] => {}
|
||||||
[Arc<RwLock<MidiClip>>] => {}
|
[Arc<RwLock<MidiClip>>] => {}
|
||||||
|
[u16] => { ":w-sidebar" => self.w_sidebar(), }
|
||||||
|
[usize] => { ":scene-last" => self.scenes.len(),
|
||||||
|
":track-last" => self.tracks.len(), }
|
||||||
|
[Option<usize>] => { ":scene" => self.selected.scene(),
|
||||||
|
":track" => self.selected.track(), }
|
||||||
[Option<Arc<RwLock<MidiClip>>>] => {
|
[Option<Arc<RwLock<MidiClip>>>] => {
|
||||||
":clip" => match self.selected {
|
":clip" => match self.selected {
|
||||||
Selection::Clip(t, s) => self.scenes[s].clips[t].clone(),
|
Selection::Clip(t, s) => self.scenes[s].clips[t].clone(),
|
||||||
|
|
|
||||||
|
|
@ -20,14 +20,12 @@ view!(TuiOut: |self: Tek| {
|
||||||
self.editor.as_ref()
|
self.editor.as_ref()
|
||||||
.map(|e|Bsp::n(Bsp::e(e.clip_status(), e.edit_status()), e))
|
.map(|e|Bsp::n(Bsp::e(e.clip_status(), e.edit_status()), e))
|
||||||
.boxed(),
|
.boxed(),
|
||||||
":sample" =>
|
|
||||||
().boxed(),//self.view_sample(self.is_editing()).boxed(),
|
|
||||||
":sampler" =>
|
|
||||||
().boxed(),//self.view_sampler(self.is_editing(), &self.editor).boxed(),
|
|
||||||
":samples-keys" =>
|
":samples-keys" =>
|
||||||
self.tracks[0].sampler(0).map(|s|s.view_list(false, self.editor.as_ref().unwrap())).boxed(),
|
self.tracks[0].sampler(0).map(|s|s.view_list(false, self.editor.as_ref().unwrap())).boxed(),
|
||||||
":samples-grid" =>
|
":samples-grid" =>
|
||||||
self.tracks[0].sampler(0).map(|s|s.view_grid()).boxed(),
|
self.tracks[0].sampler(0).map(|s|s.view_grid()).boxed(),
|
||||||
|
":sample-viewer" =>
|
||||||
|
self.tracks[0].sampler(0).map(|s|s.view_sample(self.editor.as_ref().unwrap().note_pos())).boxed(),
|
||||||
":status" =>
|
":status" =>
|
||||||
self.view_status().boxed(),
|
self.view_status().boxed(),
|
||||||
":pool" => self.pool.as_ref()
|
":pool" => self.pool.as_ref()
|
||||||
|
|
|
||||||
|
|
@ -1,6 +1,6 @@
|
||||||
(bsp/a :modal
|
(bsp/a :modal
|
||||||
(bsp/s (fixed/y 1 :transport)
|
(bsp/s (fixed/y 1 :transport)
|
||||||
(bsp/n (fixed/y 1 :status)
|
(bsp/n (fixed/y 1 :status)
|
||||||
(fill/xy (bsp/a
|
(fill/xy (bsp/a
|
||||||
(fill/xy (align/e :pool))
|
(fill/xy (align/e :pool))
|
||||||
:arranger)))))
|
:arranger)))))
|
||||||
|
|
|
||||||
|
|
@ -1,7 +1,7 @@
|
||||||
(bsp/a :modal
|
(bsp/a :modal
|
||||||
(bsp/s (fixed/y 1 :transport)
|
(bsp/s (fixed/y 1 :transport)
|
||||||
(bsp/s :sample
|
(bsp/n (fixed/y 1 :status)
|
||||||
(bsp/n (fixed/y 1 :status)
|
(bsp/n (fixed/y 5 :sample-viewer)
|
||||||
(bsp/w (fixed/x :w-sidebar :pool)
|
(bsp/w (fixed/x :w-sidebar :pool)
|
||||||
(bsp/e :samples-keys
|
(bsp/e :samples-keys
|
||||||
(fill/y :editor)))))))
|
(fill/y :editor)))))))
|
||||||
|
|
|
||||||
|
|
@ -1,4 +1,4 @@
|
||||||
(bsp/a :modal
|
(bsp/a :modal
|
||||||
(bsp/s (fixed/y 1 :transport)
|
(bsp/s (fixed/y 1 :transport)
|
||||||
(bsp/n (fixed/y 1 :status)
|
(bsp/n (fixed/y 1 :status)
|
||||||
(fill/xy :samples-grid))))
|
(fill/xy :samples-grid))))
|
||||||
|
|
|
||||||
|
|
@ -1,6 +1,6 @@
|
||||||
(bsp/a :modal
|
(bsp/a :modal
|
||||||
(bsp/s (fixed/y 1 :transport)
|
(bsp/s (fixed/y 1 :transport)
|
||||||
(bsp/n (fixed/y 1 :status)
|
(bsp/n (fixed/y 1 :status)
|
||||||
(fill/xy (bsp/a
|
(fill/xy (bsp/a
|
||||||
(fill/xy (align/e :pool))
|
(fill/xy (align/e :pool))
|
||||||
:editor)))))
|
:editor)))))
|
||||||
|
|
|
||||||
|
|
@ -89,14 +89,14 @@ impl Sampler {
|
||||||
draw_list_item(&self.mapped[note])
|
draw_list_item(&self.mapped[note])
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
pub fn viewer (&self, note_pt: usize) -> impl Content<TuiOut> + use<'_> {
|
pub fn view_sample (&self, note_pt: usize) -> impl Content<TuiOut> + use<'_> {
|
||||||
draw_viewer(if let Some((_, sample)) = &self.recording {
|
Outer(true, Style::default().fg(Tui::g(96))).enclose(draw_viewer(if let Some((_, sample)) = &self.recording {
|
||||||
Some(sample)
|
Some(sample)
|
||||||
} else if let Some(sample) = &self.mapped[note_pt] {
|
} else if let Some(sample) = &self.mapped[note_pt] {
|
||||||
Some(sample)
|
Some(sample)
|
||||||
} else {
|
} else {
|
||||||
None
|
None
|
||||||
})
|
}))
|
||||||
}
|
}
|
||||||
pub fn status (&self, index: usize) -> impl Content<TuiOut> {
|
pub fn status (&self, index: usize) -> impl Content<TuiOut> {
|
||||||
draw_status(self.mapped[index].as_ref())
|
draw_status(self.mapped[index].as_ref())
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue