pub struct StaticShell<P: Params, L: PluginLogicCore<S>, S: Sample = f32> {
pub params: Arc<P>,
/* private fields */
}Expand description
A static plugin shell that embeds the user’s PluginLogic impl
directly into the format-wrapper binary.
Same bridging as HotShell but without NativeLoader, Mutex,
file watching, or any dynamic loading overhead. Use via export_static!.
Fields§
§params: Arc<P>Implementations§
Source§impl<P: Params + Default + 'static, L: PluginLogicCore<S> + 'static, S: Sample> StaticShell<P, L, S>
impl<P: Params + Default + 'static, L: PluginLogicCore<S> + 'static, S: Sample> StaticShell<P, L, S>
Sourcepub fn from_parts(params: Arc<P>, logic: L) -> Self
pub fn from_parts(params: Arc<P>, logic: L) -> Self
Create from pre-constructed parts. The plugin logic should
hold an Arc::clone of the same params.
Sourcepub fn logic_ref_mut(&mut self) -> &mut L
pub fn logic_ref_mut(&mut self) -> &mut L
Mutable access to the plugin logic (for testing).
Sourcepub fn try_custom_editor(&self) -> Option<Box<dyn Editor>>
pub fn try_custom_editor(&self) -> Option<Box<dyn Editor>>
Try to get a custom editor from the plugin logic.
Sourcepub fn try_builtin_editor(&self) -> Option<BuiltinEditor<P>>
pub fn try_builtin_editor(&self) -> Option<BuiltinEditor<P>>
Try to create a BuiltinEditor from the plugin’s layout.
Returns None if the layout has zero size.
Trait Implementations§
Source§impl<P: Params + Default + 'static, L: PluginLogicCore<S> + 'static, S: Sample> Plugin for StaticShell<P, L, S>
impl<P: Params + Default + 'static, L: PluginLogicCore<S> + 'static, S: Sample> Plugin for StaticShell<P, L, S>
Source§type Sample = S
type Sample = S
The plugin’s chosen audio sample precision. Either
f32 (the
default - matches host wire format for nearly all formats) or
f64 (for plugins whose DSP path runs in f64 end-to-end:
high-order biquads, oscillator phase accumulators, long-running
cumulative state). Read moreSource§fn bus_layouts() -> Vec<BusLayout>where
Self: Sized,
fn bus_layouts() -> Vec<BusLayout>where
Self: Sized,
Supported bus layouts. The host picks one.
Source§fn reset(&mut self, sample_rate: f64, max_block_size: usize)
fn reset(&mut self, sample_rate: f64, max_block_size: usize)
Called when sample rate or max block size changes.
Reset filters, delay lines, etc. Not real-time safe.
Source§fn process(
&mut self,
buffer: &mut AudioBuffer<'_, S>,
events: &EventList,
context: &mut ProcessContext<'_>,
) -> ProcessStatus
fn process( &mut self, buffer: &mut AudioBuffer<'_, S>, events: &EventList, context: &mut ProcessContext<'_>, ) -> ProcessStatus
Real-time audio processing.
Source§fn save_state(&self) -> Vec<u8> ⓘ
fn save_state(&self) -> Vec<u8> ⓘ
Save extra state beyond parameter values. Empty
Vec means
“no extra state”: matches the user-facing
truce_plugin::PluginLogic::save_state shape so the wrapper
bridge is a passthrough rather than an Option<Vec<u8>> to
Vec<u8> translation.Source§fn load_state(&mut self, data: &[u8]) -> Result<(), StateLoadError>
fn load_state(&mut self, data: &[u8]) -> Result<(), StateLoadError>
Restore extra state. Matches the user-facing
truce_plugin::PluginLogic::load_state Result shape so the
wrapper bridge is a passthrough. Read moreSource§fn latency(&self) -> u32
fn latency(&self) -> u32
Processing latency in samples. Host uses this for delay compensation.
Return 0 if the plugin adds no latency (default).
Source§fn tail(&self) -> u32
fn tail(&self) -> u32
Tail time in samples. Return
u32::MAX for infinite tail.
Return 0 for no tail (default).Source§fn get_meter(&self, meter_id: u32) -> f32
fn get_meter(&self, meter_id: u32) -> f32
Read a meter value by ID (0.0–1.0). Called by the GUI at ~60fps.
Override to expose level meters, gain reduction, etc.
Source§fn supports_in_place() -> boolwhere
Self: Sized,
fn supports_in_place() -> boolwhere
Self: Sized,
Opt into zero-copy in-place I/O. When this returns
true,
the format wrapper skips its safety memcpy on host-aliased
buffers and hands the plugin the raw shared memory through
AudioBuffer::in_out_mut(ch). The plugin must check
AudioBuffer::is_in_place(ch) per channel before reading
input(ch) - for in-place channels input(ch) returns an
empty slice, and the data lives only in the shared buffer. Read moreimpl<P: Params, L: PluginLogicCore<S>, S: Sample> Send for StaticShell<P, L, S>
Auto Trait Implementations§
impl<P, L, S> Freeze for StaticShell<P, L, S>where
L: Freeze,
impl<P, L, S> RefUnwindSafe for StaticShell<P, L, S>where
L: RefUnwindSafe,
P: RefUnwindSafe,
impl<P, L, S> Sync for StaticShell<P, L, S>where
L: Sync,
impl<P, L, S> Unpin for StaticShell<P, L, S>where
L: Unpin,
impl<P, L, S> UnsafeUnpin for StaticShell<P, L, S>where
L: UnsafeUnpin,
impl<P, L, S> UnwindSafe for StaticShell<P, L, S>where
L: UnwindSafe,
P: RefUnwindSafe,
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more