use crate::*; #[derive(Debug)] pub struct AudioInput { /// Handle to JACK client, for receiving reconnect events. jack: Jack<'static>, /// Port name name: Arc, /// Port handle. port: Port, /// List of ports to connect to. pub connections: Vec, } has!(Jack<'static>: |self: AudioInput|self.jack); impl JackPort for AudioInput { type Port = AudioIn; type Pair = AudioOut; fn name (&self) -> &Arc { &self.name } fn port (&self) -> &Port { &self.port } fn port_mut (&mut self) -> &mut Port { &mut self.port } fn into_port (self) -> Port { self.port } fn connections (&self) -> &[Connect] { self.connections.as_slice() } fn new (jack: &Jack<'static>, name: &impl AsRef, connect: &[Connect]) -> Usually where Self: Sized { let port = Self { port: Self::register(jack, name)?, jack: jack.clone(), name: name.as_ref().into(), connections: connect.to_vec() }; port.connect_to_matching()?; Ok(port) } }