pub struct PluginHost { /* private fields */ }Expand description
One running host process with one plugin.
Implementations§
Source§impl PluginHost
impl PluginHost
Sourcepub fn spawn(
format: PluginFormat,
label: &str,
path: &Path,
watchdog: Duration,
) -> Result<PluginHost>
pub fn spawn( format: PluginFormat, label: &str, path: &Path, watchdog: Duration, ) -> Result<PluginHost>
Start a host for format; label and path name the plugin in errors.
pub fn label(&self) -> &str
pub fn set_label(&mut self, label: &str)
Sourcepub fn request(&mut self, req: &Request) -> Result<Reply>
pub fn request(&mut self, req: &Request) -> Result<Reply>
Send one request and wait (under the watchdog) for its reply.
pub fn probe(&mut self, path: &Path) -> Result<Vec<Descriptor>>
pub fn load(&mut self, plugin_id: Option<&str>) -> Result<PluginInfo>
pub fn set_params( &mut self, params: &[(String, String)], ) -> Result<Vec<ParamValue>>
pub fn get_params(&mut self) -> Result<Vec<ParamValue>>
pub fn load_preset(&mut self, preset: &str) -> Result<Vec<ParamValue>>
pub fn list_presets(&mut self) -> Result<Vec<PresetInfo>>
pub fn get_state(&mut self) -> Result<Vec<u8>>
pub fn set_state(&mut self, state: &[u8]) -> Result<()>
Sourcepub fn activate(
&mut self,
sample_rate: u32,
block_size: u32,
channels_in: u32,
channels_out: u32,
slots: u32,
) -> Result<Activated>
pub fn activate( &mut self, sample_rate: u32, block_size: u32, channels_in: u32, channels_out: u32, slots: u32, ) -> Result<Activated>
Create the shared-memory ring and activate the plugin.
Sourcepub fn run(
&mut self,
input: &[Vec<f32>],
total: usize,
events: &[(u64, Event)],
progress: &mut dyn FnMut(f64) -> Result<()>,
) -> Result<Vec<Vec<f32>>>
pub fn run( &mut self, input: &[Vec<f32>], total: usize, events: &[(u64, Event)], progress: &mut dyn FnMut(f64) -> Result<()>, ) -> Result<Vec<Vec<f32>>>
Stream total frames through the plugin. input (planar, may be shorter than
total — the rest is silence) must match the shared-memory input channel count.
events are (absolute frame, event) pairs; their time fields are rewritten.
progress is called after each block with the fraction done and may abort.
Trait Implementations§
Source§impl Drop for PluginHost
impl Drop for PluginHost
Auto Trait Implementations§
impl !Sync for PluginHost
impl Forget for PluginHost
impl Freeze for PluginHost
impl Move for PluginHost
impl RefUnwindSafe for PluginHost
impl Send for PluginHost
impl Unpin for PluginHost
impl UnsafeUnpin for PluginHost
impl UnwindSafe for PluginHost
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
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
Converts
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
Converts
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more