Struct Clap Main
pub struct ClapMain<'a> { /* private fields */ }Expand description
Main-thread side of one plug-in instance.
Trait Implementations§
§fn activate(
host: HostAudioProcessorHandle<'a>,
main: &ClapMain<'a>,
shared: &'a ClapShared,
config: PluginAudioConfiguration,
) -> Result<Self, PluginError>
fn activate( host: HostAudioProcessorHandle<'a>, main: &ClapMain<'a>, shared: &'a ClapShared, config: PluginAudioConfiguration, ) -> Result<Self, PluginError>
Creates and activates the audio processor. Read more
§fn process(
&mut self,
process: Process<'_>,
audio: Audio<'_>,
events: Events<'_>,
) -> Result<ProcessStatus, PluginError>
fn process( &mut self, process: Process<'_>, audio: Audio<'_>, events: Events<'_>, ) -> Result<ProcessStatus, PluginError>
Processes a chunk of audio samples and events. Read more
§fn reset(&mut self)
fn reset(&mut self)
Resets the plugin’s audio processing state. Read more
§fn start_processing(&mut self) -> Result<(), PluginError>
fn start_processing(&mut self) -> Result<(), PluginError>
Starts the plugin’s continuous audio processing. Read more
§fn stop_processing(&mut self)
fn stop_processing(&mut self)
Stops the plugin’s continuous audio processing, indicating it is being sent to sleep. Read more
§impl PluginGuiImpl for ClapMain<'_>
impl PluginGuiImpl for ClapMain<'_>
§fn is_api_supported(&self, configuration: GuiConfiguration<'_>) -> bool
fn is_api_supported(&self, configuration: GuiConfiguration<'_>) -> bool
Indicate whether a particular API is supported.
§fn get_preferred_api(&self) -> Option<GuiConfiguration<'_>>
fn get_preferred_api(&self) -> Option<GuiConfiguration<'_>>
Provide a hint to the host if the plugin prefers to use an API (and/or float state). Read more
§fn create(&self, configuration: GuiConfiguration<'_>) -> Result<(), PluginError>
fn create(&self, configuration: GuiConfiguration<'_>) -> Result<(), PluginError>
Create and allocate all resources needed for the GUI Read more
§fn destroy(&self)
fn destroy(&self)
Free all resources associated with the GUI
§fn set_scale(&self, scale: f64) -> Result<(), PluginError>
fn set_scale(&self, scale: f64) -> Result<(), PluginError>
Set absolute scaling factor for GUI Read more
§fn adjust_size(&self, size: GuiSize) -> Option<GuiSize>
fn adjust_size(&self, size: GuiSize) -> Option<GuiSize>
Calculate the closest possible size for the GUI Read more
§fn set_parent(&self, window: Window<'_, '_>) -> Result<(), PluginError>
fn set_parent(&self, window: Window<'_, '_>) -> Result<(), PluginError>
Embed UI into the given parent window
§fn on_main_thread(&self)
fn on_main_thread(&self)
This is called by the host on the main thread, in response to a previous call to
HostSharedHandle::request_callback. Read more§impl PluginMainThreadParams for ClapMain<'_>
impl PluginMainThreadParams for ClapMain<'_>
§fn get_info(&self, index: u32, writer: &mut ParamInfoWriter<'_>)
fn get_info(&self, index: u32, writer: &mut ParamInfoWriter<'_>)
Gets the metadata for a parameter by its index. Read more
§fn get_value(&self, id: ClapId) -> Option<f64>
fn get_value(&self, id: ClapId) -> Option<f64>
Gets the current value of a parameter by its ID. Read more
§fn value_to_text(
&self,
id: ClapId,
value: f64,
writer: &mut ParamDisplayWriter<'_>,
) -> Result
fn value_to_text( &self, id: ClapId, value: f64, writer: &mut ParamDisplayWriter<'_>, ) -> Result
Converts a parameter’s plain value to a human-readable string. Read more
§fn text_to_value(&self, id: ClapId, text: &CStr) -> Option<f64>
fn text_to_value(&self, id: ClapId, text: &CStr) -> Option<f64>
Converts a human-readable string back to a parameter’s plain value. Read more
§fn flush(&self, input: &InputEvents<'_>, output: &mut OutputEvents<'_>)
fn flush(&self, input: &InputEvents<'_>, output: &mut OutputEvents<'_>)
Flushes pending parameter changes between the host and plugin. Read more