pub struct SignalGraph<T: Transcendental, const BUF_SIZE: usize> {
pub buffers: BufferRegistry<T>,
/* private fields */
}Expand description
Immutable signal graph with static DAG topology.
Once built the graph cannot be modified. The graph owns no processing
logic — it is a pure topology description. Processing is driven by
port-level methods (pre_process, snapshot_feedback, propagate)
called from external code (e.g. a real-time signal callback or an
offline renderer).
Fields§
§buffers: BufferRegistry<T>Allocated buffer registry — named buffers shared between nodes.
Implementations§
Source§impl<T: Transcendental, const BUF_SIZE: usize> SignalGraph<T, BUF_SIZE>
impl<T: Transcendental, const BUF_SIZE: usize> SignalGraph<T, BUF_SIZE>
Sourcepub fn new(clock_source: Box<dyn ClockSource>) -> Self
pub fn new(clock_source: Box<dyn ClockSource>) -> Self
Create an empty graph with the given clock source.
Sourcepub fn with_sample_rate(sample_rate: f32) -> Self
pub fn with_sample_rate(sample_rate: f32) -> Self
Create an empty graph with a system clock at the given sample rate.
Sourcepub fn output_buffer(
&self,
node_idx: usize,
port_idx: usize,
) -> Option<&[T; BUF_SIZE]>
pub fn output_buffer( &self, node_idx: usize, port_idx: usize, ) -> Option<&[T; BUF_SIZE]>
Borrow an output port buffer (for inspection in tests).
Sourcepub fn current_tick(&self) -> ClockTick
pub fn current_tick(&self) -> ClockTick
Return the current clock tick.
Sourcepub fn node_count(&self) -> usize
pub fn node_count(&self) -> usize
Return the number of nodes in the graph.
Sourcepub fn topo_order(&self) -> &[usize]
pub fn topo_order(&self) -> &[usize]
Return the topological ordering of node indices.
Sourcepub fn resources(&self) -> &[GraphResource]
pub fn resources(&self) -> &[GraphResource]
Access the named resources (tape loops, etc.) allocated for this graph.
Sourcepub fn dispatch_set_parameters(&mut self, commands: &[SetParameter])
pub fn dispatch_set_parameters(&mut self, commands: &[SetParameter])
Dispatch SetParameter commands to their target nodes.
Each command is routed to the node identified by cmd.port.node_id()
via that node’s apply_set_parameter method.
Sourcepub fn into_parts(
self,
) -> (Vec<NodeVariant<T, BUF_SIZE>>, Vec<usize>, ClockTick)
pub fn into_parts( self, ) -> (Vec<NodeVariant<T, BUF_SIZE>>, Vec<usize>, ClockTick)
Consume the graph and return its parts for the SignalEngine.