pub trait PluginParameters: Sync {
Show 15 methods // Provided methods fn change_preset(&self, preset: i32) { ... } fn get_preset_num(&self) -> i32 { ... } fn set_preset_name(&self, name: String) { ... } fn get_preset_name(&self, preset: i32) -> String { ... } fn get_parameter_label(&self, index: i32) -> String { ... } fn get_parameter_text(&self, index: i32) -> String { ... } fn get_parameter_name(&self, index: i32) -> String { ... } fn get_parameter(&self, index: i32) -> f32 { ... } fn set_parameter(&self, index: i32, value: f32) { ... } fn can_be_automated(&self, index: i32) -> bool { ... } fn string_to_parameter(&self, index: i32, text: String) -> bool { ... } fn get_preset_data(&self) -> Vec<u8> { ... } fn get_bank_data(&self) -> Vec<u8> { ... } fn load_preset_data(&self, data: &[u8]) { ... } fn load_bank_data(&self, data: &[u8]) { ... }
}
Expand description

Parameter object shared between the UI and processing threads. Since access is shared, all methods take self by immutable reference. All mutation must thus be performed using thread-safe interior mutability.

Provided Methods§

source

fn change_preset(&self, preset: i32)

Set the current preset to the index specified by preset.

This method can be called on the processing thread for automation.

source

fn get_preset_num(&self) -> i32

Get the current preset index.

source

fn set_preset_name(&self, name: String)

Set the current preset name.

source

fn get_preset_name(&self, preset: i32) -> String

Get the name of the preset at the index specified by preset.

source

fn get_parameter_label(&self, index: i32) -> String

Get parameter label for parameter at index (e.g. “db”, “sec”, “ms”, “%”).

source

fn get_parameter_text(&self, index: i32) -> String

Get the parameter value for parameter at index (e.g. “1.0”, “150”, “Plate”, “Off”).

source

fn get_parameter_name(&self, index: i32) -> String

Get the name of parameter at index.

source

fn get_parameter(&self, index: i32) -> f32

Get the value of paramater at index. Should be value between 0.0 and 1.0.

source

fn set_parameter(&self, index: i32, value: f32)

Set the value of parameter at index. value is between 0.0 and 1.0.

This method can be called on the processing thread for automation.

source

fn can_be_automated(&self, index: i32) -> bool

Return whether parameter at index can be automated.

source

fn string_to_parameter(&self, index: i32, text: String) -> bool

Use String as input for parameter value. Used by host to provide an editable field to adjust a parameter value. E.g. “100” may be interpreted as 100hz for parameter. Returns if the input string was used.

source

fn get_preset_data(&self) -> Vec<u8>

If preset_chunks is set to true in plugin info, this should return the raw chunk data for the current preset.

source

fn get_bank_data(&self) -> Vec<u8>

If preset_chunks is set to true in plugin info, this should return the raw chunk data for the current plugin bank.

source

fn load_preset_data(&self, data: &[u8])

If preset_chunks is set to true in plugin info, this should load a preset from the given chunk data.

source

fn load_bank_data(&self, data: &[u8])

If preset_chunks is set to true in plugin info, this should load a preset bank from the given chunk data.

Implementors§