pub struct AudioGraph { /* private fields */ }Expand description
The audio processing graph. Immutable once built — mutate via clone + swap.
Implementations§
Source§impl AudioGraph
impl AudioGraph
Sourcepub fn build(
nodes: Vec<Box<dyn AudioNode>>,
edges: Vec<Edge>,
max_frames: usize,
) -> Result<Self, GraphError>
pub fn build( nodes: Vec<Box<dyn AudioNode>>, edges: Vec<Edge>, max_frames: usize, ) -> Result<Self, GraphError>
Build a new graph from nodes and edges. Runs topological sort.
Returns Err if the graph contains a cycle that can’t be broken.
Sourcepub fn process(&mut self, frames: usize)
pub fn process(&mut self, frames: usize)
Process one block of audio through the entire graph.
REAL-TIME SAFE: no allocations, no locks, no I/O.
Caller must ensure frames <= max_frames.
Sourcepub fn output(&self, node_id: NodeId) -> Option<&[f64]>
pub fn output(&self, node_id: NodeId) -> Option<&[f64]>
Get the output buffer of a specific node (e.g., Master for final output).
Sourcepub fn eval_order(&self) -> &[NodeId]
pub fn eval_order(&self) -> &[NodeId]
List all node IDs in evaluation order.
Sourcepub fn node_count(&self) -> usize
pub fn node_count(&self) -> usize
Get the number of nodes.
Sourcepub fn edge_count(&self) -> usize
pub fn edge_count(&self) -> usize
Get the number of edges.
Auto Trait Implementations§
impl !RefUnwindSafe for AudioGraph
impl !UnwindSafe for AudioGraph
impl Freeze for AudioGraph
impl Send for AudioGraph
impl Sync for AudioGraph
impl Unpin for AudioGraph
impl UnsafeUnpin 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