Struct Prepared Graph Output
pub struct PreparedGraphOutput { /* private fields */ }Expand description
Control-prepared f32 graph and worker scratch; new uses no input while with_input consumes an explicitly prepared input queue. Move this to an explicitly owned worker; start its non-Send session there and finish before returning it to main for graph/node retirement. No thread/device is created. Config requires matching input/output queue channels, zero aux buses, 0..1024 events per direction, 1..65536 frames, and producer-matching 1..64 channels. Scratch uses at most 32 MiB outside the graph’s own memory cap. Preparation consumes a fresh graph, preparing it once. Queue backpressure retains exact whole-frame suffixes without rerendering.
Implementations§
§impl PreparedGraphOutput
impl PreparedGraphOutput
pub fn new( graph: Box<Graph>, producer: AudioProducer, config: ProcessConfig, ) -> Result<Self, GraphOutputError>
pub fn with_input(
graph: Box<Graph>,
consumer: AudioConsumer,
producer: AudioProducer,
config: ProcessConfig,
) -> Result<Self, GraphOutputError>
pub fn with_input( graph: Box<Graph>, consumer: AudioConsumer, producer: AudioProducer, config: ProcessConfig, ) -> Result<Self, GraphOutputError>
Prepare queued f32 input and output with matching explicit graph/ring channels and rate policy. Input underflow fills zero; only fresh renders consume input, never retained output suffixes. No clocks/resampling/waits or devices are inferred. Combined worker scratch is capped at 32 MiB.
pub fn start_audio(
&mut self,
) -> Result<GraphOutputSession<'_>, GraphOutputError>
pub fn start_audio( &mut self, ) -> Result<GraphOutputSession<'_>, GraphOutputError>
Start this fixed graph on its explicit worker owner. Finish/drop before returning storage to main for graph/native retirement.
pub fn into_graph(self) -> Box<Graph>
pub fn into_graph(self) -> Box<Graph>
Consume stopped worker storage on control. The caller retires the graph and separately retained native main controls; queued samples remain owned by the consumer until drain/drop. No automatic queue discard is implied.