wip: refactor into api and app

This commit is contained in:
🪞👃🪞 2024-11-09 19:50:22 +01:00
parent 051c3d3663
commit 70fc3c97d1
61 changed files with 453 additions and 255 deletions

View file

@ -1,23 +0,0 @@
//! Sample player
include!("lib.rs");
use tek_core::clap::{self, Parser};
pub fn main () -> Usually<()> { SamplerCli::parse().run() }
#[derive(Debug, Parser)] #[command(version, about, long_about = None)] pub struct SamplerCli {
/// Name of JACK client
#[arg(short, long)] name: Option<String>,
/// Path to plugin
#[arg(short, long)] path: Option<String>,
}
impl SamplerCli {
fn run (&self) -> Usually<()> {
Tui::run(JackClient::new("tek_sampler")?.activate_with(|jack|{
let mut plugin = Sampler::new(
jack,
self.name.as_ref().map(|x|x.as_str()).unwrap_or("mixer"),
None,
)?;
Ok(plugin)
})?)?;
Ok(())
}
}