mirror of
https://codeberg.org/unspeaker/tek.git
synced 2025-12-06 11:46:41 +01:00
groovebox: looks surprisingly well
This commit is contained in:
parent
c66a006120
commit
03024f8a14
11 changed files with 130 additions and 91 deletions
|
|
@ -244,22 +244,22 @@ impl App {
|
|||
Some(Dialog::Menu(0))
|
||||
}
|
||||
fn dialog_save (&self) -> Option<Dialog> {
|
||||
Some(Dialog::Browser(BrowserTarget::SaveProject, Default::default()))
|
||||
Some(Dialog::Browser(BrowserTarget::SaveProject, Browser::new(None).unwrap()))
|
||||
}
|
||||
fn dialog_load (&self) -> Option<Dialog> {
|
||||
Some(Dialog::Browser(BrowserTarget::LoadProject, Default::default()))
|
||||
Some(Dialog::Browser(BrowserTarget::LoadProject, Browser::new(None).unwrap()))
|
||||
}
|
||||
fn dialog_import_clip (&self) -> Option<Dialog> {
|
||||
Some(Dialog::Browser(BrowserTarget::ImportClip(Default::default()), Default::default()))
|
||||
Some(Dialog::Browser(BrowserTarget::ImportClip(Default::default()), Browser::new(None).unwrap()))
|
||||
}
|
||||
fn dialog_export_clip (&self) -> Option<Dialog> {
|
||||
Some(Dialog::Browser(BrowserTarget::ExportClip(Default::default()), Default::default()))
|
||||
Some(Dialog::Browser(BrowserTarget::ExportClip(Default::default()), Browser::new(None).unwrap()))
|
||||
}
|
||||
fn dialog_import_sample (&self) -> Option<Dialog> {
|
||||
Some(Dialog::Browser(BrowserTarget::ImportSample(Default::default()), Default::default()))
|
||||
Some(Dialog::Browser(BrowserTarget::ImportSample(Default::default()), Browser::new(None).unwrap()))
|
||||
}
|
||||
fn dialog_export_sample (&self) -> Option<Dialog> {
|
||||
Some(Dialog::Browser(BrowserTarget::ExportSample(Default::default()), Default::default()))
|
||||
Some(Dialog::Browser(BrowserTarget::ExportSample(Default::default()), Browser::new(None).unwrap()))
|
||||
}
|
||||
fn dialog_options (&self) -> Option<Dialog> {
|
||||
Some(Dialog::Options)
|
||||
|
|
|
|||
|
|
@ -19,7 +19,7 @@ impl App {
|
|||
let cache = self.view_cache.read().unwrap();
|
||||
let theme = self.color;
|
||||
let playing = self.clock().is_rolling();
|
||||
Fixed::xy(20, 7, col!(
|
||||
Fixed::xy(20, 6, 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
|
||||
|
|
@ -60,22 +60,33 @@ impl App {
|
|||
self.editor()
|
||||
}
|
||||
pub fn view_editor_status (&self) -> impl Content<TuiOut> + use<'_> {
|
||||
Fixed::y(5, self.editor().map(|e|Bsp::s(e.clip_status(), e.edit_status())))
|
||||
self.editor().map(|e|Bsp::s(e.clip_status(), e.edit_status()))
|
||||
}
|
||||
pub fn view_ports_status (&self) -> impl Content<TuiOut> + use<'_> {
|
||||
pub fn view_midi_ports_status (&self) -> impl Content<TuiOut> + use<'_> {
|
||||
self.project.get_track().map(|track|Bsp::s(
|
||||
Fixed::y(2.max(track.sequencer.midi_ins.len() as u16), Align::n(Map::south(1,
|
||||
||track.sequencer.midi_ins.iter(),
|
||||
|port, index|Fixed::x(20, FieldV(
|
||||
self.color,
|
||||
format!("MIDI in {index}: "),
|
||||
format!("{}", port.name())))))),
|
||||
Fixed::y(2.max(track.sequencer.midi_outs.len() as u16), Align::n(Map::south(1,
|
||||
||track.sequencer.midi_outs.iter(),
|
||||
|port, index|Fixed::x(20, FieldV(
|
||||
self.color,
|
||||
format!("MIDI out {index}:"),
|
||||
format!("{}", port.name()))))))
|
||||
Fixed::xy(20, 1 + track.sequencer.midi_ins.len() as u16, 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()))))))
|
||||
))
|
||||
}
|
||||
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: "),
|
||||
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:"),
|
||||
Map::south(1, ||device.audio_outs().iter(),
|
||||
|port, index|Fill::x(Align::w(format!(" {index} {}", port.name()))))))),
|
||||
))
|
||||
}
|
||||
pub fn view_arranger (&self) -> impl Content<TuiOut> + use<'_> {
|
||||
|
|
@ -83,8 +94,8 @@ impl App {
|
|||
}
|
||||
pub fn view_pool (&self) -> impl Content<TuiOut> + use<'_> {
|
||||
Fixed::x(20, Bsp::s(
|
||||
Fill::x(Align::w(Bsp::s("", FieldH(self.color, "Pool", "")))),
|
||||
Fill::y(Align::n(Tui::bg(Black, PoolView(&self.project.pool)))),
|
||||
Fill::x(Align::w(FieldH(self.color, "MIDI clip pool:", ""))),
|
||||
Fill::y(Align::n(Tui::bg(Rgb(0, 0, 0), PoolView(&self.project.pool)))),
|
||||
))
|
||||
}
|
||||
pub fn view_samples_keys (&self) -> impl Content<TuiOut> + use<'_> {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue