Trait rotary::ChannelsMut[][src]

pub trait ChannelsMut<T>: Channels<T> {
    pub fn channel_mut(&mut self, channel: usize) -> ChannelMut<'_, T>;
pub fn copy_channels(&mut self, from: usize, to: usize)
    where
        T: Copy
; }

A trait describing a mutable audio buffer.

Required methods

pub fn channel_mut(&mut self, channel: usize) -> ChannelMut<'_, T>[src]

Return a mutable handler to the buffer associated with the channel.

Panics

Panics if the specified channel is out of bound as reported by Buf::channels.

pub fn copy_channels(&mut self, from: usize, to: usize) where
    T: Copy
[src]

Copy one channel into another.

If the channels have different sizes, the minimul difference between them will be copied.

Panics

Panics if one of the channels being tried to copy from or to is out of bounds as reported by Buf::channels.

Examples

use rotary::{Channels, ChannelsMut};

let mut buffer: rotary::Dynamic<i16> = rotary::dynamic![[1, 2, 3, 4], [0, 0, 0, 0]];
buffer.copy_channels(0, 1);

assert_eq!(buffer.channel(1), buffer.channel(0));
Loading content...

Implementations on Foreign Types

impl<'_, B, T> ChannelsMut<T> for &'_ mut B where
    B: ChannelsMut<T> + ?Sized
[src]

impl<T> ChannelsMut<T> for Vec<Vec<T, Global>, Global> where
    T: Copy
[src]

Loading content...

Implementors

impl<B, T> ChannelsMut<T> for ReadWrite<B> where
    B: ExactSizeBuf + ChannelsMut<T>, 
[src]

impl<B, T> ChannelsMut<T> for Write<B> where
    B: ChannelsMut<T>, 
[src]

impl<T> ChannelsMut<T> for Dynamic<T> where
    T: Copy
[src]

impl<T> ChannelsMut<T> for rotary::interleaved::Interleaved<T> where
    T: Copy
[src]

impl<T> ChannelsMut<T> for rotary::sequential::Sequential<T> where
    T: Copy
[src]

impl<T> ChannelsMut<T> for rotary::wrap::Interleaved<&mut [T]> where
    T: Copy
[src]

impl<T> ChannelsMut<T> for rotary::wrap::Sequential<&mut [T]> where
    T: Copy
[src]

impl<T, const N: usize> ChannelsMut<T> for rotary::wrap::Interleaved<&mut [T; N]> where
    T: Copy
[src]

impl<T, const N: usize> ChannelsMut<T> for rotary::wrap::Sequential<&mut [T; N]> where
    T: Copy
[src]

Loading content...