port connections; DevicePorts -> PortList

This commit is contained in:
🪞👃🪞 2024-06-26 01:50:02 +03:00
parent b1df7bf4e6
commit 22b44f562b
8 changed files with 117 additions and 77 deletions

View file

@ -27,6 +27,23 @@ impl Chain {
}
}
impl PortList for Chain {
fn midi_ins (&self) -> Usually<Vec<String>> {
if let Some(device) = self.items.get(0) {
device.midi_ins()
} else {
Ok(vec![])
}
}
fn audio_outs (&self) -> Usually<Vec<String>> {
if let Some(device) = self.items.get(self.items.len().saturating_sub(1)) {
device.audio_outs()
} else {
Ok(vec![])
}
}
}
pub fn process (_: &mut Chain, _: &Client, _: &ProcessScope) -> Control {
Control::Continue
}
@ -238,5 +255,3 @@ pub fn handle (state: &mut Chain, event: &AppEvent) -> Usually<bool> {
|s: &mut Chain|s.handle_focus(&FocusEvent::Outward)]
}))
}
impl DevicePorts for Chain {}