fix some more errors 🐢
Some checks are pending
/ build (push) Waiting to run

🐌
This commit is contained in:
🪞👃🪞 2025-12-14 01:34:36 +02:00
parent 97c563a5ad
commit d930025422
4 changed files with 28 additions and 25 deletions

View file

@ -2,7 +2,7 @@ export RUSTFLAGS := "--cfg procmacro2_semver_exempt -Zmacro-backtrace -Clink-arg
export RUST_BACKTRACE := "1" export RUST_BACKTRACE := "1"
default: default:
just -l @just -l
cloc: cloc:
for src in {cli,edn/src,input/src,jack/src,midi/src,output/src,plugin/src,sampler/src,tek/src,time/src,tui/src}; do echo; echo $src; cloc --quiet $src; done for src in {cli,edn/src,input/src,jack/src,midi/src,output/src,plugin/src,sampler/src,tek/src,time/src,tui/src}; do echo; echo $src; cloc --quiet $src; done

View file

@ -1,7 +1,8 @@
pub(crate) use ::{ pub(crate) use ::{
tek_device::*, tek_device::{*, tek_engine::*},
tengri::{ tengri::{
Usually, Perhaps, Has, MaybeHas, has, maybe_has, impl_debug, from, Usually, Perhaps, Has, MaybeHas, has, maybe_has, impl_debug, from,
wrap_inc, wrap_dec,
dsl::*, dsl::*,
input::*, input::*,
output::*, output::*,

View file

@ -51,7 +51,7 @@ impl View<TuiOut, ()> for App {
let selected = selected; let selected = selected;
Some(Fill::XY(Thunk::new(move|to: &mut TuiOut|{ Some(Fill::XY(Thunk::new(move|to: &mut TuiOut|{
for (index, MenuItem(item, _)) in items.0.iter().enumerate() { for (index, MenuItem(item, _)) in items.0.iter().enumerate() {
to.place(&Push::y((2 * index) as u16, to.place(&Push::Y((2 * index) as u16,
Tui::fg_bg( Tui::fg_bg(
if *selected == index { Rgb(240,200,180) } else { Rgb(200, 200, 200) }, if *selected == index { Rgb(240,200,180) } else { Rgb(200, 200, 200) },
if *selected == index { Rgb(80, 80, 50) } else { Rgb(30, 30, 30) }, if *selected == index { Rgb(80, 80, 50) } else { Rgb(30, 30, 30) },
@ -67,7 +67,7 @@ impl View<TuiOut, ()> for App {
Some(":templates") => to.place(&{ Some(":templates") => to.place(&{
let modes = self.config.modes.clone(); let modes = self.config.modes.clone();
let height = (modes.read().unwrap().len() * 2) as u16; let height = (modes.read().unwrap().len() * 2) as u16;
Fixed::Y(height, Min::x(30, Thunk::new(move |to: &mut TuiOut|{ Fixed::Y(height, Min::X(30, Thunk::new(move |to: &mut TuiOut|{
for (index, (id, profile)) in modes.read().unwrap().iter().enumerate() { for (index, (id, profile)) in modes.read().unwrap().iter().enumerate() {
let bg = if index == 0 { Rgb(70,70,70) } else { Rgb(50,50,50) }; let bg = if index == 0 { Rgb(70,70,70) } else { Rgb(50,50,50) };
let name = profile.name.get(0).map(|x|x.as_ref()).unwrap_or("<no name>"); let name = profile.name.get(0).map(|x|x.as_ref()).unwrap_or("<no name>");
@ -77,21 +77,21 @@ impl View<TuiOut, ()> for App {
let field_name = Fill::X(Align::w(Tui::fg(fg1, name))); let field_name = Fill::X(Align::w(Tui::fg(fg1, name)));
let field_id = Fill::X(Align::e(Tui::fg(fg2, id))); let field_id = Fill::X(Align::e(Tui::fg(fg2, id)));
let field_info = Fill::X(Align::w(info)); let field_info = Fill::X(Align::w(info));
to.place(&Push::y((2 * index) as u16, to.place(&Push::Y((2 * index) as u16,
Fixed::Y(2, Fill::X(Tui::bg(bg, Bsp::s( Fixed::Y(2, Fill::X(Tui::bg(bg, Bsp::s(
Bsp::a(field_name, field_id), field_info)))))); Bsp::a(field_name, field_id), field_info))))));
} }
}))) })))
}), }),
Some(":sessions") => to.place(&Fixed::Y(6, Min::x(30, Thunk::new(|to: &mut TuiOut|{ Some(":sessions") => to.place(&Fixed::Y(6, Min::X(30, Thunk::new(|to: &mut TuiOut|{
let fg = Rgb(224, 192, 128); let fg = Rgb(224, 192, 128);
for (index, name) in ["session1", "session2", "session3"].iter().enumerate() { for (index, name) in ["session1", "session2", "session3"].iter().enumerate() {
let bg = if index == 0 { Rgb(50,50,50) } else { Rgb(40,40,40) }; let bg = if index == 0 { Rgb(50,50,50) } else { Rgb(40,40,40) };
to.place(&Push::y((2 * index) as u16, to.place(&Push::Y((2 * index) as u16,
&Fixed::Y(2, Fill::X(Tui::bg(bg, Align::w(Tui::fg(fg, name))))))); &Fixed::Y(2, Fill::X(Tui::bg(bg, Align::w(Tui::fg(fg, name)))))));
} }
})))), })))),
Some(":browse/title") => to.place(&Fill::X(Align::w(FieldV(Default::default(), Some(":browse/title") => to.place(&Fill::X(Align::w(FieldV(ItemColor::default(),
match self.dialog.browser_target().unwrap() { match self.dialog.browser_target().unwrap() {
BrowseTarget::SaveProject => "Save project:", BrowseTarget::SaveProject => "Save project:",
BrowseTarget::LoadProject => "Load project:", BrowseTarget::LoadProject => "Load project:",
@ -99,7 +99,7 @@ impl View<TuiOut, ()> for App {
BrowseTarget::ExportSample(_) => "Export sample:", BrowseTarget::ExportSample(_) => "Export sample:",
BrowseTarget::ImportClip(_) => "Import clip:", BrowseTarget::ImportClip(_) => "Import clip:",
BrowseTarget::ExportClip(_) => "Export clip:", BrowseTarget::ExportClip(_) => "Export clip:",
}, Shrink::x(3, Fixed::Y(1, Tui::fg(Tui::g(96), RepeatH("🭻")))))))), }, Shrink::X(3, Fixed::Y(1, Tui::fg(Tui::g(96), RepeatH("🭻")))))))),
Some(":device") => { Some(":device") => {
let selected = self.dialog.device_kind().unwrap(); let selected = self.dialog.device_kind().unwrap();
to.place(&Bsp::s(Tui::bold(true, "Add device"), Map::south(1, to.place(&Bsp::s(Tui::bold(true, "Add device"), Map::south(1,
@ -149,8 +149,8 @@ fn view_logo () -> impl Content<TuiOut> {
//.filter_map(|x|if let Value::Exp(_, iter)=x.value{ Some(iter) } else { None }) //.filter_map(|x|if let Value::Exp(_, iter)=x.value{ Some(iter) } else { None })
//.skip(offset) //.skip(offset)
//.take(20), //.take(20),
//|mut b,i|Fixed::x(60, Align::w(Bsp::e("(", Bsp::e( //|mut b,i|Fixed::X(60, Align::w(Bsp::e("(", Bsp::e(
//b.next().map(|t|Fixed::x(16, Align::w(Tui::fg(Rgb(64,224,0), format!("{}", t.value))))), //b.next().map(|t|Fixed::X(16, Align::w(Tui::fg(Rgb(64,224,0), format!("{}", t.value))))),
//Bsp::e(" ", Align::w(format!("{}", b.0.0.trim()))))))))))), //Bsp::e(" ", Align::w(format!("{}", b.0.0.trim()))))))))))),
//Dialog::Browse(BrowseTarget::Load, browser) => { //Dialog::Browse(BrowseTarget::Load, browser) => {
@ -158,7 +158,7 @@ fn view_logo () -> impl Content<TuiOut> {
////Bsp::s( ////Bsp::s(
////Fill::X(Align::w(Margin::XY(1, 1, Bsp::e( ////Fill::X(Align::w(Margin::XY(1, 1, Bsp::e(
////Tui::bold(true, " Load project: "), ////Tui::bold(true, " Load project: "),
////Shrink::x(3, Fixed::Y(1, RepeatH("🭻"))))))), ////Shrink::X(3, Fixed::Y(1, RepeatH("🭻"))))))),
////Outer(true, Style::default().fg(Tui::g(96))) ////Outer(true, Style::default().fg(Tui::g(96)))
////.enclose(Fill::XY(browser))) ////.enclose(Fill::XY(browser)))
//}, //},
@ -167,7 +167,7 @@ fn view_logo () -> impl Content<TuiOut> {
////Bsp::s( ////Bsp::s(
////Fill::X(Align::w(Margin::XY(1, 1, Bsp::e( ////Fill::X(Align::w(Margin::XY(1, 1, Bsp::e(
////Tui::bold(true, " Export: "), ////Tui::bold(true, " Export: "),
////Shrink::x(3, Fixed::Y(1, RepeatH("🭻"))))))), ////Shrink::X(3, Fixed::Y(1, RepeatH("🭻"))))))),
////Outer(true, Style::default().fg(Tui::g(96))) ////Outer(true, Style::default().fg(Tui::g(96)))
////.enclose(Fill::XY(browser))) ////.enclose(Fill::XY(browser)))
//}, //},
@ -176,7 +176,7 @@ fn view_logo () -> impl Content<TuiOut> {
////Bsp::s( ////Bsp::s(
////Fill::X(Align::w(Margin::XY(1, 1, Bsp::e( ////Fill::X(Align::w(Margin::XY(1, 1, Bsp::e(
////Tui::bold(true, " Import: "), ////Tui::bold(true, " Import: "),
////Shrink::x(3, Fixed::Y(1, RepeatH("🭻"))))))), ////Shrink::X(3, Fixed::Y(1, RepeatH("🭻"))))))),
////Outer(true, Style::default().fg(Tui::g(96))) ////Outer(true, Style::default().fg(Tui::g(96)))
////.enclose(Fill::XY(browser))) ////.enclose(Fill::XY(browser)))
//}, //},
@ -196,13 +196,13 @@ fn view_logo () -> impl Content<TuiOut> {
//let hist_len = self.history.len(); //let hist_len = self.history.len();
//let hist_last = self.history.last(); //let hist_last = self.history.last();
//Fixed::Y(2, Stack::east(move|add: &mut dyn FnMut(&dyn Draw<TuiOut>)|{ //Fixed::Y(2, Stack::east(move|add: &mut dyn FnMut(&dyn Draw<TuiOut>)|{
//add(&Fixed::x(5, Tui::bg(if playing { Rgb(0, 128, 0) } else { Rgb(128, 64, 0) }, //add(&Fixed::X(5, Tui::bg(if playing { Rgb(0, 128, 0) } else { Rgb(128, 64, 0) },
//Either::new(false, // TODO //Either::new(false, // TODO
//Thunk::new(move||Fixed::x(9, Either::new(playing, //Thunk::new(move||Fixed::X(9, Either::new(playing,
//Tui::fg(Rgb(0, 255, 0), " PLAYING "), //Tui::fg(Rgb(0, 255, 0), " PLAYING "),
//Tui::fg(Rgb(255, 128, 0), " STOPPED "))) //Tui::fg(Rgb(255, 128, 0), " STOPPED ")))
//), //),
//Thunk::new(move||Fixed::x(5, Either::new(playing, //Thunk::new(move||Fixed::X(5, Either::new(playing,
//Tui::fg(Rgb(0, 255, 0), Bsp::s(" 🭍🭑🬽 ", " 🭞🭜🭘 ",)), //Tui::fg(Rgb(0, 255, 0), Bsp::s(" 🭍🭑🬽 ", " 🭞🭜🭘 ",)),
//Tui::fg(Rgb(255, 128, 0), Bsp::s(" ▗▄▖ ", " ▝▀▘ ",)))) //Tui::fg(Rgb(255, 128, 0), Bsp::s(" ▗▄▖ ", " ▝▀▘ ",))))
//) //)
@ -211,15 +211,15 @@ fn view_logo () -> impl Content<TuiOut> {
//add(&" "); //add(&" ");
//{ //{
//let cache = cache.read().unwrap(); //let cache = cache.read().unwrap();
//add(&Fixed::x(15, Align::w(Bsp::s( //add(&Fixed::X(15, Align::w(Bsp::s(
//FieldH(theme, "Beat", cache.beat.view.clone()), //FieldH(theme, "Beat", cache.beat.view.clone()),
//FieldH(theme, "Time", cache.time.view.clone()), //FieldH(theme, "Time", cache.time.view.clone()),
//)))); //))));
//add(&Fixed::x(13, Align::w(Bsp::s( //add(&Fixed::X(13, Align::w(Bsp::s(
//Fill::X(Align::w(FieldH(theme, "BPM", cache.bpm.view.clone()))), //Fill::X(Align::w(FieldH(theme, "BPM", cache.bpm.view.clone()))),
//Fill::X(Align::w(FieldH(theme, "SR ", cache.sr.view.clone()))), //Fill::X(Align::w(FieldH(theme, "SR ", cache.sr.view.clone()))),
//)))); //))));
//add(&Fixed::x(12, Align::w(Bsp::s( //add(&Fixed::X(12, Align::w(Bsp::s(
//Fill::X(Align::w(FieldH(theme, "Buf", cache.buf.view.clone()))), //Fill::X(Align::w(FieldH(theme, "Buf", cache.buf.view.clone()))),
//Fill::X(Align::w(FieldH(theme, "Lat", cache.lat.view.clone()))), //Fill::X(Align::w(FieldH(theme, "Lat", cache.lat.view.clone()))),
//)))); //))));
@ -246,11 +246,11 @@ fn view_logo () -> impl Content<TuiOut> {
//Fill::X(Align::w(Bsp::e( //Fill::X(Align::w(Bsp::e(
//Align::w(Tui::bg(if playing { Rgb(0, 128, 0) } else { Rgb(128, 64, 0) }, //Align::w(Tui::bg(if playing { Rgb(0, 128, 0) } else { Rgb(128, 64, 0) },
//Either::new(false, // TODO //Either::new(false, // TODO
//Thunk::new(move||Fixed::x(9, Either::new(playing, //Thunk::new(move||Fixed::X(9, Either::new(playing,
//Tui::fg(Rgb(0, 255, 0), " PLAYING "), //Tui::fg(Rgb(0, 255, 0), " PLAYING "),
//Tui::fg(Rgb(255, 128, 0), " STOPPED "))) //Tui::fg(Rgb(255, 128, 0), " STOPPED ")))
//), //),
//Thunk::new(move||Fixed::x(5, Either::new(playing, //Thunk::new(move||Fixed::X(5, Either::new(playing,
//Tui::fg(Rgb(0, 255, 0), Bsp::s(" 🭍🭑🬽 ", " 🭞🭜🭘 ",)), //Tui::fg(Rgb(0, 255, 0), Bsp::s(" 🭍🭑🬽 ", " 🭞🭜🭘 ",)),
//Tui::fg(Rgb(255, 128, 0), Bsp::s(" ▗▄▖ ", " ▝▀▘ ",)))) //Tui::fg(Rgb(255, 128, 0), Bsp::s(" ▗▄▖ ", " ▝▀▘ ",))))
//) //)
@ -286,7 +286,7 @@ fn view_logo () -> impl Content<TuiOut> {
//Fill::XY(Tui::bg(bg.rgb, self.editor())) //Fill::XY(Tui::bg(bg.rgb, self.editor()))
//} //}
//pub fn view_editor_status (&self) -> impl Content<TuiOut> + use<'_> { //pub fn view_editor_status (&self) -> impl Content<TuiOut> + use<'_> {
//self.editor().map(|e|Fixed::x(20, Outer(true, Style::default().fg(Tui::g(96))).enclose( //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())))))) //Fill::Y(Align::n(Bsp::s(e.clip_status(), e.edit_status()))))))
//} //}
//pub fn view_midi_ins_status (&self) -> impl Content<TuiOut> + use<'_> { //pub fn view_midi_ins_status (&self) -> impl Content<TuiOut> + use<'_> {
@ -303,7 +303,7 @@ fn view_logo () -> impl Content<TuiOut> {
//} //}
//pub fn view_scenes (&self) -> impl Content<TuiOut> + use<'_> { //pub fn view_scenes (&self) -> impl Content<TuiOut> + use<'_> {
//Bsp::e( //Bsp::e(
//Fixed::x(20, Align::nw(self.project.view_scenes_names())), //Fixed::X(20, Align::nw(self.project.view_scenes_names())),
//self.project.view_scenes_clips(), //self.project.view_scenes_clips(),
//) //)
//} //}
@ -327,7 +327,7 @@ fn view_logo () -> impl Content<TuiOut> {
//Fixed::Y(2, self.project.view_track_names(self.color)) //Fixed::Y(2, self.project.view_track_names(self.color))
//} //}
//pub fn view_pool (&self) -> impl Content<TuiOut> + use<'_> { //pub fn view_pool (&self) -> impl Content<TuiOut> + use<'_> {
//Fixed::x(20, Bsp::s( //Fixed::X(20, Bsp::s(
//Fill::X(Align::w(FieldH(self.color, "Clip pool:", ""))), //Fill::X(Align::w(FieldH(self.color, "Clip pool:", ""))),
//Fill::Y(Align::n(Tui::bg(Rgb(0, 0, 0), Outer(true, Style::default().fg(Tui::g(96))) //Fill::Y(Align::n(Tui::bg(Rgb(0, 0, 0), Outer(true, Style::default().fg(Tui::g(96)))
//.enclose(PoolView(&self.pool))))))) //.enclose(PoolView(&self.pool)))))))

View file

@ -1,5 +1,7 @@
#![feature(trait_alias)] #![feature(trait_alias)]
pub use tek_engine;
pub(crate) use ::{ pub(crate) use ::{
tek_engine::*, tek_engine::*,
tek_engine::tengri::{ tek_engine::tengri::{