Trait vst::plugin::PluginParameters
source · pub trait PluginParameters: Sync {
Show 15 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§
sourcefn change_preset(&self, preset: i32)
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.
sourcefn get_preset_num(&self) -> i32
fn get_preset_num(&self) -> i32
Get the current preset index.
sourcefn set_preset_name(&self, name: String)
fn set_preset_name(&self, name: String)
Set the current preset name.
sourcefn get_preset_name(&self, preset: i32) -> String
fn get_preset_name(&self, preset: i32) -> String
Get the name of the preset at the index specified by preset
.
sourcefn get_parameter_label(&self, index: i32) -> String
fn get_parameter_label(&self, index: i32) -> String
Get parameter label for parameter at index
(e.g. “db”, “sec”, “ms”, “%”).
sourcefn get_parameter_text(&self, index: i32) -> String
fn get_parameter_text(&self, index: i32) -> String
Get the parameter value for parameter at index
(e.g. “1.0”, “150”, “Plate”, “Off”).
sourcefn get_parameter_name(&self, index: i32) -> String
fn get_parameter_name(&self, index: i32) -> String
Get the name of parameter at index
.
sourcefn get_parameter(&self, index: i32) -> f32
fn get_parameter(&self, index: i32) -> f32
Get the value of parameter at index
. Should be value between 0.0 and 1.0.
sourcefn set_parameter(&self, index: i32, value: f32)
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.
sourcefn can_be_automated(&self, index: i32) -> bool
fn can_be_automated(&self, index: i32) -> bool
Return whether parameter at index
can be automated.
sourcefn string_to_parameter(&self, index: i32, text: String) -> bool
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.
sourcefn get_preset_data(&self) -> Vec<u8>
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.
sourcefn get_bank_data(&self) -> Vec<u8>
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.
sourcefn load_preset_data(&self, data: &[u8])
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.
sourcefn load_bank_data(&self, data: &[u8])
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.