restruct: 12e

This commit is contained in:
i do not exist 2026-06-27 22:10:04 +03:00
parent 804a5bc905
commit 19ab138320
2 changed files with 21 additions and 8 deletions

View file

@ -22,7 +22,7 @@ pub(crate) use ::midly::{Smf, TrackEventKind, MidiMessage, Error as MidiError, n
pub extern crate tengri; pub extern crate tengri;
pub(crate) use tengri::{ pub(crate) use tengri::{
*, lang::*, exit::*, eval::*, keys::*, sing::*, time::*, draw::*, term::*, color::*, task::*, *, lang::*, exit::*, eval::*, sing::*, time::*, draw::*, term::*, color::*, task::*,
crossterm::event::{Event, KeyEvent}, crossterm::event::{Event, KeyEvent},
ratatui::{ ratatui::{
self, self,
@ -89,8 +89,8 @@ pub(crate) use tengri::{
pub fn main () -> Usually<()> { pub fn main () -> Usually<()> {
Config::watch(|config|{ Config::watch(|config|{
Exit::run(|exit|{ Exit::run(|exit|{
Jack::new_run("tek", move|jack|{ let state = Jack::new_run("tek", move|jack|{
Ok(App::new_shared_run(&exit, &jack, Arrangement::new( Ok(App::new(&jack, Arrangement::new(
&jack, &jack,
None, None,
Clock::new(&jack, Some(51.))?, Clock::new(&jack, Some(51.))?,
@ -98,15 +98,28 @@ pub fn main () -> Usually<()> {
vec![], vec![],
vec![], vec![],
vec![], vec![],
), config, ":menu")?.0) ), config, ":menu"))
// TODO: Sync I/O timings with main clock, so that things })?;
// "accidentally" fall on the beat in overload conditions. 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)
)?;
Ok(())
}) })
})?; })?;
Ok(()) Ok(())
} }
tui_keys!(|self: App, input| {
todo!()
});
tui_view!(|self: App| {
""
});
pub fn swap_value <T: Clone + PartialEq, U> ( pub fn swap_value <T: Clone + PartialEq, U> (
target: &mut T, value: &T, returned: impl Fn(T)->U target: &mut T, value: &T, returned: impl Fn(T)->U
) -> Perhaps<U> { ) -> Perhaps<U> {

2
tengri

@ -1 +1 @@
Subproject commit cb382cf12e9169310ddab4eca2ca01e87fde9869 Subproject commit 7613c655000949180e6e838ce96c0f168b8d4cc7