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>
impl<E: AudioEffect> WetDryWrapper<E>
Sourcepub fn new(inner: E, wet: f32) -> Self
pub fn new(inner: E, wet: f32) -> Self
Wrap an effect with the given initial wet level [0.0, 1.0].
Sourcepub fn into_inner(self) -> E
pub fn into_inner(self) -> E
Consume the wrapper, returning the inner effect.
Trait Implementations§
Source§impl<E: AudioEffect> AudioEffect for WetDryWrapper<E>
impl<E: AudioEffect> AudioEffect for WetDryWrapper<E>
Source§const EFFECT_ID: &'static str = E::EFFECT_ID
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
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)
fn process_sample_stereo(&mut self, left: f32, right: f32) -> (f32, f32)
Process a single stereo sample pair.
Source§fn latency_samples(&self) -> usize
fn latency_samples(&self) -> usize
Get the latency introduced by this effect in samples.
Source§fn set_sample_rate(&mut self, sample_rate: f32)
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)
fn set_wet_dry(&mut self, wet: f32)
Set the wet/dry mix ratio. Read more
Source§fn process_stereo(&mut self, left: &mut [f32], right: &mut [f32])
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)
fn set_wet_mix(&mut self, wet: f32)
Set the wet mix level in
[0.0, 1.0]. Read moreAuto 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> 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
impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
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 moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
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