pub struct AudioGraph {
pub nodes: HashMap<String, AudioNode>,
pub routes: Vec<AudioRoute>,
pub master: String,
}Expand description
Audio Graph: collection of nodes and routes
Fields§
§nodes: HashMap<String, AudioNode>All nodes by ID
routes: Vec<AudioRoute>All routes (connections)
master: StringMaster output node ID (always present)
Implementations§
Source§impl AudioGraph
impl AudioGraph
Sourcepub fn add_route(&mut self, route: AudioRoute) -> Result<()>
pub fn add_route(&mut self, route: AudioRoute) -> Result<()>
Add route to graph (validates source and destination exist)
Sourcepub fn upsert_bus(
&mut self,
id: impl Into<String>,
alias: Option<String>,
effects: Option<Value>,
) -> Result<()>
pub fn upsert_bus( &mut self, id: impl Into<String>, alias: Option<String>, effects: Option<Value>, ) -> Result<()>
Add or update a bus node. This is used for routing declarations, where repeated declarations may add effects to an existing bus.
Sourcepub fn from_routing_setup(routing_setup: &RoutingSetup) -> Self
pub fn from_routing_setup(routing_setup: &RoutingSetup) -> Self
Build the canonical graph from the interpreter routing setup.
Sourcepub fn get_node_mut(&mut self, id: &str) -> Option<&mut AudioNode>
pub fn get_node_mut(&mut self, id: &str) -> Option<&mut AudioNode>
Get mutable node by ID
Sourcepub fn get_routes_from(&self, node_id: &str) -> Vec<&AudioRoute>
pub fn get_routes_from(&self, node_id: &str) -> Vec<&AudioRoute>
Get all routes from a node
Sourcepub fn get_routes_to(&self, node_id: &str) -> Vec<&AudioRoute>
pub fn get_routes_to(&self, node_id: &str) -> Vec<&AudioRoute>
Get all routes to a node
Sourcepub fn node_count(&self) -> usize
pub fn node_count(&self) -> usize
Count total nodes
Sourcepub fn route_count(&self) -> usize
pub fn route_count(&self) -> usize
Count total routes
Sourcepub fn node_names(&self) -> Vec<String>
pub fn node_names(&self) -> Vec<String>
Get all node names.
Trait Implementations§
Source§impl Clone for AudioGraph
impl Clone for AudioGraph
Source§impl Debug for AudioGraph
impl Debug for AudioGraph
Auto Trait Implementations§
impl Freeze for AudioGraph
impl RefUnwindSafe for AudioGraph
impl Send for AudioGraph
impl Sync for AudioGraph
impl Unpin for AudioGraph
impl UnsafeUnpin for AudioGraph
impl UnwindSafe for AudioGraph
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
impl<S, T> Duplex<S> for Twhere
T: FromSample<S> + ToSample<S>,
impl<T> ErasedDestructor for Twhere
T: 'static,
Source§impl<S> FromSample<S> for S
impl<S> FromSample<S> for S
fn from_sample_(s: S) -> S
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
Source§fn in_current_span(self) -> Instrumented<Self> ⓘ
fn in_current_span(self) -> Instrumented<Self> ⓘ
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
Converts
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
Converts
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more