mirror of
https://codeberg.org/unspeaker/tek.git
synced 2025-12-08 12:46:42 +01:00
define midi ins and audio outs in project
This commit is contained in:
parent
58cd51dfbf
commit
c4c1271c32
5 changed files with 56 additions and 35 deletions
22
src/edn.rs
22
src/edn.rs
|
|
@ -59,6 +59,28 @@ impl App {
|
|||
Some(Edn::Symbol("track")) => {
|
||||
Track::load_edn(self, &items[1..])?;
|
||||
},
|
||||
Some(Edn::Symbol("midi-in")) => {
|
||||
self.midi_ins = items[1..].iter().map(|x|match x {
|
||||
Edn::Str(n) => n.to_string(),
|
||||
_ => panic!("unexpected midi-in")
|
||||
}).collect::<Vec<_>>();
|
||||
},
|
||||
Some(Edn::Symbol("audio-out")) => {
|
||||
let client = self.client();
|
||||
self.audio_outs = items[1..].iter().map(|x|match x {
|
||||
Edn::Str(n) => n.to_string(),
|
||||
_ => panic!("unexpected midi-in")
|
||||
}).collect::<Vec<_>>()
|
||||
.iter()
|
||||
.map(|name|client
|
||||
.ports(Some(name), None, PortFlags::empty())
|
||||
.get(0)
|
||||
.map(|name|client.port_by_name(name)))
|
||||
.flatten()
|
||||
.filter_map(|x|x)
|
||||
.map(Arc::new)
|
||||
.collect();
|
||||
},
|
||||
_ => panic!("unexpected edn: {:?}", items.get(0))
|
||||
}
|
||||
},
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue