mirror of
https://codeberg.org/unspeaker/tek.git
synced 2025-12-08 20:56:43 +01:00
reenable mixer crate
This commit is contained in:
parent
792dab9714
commit
2f189c6d7e
7 changed files with 51 additions and 79 deletions
|
|
@ -1,31 +0,0 @@
|
|||
//! Multi-track mixer
|
||||
include!("lib.rs");
|
||||
use tek_core::clap::{self, Parser};
|
||||
#[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<E: Engine> Mixer<E> {
|
||||
pub fn from_args () -> Usually<Self> {
|
||||
let args = MixerCli::parse();
|
||||
let mut mix = Self::new("")?;
|
||||
if let Some(name) = args.name {
|
||||
mix.name = name.clone();
|
||||
}
|
||||
if let Some(channels) = args.channels {
|
||||
for channel in 0..channels {
|
||||
mix.track_add(&format!("Track {}", channel + 1), 1)?;
|
||||
}
|
||||
}
|
||||
Ok(mix)
|
||||
}
|
||||
}
|
||||
|
||||
pub fn main () -> Usually<()> {
|
||||
Tui::run(Arc::new(RwLock::new(crate::Mixer::from_args()?)))?;
|
||||
Ok(())
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue