pub struct GuiContext { /* private fields */ }Expand description
Callbacks the plugin can make when the user interacts with its GUI such as updating parameter
values. This is passed to the plugin during Editor::spawn().
All of these functions assume they’re being called from the main GUI thread.
Implementations§
Source§impl GuiContext
impl GuiContext
pub fn new(inner: Arc<dyn GuiContextInner>) -> Self
Sourcepub fn plugin_api(&self) -> PluginApi
pub fn plugin_api(&self) -> PluginApi
Get the current plugin API. This may be useful to display in the plugin’s GUI as part of an about screen.
pub fn param_setter<'a>(&'a self) -> ParamSetter<'a>
Sourcepub unsafe fn raw_begin_set_parameter(&self, param: ParamPtr)
pub unsafe fn raw_begin_set_parameter(&self, param: ParamPtr)
Inform the host a parameter will be automated. Create a ParamSetter and use
ParamSetter::begin_set_parameter() instead for a safe, user friendly API.
§Safety
The implementing function still needs to check if param actually exists. This function is
mostly marked as unsafe for API reasons.
Sourcepub unsafe fn raw_set_parameter_normalized(
&self,
param: ParamPtr,
normalized: f32,
)
pub unsafe fn raw_set_parameter_normalized( &self, param: ParamPtr, normalized: f32, )
Inform the host a parameter is being automated with an already normalized value. Create a
ParamSetter and use ParamSetter::set_parameter() instead for a safe, user friendly
API.
§Safety
The implementing function still needs to check if param actually exists. This function is
mostly marked as unsafe for API reasons.
Sourcepub unsafe fn raw_end_set_parameter(&self, param: ParamPtr)
pub unsafe fn raw_end_set_parameter(&self, param: ParamPtr)
Inform the host a parameter has been automated. Create a ParamSetter and use
ParamSetter::end_set_parameter() instead for a safe, user friendly API.
§Safety
The implementing function still needs to check if param actually exists. This function is
mostly marked as unsafe for API reasons.
Sourcepub fn get_state(&self) -> PluginState
pub fn get_state(&self) -> PluginState
Serialize the plugin’s current state to a serde-serializable object. Useful for implementing preset handling within a plugin’s GUI.
Sourcepub fn set_state(&self, state: PluginState)
pub fn set_state(&self, state: PluginState)
Restore the state from a previously serialized state object. This will block the GUI thread until the state has been restored and a parameter value rescan has been requested from the host. If the plugin is currently processing audio, then the parameter values will be restored at the end of the current processing cycle.
Trait Implementations§
Source§impl Clone for GuiContext
impl Clone for GuiContext
Source§fn clone(&self) -> GuiContext
fn clone(&self) -> GuiContext
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read more