diff --git a/src/core.rs b/src/core.rs index d23f8834..faa9782a 100644 --- a/src/core.rs +++ b/src/core.rs @@ -71,6 +71,7 @@ pub use crate::{submod, pubmod, render, handle, process, phrase, keymap, ports}; // Reexport JACK proto-lib: pub use crate::jack::*; +/// Run the main loop. pub fn run (state: Arc>) -> Usually>> where T: Render + Handle + Send + Sync + Sized + 'static { diff --git a/src/jack.rs b/src/jack.rs index 135698ca..a964937a 100644 --- a/src/jack.rs +++ b/src/jack.rs @@ -4,7 +4,7 @@ use crate::core::*; submod!( device event factory ports ); -pub use ::_jack::{ +pub(crate) use ::_jack::{ AsyncClient, AudioIn, AudioOut, @@ -23,15 +23,14 @@ pub use ::_jack::{ PortFlags, PortId, PortSpec, - ProcessHandler, ProcessScope, RawMidi, Transport, TransportState, - TransportStatePosition, Unowned }; +/// Wraps [Client] or [DynamicAsyncClient] in place. pub enum JackClient { Inactive(Client), Active(DynamicAsyncClient), diff --git a/src/jack/device.rs b/src/jack/device.rs index 426b5616..59a60ed8 100644 --- a/src/jack/device.rs +++ b/src/jack/device.rs @@ -1,6 +1,8 @@ +//! Wrap JACK-enabled [Device]s. + use super::*; -/// A Device bound to a JACK client and a set of ports. +/// A [Device] bound to a JACK client and a set of ports. pub struct JackDevice { /// The active JACK client of this device. pub client: DynamicAsyncClient, diff --git a/src/jack/event.rs b/src/jack/event.rs index 2602aa79..00c5b976 100644 --- a/src/jack/event.rs +++ b/src/jack/event.rs @@ -1,9 +1,14 @@ +//! JACK event handling. + use super::*; +/// Notification handler used by the [Jack] factory +/// when constructing [JackDevice]s. pub type DynamicNotifications = Notifications>; #[derive(Debug)] +/// Event enum for JACK events in [AppEvent]. pub enum JackEvent { ThreadInit, Shutdown(ClientStatus, String), @@ -17,6 +22,7 @@ pub enum JackEvent { XRun, } +/// Generic notification handler that emits [AppEvent]::Jack([JackEvent])s. pub struct Notifications(pub T); impl NotificationHandler for Notifications { diff --git a/src/jack/factory.rs b/src/jack/factory.rs index 3c2d5ec5..3a66913f 100644 --- a/src/jack/factory.rs +++ b/src/jack/factory.rs @@ -1,3 +1,4 @@ +//! Encapsulate and run [Device]s as [JackDevice]s. use super::*; /// `JackDevice` factory. Creates JACK `Client`s, performs port registration diff --git a/src/jack/ports.rs b/src/jack/ports.rs index a9b122aa..7404d09d 100644 --- a/src/jack/ports.rs +++ b/src/jack/ports.rs @@ -1,6 +1,8 @@ +//! Handling JACK ports. use super::*; #[derive(Default)] +/// Collection of JACK ports as [AudioIn]/[AudioOut]/[MidiIn]/[MidiOut]. pub struct JackPorts { pub audio_ins: BTreeMap>, pub midi_ins: BTreeMap>, @@ -9,11 +11,12 @@ pub struct JackPorts { } #[derive(Default)] +/// Collection of JACK ports as [Unowned]. pub struct UnownedJackPorts { - pub audio_ins: BTreeMap>, - pub midi_ins: BTreeMap>, - pub audio_outs: BTreeMap>, - pub midi_outs: BTreeMap>, + pub audio_ins: BTreeMap>, + pub midi_ins: BTreeMap>, + pub audio_outs: BTreeMap>, + pub midi_outs: BTreeMap>, } impl JackPorts { diff --git a/src/model/transport.rs b/src/model/transport.rs index 2fa89ae8..3bc43182 100644 --- a/src/model/transport.rs +++ b/src/model/transport.rs @@ -21,7 +21,7 @@ impl TransportFocus { } } -/// Stored and displays time-related state. +/// Stores and displays time-related state. pub struct TransportToolbar { /// Enable metronome? pub metronome: bool,