mirror of
https://codeberg.org/unspeaker/tek.git
synced 2025-12-06 11:46:41 +01:00
trying to get new Bsp to work; update docs
This commit is contained in:
parent
c9b81edb45
commit
62ce1776c0
11 changed files with 301 additions and 157 deletions
|
|
@ -23,10 +23,10 @@ from_jack!(|jack|TransportTui Self {
|
|||
has_clock!(|self: TransportTui|&self.clock);
|
||||
audio!(|self: TransportTui, client, scope|ClockAudio(self).process(client, scope));
|
||||
handle!(<Tui>|self: TransportTui, from|TransportCommand::execute_with_state(self, from));
|
||||
render!(Tui: (self: TransportTui) => Fixed::y(3, row!(
|
||||
" ", Fixed::x(5, PlayPause(false)),
|
||||
" ", Shrink::x(1, TransportView::new(self, Some(self.color), true)),
|
||||
)));
|
||||
render!(Tui: (self: TransportTui) => Align::x(Fixed::y(3, row!(
|
||||
Fixed::x(5, Fixed::y(3, PlayPause(false))),
|
||||
TransportView::new(self, Some(self.color), true),
|
||||
))));
|
||||
impl std::fmt::Debug for TransportTui {
|
||||
fn fmt (&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
|
||||
f.debug_struct("TransportTui")
|
||||
|
|
@ -89,35 +89,25 @@ impl TransportView {
|
|||
}
|
||||
render!(Tui: (self: TransportView) => {
|
||||
let color = self.color;
|
||||
let transport_field = move|label, value|row!(
|
||||
Tui::fg_bg(color.lightest.rgb, color.base.rgb, Tui::bold(true, label)),
|
||||
Tui::fg_bg(color.base.rgb, color.darkest.rgb, "▌"),
|
||||
Tui::fg_bg(color.lightest.rgb, color.darkest.rgb, format!("{:>10}", value)),
|
||||
Tui::fg_bg(color.darkest.rgb, color.base.rgb, "▌"),
|
||||
);
|
||||
Fixed::y(3, Tui::bg(color.base.rgb, Fill::x(row!(
|
||||
Thunk::new(move||col!(
|
||||
//let transport_field = move|label, value|row!(
|
||||
//Tui::fg_bg(color.lightest.rgb, color.base.rgb, Tui::bold(true, label)),
|
||||
//Tui::fg_bg(color.base.rgb, color.darkest.rgb, "▌"),
|
||||
//Tui::fg_bg(color.lightest.rgb, color.darkest.rgb, format!("{:>10}", value)),
|
||||
//Tui::fg_bg(color.darkest.rgb, color.base.rgb, "▌"),
|
||||
//);
|
||||
Min::x(35, Fixed::y(3, Tui::bg(color.base.rgb, "kyp")))/*Bsp::e(
|
||||
Fixed::x(17, col!(
|
||||
transport_field(" Beat", self.beat.clone()),
|
||||
transport_field(" Time", format!("{:.1}s", self.current_second)),
|
||||
transport_field(" BPM", self.bpm.clone()),
|
||||
)),
|
||||
Thunk::new(move||col!(
|
||||
Fixed::x(17, col!(
|
||||
transport_field(" Rate", format!("{}", self.sr)),
|
||||
transport_field(" Chunk", format!("{}", self.chunk)),
|
||||
transport_field(" Lag", format!("{:.3}ms", self.latency)),
|
||||
)),
|
||||
col!(
|
||||
//Field(" CPU%", format!("{:.1}ms", self.perf).as_str(), &color),
|
||||
),
|
||||
))))
|
||||
)))*/
|
||||
});
|
||||
struct TransportField(&'static str, String, ItemPalette);
|
||||
render!(Tui: (self: TransportField) => row!(
|
||||
Tui::fg_bg(self.2.lightest.rgb, self.2.base.rgb, Tui::bold(true, self.0)),
|
||||
Tui::fg_bg(self.2.base.rgb, self.2.darkest.rgb, "▌"),
|
||||
Tui::fg_bg(self.2.lightest.rgb, self.2.darkest.rgb, format!("{:>10}", self.1)),
|
||||
Tui::fg_bg(self.2.darkest.rgb, self.2.base.rgb, "▌"),
|
||||
));
|
||||
pub struct PlayPause(pub bool);
|
||||
render!(Tui: (self: PlayPause) => Tui::bg(
|
||||
if self.0{Color::Rgb(0,128,0)}else{Color::Rgb(128,64,0)},
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue