AUDIO
Source snapshot · 11 November 2026

API reference / ravet_plugin::clap::ClapMain

Struct ClapMain 

pub struct ClapMain<'a> { /* private fields */ }
Expand description

Main-thread side of one plug-in instance.

Trait Implementations§

§

impl PluginAudioPortsImpl for ClapMain<'_>

§

fn count(&self, input: bool) -> u32

Returns the number of audio ports for the given direction. Read more
§

fn get(&self, index: u32, input: bool, writer: &mut AudioPortInfoWriter<'_>)

Populates metadata about the audio port at index. Read more
§

impl<'a, P: PluginExport> PluginAudioProcessor<'a, ClapShared, ClapMain<'a>> for ClapAudio<'a, P>

§

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>

Processes a chunk of audio samples and events. Read more
§

fn reset(&mut self)

Resets the plugin’s audio processing state. Read more
§

fn deactivate(self, _: &ClapMain<'a>)

Deactivates the audio processor. Read more
§

fn start_processing(&mut self) -> Result<(), PluginError>

Starts the plugin’s continuous audio processing. Read more
§

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<'_>

§

fn is_api_supported(&self, configuration: GuiConfiguration<'_>) -> bool

Indicate whether a particular API is supported.
§

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>

Create and allocate all resources needed for the GUI Read more
§

fn destroy(&self)

Free all resources associated with the GUI
§

fn set_scale(&self, scale: f64) -> Result<(), PluginError>

Set absolute scaling factor for GUI Read more
§

fn get_size(&self) -> Option<GuiSize>

Get current size of GUI
§

fn can_resize(&self) -> bool

Tell host if GUI can be resized Read more
§

fn get_resize_hints(&self) -> Option<GuiResizeHints>

Provide hints on the resize-ability of the GUI
§

fn adjust_size(&self, size: GuiSize) -> Option<GuiSize>

Calculate the closest possible size for the GUI Read more
§

fn set_size(&self, size: GuiSize) -> Result<(), PluginError>

Set the size of an embedded window
§

fn set_parent(&self, window: Window<'_, '_>) -> Result<(), PluginError>

Embed UI into the given parent window
§

fn set_transient(&self, _: Window<'_, '_>) -> Result<(), PluginError>

Receive instruction to stay above the given window Read more
§

fn show(&self) -> Result<(), PluginError>

Show the window
§

fn hide(&self) -> Result<(), PluginError>

Hide the window Read more
§

fn suggest_title(&self, title: &str)

Receive a suggested window title from the host Read more
§

impl PluginLatencyImpl for ClapMain<'_>

§

fn get(&self) -> u32

Returns the plugin latency in samples.
§

impl<'a> PluginMainThread<'a, ClapShared> for ClapMain<'a>

§

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<'_>

§

fn count(&self) -> u32

Returns the total number of parameters the plugin exposes.
§

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>

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

Converts a parameter’s plain value to a human-readable string. Read more
§

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<'_>)

Flushes pending parameter changes between the host and plugin. Read more
§

impl PluginNotePortsImpl for ClapMain<'_>

§

fn count(&self, input: bool) -> u32

Returns number of audio ports, for either input or output.
§

fn get(&self, index: u32, input: bool, writer: &mut NotePortInfoWriter<'_>)

Get information about a note port by its index, for either input or output.
§

impl PluginStateImpl for ClapMain<'_>

§

fn save(&self, output: &mut OutputStream<'_>) -> Result<(), PluginError>

Saves the plugin state into a given output byte stream. Read more
§

fn load(&self, input: &mut InputStream<'_>) -> Result<(), PluginError>

Loads the plugin state from a given input byte stream. Read more

Auto Trait Implementations§

§

impl<'a> !Freeze for ClapMain<'a>

§

impl<'a> !RefUnwindSafe for ClapMain<'a>

§

impl<'a> !Send for ClapMain<'a>

§

impl<'a> !Sync for ClapMain<'a>

§

impl<'a> !UnwindSafe for ClapMain<'a>

§

impl<'a> Unpin for ClapMain<'a>

§

impl<'a> UnsafeUnpin for ClapMain<'a>

Blanket Implementations§

§

impl<T> Any for T
where T: 'static + ?Sized,

§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
§

impl<T> AutoreleaseSafe for T
where T: ?Sized,

§

impl<T> Borrow<T> for T
where T: ?Sized,

§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
§

impl<T> BorrowMut<T> for T
where T: ?Sized,

§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
§

impl<T> From<T> for T

§

fn from(t: T) -> T

Returns the argument unchanged.

§

impl<T, U> Into<U> for T
where U: From<T>,

§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

§

impl<T> Same for T

§

type Output = T

Should always be Self
§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

§

type Error = Infallible

The type returned in the event of a conversion error.
§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.