pub struct ProcessorPlugin<P> { /* private fields */ }Expand description
Presents an audio-graph Processor as a PluginInstance.
This is the inverse adapter of HostedPluginProcessor: it pairs a bare
processor with a descriptor and a held PluginState, letting any
processor be hosted as a native (sim-format) plugin. State is stored on the
wrapper rather than pushed into the processor.
Implementations§
Source§impl<P> ProcessorPlugin<P>
impl<P> ProcessorPlugin<P>
Sourcepub fn new(descriptor: PluginDescriptor, processor: P) -> Self
pub fn new(descriptor: PluginDescriptor, processor: P) -> Self
Pairs a descriptor with a processor, starting from empty state.
Sourcepub fn processor_mut(&mut self) -> &mut P
pub fn processor_mut(&mut self) -> &mut P
Returns a mutable reference to the wrapped processor.
Sourcepub fn into_processor(self) -> P
pub fn into_processor(self) -> P
Consumes the wrapper and returns the wrapped processor.
Trait Implementations§
Source§impl<P: Clone> Clone for ProcessorPlugin<P>
impl<P: Clone> Clone for ProcessorPlugin<P>
Source§fn clone(&self) -> ProcessorPlugin<P>
fn clone(&self) -> ProcessorPlugin<P>
Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl<P: Debug> Debug for ProcessorPlugin<P>
impl<P: Debug> Debug for ProcessorPlugin<P>
Source§impl<P: Processor> PluginInstance for ProcessorPlugin<P>
impl<P: Processor> PluginInstance for ProcessorPlugin<P>
Source§fn descriptor(&self) -> &PluginDescriptor
fn descriptor(&self) -> &PluginDescriptor
Returns the descriptor that identifies this instance and its port and
parameter layout.
Source§fn state(&self) -> PluginState
fn state(&self) -> PluginState
Captures the instance’s current persistable state. Read more
Source§fn set_state(&mut self, state: PluginState)
fn set_state(&mut self, state: PluginState)
Restores the instance from a previously captured
PluginState. Read moreSource§fn prepare(&mut self, cfg: PrepareConfig)
fn prepare(&mut self, cfg: PrepareConfig)
Prepares the instance for processing under the given configuration.
Source§fn process(&mut self, block: &mut ProcessBlock<'_>)
fn process(&mut self, block: &mut ProcessBlock<'_>)
Processes one audio block in place.
Source§fn latency_frames(&self) -> u32
fn latency_frames(&self) -> u32
Returns the instance’s reported latency in frames. Read more
Auto Trait Implementations§
impl<P> Freeze for ProcessorPlugin<P>where
P: Freeze,
impl<P> RefUnwindSafe for ProcessorPlugin<P>where
P: RefUnwindSafe,
impl<P> Send for ProcessorPlugin<P>where
P: Send,
impl<P> Sync for ProcessorPlugin<P>where
P: Sync,
impl<P> Unpin for ProcessorPlugin<P>where
P: Unpin,
impl<P> UnsafeUnpin for ProcessorPlugin<P>where
P: UnsafeUnpin,
impl<P> UnwindSafe for ProcessorPlugin<P>where
P: UnwindSafe,
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