mirror of
https://codeberg.org/unspeaker/tek.git
synced 2025-12-15 16:06:41 +01:00
ports macro
This commit is contained in:
parent
2067004d4a
commit
e86be4facc
10 changed files with 104 additions and 102 deletions
|
|
@ -144,33 +144,13 @@ impl Plugin {
|
|||
}
|
||||
}
|
||||
|
||||
impl PortList for Plugin {
|
||||
fn audio_ins (&self) -> Usually<Vec<String>> {
|
||||
let mut ports = vec![];
|
||||
for port in self.audio_ins.iter() {
|
||||
ports.push(port.name()?);
|
||||
}
|
||||
Ok(ports)
|
||||
ports!(Plugin {
|
||||
audio: {
|
||||
ins: |track|Ok(track.audio_ins.iter().collect()),
|
||||
outs: |track|Ok(track.audio_outs.iter().collect()),
|
||||
}
|
||||
fn audio_outs (&self) -> Usually<Vec<String>> {
|
||||
let mut ports = vec![];
|
||||
for port in self.audio_outs.iter() {
|
||||
ports.push(port.name()?);
|
||||
}
|
||||
Ok(ports)
|
||||
midi: {
|
||||
ins: |track|Ok(track.midi_ins.iter().collect()),
|
||||
outs: |track|Ok(track.midi_outs.iter().collect()),
|
||||
}
|
||||
fn midi_ins (&self) -> Usually<Vec<String>> {
|
||||
let mut ports = vec![];
|
||||
for port in self.midi_ins.iter() {
|
||||
ports.push(port.name()?);
|
||||
}
|
||||
Ok(ports)
|
||||
}
|
||||
fn midi_outs (&self) -> Usually<Vec<String>> {
|
||||
let mut ports = vec![];
|
||||
for port in self.midi_outs.iter() {
|
||||
ports.push(port.name()?);
|
||||
}
|
||||
Ok(ports)
|
||||
}
|
||||
}
|
||||
});
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue