Skip to main content

WetDryWrapper

Struct WetDryWrapper 

Source
pub struct WetDryWrapper<E: AudioEffect> { /* private fields */ }
Expand description

A lightweight wrapper that adds wet/dry mix control to any AudioEffect.

Use this when an underlying effect does not natively support wet/dry mix, or when you want a single consistent control surface.

§Example

use oximedia_effects::{WetDryWrapper, AudioEffect};
use oximedia_effects::reverb::Freeverb;

let mut wrapped = WetDryWrapper::new(Freeverb::default(), 0.4);
let out = wrapped.process_sample(0.5);

Implementations§

Source§

impl<E: AudioEffect> WetDryWrapper<E>

Source

pub fn new(inner: E, wet: f32) -> Self

Wrap an effect with the given initial wet level [0.0, 1.0].

Source

pub fn inner(&self) -> &E

Access the inner effect.

Source

pub fn inner_mut(&mut self) -> &mut E

Access the inner effect mutably.

Source

pub fn into_inner(self) -> E

Consume the wrapper, returning the inner effect.

Trait Implementations§

Source§

impl<E: AudioEffect> AudioEffect for WetDryWrapper<E>

Source§

const EFFECT_ID: &'static str = E::EFFECT_ID

Unique string identifier for this effect type (used for FunDSP adapter dispatch). Read more
Source§

fn process_sample(&mut self, input: f32) -> f32

Process a single mono sample.
Source§

fn process_sample_stereo(&mut self, left: f32, right: f32) -> (f32, f32)

Process a single stereo sample pair.
Source§

fn reset(&mut self)

Reset the effect state (clear buffers, reset LFOs, etc.).
Source§

fn latency_samples(&self) -> usize

Get the latency introduced by this effect in samples.
Source§

fn set_sample_rate(&mut self, sample_rate: f32)

Set the sample rate (if the effect supports it).
Source§

fn set_wet_dry(&mut self, wet: f32)

Set the wet/dry mix ratio. Read more
Source§

fn wet_dry(&self) -> f32

Return the current wet mix level in [0.0, 1.0]. Read more
Source§

fn process(&mut self, buffer: &mut [f32])

Process a buffer of mono samples in-place.
Source§

fn process_stereo(&mut self, left: &mut [f32], right: &mut [f32])

Process stereo samples (left and right channels).
Source§

fn set_wet_mix(&mut self, wet: f32)

Set the wet mix level in [0.0, 1.0]. Read more
Source§

fn wet_mix(&self) -> f32

Return the current wet mix level in [0.0, 1.0]. Read more
Source§

fn process_with_wet_dry(&mut self, input: &[f32], output: &mut [f32], wet: f32)

Process input through this effect and blend the result with the dry signal according to wet in [0.0, 1.0]. Read more

Auto Trait Implementations§

§

impl<E> Freeze for WetDryWrapper<E>
where E: Freeze,

§

impl<E> RefUnwindSafe for WetDryWrapper<E>
where E: RefUnwindSafe,

§

impl<E> Send for WetDryWrapper<E>
where E: Send,

§

impl<E> Sync for WetDryWrapper<E>
where E: Sync,

§

impl<E> Unpin for WetDryWrapper<E>
where E: Unpin,

§

impl<E> UnsafeUnpin for WetDryWrapper<E>
where E: UnsafeUnpin,

§

impl<E> UnwindSafe for WetDryWrapper<E>
where E: UnwindSafe,

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<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
where ST: ?Sized, DT: ?Sized,

Source§

impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
where ST: ?Sized, DT: ?Sized,

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> IntoEither for T

Source§

fn into_either(self, into_left: bool) -> Either<Self, Self>

Converts self into a Left variant of Either<Self, Self> if into_left is true. Converts self into a Right variant of Either<Self, Self> otherwise. Read more
Source§

fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
where F: FnOnce(&Self) -> bool,

Converts self into a Left variant of Either<Self, Self> if into_left(&self) returns true. Converts self into a Right variant of Either<Self, Self> otherwise. Read more
Source§

impl<T> Pointable for T

Source§

const ALIGN: usize

The alignment of pointer.
Source§

type Init = T

The type for initializers.
Source§

unsafe fn init(init: <T as Pointable>::Init) -> usize

Initializes a with the given initializer. Read more
Source§

unsafe fn deref<'a>(ptr: usize) -> &'a T

Dereferences the given pointer. Read more
Source§

unsafe fn deref_mut<'a>(ptr: usize) -> &'a mut T

Mutably dereferences the given pointer. Read more
Source§

unsafe fn drop(ptr: usize)

Drops the object pointed to by the given pointer. Read more
Source§

impl<T> Read<Exclusive, BecauseExclusive> for T
where T: ?Sized,

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

impl<V, T> VZip<V> for T
where V: MultiLane<T>,

Source§

fn vzip(self) -> V