pub struct Engine<G: DspGraph> { /* private fields */ }Expand description
Generic DSP engine that owns a Runtime and a mounted graph.
Implementations§
Source§impl<G: DspGraph> Engine<G>
impl<G: DspGraph> Engine<G>
Sourcepub fn new(
sample_rate: f64,
buffer_size: usize,
params: &G::Params,
) -> Result<Self, String>
pub fn new( sample_rate: f64, buffer_size: usize, params: &G::Params, ) -> Result<Self, String>
Create the engine, build and mount the graph, apply it to the runtime.
Sourcepub fn set_params(&mut self, params: &G::Params)
pub fn set_params(&mut self, params: &G::Params)
Update parameters. Rebuilds the graph declaratively, diffs keyed consts and native node props against the previous build, and emits minimal instruction batches for any changes.
Sourcepub fn process(
&self,
num_samples: usize,
inputs: &[&[f64]],
outputs: &mut [&mut [f64]],
) -> Result<()>
pub fn process( &self, num_samples: usize, inputs: &[&[f64]], outputs: &mut [&mut [f64]], ) -> Result<()>
Process a block of audio.
Sourcepub fn mounted(&self) -> &MountedGraph
pub fn mounted(&self) -> &MountedGraph
Returns a reference to the mounted graph.
Auto Trait Implementations§
impl<G> !Freeze for Engine<G>
impl<G> !RefUnwindSafe for Engine<G>
impl<G> Send for Engine<G>
impl<G> !Sync for Engine<G>
impl<G> Unpin for Engine<G>
impl<G> !UnwindSafe for Engine<G>
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