mirror of
https://codeberg.org/unspeaker/tek.git
synced 2026-07-17 07:46:57 +02:00
79e...
This commit is contained in:
parent
80fe958476
commit
b130471f12
1 changed files with 13 additions and 26 deletions
39
src/tek.rs
39
src/tek.rs
|
|
@ -382,12 +382,7 @@ pub fn view_logo () -> impl Draw<Tui> {
|
|||
/// let _ = tek::view_transport(true, x.clone(), x.clone(), x.clone());
|
||||
/// let _ = tek::view_transport(false, x.clone(), x.clone(), x.clone());
|
||||
/// ```
|
||||
pub fn view_transport (
|
||||
play: bool,
|
||||
bpm: &Arc<RwLock<String>>,
|
||||
beat: &Arc<RwLock<String>>,
|
||||
time: &Arc<RwLock<String>>,
|
||||
) -> impl Draw<Tui> {
|
||||
pub fn view_transport (play: bool, bpm: &str, beat: &str, time: &str) -> impl Draw<Tui> {
|
||||
let theme = ItemTheme::G[96];
|
||||
bg(Black, east!(above(
|
||||
wh_full(origin_w(button_play_pause(play))),
|
||||
|
|
@ -404,7 +399,7 @@ pub fn view_transport (
|
|||
/// let _ = tek::view_status(None, x.clone(), x.clone(), x.clone());
|
||||
/// let _ = tek::view_status(Some("".into()), x.clone(), x.clone(), x.clone());
|
||||
/// ```
|
||||
pub fn view_status (sel: Option<Arc<str>>, sr: &str, buf: &str, lat: &str) -> impl Draw<Tui> {
|
||||
pub fn view_status (sel: Option<&str>, sr: &str, buf: &str, lat: &str) -> impl Draw<Tui> {
|
||||
let theme = ItemTheme::G[96];
|
||||
let sr = field_h(theme, "SR", sr);
|
||||
let buf = field_h(theme, "Buf", buf);
|
||||
|
|
@ -520,7 +515,7 @@ pub fn draw_info_v (sample: Option<&Arc<RwLock<Sample>>>) -> impl Draw<Tui> + us
|
|||
bold(true, "× No sample."),
|
||||
"[r] record",
|
||||
"[Shift-F9] import",
|
||||
)));
|
||||
)).draw(to));
|
||||
|
||||
either(sample.is_some(), a, b)
|
||||
}
|
||||
|
|
@ -554,30 +549,22 @@ pub fn io_ports <'a, T: PortsSizes<'a>> (
|
|||
) -> impl Draw<Tui> + 'a {
|
||||
iter(items, move|(
|
||||
_index, name, connections, y, y2
|
||||
): (usize, &'a Arc<str>, &'a [Connect], usize, usize), _|
|
||||
iter_south(
|
||||
y as u16,
|
||||
(y2-y) as u16,
|
||||
south(
|
||||
h_full(bold(true, fg_bg(fg, bg, origin_w(east(" ", name))))),
|
||||
iter(
|
||||
||connections.iter(),
|
||||
move|connect: &'a Connect, index|iter_south(
|
||||
index as u16,
|
||||
1,
|
||||
h_full(origin_w(bold(false, fg_bg(fg, bg, &connect.info))))
|
||||
)
|
||||
)
|
||||
)
|
||||
)
|
||||
)
|
||||
): (usize, &'a Arc<str>, &'a [Connect], usize, usize), _| {
|
||||
let conns = ||connections.iter();
|
||||
let conn = move|connect: &'a Connect, index|iter_south_fixed(
|
||||
index as u16, 1, h_full(origin_w(bold(false, fg_bg(fg, bg, &connect.info))))
|
||||
);
|
||||
iter_south(y as u16, (y2-y) as u16,
|
||||
south(h_full(bold(true, fg_bg(fg, bg, origin_w(east(" ", name))))),
|
||||
iter(conns, conn)))
|
||||
})
|
||||
}
|
||||
|
||||
/// CLI banner.
|
||||
pub(crate) const HEADER: &'static str = r#"
|
||||
|
||||
~ █▀█▀█ █▀▀█ █ █ ~~~ ~ ~ ~~ ~ ~ ~ ~~ ~ ~ ~ ~
|
||||
█ term█▀ █▀▀▄ ~ v0.4.0, 2026 winter (or is it) ~
|
||||
█ █▀ █▀▀▄ ~ v0.4.0, 2026 winter (or is it) ~
|
||||
~ ▀ █▀▀█ ▀ ▀ ~ ~~~ ~ ~ ~ ~ ~~~ ~~~ ~ ~~ "#;
|
||||
|
||||
/// Total state
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue