[][src]Function dasp_graph::process

pub fn process<G, T>(
    processor: &mut Processor<G>,
    graph: &mut G,
    node: G::NodeId
) where
    G: Data<NodeWeight = NodeData<T>> + DataMapMut + Visitable,
    &'a G: GraphBase<NodeId = G::NodeId> + IntoNeighborsDirected,
    T: Node

Process audio through the subgraph ending at the node with the given ID.

Specifically, this traverses nodes in depth-first-search post order where the edges of the graph are reversed. This is equivalent to the topological order of all nodes that are connected to the inputs of the given node. This ensures that all inputs of each node are visited before the node itself.

The Node::process method is called on each node as they are visited in the traversal.

Upon returning, the buffers of each visited node will contain the audio processed by their respective nodes.

Supports all graphs that implement the necessary petgraph traits and whose nodes are of type NodeData<T> where T implements the Node trait.

Panics if there is no node for the given index.