mirror of
https://codeberg.org/unspeaker/tek.git
synced 2025-12-07 04:06:45 +01:00
more doc strings; limit jack reexport
This commit is contained in:
parent
f5ebc16067
commit
c85fa3cd06
7 changed files with 21 additions and 9 deletions
|
|
@ -71,6 +71,7 @@ pub use crate::{submod, pubmod, render, handle, process, phrase, keymap, ports};
|
||||||
// Reexport JACK proto-lib:
|
// Reexport JACK proto-lib:
|
||||||
pub use crate::jack::*;
|
pub use crate::jack::*;
|
||||||
|
|
||||||
|
/// Run the main loop.
|
||||||
pub fn run <T> (state: Arc<RwLock<T>>) -> Usually<Arc<RwLock<T>>>
|
pub fn run <T> (state: Arc<RwLock<T>>) -> Usually<Arc<RwLock<T>>>
|
||||||
where T: Render + Handle + Send + Sync + Sized + 'static
|
where T: Render + Handle + Send + Sync + Sized + 'static
|
||||||
{
|
{
|
||||||
|
|
|
||||||
|
|
@ -4,7 +4,7 @@ use crate::core::*;
|
||||||
|
|
||||||
submod!( device event factory ports );
|
submod!( device event factory ports );
|
||||||
|
|
||||||
pub use ::_jack::{
|
pub(crate) use ::_jack::{
|
||||||
AsyncClient,
|
AsyncClient,
|
||||||
AudioIn,
|
AudioIn,
|
||||||
AudioOut,
|
AudioOut,
|
||||||
|
|
@ -23,15 +23,14 @@ pub use ::_jack::{
|
||||||
PortFlags,
|
PortFlags,
|
||||||
PortId,
|
PortId,
|
||||||
PortSpec,
|
PortSpec,
|
||||||
ProcessHandler,
|
|
||||||
ProcessScope,
|
ProcessScope,
|
||||||
RawMidi,
|
RawMidi,
|
||||||
Transport,
|
Transport,
|
||||||
TransportState,
|
TransportState,
|
||||||
TransportStatePosition,
|
|
||||||
Unowned
|
Unowned
|
||||||
};
|
};
|
||||||
|
|
||||||
|
/// Wraps [Client] or [DynamicAsyncClient] in place.
|
||||||
pub enum JackClient {
|
pub enum JackClient {
|
||||||
Inactive(Client),
|
Inactive(Client),
|
||||||
Active(DynamicAsyncClient),
|
Active(DynamicAsyncClient),
|
||||||
|
|
|
||||||
|
|
@ -1,6 +1,8 @@
|
||||||
|
//! Wrap JACK-enabled [Device]s.
|
||||||
|
|
||||||
use super::*;
|
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 {
|
pub struct JackDevice {
|
||||||
/// The active JACK client of this device.
|
/// The active JACK client of this device.
|
||||||
pub client: DynamicAsyncClient,
|
pub client: DynamicAsyncClient,
|
||||||
|
|
|
||||||
|
|
@ -1,9 +1,14 @@
|
||||||
|
//! JACK event handling.
|
||||||
|
|
||||||
use super::*;
|
use super::*;
|
||||||
|
|
||||||
|
/// Notification handler used by the [Jack] factory
|
||||||
|
/// when constructing [JackDevice]s.
|
||||||
pub type DynamicNotifications =
|
pub type DynamicNotifications =
|
||||||
Notifications<Box<dyn Fn(AppEvent) + Send + Sync>>;
|
Notifications<Box<dyn Fn(AppEvent) + Send + Sync>>;
|
||||||
|
|
||||||
#[derive(Debug)]
|
#[derive(Debug)]
|
||||||
|
/// Event enum for JACK events in [AppEvent].
|
||||||
pub enum JackEvent {
|
pub enum JackEvent {
|
||||||
ThreadInit,
|
ThreadInit,
|
||||||
Shutdown(ClientStatus, String),
|
Shutdown(ClientStatus, String),
|
||||||
|
|
@ -17,6 +22,7 @@ pub enum JackEvent {
|
||||||
XRun,
|
XRun,
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/// Generic notification handler that emits [AppEvent]::Jack([JackEvent])s.
|
||||||
pub struct Notifications<T: Fn(AppEvent) + Send>(pub T);
|
pub struct Notifications<T: Fn(AppEvent) + Send>(pub T);
|
||||||
|
|
||||||
impl<T: Fn(AppEvent) + Send> NotificationHandler for Notifications<T> {
|
impl<T: Fn(AppEvent) + Send> NotificationHandler for Notifications<T> {
|
||||||
|
|
|
||||||
|
|
@ -1,3 +1,4 @@
|
||||||
|
//! Encapsulate and run [Device]s as [JackDevice]s.
|
||||||
use super::*;
|
use super::*;
|
||||||
|
|
||||||
/// `JackDevice` factory. Creates JACK `Client`s, performs port registration
|
/// `JackDevice` factory. Creates JACK `Client`s, performs port registration
|
||||||
|
|
|
||||||
|
|
@ -1,6 +1,8 @@
|
||||||
|
//! Handling JACK ports.
|
||||||
use super::*;
|
use super::*;
|
||||||
|
|
||||||
#[derive(Default)]
|
#[derive(Default)]
|
||||||
|
/// Collection of JACK ports as [AudioIn]/[AudioOut]/[MidiIn]/[MidiOut].
|
||||||
pub struct JackPorts {
|
pub struct JackPorts {
|
||||||
pub audio_ins: BTreeMap<String, Port<AudioIn>>,
|
pub audio_ins: BTreeMap<String, Port<AudioIn>>,
|
||||||
pub midi_ins: BTreeMap<String, Port<MidiIn>>,
|
pub midi_ins: BTreeMap<String, Port<MidiIn>>,
|
||||||
|
|
@ -9,11 +11,12 @@ pub struct JackPorts {
|
||||||
}
|
}
|
||||||
|
|
||||||
#[derive(Default)]
|
#[derive(Default)]
|
||||||
|
/// Collection of JACK ports as [Unowned].
|
||||||
pub struct UnownedJackPorts {
|
pub struct UnownedJackPorts {
|
||||||
pub audio_ins: BTreeMap<String, Port<::jack::Unowned>>,
|
pub audio_ins: BTreeMap<String, Port<Unowned>>,
|
||||||
pub midi_ins: BTreeMap<String, Port<::jack::Unowned>>,
|
pub midi_ins: BTreeMap<String, Port<Unowned>>,
|
||||||
pub audio_outs: BTreeMap<String, Port<::jack::Unowned>>,
|
pub audio_outs: BTreeMap<String, Port<Unowned>>,
|
||||||
pub midi_outs: BTreeMap<String, Port<::jack::Unowned>>,
|
pub midi_outs: BTreeMap<String, Port<Unowned>>,
|
||||||
}
|
}
|
||||||
|
|
||||||
impl JackPorts {
|
impl JackPorts {
|
||||||
|
|
|
||||||
|
|
@ -21,7 +21,7 @@ impl TransportFocus {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/// Stored and displays time-related state.
|
/// Stores and displays time-related state.
|
||||||
pub struct TransportToolbar {
|
pub struct TransportToolbar {
|
||||||
/// Enable metronome?
|
/// Enable metronome?
|
||||||
pub metronome: bool,
|
pub metronome: bool,
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue