pub trait PluginLogicCore<S = f32>: Send + 'staticwhere
S: Sample,{
// 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§
fn supports_in_place() -> boolwhere
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> ⓘ
Sourcefn load_state(&mut self, data: &[u8]) -> Result<(), StateLoadError>
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.
fn state_changed(&mut self)
fn latency(&self) -> u32
fn tail(&self) -> u32
Sourcefn editor(&self) -> Box<dyn Editor>
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".