Trait Plugin

Source
pub trait Plugin: Default + Extensions<Self> {
    type AudioThread: AudioThread<Self>;

    const ID: &'static str;
    const NAME: &'static str;
    const VENDOR: &'static str = "";
    const URL: &'static str = "";
    const MANUAL_URL: &'static str = "";
    const SUPPORT_URL: &'static str = "";
    const VERSION: &'static str = "";
    const DESCRIPTION: &'static str = "";

    // Required method
    fn activate(
        &mut self,
        sample_rate: f64,
        min_frames: u32,
        max_frames: u32,
    ) -> Result<Self::AudioThread, Error>;

    // Provided methods
    fn features() -> impl Iterator<Item = &'static str> { ... }
    fn init(&mut self, host: Arc<Host>) -> Result<(), Error> { ... }
    fn on_main_thread(&mut self) { ... }
}

Required Associated Constants§

Source

const ID: &'static str

Source

const NAME: &'static str

Provided Associated Constants§

Source

const VENDOR: &'static str = ""

Source

const URL: &'static str = ""

Source

const MANUAL_URL: &'static str = ""

Source

const SUPPORT_URL: &'static str = ""

Source

const VERSION: &'static str = ""

Source

const DESCRIPTION: &'static str = ""

Required Associated Types§

Required Methods§

Source

fn activate( &mut self, sample_rate: f64, min_frames: u32, max_frames: u32, ) -> Result<Self::AudioThread, Error>

Provided Methods§

Source

fn features() -> impl Iterator<Item = &'static str>

Plugin features as an arbitrary list of keywords.

They can be matched by the host indexer and used to classify the plugin. For some standard features, see module: plugin_features.

The default implementation returns an empty iterator.

§Example
fn features() -> impl Iterator<Item = &'static str> {
    "instrument stereo sampler".split_whitespace()
}
Source

fn init(&mut self, host: Arc<Host>) -> Result<(), Error>

Source

fn on_main_thread(&mut self)

Dyn Compatibility§

This trait is not dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety", so this trait is not object safe.

Implementors§