pub struct StaticShell<P: Params, L: PluginLogicCore<S, Params = P>, 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, Params = P> + 'static, S: Sample> StaticShell<P, L, S>
impl<P: Params + Default + 'static, L: PluginLogicCore<S, Params = P> + 'static, S: Sample> StaticShell<P, L, S>
Sourcepub fn from_parts(params: Arc<P>) -> Self
pub fn from_parts(params: Arc<P>) -> Self
Build the shell from shared params, constructing the initial DSP
state via L::init(¶ms). The descriptor L is a type-only
marker; the shell owns the state it produces.
Sourcepub fn meter_store(&self) -> Arc<MeterStore>
pub fn meter_store(&self) -> Arc<MeterStore>
Shared meter storage handle - the GUI-thread-safe channel
for meter reads (see PluginExport::meter_store).
Sourcepub fn snapshot_slot(&self) -> Arc<SnapshotSlot>
pub fn snapshot_slot(&self) -> Arc<SnapshotSlot>
Shared snapshot slot for lock-free state save (see
PluginExport::snapshot_slot).
Sourcepub fn state_ref_mut(&mut self) -> &mut L::DspState
pub fn state_ref_mut(&mut self) -> &mut L::DspState
Mutable access to the plugin’s DSP state (for testing).
Trait Implementations§
Source§impl<P: Params + Default + 'static, L: PluginLogicCore<S, Params = P> + 'static, S: Sample> PluginRuntime for StaticShell<P, L, S>
impl<P: Params + Default + 'static, L: PluginLogicCore<S, Params = P> + 'static, S: Sample> PluginRuntime 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, config: &AudioConfig)
fn reset(&mut self, config: &AudioConfig)
Called when sample rate, max block size, or processing mode
changes. Reset filters, delay lines, etc., and size any
mode-dependent buffers off
config.process_mode. 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. Read moreSource§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 migrate_state(foreign: &ForeignState<'_>) -> Option<MigratedState>where
Self: Sized,
fn migrate_state(foreign: &ForeignState<'_>) -> Option<MigratedState>where
Self: Sized,
Translate foreign state - a previous framework’s blob, or a
truce envelope saved under a different plugin id - into truce
params + extra. Format wrappers call this when the host hands
them state that isn’t this plugin’s envelope, so a plugin
ported to truce can keep its users’ old sessions and presets. Read more
Source§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 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, Params = P>, S: Sample> Send for StaticShell<P, L, S>
Auto Trait Implementations§
impl<P, L, S> Freeze for StaticShell<P, L, S>
impl<P, L, S> RefUnwindSafe for StaticShell<P, L, S>
impl<P, L, S> Sync for StaticShell<P, L, S>
impl<P, L, S> Unpin for StaticShell<P, L, S>
impl<P, L, S> UnsafeUnpin for StaticShell<P, L, S>
impl<P, L, S> UnwindSafe for StaticShell<P, L, S>
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