From a8febbe96f0803b033205626d153c42b77003c36 Mon Sep 17 00:00:00 2001 From: i do not exist Date: Sun, 28 Jun 2026 14:31:32 +0300 Subject: [PATCH] restruct: 9e --- src/app.rs | 22 ++++++++++++---------- src/app/bind.rs | 2 +- src/tek.rs | 17 ++++++----------- tengri | 2 +- 4 files changed, 20 insertions(+), 23 deletions(-) diff --git a/src/app.rs b/src/app.rs index 2c88280a..c198381d 100644 --- a/src/app.rs +++ b/src/app.rs @@ -86,16 +86,17 @@ impl App { Arc::new(RwLock::new(App::new(jack, project, config, ":menu"))) } - pub fn new_shared_run ( - exit: &Exit, jack: &Jack<'static>, project: Arrangement, config: Config, mode: impl AsRef + pub fn new_shared_run ( + exit: &Exit, + output: W, + jack: &Jack<'static>, + project: Arrangement, + config: Config, + mode: impl AsRef ) -> Usually<(Arc>, Task, Task)> { let state = Self::new_shared(&jack, project, config, mode); - let keyboard = tui_input( - exit.as_ref(), &state, Duration::from_millis(100) - )?; - let terminal = tui_output( - &mut std::io::stdout(), exit.as_ref(), &state, Duration::from_millis(10) - )?; + let keyboard = tui_input(exit.as_ref(), &state, Duration::from_millis(100))?; + let terminal = tui_output(exit.as_ref(), &state, Duration::from_millis(10), output)?; Ok((state, keyboard, terminal)) } @@ -529,7 +530,7 @@ fn app_interpret_word (state: &App, to: &mut Tui, dsl: &impl Expression) -> Usua Ok(to.area().into()) }))).draw(to), - Some(":browse/title") => w_full(origin_w(field_v(ItemColor::default(), + Some(":browse/title") => w_full(origin_w(field_v(ItemTheme::default(), match state.dialog.browser_target().unwrap() { BrowseTarget::SaveProject => "Save project:", BrowseTarget::LoadProject => "Load project:", @@ -537,7 +538,8 @@ fn app_interpret_word (state: &App, to: &mut Tui, dsl: &impl Expression) -> Usua BrowseTarget::ExportSample(_) => "Export sample:", BrowseTarget::ImportClip(_) => "Import clip:", BrowseTarget::ExportClip(_) => "Export clip:", - }, w_shrink(3, h_exact(1, fg(g(96), x_repeat("🭻"))))))).draw(to), + }, h_exact(1, fg(g(96), x_repeat("🭻"))) + ))).draw(to), Some(":device") => { let selected = state.dialog.device_kind().unwrap(); diff --git a/src/app/bind.rs b/src/app/bind.rs index be5a5705..25f60a07 100644 --- a/src/app/bind.rs +++ b/src/app/bind.rs @@ -61,7 +61,7 @@ impl Bind> { // TODO Ok(()) } else if let Ok(Some(_word)) = item.expr().head().word() { - if let Some(key) = TuiEvent::named(item.expr()?.head()?)? { + if let Some(key) = TuiKey::from_dsl(item.expr()?.head()?)? { map.add(key, Binding { commands: [item.expr()?.tail()?.unwrap_or_default().into()].into(), condition: None, diff --git a/src/tek.rs b/src/tek.rs index 6e83d5e0..7efe2fe4 100644 --- a/src/tek.rs +++ b/src/tek.rs @@ -7,7 +7,7 @@ pub(crate) const HEADER: &'static str = r#" ~ █▀█▀█ █▀▀█ █ █ ~~~ ~ ~ ~~ ~ ~ ~ ~~ ~ ~ ~ ~ - █ █▀ █▀▀▄ ~ v0.4.0, 2026 winter (or is it) ~ + █ █▀ █▀▀▄ ~ v0.4.0, 2026 heatwave edition ~ ~ ▀ █▀▀█ ▀ ▀ ~ ~~~ ~ ~ ~ ~ ~~~ ~~~ ~ ~~ "#; #[cfg(feature = "cli")] use clap::{self, Parser, Subcommand}; @@ -90,21 +90,16 @@ pub fn main () -> Usually<()> { Config::watch(|config|{ Exit::run(|exit|{ let state = Jack::new_run("tek", move|jack|{ - Ok(App::new(&jack, Arrangement::new( - &jack, - None, - Clock::new(&jack, Some(51.))?, - vec![], - vec![], - vec![], - vec![], - ), config, ":menu")) + let clock = Clock::new(&jack, Some(51.))?; + let project = Arrangement::new(&jack, None, clock, vec![], vec![], vec![], vec![]); + let app = App::new(&jack, project, config, ":menu"); + Ok(app) })?; let keyboard = tui_input( exit.as_ref(), &state, Duration::from_millis(100) )?; let terminal = tui_output( - &mut std::io::stdout(), exit.as_ref(), &state, Duration::from_millis(10) + exit.as_ref(), &state, Duration::from_millis(10), std::io::stdout(), )?; Ok(()) }) diff --git a/tengri b/tengri index 7613c655..dd7091bd 160000 --- a/tengri +++ b/tengri @@ -1 +1 @@ -Subproject commit 7613c655000949180e6e838ce96c0f168b8d4cc7 +Subproject commit dd7091bda11504a16ba8de0c0b719359df37b5ef