mirror of
https://codeberg.org/unspeaker/tek.git
synced 2025-12-06 11:46:41 +01:00
This commit is contained in:
parent
7495dd10f2
commit
4ba88bfd6d
5 changed files with 78 additions and 63 deletions
|
|
@ -12,14 +12,17 @@
|
|||
(layer "./keys_global.edn"))
|
||||
|
||||
(view (bsp/a :view-dialog (bsp/w :view-meters-output (bsp/e :view-meters-input
|
||||
(bsp/e
|
||||
(fill/y (align/n
|
||||
(bsp/s :view-status-v
|
||||
(bsp/s :view-editor-status :view-pool))))
|
||||
(bsp/w
|
||||
(fill/y (align/n
|
||||
(bsp/s :view-midi-ins-status
|
||||
(bsp/s :view-midi-outs-status
|
||||
(bsp/s :view-audio-ins-status :view-audio-outs-status)))))
|
||||
(bsp/n
|
||||
(fixed/y :h-sample-detail
|
||||
(bsp/e (fill/y (fixed/x 20 (align/nw :view-sample-status)))
|
||||
:view-sample-viewer))
|
||||
(bsp/e
|
||||
(fill/y (align/n
|
||||
(bsp/s :view-status-v
|
||||
(bsp/s :view-midi-ports-status :view-audio-ports-status))))
|
||||
(bsp/w
|
||||
(bsp/s :view-editor-status :view-pool)
|
||||
(bsp/e :view-samples-keys :view-editor))))))))
|
||||
|
|
|
|||
|
|
@ -190,7 +190,7 @@ impl App {
|
|||
self.project.w_sidebar(self.editor.is_some())
|
||||
}
|
||||
fn h_sample_detail (&self) -> u16 {
|
||||
4.max(self.height() as u16 * 3 / 9)
|
||||
6.max(self.height() as u16 * 3 / 9)
|
||||
}
|
||||
fn focus_editor (&self) -> bool {
|
||||
self.is_editing()
|
||||
|
|
|
|||
|
|
@ -19,7 +19,8 @@ impl App {
|
|||
let cache = self.view_cache.read().unwrap();
|
||||
let theme = self.color;
|
||||
let playing = self.clock().is_rolling();
|
||||
Tui::bg(theme.darkest.rgb, Fixed::xy(20, 6, col!(
|
||||
Tui::bg(theme.darkest.rgb, Fixed::xy(20, 6, Outer(true, Style::default().fg(Tui::g(96))).enclose(
|
||||
col!(
|
||||
Fill::x(Align::w(Bsp::e(
|
||||
Align::w(Tui::bg(if playing { Rgb(0, 128, 0) } else { Rgb(128, 64, 0) },
|
||||
Either::new(false, // TODO
|
||||
|
|
@ -42,7 +43,7 @@ impl App {
|
|||
Fill::x(Align::w(FieldH(theme, "SR ", cache.sr.view.clone()))),
|
||||
Fill::x(Align::w(FieldH(theme, "Buf", cache.buf.view.clone()))),
|
||||
Fill::x(Align::w(FieldH(theme, "Lat", cache.lat.view.clone()))),
|
||||
)))
|
||||
))))
|
||||
}
|
||||
pub fn view_status (&self) -> impl Content<TuiOut> + use<'_> {
|
||||
self.update_clock();
|
||||
|
|
@ -62,32 +63,43 @@ impl App {
|
|||
pub fn view_editor_status (&self) -> impl Content<TuiOut> + use<'_> {
|
||||
self.editor().map(|e|Bsp::s(e.clip_status(), e.edit_status()))
|
||||
}
|
||||
pub fn view_midi_ports_status (&self) -> impl Content<TuiOut> + use<'_> {
|
||||
self.project.get_track().map(|track|Bsp::s(
|
||||
Fixed::xy(20, 1 + track.sequencer.midi_ins.len() as u16, FieldV(self.color,
|
||||
format!("MIDI ins: "),
|
||||
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())))))),
|
||||
Fixed::xy(20, 1 + track.sequencer.midi_outs.len() as u16, FieldV(
|
||||
self.color,
|
||||
format!("MIDI outs: "),
|
||||
Map::south(1, ||track.sequencer.midi_outs.iter(),
|
||||
|port, index|Fill::x(Align::w(format!(" {index} {}", port.name()))))))
|
||||
))
|
||||
|port, index|Fill::x(Align::w(format!(" {index} {}", port.name()))))))))
|
||||
})
|
||||
}
|
||||
pub fn view_audio_ports_status (&self) -> impl Content<TuiOut> + use<'_> {
|
||||
self.project.get_track().map(|track|Bsp::s(
|
||||
track.devices.get(0).map(|device|
|
||||
Fixed::xy(20, 1 + device.audio_ins().len() as u16, FieldV(self.color,
|
||||
format!("Audio ins: "),
|
||||
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()))))))))
|
||||
})
|
||||
}
|
||||
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()))))))),
|
||||
track.devices.last().map(|device|
|
||||
Fixed::xy(20, 1 + device.audio_outs().len() as u16, FieldV(self.color,
|
||||
format!("Audio outs:"),
|
||||
|port, index|Fill::x(Align::w(format!(" {index} {}", port.name()))))))))})
|
||||
}
|
||||
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()))))))),
|
||||
))
|
||||
|port, index|Fill::x(Align::w(format!(" {index} {}", port.name()))))))))})
|
||||
}
|
||||
pub fn view_arranger (&self) -> impl Content<TuiOut> + use<'_> {
|
||||
ArrangerView::new(&self.project, self.editor.as_ref())
|
||||
|
|
@ -218,8 +230,8 @@ impl App {
|
|||
pub fn view_pool (&self) -> impl Content<TuiOut> + use<'_> {
|
||||
Fixed::x(20, Bsp::s(
|
||||
Fill::x(Align::w(FieldH(self.color, "Clip pool:", ""))),
|
||||
Fill::y(Align::n(Tui::bg(Rgb(0, 0, 0), PoolView(&self.project.pool)))),
|
||||
))
|
||||
Fill::y(Align::n(Tui::bg(Rgb(0, 0, 0), Outer(true, Style::default().fg(Tui::g(96)))
|
||||
.enclose(PoolView(&self.project.pool)))))))
|
||||
}
|
||||
pub fn view_samples_keys (&self) -> impl Content<TuiOut> + use<'_> {
|
||||
self.project.sampler().map(|s|s.view_list(true, self.editor().unwrap()))
|
||||
|
|
|
|||
|
|
@ -119,13 +119,13 @@ impl Sampler {
|
|||
}
|
||||
|
||||
pub fn view_sample_status (&self, note_pt: usize) -> impl Content<TuiOut> + use<'_> {
|
||||
Fixed::x(20, draw_info_v(if let Some((_, sample)) = &self.recording {
|
||||
Fixed::x(20, Outer(true, Style::default().fg(Tui::g(96))).enclose(draw_info_v(if let Some((_, sample)) = &self.recording {
|
||||
Some(sample)
|
||||
} else if let Some(sample) = &self.mapped[note_pt] {
|
||||
Some(sample)
|
||||
} else {
|
||||
None
|
||||
}))
|
||||
})))
|
||||
}
|
||||
|
||||
pub fn view_status (&self, index: usize) -> impl Content<TuiOut> {
|
||||
|
|
|
|||
0
target/.gitkeep
Normal file
0
target/.gitkeep
Normal file
Loading…
Add table
Add a link
Reference in a new issue