Trait Params

Source
pub trait Params<P: Plugin> {
    // Required methods
    fn count(plugin: &P) -> u32;
    fn get_info(plugin: &P, param_index: u32) -> Option<ParamInfo>;
    fn get_value(plugin: &P, param_id: ClapId) -> Option<f64>;
    fn value_to_text(
        plugin: &P,
        param_id: ClapId,
        value: f64,
        out_buf: &mut [u8],
    ) -> Result<(), Error>;
    fn text_to_value(
        plugin: &P,
        param_id: ClapId,
        param_value_text: &str,
    ) -> Result<f64, Error>;
    fn flush_inactive(
        plugin: &P,
        in_events: &InputEvents<'_>,
        out_events: &OutputEvents<'_>,
    );
    fn flush(
        audio_thread: &P::AudioThread,
        in_events: &InputEvents<'_>,
        out_events: &OutputEvents<'_>,
    );
}

Required Methods§

Source

fn count(plugin: &P) -> u32

Source

fn get_info(plugin: &P, param_index: u32) -> Option<ParamInfo>

Source

fn get_value(plugin: &P, param_id: ClapId) -> Option<f64>

Source

fn value_to_text( plugin: &P, param_id: ClapId, value: f64, out_buf: &mut [u8], ) -> Result<(), Error>

Fills out_buffer with a null-terminated UTF-8 string that represents the parameter at the given ‘value’ argument. eg: “2.3 kHz”. The host should always use this to format parameter values before displaying it to the user.

Source

fn text_to_value( plugin: &P, param_id: ClapId, param_value_text: &str, ) -> Result<f64, Error>

Converts the null-terminated UTF-8 param_value_text into a double and writes it to out_value. The host can use this to convert user input into a parameter value.

Source

fn flush_inactive( plugin: &P, in_events: &InputEvents<'_>, out_events: &OutputEvents<'_>, )

Flushes a set of parameter changes. This method must not be called concurrently to clap_plugin->process().

Note: if the plugin is processing, then the process() call will already achieve the parameter update (bidirectional), so a call to flush isn’t required, also be aware that the plugin may use the sample offset in process(), while this information would be lost within flush().

Source

fn flush( audio_thread: &P::AudioThread, in_events: &InputEvents<'_>, out_events: &OutputEvents<'_>, )

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.

Implementations on Foreign Types§

Source§

impl<P: Plugin> Params<P> for ()

Implementors§