mirror of
https://codeberg.org/unspeaker/tek.git
synced 2025-12-06 11:46:41 +01:00
groovebox: reenable sample list
This commit is contained in:
parent
7af98b7008
commit
d88f4e33eb
6 changed files with 94 additions and 78 deletions
|
|
@ -1,29 +1,5 @@
|
|||
use crate::*;
|
||||
|
||||
view!(TuiOut: |self: Tek| self.size.of(View(self, self.view)); {
|
||||
":nil" =>
|
||||
Box::new("nil"),
|
||||
":transport" =>
|
||||
self.view_transport().boxed(),
|
||||
":arranger" =>
|
||||
ArrangerView::new(self).boxed(),
|
||||
":editor" =>
|
||||
self.editor.as_ref()
|
||||
.map(|e|Bsp::s(Bsp::e(e.clip_status(), e.edit_status()), e))
|
||||
.boxed(),
|
||||
":sample" =>
|
||||
().boxed(),//self.view_sample(self.is_editing()).boxed(),
|
||||
":sampler" =>
|
||||
().boxed(),//self.view_sampler(self.is_editing(), &self.editor).boxed(),
|
||||
":samples-grid" =>
|
||||
self.tracks[0].sampler(0).map(|s|s.view_grid()).boxed(),
|
||||
":status" =>
|
||||
self.view_status().boxed(),
|
||||
":pool" => self.pool.as_ref()
|
||||
.map(|pool|Fixed::x(self.w_sidebar(), PoolView(self.is_editing(), pool)))
|
||||
.boxed(),
|
||||
});
|
||||
|
||||
expose!([self: Tek] {
|
||||
[bool] => {}
|
||||
[u16] => {
|
||||
|
|
|
|||
|
|
@ -266,10 +266,18 @@ pub trait HasSelection {
|
|||
|
||||
/// Focus identification methods
|
||||
impl Selection {
|
||||
fn is_mix (&self) -> bool { matches!(self, Self::Mix) }
|
||||
fn is_track (&self) -> bool { matches!(self, Self::Track(_)) }
|
||||
fn is_scene (&self) -> bool { matches!(self, Self::Scene(_)) }
|
||||
fn is_clip (&self) -> bool { matches!(self, Self::Clip(_, _)) }
|
||||
pub fn is_mix (&self) -> bool {
|
||||
matches!(self, Self::Mix)
|
||||
}
|
||||
pub fn is_track (&self) -> bool {
|
||||
matches!(self, Self::Track(_))
|
||||
}
|
||||
pub fn is_scene (&self) -> bool {
|
||||
matches!(self, Self::Scene(_))
|
||||
}
|
||||
pub fn is_clip (&self) -> bool {
|
||||
matches!(self, Self::Clip(_, _))
|
||||
}
|
||||
pub fn track (&self) -> Option<usize> {
|
||||
use Selection::*;
|
||||
match self { Clip(t, _) => Some(*t), Track(t) => Some(*t), _ => None }
|
||||
|
|
|
|||
|
|
@ -2,6 +2,32 @@ use crate::*;
|
|||
pub(crate) use std::fmt::Write;
|
||||
pub(crate) use ::tengri::tui::ratatui::prelude::Position;
|
||||
|
||||
view!(TuiOut: |self: Tek| self.size.of(View(self, self.view)); {
|
||||
":nil" =>
|
||||
Box::new("nil"),
|
||||
":transport" =>
|
||||
self.view_transport().boxed(),
|
||||
":arranger" =>
|
||||
ArrangerView::new(self).boxed(),
|
||||
":editor" =>
|
||||
self.editor.as_ref()
|
||||
.map(|e|Bsp::s(Bsp::e(e.clip_status(), e.edit_status()), e))
|
||||
.boxed(),
|
||||
":sample" =>
|
||||
().boxed(),//self.view_sample(self.is_editing()).boxed(),
|
||||
":sampler" =>
|
||||
().boxed(),//self.view_sampler(self.is_editing(), &self.editor).boxed(),
|
||||
":samples-keys" =>
|
||||
self.tracks[0].sampler(0).map(|s|s.view_list(false, self.editor.as_ref().unwrap())).boxed(),
|
||||
":samples-grid" =>
|
||||
self.tracks[0].sampler(0).map(|s|s.view_grid()).boxed(),
|
||||
":status" =>
|
||||
self.view_status().boxed(),
|
||||
":pool" => self.pool.as_ref()
|
||||
.map(|pool|Fixed::x(self.w_sidebar(), PoolView(self.is_editing(), pool)))
|
||||
.boxed(),
|
||||
});
|
||||
|
||||
pub(crate) struct ArrangerView<'a> {
|
||||
app: &'a Tek,
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue