pub struct RealtimePluginRunner { /* private fields */ }Expand description
Implementations§
Source§impl RealtimePluginRunner
impl RealtimePluginRunner
Sourcepub fn new(plugin: Plugin, command_capacity: usize) -> (Self, RtControl)
pub fn new(plugin: Plugin, command_capacity: usize) -> (Self, RtControl)
Build a runner that owns plugin, plus the RtControl handle to drive it.
command_capacity is the maximum number of MIDI/parameter commands that can be
queued between two process calls; pushes beyond it are dropped
(reported by the RtControl methods returning false). Size it for your block rate
and worst-case control burst (e.g. 1024).
Sourcepub fn process(&mut self, buffers: &mut AudioBuffers) -> Result<()>
pub fn process(&mut self, buffers: &mut AudioBuffers) -> Result<()>
Drain all queued control commands and render one block.
Call this from the audio thread (e.g. inside your device callback). It performs only the lock-free queue drain plus the plugin’s own processing — it never blocks on a lock a control thread could hold.
Sourcepub fn plugin(&self) -> &Plugin
pub fn plugin(&self) -> &Plugin
Borrow the underlying plugin (e.g. to read parameters or info). Do not call this from the audio thread while another thread might also touch the plugin.
Sourcepub fn into_plugin(self) -> Plugin
pub fn into_plugin(self) -> Plugin
Recover the owned plugin, consuming the runner.