Skip to main content

StaticShell

Struct StaticShell 

Source
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>

Source

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.

Source

pub fn logic_ref(&self) -> &L

Access the plugin logic (for testing).

Source

pub fn logic_ref_mut(&mut self) -> &mut L

Mutable access to the plugin logic (for testing).

Trait Implementations§

Source§

impl<P: Params + Default + 'static, L: PluginLogicCore<S> + 'static, S: Sample> PluginRuntime for StaticShell<P, L, S>

Source§

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 more
Source§

fn info() -> PluginInfo
where Self: Sized,

Static metadata about the plugin. Read more
Source§

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

Supported bus layouts. The host picks one.
Source§

fn init(&mut self)

Called once after construction. Not real-time safe.
Source§

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

Real-time audio processing.
Source§

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>

Restore extra state. Matches the user-facing truce_plugin::PluginLogic::load_state Result shape so the wrapper bridge is a passthrough. Read more
Source§

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

GUI editor. Return None for headless plugins.
Source§

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

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

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() -> bool
where 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 more
Source§

impl<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>

§

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>

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.