This commit is contained in:
i do not exist 2026-09-17 09:49:38 +03:00
parent f743d9fb4d
commit 922c2e1f2f
45 changed files with 1950 additions and 1765 deletions

View file

@ -10,32 +10,6 @@ pub fn show_version () {
println!("versions aint real man");
}
#[cfg(not(feature = "cli"))]
fn run_new_plain (config: Config) -> Usually<()> {
let name = "tek";
tengri::Tui::run_main(Jack::new_run(name, move|jack|{
let mode = ":menu";
let title = "untitled!";
let bpm = 74.;
let clock = Clock::new(&jack, Some(bpm))?;
let tracks = [];
let scenes = [];
Ok(App::new(None, Arrangement::new(
&jack,
title.into(),
clock,
tracks.into_iter(),
scenes.into_iter(),
connect_midi_ins(&jack, &"M", &[], None)?.into_iter(),
connect_midi_outs(&jack, &"M", &[], None)?.into_iter(),
[].into_iter().chain(connect_audio_ins(&jack, &"L", &[], None)?.into_iter())
.chain(connect_audio_ins(&jack, &"R", &[], None)?.into_iter()),
[].into_iter().chain(connect_audio_outs(&jack, &"L", &[], None)?.into_iter())
.chain(connect_audio_outs(&jack, &"R", &[], None)?.into_iter()),
), config, mode))
})?)
}
pub fn run_with_config (config: Arc<Config>) -> Usually<()> {
Cli::parse().run(Some(config))
}
@ -99,7 +73,7 @@ pub enum Action {
}
impl Action {
fn run (&self, config: Arc<Config>, trace: bool) -> Usually<()> {
fn run (&self, config: Arc<Config>, _trace: bool) -> Usually<()> {
use Action::*;
match self {
Version => show_version(),
@ -109,6 +83,7 @@ impl Action {
New(sesh) => Exit::run(|exit|Tui::run_main(
exit.clone(),
{
#[allow(unused_mut)]
let mut app = App::new(Some(exit), sesh.init()?, config, ":menu");
#[cfg(feature = "prof2")] {
if trace {
@ -165,7 +140,7 @@ pub struct ProjectInit {
#[arg(short='s', long)] scenes: Option<usize>,
}
impl ProjectInit {
pub fn init (&self) -> Usually<Arrangement> {
pub fn init (&self) -> Usually<Project> {
let Self {
name, bpm, tracks, scenes,
sync_lead: _, sync_follow: _,
@ -175,7 +150,7 @@ impl ProjectInit {
} = self;
let name = name.as_ref().map_or("tek", |x|x.as_str());
let jack = Jack::new(&name)?;
let mut proj = Arrangement::new(
let mut proj = Project::new(
&jack,
name.into(),
Clock::new(&jack, *bpm)?,
@ -207,7 +182,7 @@ impl ProjectInit {
}
}
pub fn print_status (project: &Arrangement) {
pub fn print_status (project: &Project) {
println!("Name: {:?}", &project.name);
println!("JACK: {:?}", &project.jack);
println!("Buffer: {:?}", &project.clock.chunk);