Skip to main content

PluginLogicCore

Trait PluginLogicCore 

Source
pub trait PluginLogicCore<S: Sample = f32>: Send + 'static {
    // Required methods
    fn supports_in_place() -> bool
       where Self: Sized;
    fn bus_layouts() -> Vec<BusLayout>
       where Self: Sized;
    fn reset(&mut self, sample_rate: f64, max_block_size: usize);
    fn process(
        &mut self,
        buffer: &mut AudioBuffer<'_, S>,
        events: &EventList,
        context: &mut ProcessContext<'_>,
    ) -> ProcessStatus;
    fn save_state(&self) -> Vec<u8> ;
    fn load_state(&mut self, data: &[u8]) -> Result<(), StateLoadError>;
    fn state_changed(&mut self);
    fn latency(&self) -> u32;
    fn tail(&self) -> u32;
    fn editor(&self) -> Box<dyn Editor>;
}
Expand description

Wrapper-facing plugin trait, generic over the audio sample type.

Format wrappers (StaticShell, HotShell, CLAP / VST3 / etc.) bind on PluginLogicCore<S>. Plugin authors don’t implement this directly - they implement PluginLogic (f32) or PluginLogic64 (f64), and the blanket impls below route them into PluginLogicCore.

Method docs live on the leaf traits (PluginLogic / PluginLogic64); the shape mirrors them exactly.

Required Methods§

Source

fn supports_in_place() -> bool
where Self: Sized,

Source

fn bus_layouts() -> Vec<BusLayout>
where Self: Sized,

Source

fn reset(&mut self, sample_rate: f64, max_block_size: usize)

Source

fn process( &mut self, buffer: &mut AudioBuffer<'_, S>, events: &EventList, context: &mut ProcessContext<'_>, ) -> ProcessStatus

Source

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

Source

fn load_state(&mut self, data: &[u8]) -> Result<(), StateLoadError>

Restore plugin-specific state. See PluginLogic::load_state.

§Errors

Forwards whatever the user impl returns - typically a malformed blob error decoded by bincode / serde / similar.

Source

fn state_changed(&mut self)

Source

fn latency(&self) -> u32

Source

fn tail(&self) -> u32

Source

fn editor(&self) -> Box<dyn Editor>

Construct the editor for this plugin. Required - there is no auto-fallback. Layout-only plugins call truce_gui::default_editor(params, layout) from here; custom- renderer plugins construct their EguiEditor / IcedEditor / SlintEditor / hand-rolled Editor directly.

Dyn Compatibility§

This trait is dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety".

Implementors§