pub struct DelayLine { /* private fields */ }Expand description
A fixed delay of whole samples on up to two channels that share one cursor: process each
channel of a block, then call Self::advance once.
Implementations§
Source§impl DelayLine
impl DelayLine
Sourcepub fn new(samples: usize, channels: usize) -> Self
pub fn new(samples: usize, channels: usize) -> Self
A silent delay of samples on channels channels. A delay of zero passes through.
Sourcepub fn process(&mut self, channel: usize, input: &[f32], output: &mut [f32])
pub fn process(&mut self, channel: usize, input: &[f32], output: &mut [f32])
Writes input delayed into output for one channel, covering the shorter of the two.
Sourcepub fn process_in_place(&mut self, channel: usize, samples: &mut [f32])
pub fn process_in_place(&mut self, channel: usize, samples: &mut [f32])
Replaces one channel’s samples with themselves delayed.
Sourcepub fn advance(&mut self, frames: usize)
pub fn advance(&mut self, frames: usize)
Moves every channel on by frames samples, after each was processed over them.
Sourcepub fn save_state(&self) -> StateBlob
pub fn save_state(&self) -> StateBlob
The held samples and the cursor.
Sourcepub fn load_state(&mut self, state: &StateBlob) -> Result<(), StateError>
pub fn load_state(&mut self, state: &StateBlob) -> Result<(), StateError>
Restores a state saved by a delay of the same length and channels.
§Errors
Returns StateError::Mismatch for another length or channel count and
StateError::Invalid for a cursor past the end; the delay is unchanged.
Trait Implementations§
Auto Trait Implementations§
impl Forget for DelayLine
impl Freeze for DelayLine
impl Move for DelayLine
impl RefUnwindSafe for DelayLine
impl Send for DelayLinewhere
RawVecInner: Send,
impl Sync for DelayLinewhere
RawVecInner: Sync,
impl Unpin for DelayLine
impl UnsafeUnpin for DelayLine
impl UnwindSafe for DelayLinewhere
RawVecInner: 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