Skip to main content

AudioRouting

Struct AudioRouting 

Source
pub struct AudioRouting {
    pub order: Vec<AudioNode>,
    pub edges: Vec<AudioEdge>,
}
Expand description

A project’s audio routing: every edge, and an order in which each node comes after the nodes that feed or key it.

Fields§

§order: Vec<AudioNode>

Every track and bus, each after the nodes that feed or key it; among those ready, tracks in timeline order before buses in document order.

§edges: Vec<AudioEdge>

Every edge, grouped by the node that reads it (tracks in timeline order, buses in document order, then the master). In one group the edges a sum adds come first, in the order it adds them: from tracks in timeline order, then from buses in document order; for one source, its output before its sends in their order. Keys follow by effect position.

Implementations§

Source§

impl AudioRouting

Source

pub fn alignment( &self, chain_latency: impl Fn(Option<AudioNode>, usize) -> u64, ) -> AudioAlignment

Aligns every path to the output, given the delay of each effect chain: chain_latency of the chain of a track or bus, or of the master for None, from the effect at the given position to its end.

A consumer reads an edge ahead of the output by its own lead (none for the master) plus the latency of its chain from where the edge enters it: the start for an output or a send, the keyed effect for a key. A node’s lead is the largest such need among its edges, so its longest path is read directly and each shorter one waits for the difference.

Source

pub fn liveness(&self, project: &Project) -> AudioLiveness

Which edges of project, whose routing this is, carry signal, and which nodes are mixed.

A muted track or bus feeds and keys nothing. With nothing soloed every other output and send is live. Otherwise one is live when its source is soloed or fed by a soloed node, or its consumer is soloed or feeds one; the master is neither, so it hears a node only through the first rule. An output or send into a bus that reaches the master over no live edge is not live either.

Solo does not silence a key: a key is live when its source is unmuted and the keyed effect runs, and a node mixed only to form a key takes every unmuted input. A bus that is both heard under a solo and a key carries what the solo leaves it.

Source

pub fn liveness_tapped( &self, project: &Project, tapped: &[AudioNode], ) -> AudioLiveness

Self::liveness when a host also reads the signal of each node in tapped: an unmuted tapped node is mixed whatever is soloed, taking every unmuted input as a node that forms a key does.

Trait Implementations§

Source§

impl Clone for AudioRouting

Source§

fn clone(&self) -> Self

Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl Debug for AudioRouting

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl Eq for AudioRouting

Source§

impl PartialEq for AudioRouting

Source§

fn eq(&self, other: &Self) -> bool

Equality operator ==. Read more
1.0.0 (const: unstable) · Source§

fn ne(&self, other: &Rhs) -> bool

Inequality operator !=. Read more
Source§

impl StructuralPartialEq for AudioRouting

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = !

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, !>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.