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>, tasks: Option<AnyTaskSpawner>) -> Self
pub fn from_parts(params: Arc<P>, tasks: Option<AnyTaskSpawner>) -> Self
Build the shell from shared params, constructing the initial DSP
state via L::init(¶ms, &cx). The descriptor L is a
type-only marker; the shell owns the state it produces. tasks is
the plugin’s background-task spawner (Some only when the plugin
wired tasks: on plugin!); it reaches init through the
InitContext and each block through the ProcessContext.
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 task_spawner(&self) -> Option<AnyTaskSpawner>
pub fn task_spawner(&self) -> Option<AnyTaskSpawner>
The plugin’s background-task spawner (see
PluginExport::task_spawner). None unless the plugin wired
tasks: on plugin!.
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
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,
Source§fn reset(&mut self, config: &AudioConfig)
fn reset(&mut self, config: &AudioConfig)
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
Source§fn save_state(&self) -> Vec<u8> ⓘ
fn save_state(&self) -> Vec<u8> ⓘ
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 snapshot_into(&self, buf: &mut Vec<u8>) -> bool
fn snapshot_into(&self, buf: &mut Vec<u8>) -> bool
buf (cleared on entry) -
the real-time path CLAP / VST3 / AU publish to the lock-free slot.
Returns whether the plugin publishes snapshots at all (see
truce_plugin::PluginLogic::snapshot_into), whose default delegates
to save_state, so this covers legacy save_state-only plugins
too. Exposed so non-realtime save paths (LV2, the standalone host)
can compute live state here instead of reading the version-gated
slot. Default: no snapshot.Source§fn republish_snapshot(&mut self)
fn republish_snapshot(&mut self)
Source§fn load_state(&mut self, data: &[u8]) -> Result<(), StateLoadError>
fn load_state(&mut self, data: &[u8]) -> Result<(), StateLoadError>
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,
Source§fn latency(&self) -> u32
fn latency(&self) -> u32
Source§fn tail(&self) -> u32
fn tail(&self) -> u32
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,
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 more