mirror of
https://codeberg.org/unspeaker/tek.git
synced 2026-10-08 18:56:42 +02:00
restruct: 40e
This commit is contained in:
parent
027f69cd50
commit
8b6ab2fd08
8 changed files with 331 additions and 290 deletions
28
src/tek.rs
28
src/tek.rs
|
|
@ -1,8 +1,7 @@
|
|||
#![allow(clippy::unit_arg)]
|
||||
#![feature(
|
||||
adt_const_params, associated_type_defaults, anonymous_lifetime_in_impl_trait, closure_lifetime_binder,
|
||||
impl_trait_in_assoc_type, trait_alias, type_alias_impl_trait, type_changing_struct_update
|
||||
)]
|
||||
#![feature(adt_const_params, associated_type_defaults, anonymous_lifetime_in_impl_trait,
|
||||
closure_lifetime_binder, impl_trait_in_assoc_type, trait_alias, type_alias_impl_trait,
|
||||
type_changing_struct_update)]
|
||||
|
||||
/// CLI banner.
|
||||
pub(crate) const HEADER: &'static str = r#"
|
||||
|
|
@ -23,7 +22,7 @@ pub(crate) use ::midly::{Smf, TrackEventKind, MidiMessage, Error as MidiError, n
|
|||
|
||||
pub extern crate tengri;
|
||||
pub(crate) use tengri::{
|
||||
*, lang::*, exit::*, eval::*, keys::*, sing::*, time::*, draw::*, term::*, color::*,
|
||||
*, lang::*, exit::*, eval::*, keys::*, sing::*, time::*, draw::*, term::*, color::*, task::*,
|
||||
crossterm::event::{Event, KeyEvent},
|
||||
ratatui::{
|
||||
self,
|
||||
|
|
@ -88,19 +87,26 @@ pub(crate) use tengri::{
|
|||
/// Command-line entrypoint.
|
||||
#[cfg(feature = "cli")]
|
||||
pub fn main () -> Usually<()> {
|
||||
|
||||
Config::watch(|config|{
|
||||
Exit::run(|exit|{
|
||||
Jack::new_run("tek", |jack|{
|
||||
let project = Arrangement::new(&jack, &Clock::new(&jack, Some(51.)));
|
||||
let state = App::new_shared(jack, config, project, ":menu");
|
||||
let keyboard = tui_input(&exit, &state, Duration::from_millis(100))?;
|
||||
let terminal = tui_output(&exit, &state, Duration::from_millis(10))?;
|
||||
(keyboard, terminal)
|
||||
App::new_shared_run(&exit, &jack, Arrangement::new(
|
||||
&jack,
|
||||
None,
|
||||
Clock::new(&jack, Some(51.))?,
|
||||
vec![],
|
||||
vec![],
|
||||
vec![],
|
||||
vec![],
|
||||
), config, ":menu")
|
||||
// TODO: Sync I/O timings with main clock, so that things
|
||||
// "accidentally" fall on the beat in overload conditions.
|
||||
})
|
||||
})
|
||||
})
|
||||
})?;
|
||||
|
||||
Ok(())
|
||||
}
|
||||
|
||||
pub fn swap_value <T: Clone + PartialEq, U> (
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue