Skip to main content

BoardSwitcherProcessor

Struct BoardSwitcherProcessor 

Source
pub struct BoardSwitcherProcessor { /* private fields */ }
Expand description

Meta-processor wrapping multiple pre-compiled pedalboards.

Delegates process() to the active board. Switching is instant — just an index change, no allocation, no audio gap.

Implementations§

Source§

impl BoardSwitcherProcessor

Source

pub fn new(boards: Vec<PedalboardProcessor>) -> Self

Create a new board switcher from a vec of pre-compiled pedalboards.

Source

pub fn len(&self) -> usize

Number of boards.

Source

pub fn is_empty(&self) -> bool

Whether there are no boards.

Source

pub fn active(&self) -> usize

Current active board index.

Trait Implementations§

Source§

impl PedalProcessor for BoardSwitcherProcessor

Source§

fn process(&mut self, input: Wave) -> Wave

Process a single sample.
Source§

fn set_sample_rate(&mut self, rate: Wave)

Set sample rate (call before processing).
Source§

fn reset(&mut self)

Reset all internal state.
Source§

fn set_control(&mut self, label: &str, value: Wave)

Set a named control parameter (0.0-1.0). Default: no-op.
§

fn set_supply_voltage(&mut self, _voltage: f64)

Set supply voltage in volts (default 9.0).
§

fn resolve_port(&self, _name: &str) -> Option<usize>

Resolve a port name to its index in the ports slice. Call once at init to cache indices.
§

fn port_count(&self) -> usize

Number of declared ports (for allocating the ports slice).
§

fn process_ports(&mut self, _ports: &mut [f64])

Process one sample with named port I/O. Read more
§

fn list_editable_components(&self) -> Vec<(String, &'static str, f64)>

List all editable passive components (R, C, L with comp_ids). Returns (comp_id, kind_str, current_value) for each editable leaf.
§

fn set_passive(&mut self, _comp_id: &str, _value: f64) -> bool

Set a passive component’s value by comp_id. Returns true if found.
§

fn reset_passive(&mut self, _comp_id: &str) -> bool

Reset a passive component to its original value. Returns true if found.
§

fn control_debug_info(&self) -> Vec<(String, f64, f64)>

Debug: return current control state as (label, target_value, smoothed_value).

Auto Trait Implementations§

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.

§

impl<T> Instrument for T

§

fn instrument(self, span: Span) -> Instrumented<Self>

Instruments this type with the provided [Span], returning an Instrumented wrapper. Read more
§

fn in_current_span(self) -> Instrumented<Self>

Instruments this type with the current Span, returning an Instrumented wrapper. Read more
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.
§

impl<T> WithSubscriber for T

§

fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self>
where S: Into<Dispatch>,

Attaches the provided Subscriber to this type, returning a [WithDispatch] wrapper. Read more
§

fn with_current_subscriber(self) -> WithDispatch<Self>

Attaches the current default Subscriber to this type, returning a [WithDispatch] wrapper. Read more