mirror of
https://codeberg.org/unspeaker/tek.git
synced 2025-12-06 03:36:41 +01:00
wip: compiles again, after extensive jack rework
Some checks are pending
/ build (push) Waiting to run
Some checks are pending
/ build (push) Waiting to run
This commit is contained in:
parent
cb7e4f7a95
commit
0192d85a19
18 changed files with 526 additions and 525 deletions
|
|
@ -78,25 +78,23 @@ impl Cli {
|
|||
let mut midi_outs = vec![];
|
||||
let mut tracks = vec![];
|
||||
let mut scenes = vec![];
|
||||
let midi_froms = PortConnect::collect(&self.midi_from, empty, &self.midi_from_re);
|
||||
let midi_tos = PortConnect::collect(&self.midi_to, empty, &self.midi_to_re);
|
||||
let left_froms = PortConnect::collect(&self.left_from, empty, empty);
|
||||
let left_tos = PortConnect::collect(&self.left_to, empty, empty);
|
||||
let right_froms = PortConnect::collect(&self.right_from, empty, empty);
|
||||
let right_tos = PortConnect::collect(&self.right_to, empty, empty);
|
||||
let midi_froms = Connect::collect(&self.midi_from, empty, &self.midi_from_re);
|
||||
let midi_tos = Connect::collect(&self.midi_to, empty, &self.midi_to_re);
|
||||
let left_froms = Connect::collect(&self.left_from, empty, empty);
|
||||
let left_tos = Connect::collect(&self.left_to, empty, empty);
|
||||
let right_froms = Connect::collect(&self.right_from, empty, empty);
|
||||
let right_tos = Connect::collect(&self.right_to, empty, empty);
|
||||
let audio_froms = &[left_froms.as_slice(), right_froms.as_slice()];
|
||||
let audio_tos = &[left_tos.as_slice(), right_tos.as_slice()];
|
||||
let clip = Arc::new(RwLock::new(MidiClip::new(
|
||||
"Clip", true, 384usize, None, Some(ItemColor::random().into())),
|
||||
));
|
||||
Tui::new()?.run(&Jack::new(name)?.run(|jack|{
|
||||
Tui::new()?.run(&Jack::new_run(&name, move|jack|{
|
||||
for (index, connect) in midi_froms.iter().enumerate() {
|
||||
let port = MidiInput::new(jack, &format!("M/{index}"), &[connect.clone()])?;
|
||||
midi_ins.push(port);
|
||||
midi_ins.push(jack.midi_in(&format!("M/{index}"), &[connect.clone()])?);
|
||||
}
|
||||
for (index, connect) in midi_tos.iter().enumerate() {
|
||||
let port = MidiOutput::new(jack, &format!("{index}/M"), &[connect.clone()])?;
|
||||
midi_outs.push(port);
|
||||
midi_outs.push(jack.midi_out(&format!("{index}/M"), &[connect.clone()])?);
|
||||
};
|
||||
let config = Configuration::new(&match self.mode {
|
||||
LaunchMode::Clock => "config/config_transport.edn",
|
||||
|
|
@ -106,14 +104,14 @@ impl Cli {
|
|||
LaunchMode::Sampler => "config/config_sampler.edn",
|
||||
_ => todo!("{:?}", self.mode),
|
||||
}, false)?;
|
||||
let clock = Clock::new(jack, self.bpm)?;
|
||||
let clock = Clock::new(&jack, self.bpm)?;
|
||||
match self.mode {
|
||||
LaunchMode::Sequencer => tracks.push(Track::new(
|
||||
&name, None, jack, Some(&clock), Some(&clip),
|
||||
&name, None, &jack, Some(&clock), Some(&clip),
|
||||
midi_froms.as_slice(), midi_tos.as_slice()
|
||||
)?),
|
||||
LaunchMode::Groovebox | LaunchMode::Sampler => tracks.push(Track::new_with_sampler(
|
||||
&name, None, jack, Some(&clock), Some(&clip),
|
||||
&name, None, &jack, Some(&clock), Some(&clip),
|
||||
midi_froms.as_slice(), midi_tos.as_slice(), audio_froms, audio_tos,
|
||||
)?),
|
||||
_ => {}
|
||||
|
|
@ -172,10 +170,5 @@ const HEADER: &'static str = r#"
|
|||
#[cfg(test)] #[test] fn test_cli () {
|
||||
use clap::CommandFactory;
|
||||
Cli::command().debug_assert();
|
||||
let jack = Jack::default();
|
||||
//TODO:
|
||||
//let _ = App::new_clock(&jack, None, false, false, &[], &[]);
|
||||
//let _ = App::new_sequencer(&jack, None, false, false, &[], &[]);
|
||||
//let _ = App::new_groovebox(&jack, None, false, false, &[], &[], &[&[], &[]], &[&[], &[]]);
|
||||
//let _ = App::new_arranger(&jack, None, false, false, &[], &[], &[&[], &[]], &[&[], &[]], 0, 0, 0);
|
||||
//let jack = Jack::default();
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue