mirror of
https://codeberg.org/unspeaker/tek.git
synced 2025-12-09 13:16:44 +01:00
wip: enabling standalone arranger
This commit is contained in:
parent
b6da43e93e
commit
7685072e4c
16 changed files with 445 additions and 370 deletions
40
crates/tek_sequencer/src/arranger_cli.rs
Normal file
40
crates/tek_sequencer/src/arranger_cli.rs
Normal file
|
|
@ -0,0 +1,40 @@
|
|||
use tek_core::clap::{self, Parser};
|
||||
use tek_timer::TransportToolbar;
|
||||
use crate::*;
|
||||
|
||||
#[derive(Debug, Parser)]
|
||||
#[command(version, about, long_about = None)]
|
||||
pub struct ArrangerCli {
|
||||
/// Name of JACK client
|
||||
#[arg(short, long)] name: Option<String>,
|
||||
/// Pulses per quarter note (arruencer resolution; default: 96)
|
||||
#[arg(short, long)] ppq: Option<usize>,
|
||||
/// Whether to include a transport toolbar (default: true)
|
||||
#[arg(short, long)] transport: Option<bool>,
|
||||
/// Number of tracks
|
||||
#[arg(short = 'x', long)] tracks: Option<usize>,
|
||||
/// Number of scenes
|
||||
#[arg(short, long)] scenes: Option<usize>,
|
||||
}
|
||||
|
||||
impl Arranger {
|
||||
pub fn from_args () -> Usually<Self> {
|
||||
let args = ArrangerCli::parse();
|
||||
let mut arr = Self::new("");
|
||||
if let Some(name) = args.name {
|
||||
arr.name = name.clone();
|
||||
}
|
||||
if args.transport == Some(true) {
|
||||
arr.transport = Some(Arc::new(RwLock::new(TransportToolbar::new(None))));
|
||||
}
|
||||
if let Some(tracks) = args.tracks {
|
||||
for track in 0..tracks {
|
||||
arr.track_add(None)?;
|
||||
if let Some(scenes) = args.scenes {
|
||||
}
|
||||
}
|
||||
}
|
||||
Ok(arr)
|
||||
}
|
||||
}
|
||||
|
||||
Loading…
Add table
Add a link
Reference in a new issue