mirror of
https://codeberg.org/unspeaker/tek.git
synced 2026-07-17 15:56:57 +02:00
restruct: 9e
This commit is contained in:
parent
19ab138320
commit
a8febbe96f
4 changed files with 20 additions and 23 deletions
22
src/app.rs
22
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<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();
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue