pub trait Backend {
Show 14 methods
// Required methods
fn host_name(&self) -> &'static str;
fn formats(&self) -> Vec<String>;
fn probe(&mut self, path: &Path) -> HostResult<Vec<Descriptor>>;
fn load(
&mut self,
path: &Path,
plugin_id: Option<&str>,
) -> HostResult<PluginInfo>;
fn get_params(&mut self) -> HostResult<Vec<ParamValue>>;
fn set_params(
&mut self,
params: &[ParamAssign],
) -> HostResult<Vec<ParamValue>>;
fn list_presets(&mut self) -> HostResult<Vec<PresetInfo>>;
fn load_preset(&mut self, preset: &str) -> HostResult<Vec<ParamValue>>;
fn get_state(&mut self) -> HostResult<Vec<u8>>;
fn set_state(&mut self, state: &[u8]) -> HostResult<()>;
fn activate(
&mut self,
sample_rate: f64,
block_size: u32,
) -> HostResult<Activation>;
fn process(
&mut self,
inputs: &[&[f32]],
outputs: &mut [&mut [f32]],
frames: u32,
events: &[Event],
) -> HostResult<()>;
fn deactivate(&mut self);
fn main_channels(&self) -> (u32, u32);
}Expand description
One plugin format. Every method runs on the host’s single thread.
Required Methods§
fn formats(&self) -> Vec<String>
fn probe(&mut self, path: &Path) -> HostResult<Vec<Descriptor>>
fn load( &mut self, path: &Path, plugin_id: Option<&str>, ) -> HostResult<PluginInfo>
fn get_params(&mut self) -> HostResult<Vec<ParamValue>>
fn set_params(&mut self, params: &[ParamAssign]) -> HostResult<Vec<ParamValue>>
fn list_presets(&mut self) -> HostResult<Vec<PresetInfo>>
fn load_preset(&mut self, preset: &str) -> HostResult<Vec<ParamValue>>
fn get_state(&mut self) -> HostResult<Vec<u8>>
fn set_state(&mut self, state: &[u8]) -> HostResult<()>
Sourcefn activate(
&mut self,
sample_rate: f64,
block_size: u32,
) -> HostResult<Activation>
fn activate( &mut self, sample_rate: f64, block_size: u32, ) -> HostResult<Activation>
Activate and start processing. The main ports’ channel counts come from
PluginInfo::main_in_channels/PluginInfo::main_out_channels.
Sourcefn process(
&mut self,
inputs: &[&[f32]],
outputs: &mut [&mut [f32]],
frames: u32,
events: &[Event],
) -> HostResult<()>
fn process( &mut self, inputs: &[&[f32]], outputs: &mut [&mut [f32]], frames: u32, events: &[Event], ) -> HostResult<()>
Process one block from the main input channels into the main output channels.
fn deactivate(&mut self)
Sourcefn main_channels(&self) -> (u32, u32)
fn main_channels(&self) -> (u32, u32)
Main channel counts, valid after load.
Dyn Compatibility§
This trait is dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety".