mirror of
https://codeberg.org/unspeaker/tek.git
synced 2025-12-10 13:46:42 +01:00
This commit is contained in:
parent
573534a9a6
commit
447638ee71
30 changed files with 824 additions and 548 deletions
|
|
@ -1,9 +1,94 @@
|
|||
#![feature(type_alias_impl_trait)]
|
||||
|
||||
//macro_rules! impl_port {
|
||||
//($Name:ident : $Spec:ident -> $Pair:ident |$jack:ident, $name:ident|$port:expr) => {
|
||||
//#[derive(Debug)] pub struct $Name {
|
||||
///// Handle to JACK client, for receiving reconnect events.
|
||||
//jack: Jack<'static>,
|
||||
///// Port name
|
||||
//name: Arc<str>,
|
||||
///// Port handle.
|
||||
//port: Port<$Spec>,
|
||||
///// List of ports to connect to.
|
||||
//conn: Vec<PortConnect>
|
||||
//}
|
||||
//impl AsRef<Port<$Spec>> for $Name {
|
||||
//fn as_ref (&self) -> &Port<$Spec> { &self.port }
|
||||
//}
|
||||
//impl $Name {
|
||||
//pub fn new ($jack: &Jack, name: impl AsRef<str>, connect: &[PortConnect])
|
||||
//-> Usually<Self>
|
||||
//{
|
||||
//let $name = name.as_ref();
|
||||
//let jack = $jack.clone();
|
||||
//let port = $port?;
|
||||
//let name = $name.into();
|
||||
//let conn = connect.to_vec();
|
||||
//let port = Self { jack, port, name, conn };
|
||||
//port.connect_to_matching()?;
|
||||
//Ok(port)
|
||||
//}
|
||||
//pub fn name (&self) -> &Arc<str> { &self.name }
|
||||
//pub fn port (&self) -> &Port<$Spec> { &self.port }
|
||||
//pub fn port_mut (&mut self) -> &mut Port<$Spec> { &mut self.port }
|
||||
//pub fn into_port (self) -> Port<$Spec> { self.port }
|
||||
//pub fn close (self) -> Usually<()> {
|
||||
//let Self { jack, port, .. } = self;
|
||||
//Ok(jack.with_client(|client|client.unregister_port(port))?)
|
||||
//}
|
||||
//}
|
||||
//impl HasJack<'static> for $Name {
|
||||
//fn jack (&self) -> &'static Jack<'static> { &self.jack }
|
||||
//}
|
||||
//impl JackPort<'static> for $Name {
|
||||
//type Port = $Spec;
|
||||
//type Pair = $Pair;
|
||||
//fn port (&self) -> &Port<$Spec> { &self.port }
|
||||
//}
|
||||
//impl ConnectTo<'static, &str> for $Name {
|
||||
//fn connect_to (&self, to: &str) -> Usually<PortConnectStatus> {
|
||||
//self.with_client(|c|if let Some(ref port) = c.port_by_name(to.as_ref()) {
|
||||
//self.connect_to(port)
|
||||
//} else {
|
||||
//Ok(Missing)
|
||||
//})
|
||||
//}
|
||||
//}
|
||||
//impl ConnectTo<'static, &Port<Unowned>> for $Name {
|
||||
//fn connect_to (&self, port: &Port<Unowned>) -> Usually<PortConnectStatus> {
|
||||
//self.with_client(|c|Ok(if let Ok(_) = c.connect_ports(&self.port, port) {
|
||||
//Connected
|
||||
//} else if let Ok(_) = c.connect_ports(port, &self.port) {
|
||||
//Connected
|
||||
//} else {
|
||||
//Mismatch
|
||||
//}))
|
||||
//}
|
||||
//}
|
||||
//impl ConnectTo<'static, &Port<$Pair>> for $Name {
|
||||
//fn connect_to (&self, port: &Port<$Pair>) -> Usually<PortConnectStatus> {
|
||||
//self.with_client(|c|Ok(if let Ok(_) = c.connect_ports(&self.port, port) {
|
||||
//Connected
|
||||
//} else if let Ok(_) = c.connect_ports(port, &self.port) {
|
||||
//Connected
|
||||
//} else {
|
||||
//Mismatch
|
||||
//}))
|
||||
//}
|
||||
//}
|
||||
//impl ConnectAuto<'static> for $Name {
|
||||
//fn connections (&self) -> &[PortConnect] {
|
||||
//&self.conn
|
||||
//}
|
||||
//}
|
||||
//};
|
||||
//}
|
||||
|
||||
mod time; pub use self::time::*;
|
||||
mod note; pub use self::note::*;
|
||||
pub mod jack; pub use self::jack::*;
|
||||
pub mod midi; pub use self::midi::*;
|
||||
pub mod audio; pub use self::audio::*;
|
||||
|
||||
pub(crate) use std::sync::{Arc, atomic::{AtomicUsize, AtomicBool, Ordering::Relaxed}};
|
||||
pub(crate) use std::fmt::Debug;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue