wip: remudolarize 4

This commit is contained in:
🪞👃🪞 2025-01-08 19:56:31 +01:00
parent 0d9a4d4830
commit e8430c373f
46 changed files with 175 additions and 63 deletions

25
src/todo_cli_mixer.rs Normal file
View file

@ -0,0 +1,25 @@
include!("./lib.rs");
pub fn main () -> Usually<()> {
MixerCli::parse().run()
}
#[derive(Debug, Parser)] #[command(version, about, long_about = None)] pub struct MixerCli {
/// Name of JACK client
#[arg(short, long)] name: Option<String>,
/// Number of tracks
#[arg(short, long)] channels: Option<usize>,
}
impl MixerCli {
fn run (&self) -> Usually<()> {
Tui::run(JackConnection::new("tek_mixer")?.activate_with(|jack|{
let mut mixer = Mixer::new(jack, self.name.as_ref().map(|x|x.as_str()).unwrap_or("mixer"))?;
for channel in 0..self.channels.unwrap_or(8) {
mixer.track_add(&format!("Track {}", channel + 1), 1)?;
}
Ok(mixer)
})?)?;
Ok(())
}
}