mirror of
https://codeberg.org/unspeaker/tek.git
synced 2025-12-09 05:06:43 +01:00
down to 48 ugly ones
This commit is contained in:
parent
57eff50973
commit
4fe51b5267
9 changed files with 104 additions and 101 deletions
|
|
@ -17,41 +17,43 @@ impl App {
|
|||
pub fn view_status (&self) -> impl Content<TuiOut> + use<'_> {
|
||||
self.update_clock();
|
||||
let cache = self.view_cache.read().unwrap();
|
||||
view_status(self.selected.describe(self.tracks(), self.scenes()),
|
||||
view_status(self.project.selected.map(|x|x.describe(self.tracks(), self.scenes())),
|
||||
cache.sr.view.clone(), cache.buf.view.clone(), cache.lat.view.clone())
|
||||
}
|
||||
pub fn view_transport (&self) -> impl Content<TuiOut> + use<'_> {
|
||||
self.update_clock();
|
||||
let cache = self.view_cache.read().unwrap();
|
||||
view_transport(self.clock.is_rolling(),
|
||||
view_transport(self.project.clock.is_rolling(),
|
||||
cache.bpm.view.clone(), cache.beat.view.clone(), cache.time.view.clone())
|
||||
}
|
||||
pub fn view_arranger (&self) -> impl Content<TuiOut> + use<'_> {
|
||||
ArrangerView::new(self, self.editor.as_ref())
|
||||
}
|
||||
pub fn view_pool (&self) -> impl Content<TuiOut> + use<'_> {
|
||||
self.pool().map(|p|Fixed::x(self.w_sidebar(), PoolView(self.is_editing(), p)))
|
||||
}
|
||||
pub fn view_editor (&self) -> impl Content<TuiOut> + use<'_> {
|
||||
self.editor().map(|e|Bsp::n(Bsp::e(e.clip_status(), e.edit_status()), e))
|
||||
}
|
||||
pub fn view_arranger (&self) -> impl Content<TuiOut> + use<'_> {
|
||||
ArrangerView::new(&self.project, self.editor.as_ref())
|
||||
}
|
||||
pub fn view_pool (&self) -> impl Content<TuiOut> + use<'_> {
|
||||
let is_editing = self.is_editing();
|
||||
Fixed::x(self.project.w_sidebar(is_editing),
|
||||
PoolView(is_editing, &self.project.pool))
|
||||
}
|
||||
pub fn view_samples_keys (&self) -> impl Content<TuiOut> + use<'_> {
|
||||
self.sampler().map(|s|s.view_list(false, self.editor().unwrap()))
|
||||
self.project.sampler().map(|s|s.view_list(false, self.editor().unwrap()))
|
||||
}
|
||||
pub fn view_samples_grid (&self) -> impl Content<TuiOut> + use<'_> {
|
||||
self.sampler().map(|s|s.view_grid())
|
||||
self.project.sampler().map(|s|s.view_grid())
|
||||
}
|
||||
pub fn view_sample_viewer (&self) -> impl Content<TuiOut> + use<'_> {
|
||||
self.sampler().map(|s|s.view_sample(self.editor().unwrap().get_note_pos()))
|
||||
self.project.sampler().map(|s|s.view_sample(self.editor().unwrap().get_note_pos()))
|
||||
}
|
||||
pub fn view_sample_info (&self) -> impl Content<TuiOut> + use<'_> {
|
||||
self.sampler().map(|s|s.view_sample_info(self.editor().unwrap().get_note_pos()))
|
||||
self.project.sampler().map(|s|s.view_sample_info(self.editor().unwrap().get_note_pos()))
|
||||
}
|
||||
pub fn view_meters_input (&self) -> impl Content<TuiOut> + use<'_> {
|
||||
self.sampler().map(|s|s.view_meters_input())
|
||||
self.project.sampler().map(|s|s.view_meters_input())
|
||||
}
|
||||
pub fn view_meters_output (&self) -> impl Content<TuiOut> + use<'_> {
|
||||
self.sampler().map(|s|s.view_meters_output())
|
||||
self.project.sampler().map(|s|s.view_meters_output())
|
||||
}
|
||||
pub fn view_dialog (&self) -> impl Content<TuiOut> + use<'_> {
|
||||
When(self.dialog.is_some(), Bsp::b( "",
|
||||
|
|
@ -76,6 +78,9 @@ impl App {
|
|||
)))
|
||||
))
|
||||
}
|
||||
}
|
||||
|
||||
impl App {
|
||||
pub fn view_dialog_menu (&self) -> impl Content<TuiOut> {
|
||||
let options = ||["Projects", "Settings", "Help", "Quit"].iter();
|
||||
let option = |a,i|Tui::fg(Rgb(255,255,255), format!("{}", a));
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue