pub struct Patch<'run, 'node, M, S, const PORTS: usize, P: ?Sized = dyn Process<M, S> + 'node> { /* private fields */ }Expand description
A decoded schedule bound to the stateful objects it will render.
Implementations§
Source§impl<'run, M, S, const PORTS: usize, P: Process<M, S> + ?Sized> Patch<'run, '_, M, S, PORTS, P>
impl<'run, M, S, const PORTS: usize, P: Process<M, S> + ?Sized> Patch<'run, '_, M, S, PORTS, P>
Sourcepub fn replace<const OPS: usize>(
&mut self,
program: &'run Program<'_, OPS, PORTS>,
available_buses: usize,
) -> Result<(), Error>
pub fn replace<const OPS: usize>( &mut self, program: &'run Program<'_, OPS, PORTS>, available_buses: usize, ) -> Result<(), Error>
Switch schedules between blocks, retaining every object’s state.
§Errors
If the program needs more than available_buses or the object layouts
are incompatible, the current schedule remains active.
Sourcepub fn render<const FRAMES: usize>(
&mut self,
dsp: &mut impl Dsp<S>,
buffers: &mut [[S; FRAMES]],
events: &[&[Event<M>]],
emit: impl FnMut(u8, Event<M>) -> Result<(), Event<M>>,
) -> Result<(), Error>
pub fn render<const FRAMES: usize>( &mut self, dsp: &mut impl Dsp<S>, buffers: &mut [[S; FRAMES]], events: &[&[Event<M>]], emit: impl FnMut(u8, Event<M>) -> Result<(), Event<M>>, ) -> Result<(), Error>
Render one block into caller-owned mono buses. The host chooses which
bus to send to each physical output. events[i] belongs to object
i; omitted trailing lists are empty. The emit sink receives the
emitting object’s index and its unmodified local outlet event. The
host bounds the number of input events per block and the work in its
event sink to fit its audio deadline.
§Errors
Invalid events, events addressed to inactive objects, and insufficient buffers are rejected before processing any object or writing any output.