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§
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>
Sourcefn value_to_text(
plugin: &P,
param_id: ClapId,
value: f64,
out_buf: &mut [u8],
) -> Result<(), Error>
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.
Sourcefn text_to_value(
plugin: &P,
param_id: ClapId,
param_value_text: &str,
) -> Result<f64, Error>
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.
Sourcefn flush_inactive(
plugin: &P,
in_events: &InputEvents<'_>,
out_events: &OutputEvents<'_>,
)
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().
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.