restruct: 9e

This commit is contained in:
i do not exist 2026-06-28 14:31:32 +03:00
parent 19ab138320
commit a8febbe96f
4 changed files with 20 additions and 23 deletions

View file

@ -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<str>
pub fn new_shared_run <W: std::io::Write + Send + Sync + 'static> (
exit: &Exit,
output: W,
jack: &Jack<'static>,
project: Arrangement,
config: Config,
mode: impl AsRef<str>
) -> Usually<(Arc<RwLock<Self>>, 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();