pub enum FrameMut<'a, T: AudioSample> {
Mono(&'a mut [T]),
MultiChannel(Vec<*mut T>, usize),
}Expand description
A mutable frame containing samples from all channels at a given time point.
Variants§
Mono(&'a mut [T])
Single-channel (mono) frame
MultiChannel(Vec<*mut T>, usize)
Multi-channel frame with channel pointers and channel count
Implementations§
Source§impl<'a, T: AudioSample> FrameMut<'a, T>
impl<'a, T: AudioSample> FrameMut<'a, T>
Sourcepub const fn is_empty(&self) -> bool
pub const fn is_empty(&self) -> bool
Returns true if the frame is empty (should not happen in practice).
Sourcepub fn get_mut(&mut self, channel: usize) -> Option<&mut T>
pub fn get_mut(&mut self, channel: usize) -> Option<&mut T>
Get a mutable reference to the sample for a specific channel.
Sourcepub fn apply<F>(&mut self, f: F)where
F: Fn(T) -> T,
pub fn apply<F>(&mut self, f: F)where
F: Fn(T) -> T,
Apply a function to all samples in this frame.
Sourcepub fn apply_with_channel<F>(&mut self, f: F)
pub fn apply_with_channel<F>(&mut self, f: F)
Apply a function with channel index to all samples in this frame.
Auto Trait Implementations§
impl<'a, T> Freeze for FrameMut<'a, T>
impl<'a, T> RefUnwindSafe for FrameMut<'a, T>where
T: RefUnwindSafe,
impl<'a, T> !Send for FrameMut<'a, T>
impl<'a, T> !Sync for FrameMut<'a, T>
impl<'a, T> Unpin for FrameMut<'a, T>
impl<'a, T> !UnwindSafe for FrameMut<'a, T>
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