From 817d2a722c56f89c3a45ac0d3549d988bbcd27bf Mon Sep 17 00:00:00 2001 From: stop screaming Date: Sat, 21 Feb 2026 05:19:26 +0200 Subject: [PATCH] some tweaks after docs regen --- app/.scratch.rs | 85 +++++++++++++++++++ app/tek.rs | 205 +++++++++++++++++----------------------------- app/tek_impls.rs | 18 ++-- app/tek_struct.rs | 33 +++++--- app/tek_test.rs | 62 -------------- app/tek_trait.rs | 26 ++++-- tengri | 2 +- 7 files changed, 214 insertions(+), 217 deletions(-) delete mode 100644 app/tek_test.rs diff --git a/app/.scratch.rs b/app/.scratch.rs index 922b4199..e0b2ef1e 100644 --- a/app/.scratch.rs +++ b/app/.scratch.rs @@ -991,3 +991,88 @@ //})), //take!(TrackCommand |state: Arrangement, iter|state.selected_track().as_ref() //.map(|t|Take::take(t, iter)).transpose().map(|x|x.flatten())); + + +//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, + ///// Port handle. + //port: Port<$Spec>, + ///// List of ports to connect to. + //conn: Vec + //} + //impl AsRef> for $Name { + //fn as_ref (&self) -> &Port<$Spec> { &self.port } + //} + //impl $Name { + //pub fn new ($jack: &Jack, name: impl AsRef, connect: &[PortConnect]) + //-> Usually + //{ + //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 { &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 { + //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> for $Name { + //fn connect_to (&self, port: &Port) -> Usually { + //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 { + //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 + //} + //} + //}; +//} diff --git a/app/tek.rs b/app/tek.rs index e4740797..63a8a898 100644 --- a/app/tek.rs +++ b/app/tek.rs @@ -7,21 +7,10 @@ trait_alias, type_alias_impl_trait, type_changing_struct_update)] - -#[allow(unused)] pub(crate) use ::{ - std::{ - cmp::Ord, - collections::BTreeMap, - error::Error, - ffi::OsString, - fmt::{Write, Debug, Formatter}, - fs::File, - ops::{Add, Sub, Mul, Div, Rem}, - path::{Path, PathBuf}, - sync::{Arc, RwLock, atomic::{AtomicBool, AtomicUsize, Ordering::Relaxed}}, - thread::{spawn, JoinHandle}, - }, -}; +mod tek_struct; pub use self::tek_struct::*; +mod tek_trait; pub use self::tek_trait::*; +mod tek_type; pub use self::tek_type::*; +mod tek_impls; extern crate xdg; pub(crate) use ::xdg::BaseDirectories; pub extern crate atomic_float; @@ -44,15 +33,11 @@ pub(crate) use tengri::{ }, }; #[cfg(feature = "sampler")] pub(crate) use symphonia::{ - core::{ - formats::Packet, - codecs::{Decoder, CODEC_TYPE_NULL}, - //errors::Error as SymphoniaError, - io::MediaSourceStream, - probe::Hint, - audio::SampleBuffer, - }, default::get_codecs, + core::{//errors::Error as SymphoniaError, + audio::SampleBuffer, formats::Packet, io::MediaSourceStream, probe::Hint, + codecs::{Decoder, CODEC_TYPE_NULL}, + }, }; #[cfg(feature = "lv2_gui")] use ::winit::{ application::ApplicationHandler, @@ -61,19 +46,20 @@ pub(crate) use tengri::{ window::{Window, WindowId}, platform::x11::EventLoopBuilderExtX11 }; - -#[cfg(test)] mod tek_test; - -mod tek_struct; -pub use self::tek_struct::*; - -mod tek_trait; -pub use self::tek_trait::*; - -mod tek_type; -pub use self::tek_type::*; - -mod tek_impls; +#[allow(unused)] pub(crate) use ::{ + std::{ + cmp::Ord, + collections::BTreeMap, + error::Error, + ffi::OsString, + fmt::{Write, Debug, Formatter}, + fs::File, + ops::{Add, Sub, Mul, Div, Rem}, + path::{Path, PathBuf}, + sync::{Arc, RwLock, atomic::{AtomicBool, AtomicUsize, Ordering::Relaxed}}, + thread::{spawn, JoinHandle}, + }, +}; pub(crate) use ConnectName::*; pub(crate) use ConnectScope::*; @@ -92,23 +78,23 @@ pub(crate) use JackState::*; /// let jack = tek::Jack::new(&"test_tek").expect("failed to connect to jack"); /// let proj = Default::default(); /// let conf = Default::default(); -/// let tek = tek::tek(&jack, proj, conf, ""); +/// let tek = tek::tek(&jack, proj, conf, "mode-doctest"); /// ``` pub fn tek ( jack: &Jack<'static>, project: Arrangement, config: Config, mode: impl AsRef ) -> App { + let mode: &str = mode.as_ref(); App { color: ItemTheme::random(), dialog: Dialog::welcome(), jack: jack.clone(), - mode: config.get_mode(mode).expect("failed to find mode"), + mode: config.get_mode(mode).expect(&format!("failed to find mode '{mode}'")), config, project, ..Default::default() } } - fn tek_confirm (state: &mut App) -> Perhaps { Ok(match &state.dialog { Dialog::Menu(index, items) => { @@ -202,6 +188,7 @@ fn collect_commands ( } Ok(commands) } + fn execute_commands ( app: &mut App, commands: Vec ) -> Usually)>> { @@ -213,6 +200,7 @@ fn execute_commands ( } Ok(history) } + pub fn tek_jack_process (app: &mut App, client: &Client, scope: &ProcessScope) -> Control { let t0 = app.perf.get_t0(); app.clock().update_from_scope(scope).unwrap(); @@ -236,6 +224,7 @@ pub fn tek_jack_process (app: &mut App, client: &Client, scope: &ProcessScope) - app.perf.update_from_jack_scope(t0, scope); result } + pub fn tek_jack_event (app: &mut App, event: JackEvent) { use JackEvent::*; match event { @@ -258,9 +247,11 @@ pub fn tek_jack_event (app: &mut App, event: JackEvent) { _ => { panic!("{event:?}"); } } } + pub fn tek_show_version () { println!("todo version"); } + pub fn tek_print_config (config: &Config) { use ::ansi_term::Color::*; println!("{:?}", config.dirs); @@ -313,6 +304,7 @@ pub fn tek_print_config (config: &Config) { println!(); } } + pub fn tek_print_status (project: &Arrangement) { println!("Name: {:?}", &project.name); println!("JACK: {:?}", &project.jack); @@ -432,94 +424,6 @@ pub fn note_pitch_to_name (n: usize) -> &'static str { NOTE_NAMES[n] } - -//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, - ///// Port handle. - //port: Port<$Spec>, - ///// List of ports to connect to. - //conn: Vec - //} - //impl AsRef> for $Name { - //fn as_ref (&self) -> &Port<$Spec> { &self.port } - //} - //impl $Name { - //pub fn new ($jack: &Jack, name: impl AsRef, connect: &[PortConnect]) - //-> Usually - //{ - //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 { &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 { - //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> for $Name { - //fn connect_to (&self, port: &Port) -> Usually { - //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 { - //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 - //} - //} - //}; -//} - - - - pub fn swap_value ( target: &mut T, value: &T, returned: impl Fn(T)->U ) -> Perhaps { @@ -1104,10 +1008,13 @@ mod size { def_sizes_iter!(TracksSizes => Track); } -pub(crate) use self::view::*; +pub use self::view::*; mod view { use crate::*; + /// ``` + /// let _ = tek::view_logo(); + /// ``` pub fn view_logo () -> impl Content { Fixed::XY(32, 7, Tui::bold(true, Tui::fg(Rgb(240,200,180), col!{ Fixed::Y(1, ""), @@ -1118,6 +1025,11 @@ mod view { }))) } + /// ``` + /// let x = std::sync::Arc::>::default(); + /// let _ = tek::view_transport(true, x.clone(), x.clone(), x.clone()); + /// let _ = tek::view_transport(false, x.clone(), x.clone(), x.clone()); + /// ``` pub fn view_transport ( play: bool, bpm: Arc>, @@ -1135,6 +1047,11 @@ mod view { ))) } + /// ``` + /// let x = std::sync::Arc::>::default(); + /// let _ = tek::view_status(None, x.clone(), x.clone(), x.clone()); + /// let _ = tek::view_status(Some("".into()), x.clone(), x.clone(), x.clone()); + /// ``` pub fn view_status ( sel: Option>, sr: Arc>, @@ -1152,6 +1069,9 @@ mod view { ))) } + /// ``` + /// let _ = tek::button_play_pause(true); + /// ``` pub fn button_play_pause (playing: bool) -> impl Content { let compact = true;//self.is_editing(); Tui::bg(if playing { Rgb(0, 128, 0) } else { Rgb(128, 64, 0) }, @@ -1178,12 +1098,21 @@ mod view { Bsp::e(Fixed::X(20, Fill::Y(Align::nw(button))), Fill::XY(Align::c(content)))) } - pub fn wrap (bg: Color, fg: Color, content: impl Content) -> impl Content { + /// ``` + /// let bg = tengri::ratatui::style::Color::Red; + /// let fg = tengri::ratatui::style::Color::Green; + /// let _ = tek::view_wrap(bg, fg, "and then blue, too!"); + /// ``` + pub fn view_wrap (bg: Color, fg: Color, content: impl Content) -> impl Content { let left = Tui::fg_bg(bg, Reset, Fixed::X(1, Repeat::Y("▐"))); let right = Tui::fg_bg(bg, Reset, Fixed::X(1, Repeat::Y("▌"))); Bsp::e(left, Bsp::w(right, Tui::fg_bg(fg, bg, content))) } + /// ``` + /// let _ = tek::view_meter("", 0.0); + /// let _ = tek::view_meters(&[0.0, 0.0]); + /// ``` pub fn view_meter <'a> (label: &'a str, value: f32) -> impl Content + 'a { col!( FieldH(ItemTheme::G[128], label, format!("{:>+9.3}", value)), @@ -1331,3 +1260,21 @@ mod view { Ok(label1.len() + label2.len() + 4) } } + +#[cfg(test)] mod test_view_meter { + use super::*; + use proptest::prelude::*; + proptest! { + #[test] fn proptest_view_meter ( + label in "\\PC*", value in f32::MIN..f32::MAX + ) { + let _ = view_meter(&label, value); + } + #[test] fn proptest_view_meters ( + value1 in f32::MIN..f32::MAX, + value2 in f32::MIN..f32::MAX + ) { + let _ = view_meters(&[value1, value2]); + } + } +} diff --git a/app/tek_impls.rs b/app/tek_impls.rs index ba12a595..98958611 100644 --- a/app/tek_impls.rs +++ b/app/tek_impls.rs @@ -894,8 +894,8 @@ impl Timebase { /// Specify sample rate, BPM and PPQ pub fn new ( s: impl Into, - b: impl Into, - p: impl Into + b: impl Into, + p: impl Into ) -> Self { Self { sr: s.into(), bpm: b.into(), ppq: p.into() } } @@ -1077,9 +1077,9 @@ impl_time_unit!(SampleCount); impl_time_unit!(SampleRate); impl_time_unit!(Microsecond); impl_time_unit!(Quantize); -impl_time_unit!(PulsesPerQuaver); +impl_time_unit!(Ppq); impl_time_unit!(Pulse); -impl_time_unit!(BeatsPerMinute); +impl_time_unit!(Bpm); impl_time_unit!(LaunchSync); /// Implement [Jack] constructor and methods @@ -1769,11 +1769,11 @@ impl Clock { &self.timebase.sr } /// Current tempo - pub fn bpm (&self) -> &BeatsPerMinute { + pub fn bpm (&self) -> &Bpm { &self.timebase.bpm } /// Current MIDI resolution - pub fn ppq (&self) -> &PulsesPerQuaver { + pub fn ppq (&self) -> &Ppq { &self.timebase.ppq } /// Next pulse that matches launch sync (for phrase switchover) @@ -3856,7 +3856,7 @@ fn sampler_jack_process ( /// Create [Voice]s from [Sample]s in response to MIDI input. fn sampler_midi_in ( - samples: &Samples<128>, voices: &Arc>>, RawMidi { time, bytes }: RawMidi + samples: &SampleKit<128>, voices: &Arc>>, RawMidi { time, bytes }: RawMidi ) { if let Ok(LiveEvent::Midi { message, .. }) = LiveEvent::parse(bytes) { match message { @@ -4438,7 +4438,7 @@ impl Track { } -impl Samples { +impl SampleKit { fn get (&self, index: usize) -> &Option>> { if index < self.0.len() { &self.0[index] @@ -4448,7 +4448,7 @@ impl Samples { } } -impl Default for Samples { +impl Default for SampleKit { fn default () -> Self { Self([const { None }; N]) } diff --git a/app/tek_struct.rs b/app/tek_struct.rs index 0f6e8c15..3c937fa6 100644 --- a/app/tek_struct.rs +++ b/app/tek_struct.rs @@ -105,7 +105,22 @@ pub struct JackNotify(pub T); /// Configuration: mode, view, and bind definitions. /// /// ``` -/// let conf = tek::Config::default(); +/// let config = tek::Config::default(); +/// ``` +/// +/// ``` +/// // Some dizzle. +/// // What indentation to use here lol? +/// let source = stringify!((mode :menu (name Menu) +/// (info Mode selector.) (keys :axis/y :confirm) +/// (view (bg (g 0) (bsp/s :ports/out +/// (bsp/n :ports/in +/// (bg (g 30) (bsp/s (fixed/y 7 :logo) +/// (fill :dialog/menu))))))))); +/// // Add this definition to the config and try to load it. +/// // A "mode" is basically a state machine +/// // with associated input and output definitions. +/// tek::Config::default().add(&source).unwrap().get_mode(":menu").unwrap(); /// ``` #[derive(Default, Debug)] pub struct Config { /// XDG base directories of running user. @@ -293,9 +308,9 @@ pub struct JackNotify(pub T); /// Audio samples per second pub sr: SampleRate, /// MIDI beats per minute - pub bpm: BeatsPerMinute, + pub bpm: Bpm, /// MIDI ticks per beat - pub ppq: PulsesPerQuaver, + pub ppq: Ppq, } /// Iterator that emits subsequent ticks within a range. @@ -387,7 +402,7 @@ pub struct JackNotify(pub T); /// ``` /// /// ``` -#[derive(Debug, Default)] pub struct PulsesPerQuaver (pub(crate) AtomicF64); +#[derive(Debug, Default)] pub struct Ppq (pub(crate) AtomicF64); /// Timestamp in MIDI pulses /// @@ -401,7 +416,7 @@ pub struct JackNotify(pub T); /// ``` /// /// ``` -#[derive(Debug, Default)] pub struct BeatsPerMinute (pub(crate) AtomicF64); +#[derive(Debug, Default)] pub struct Bpm (pub(crate) AtomicF64); /// Quantization setting for launching clips /// @@ -828,7 +843,7 @@ pub struct PoolView<'a>(pub &'a Pool); /// Recording buffer. pub buffer: Vec>, /// Samples mapped to MIDI notes. - pub samples: Samples<128>, + pub samples: SampleKit<128>, /// Samples that are not mapped to MIDI notes. pub unmapped: Vec>>, /// Sample currently being edited. @@ -861,14 +876,12 @@ pub struct PoolView<'a>(pub &'a Pool); /// Collection of samples, one per slot, fixed number of slots. /// -/// TODO: Map more than one sample per slot. -/// /// History: Separated to cleanly implement [Default]. /// /// ``` -/// let samples = tek::Samples([None, None, None, None]); +/// let samples = tek::SampleKit([None, None, None, None]); /// ``` -#[derive(Debug)] pub struct Samples( +#[derive(Debug)] pub struct SampleKit( pub [Option>>;N] ); diff --git a/app/tek_test.rs b/app/tek_test.rs deleted file mode 100644 index 4bd2b882..00000000 --- a/app/tek_test.rs +++ /dev/null @@ -1,62 +0,0 @@ -use crate::*; - -#[cfg(test)] #[test] fn test_menu () -> Usually<()> { - - // Some dizzle. - // What indentation to use here lol? - let source = stringify!((mode :menu - (name Menu) - (info Mode selector.) - (keys :axis/y :confirm) - (view (bg (g 0) (bsp/s - :ports/out - (bsp/n - :ports/in - (bg (g 30) (bsp/s - (fixed/y 7 :logo) - (fill :dialog/menu))))))))); - - // Load this definition into the config. - // A "mode" is basically a state machine - // with associated input and output definitions. - let mode = Config::new(None).add(&source)?.get_mode(":menu"); - - Ok(()) - -} - -#[cfg(test)] #[test] fn test_view_layout () { - let _ = button_play_pause(true); - let _ = button_2("", "", true); - let _ = button_2("", "", false); - let _ = button_3("", "", "", true); - let _ = button_3("", "", "", false); - //let _ = heading("", "", 0, "", true); - //let _ = heading("", "", 0, "", false); - let _ = wrap(Reset, Reset, ""); -} - -#[cfg(test)] mod test_view_meter { - use super::*; - use proptest::prelude::*; - #[test] fn test_view_meter () { - let _ = view_meter("", 0.0); - let _ = view_meters(&[0.0, 0.0]); - } - proptest! { - #[test] fn proptest_view_meter ( - label in "\\PC*", value in f32::MIN..f32::MAX - ) { - let _ = view_meter(&label, value); - } - #[test] fn proptest_view_meters ( - value1 in f32::MIN..f32::MAX, - value2 in f32::MIN..f32::MAX - ) { - let _ = view_meters(&[value1, value2]); - } - } -} - -#[cfg(test)] #[test] fn test_midi_edit () { -} diff --git a/app/tek_trait.rs b/app/tek_trait.rs index 6b21e441..c69b0325 100644 --- a/app/tek_trait.rs +++ b/app/tek_trait.rs @@ -849,19 +849,13 @@ pub trait TracksView: ScenesView + HasMidiIns + HasMidiOuts + HasTrackScroll + M } pub trait ScenesView: HasEditor + HasSelection + HasSceneScroll + HasClipsSize + Send + Sync { - /// Default scene height. const H_SCENE: usize = 2; - /// Default editor height. const H_EDITOR: usize = 15; - fn h_scenes (&self) -> u16; - fn w_side (&self) -> u16; - fn w_mid (&self) -> u16; - fn scenes_with_sizes (&self) -> impl ScenesSizes<'_> { let mut y = 0; self.scenes().iter().enumerate().skip(self.scene_scroll()).map_while(move|(s, scene)|{ @@ -930,32 +924,46 @@ pub trait RegisterPorts: HasJack<'static> { } pub trait JackPort: HasJack<'static> { + type Port: PortSpec + Default; + type Pair: PortSpec + Default; + fn new (jack: &Jack<'static>, name: &impl AsRef, connect: &[Connect]) -> Usually where Self: Sized; + fn register (jack: &Jack<'static>, name: &impl AsRef) -> Usually> { jack.with_client(|c|c.register_port::(name.as_ref(), Default::default())) .map_err(|e|e.into()) } + fn port_name (&self) -> &Arc; + fn connections (&self) -> &[Connect]; + fn port (&self) -> &Port; + fn port_mut (&mut self) -> &mut Port; + fn into_port (self) -> Port where Self: Sized; + fn close (self) -> Usually<()> where Self: Sized { let jack = self.jack().clone(); Ok(jack.with_client(|c|c.unregister_port(self.into_port()))?) } + fn ports (&self, re_name: Option<&str>, re_type: Option<&str>, flags: PortFlags) -> Vec { self.with_client(|c|c.ports(re_name, re_type, flags)) } + fn port_by_id (&self, id: u32) -> Option> { self.with_client(|c|c.port_by_id(id)) } + fn port_by_name (&self, name: impl AsRef) -> Option> { self.with_client(|c|c.port_by_name(name.as_ref())) } + fn connect_to_matching <'k> (&'k self) -> Usually<()> { for connect in self.connections().iter() { match &connect.name { @@ -970,6 +978,7 @@ pub trait JackPort: HasJack<'static> { } Ok(()) } + fn connect_exact <'k> (&'k self, name: &str) -> Usually, Arc, ConnectStatus)>> { @@ -990,6 +999,7 @@ pub trait JackPort: HasJack<'static> { Ok(status) }) } + fn connect_regexp <'k> ( &'k self, re: &str, scope: Option ) -> Usually, Arc, ConnectStatus)>> { @@ -1009,6 +1019,7 @@ pub trait JackPort: HasJack<'static> { Ok(status) }) } + /** Connect to a matching port by name. */ fn connect_to_name (&self, name: impl AsRef) -> Usually { self.with_client(|c|if let Some(ref port) = c.port_by_name(name.as_ref()) { @@ -1017,6 +1028,7 @@ pub trait JackPort: HasJack<'static> { Ok(Missing) }) } + /** Connect to a matching port by reference. */ fn connect_to_unowned (&self, port: &Port) -> Usually { self.with_client(|c|Ok(if let Ok(_) = c.connect_ports(self.port(), port) { @@ -1027,6 +1039,7 @@ pub trait JackPort: HasJack<'static> { Mismatch })) } + /** Connect to an owned matching port by reference. */ fn connect_to_owned (&self, port: &Port) -> Usually { self.with_client(|c|Ok(if let Ok(_) = c.connect_ports(self.port(), port) { @@ -1037,4 +1050,5 @@ pub trait JackPort: HasJack<'static> { Mismatch })) } + } diff --git a/tengri b/tengri index 5d61cc6c..c1011ddb 160000 --- a/tengri +++ b/tengri @@ -1 +1 @@ -Subproject commit 5d61cc6c5f975bacd20e1a90b9ad583b991f9204 +Subproject commit c1011ddb7f8061c5fe242b6eab62a66537ae671b