MultiBuffer

Struct MultiBuffer 

Source
pub struct MultiBuffer<T: Float> { /* private fields */ }
Expand description

Multi-channel delay buffer

This behaves similarly to the single-channel Buffer, with the following differences:

  • buffer.channel(c) returns a view for a single channel
  • The constructor and .resize() take an additional first channels argument.

Implementations§

Source§

impl<T: Float> MultiBuffer<T>

Source

pub fn new(channels: usize, capacity: usize) -> Self

Create a new multi-channel buffer

Source

pub fn resize(&mut self, channels: usize, capacity: usize, value: T)

Resize the buffer

Source

pub fn reset(&mut self, value: T)

Reset the buffer to a specific value

Source

pub fn advance(&mut self, amount: isize) -> &mut Self

Advance the buffer position

Source

pub fn channel(&self, channel: usize) -> View<'_, T>

Get a view for a specific channel

Source

pub fn get(&self, channel: usize, offset: isize) -> T

Get a sample at a specific channel and offset

Source

pub fn set(&mut self, channel: usize, offset: isize, value: T)

Set a sample at a specific channel and offset

Auto Trait Implementations§

§

impl<T> Freeze for MultiBuffer<T>

§

impl<T> RefUnwindSafe for MultiBuffer<T>
where T: RefUnwindSafe,

§

impl<T> Send for MultiBuffer<T>
where T: Send,

§

impl<T> Sync for MultiBuffer<T>
where T: Sync,

§

impl<T> Unpin for MultiBuffer<T>
where T: Unpin,

§

impl<T> UnwindSafe for MultiBuffer<T>
where T: 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<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, 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.