Skip to main content

Backend

Trait Backend 

Source
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§

Source

fn host_name(&self) -> &'static str

Program name reported in hello.

Source

fn formats(&self) -> Vec<String>

Source

fn probe(&mut self, path: &Path) -> HostResult<Vec<Descriptor>>

Source

fn load( &mut self, path: &Path, plugin_id: Option<&str>, ) -> HostResult<PluginInfo>

Source

fn get_params(&mut self) -> HostResult<Vec<ParamValue>>

Source

fn set_params(&mut self, params: &[ParamAssign]) -> HostResult<Vec<ParamValue>>

Source

fn list_presets(&mut self) -> HostResult<Vec<PresetInfo>>

Source

fn load_preset(&mut self, preset: &str) -> HostResult<Vec<ParamValue>>

Source

fn get_state(&mut self) -> HostResult<Vec<u8>>

Source

fn set_state(&mut self, state: &[u8]) -> HostResult<()>

Source

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.

Source

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.

Source

fn deactivate(&mut self)

Source

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".

Implementors§