mirror of
https://codeberg.org/unspeaker/tek.git
synced 2025-12-06 11:46:41 +01:00
fine detour!
This commit is contained in:
parent
4f6cb7cb8e
commit
0733742685
8 changed files with 68 additions and 58 deletions
|
|
@ -18,7 +18,8 @@
|
|||
#![feature(closure_lifetime_binder)]
|
||||
pub use ::tek_engine:: *;
|
||||
pub use ::tek_device::{self, *};
|
||||
pub use ::tengri::{Usually, Perhaps, Has};
|
||||
pub use ::tengri::{Usually, Perhaps, Has, MaybeHas};
|
||||
pub use ::tengri::{has, maybe_has};
|
||||
pub use ::tengri::dsl::*;
|
||||
pub use ::tengri::input::*;
|
||||
pub use ::tengri::output::*;
|
||||
|
|
|
|||
|
|
@ -36,6 +36,12 @@ has!(Vec<JackMidiOut>: |self: App|self.project.midi_outs);
|
|||
has!(Vec<Scene>: |self: App|self.project.scenes);
|
||||
has!(Vec<Track>: |self: App|self.project.tracks);
|
||||
has!(Measure<TuiOut>: |self: App|self.size);
|
||||
maybe_has!(Track: |self: App|
|
||||
{ MaybeHas::<Track>::get(&self.project) };
|
||||
{ MaybeHas::<Track>::get_mut(&mut self.project) });
|
||||
maybe_has!(Scene: |self: App|
|
||||
{ MaybeHas::<Scene>::get(&self.project) };
|
||||
{ MaybeHas::<Scene>::get_mut(&mut self.project) });
|
||||
|
||||
has_clips!(|self: App|self.project.pool.clips);
|
||||
has_editor!(|self: App|{
|
||||
|
|
|
|||
|
|
@ -61,45 +61,20 @@ impl App {
|
|||
self.editor()
|
||||
}
|
||||
pub fn view_editor_status (&self) -> impl Content<TuiOut> + use<'_> {
|
||||
self.editor().map(|e|Bsp::s(e.clip_status(), e.edit_status()))
|
||||
self.editor().map(|e|Fixed::x(20, Outer(true, Style::default().fg(Tui::g(96))).enclose(
|
||||
Fill::y(Align::n(Bsp::s(e.clip_status(), e.edit_status()))))))
|
||||
}
|
||||
pub fn view_midi_ins_status (&self) -> impl Content<TuiOut> + use<'_> {
|
||||
self.project.get_track().map(|track|{
|
||||
let ins = track.sequencer.midi_ins.len() as u16;
|
||||
Fixed::xy(20, 1 + ins, Outer(true, Style::default().fg(Tui::g(96))).enclose(
|
||||
Fixed::xy(20, 1 + ins, FieldV(self.color, format!("MIDI ins: "),
|
||||
Map::south(1, ||track.sequencer.midi_ins.iter(),
|
||||
|port, index|Fill::x(Align::w(format!(" {index} {}", port.name()))))))))
|
||||
})
|
||||
self.project.view_midi_ins_status(self.color)
|
||||
}
|
||||
pub fn view_midi_outs_status (&self) -> impl Content<TuiOut> + use<'_> {
|
||||
self.project.get_track().map(|track|{
|
||||
let outs = track.sequencer.midi_outs.len() as u16;
|
||||
Fixed::xy(20, 1 + outs, Outer(true, Style::default().fg(Tui::g(96))).enclose(
|
||||
Fixed::xy(20, 1 + outs, FieldV(self.color, format!("MIDI outs: "),
|
||||
Map::south(1, ||track.sequencer.midi_outs.iter(),
|
||||
|port, index|Fill::x(Align::w(format!(" {index} {}", port.name()))))))))
|
||||
})
|
||||
self.project.view_midi_outs_status(self.color)
|
||||
}
|
||||
pub fn view_audio_ins_status (&self) -> impl Content<TuiOut> + use<'_> {
|
||||
self.project.get_track()
|
||||
.and_then(|track|track.devices.get(0))
|
||||
.map(|device|{
|
||||
let ins = device.audio_ins().len() as u16;
|
||||
Fixed::xy(20, 1 + ins, Outer(true, Style::default().fg(Tui::g(96))).enclose(
|
||||
Fixed::xy(20, 1 + ins, FieldV(self.color, format!("Audio ins: "),
|
||||
Map::south(1, ||device.audio_ins().iter(),
|
||||
|port, index|Fill::x(Align::w(format!(" {index} {}", port.name()))))))))})
|
||||
self.project.view_audio_ins_status(self.color)
|
||||
}
|
||||
pub fn view_audio_outs_status (&self) -> impl Content<TuiOut> + use<'_> {
|
||||
self.project.get_track()
|
||||
.and_then(|track|track.devices.last())
|
||||
.map(|device|{
|
||||
let outs = device.audio_outs().len() as u16;
|
||||
Fixed::xy(20, 1 + outs, Outer(true, Style::default().fg(Tui::g(96))).enclose(
|
||||
Fixed::xy(20, 1 + outs, FieldV(self.color, format!("Audio outs: "),
|
||||
Map::south(1, ||device.audio_outs().iter(),
|
||||
|port, index|Fill::x(Align::w(format!(" {index} {}", port.name()))))))))})
|
||||
self.project.view_audio_outs_status(self.color)
|
||||
}
|
||||
pub fn view_arranger (&self) -> impl Content<TuiOut> + use<'_> {
|
||||
ArrangerView::new(&self.project, self.editor.as_ref())
|
||||
|
|
@ -255,7 +230,8 @@ impl App {
|
|||
self.project.sampler().map(|s|s.view_sample_info(self.editor().unwrap().get_note_pos()))
|
||||
}
|
||||
pub fn view_sample_status (&self) -> impl Content<TuiOut> + use<'_> {
|
||||
self.project.sampler().map(|s|s.view_sample_status(self.editor().unwrap().get_note_pos()))
|
||||
self.project.sampler().map(|s|Outer(true, Style::default().fg(Tui::g(96))).enclose(
|
||||
Fill::y(Align::n(s.view_sample_status(self.editor().unwrap().get_note_pos())))))
|
||||
}
|
||||
pub fn view_meters_input (&self) -> impl Content<TuiOut> + use<'_> {
|
||||
self.project.sampler().map(|s|s.view_meters_input())
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue