Trait audio_core::ChannelsMut[][src]

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

A trait describing a mutable audio buffer.

Required methods

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.

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 audio::{Channels, ChannelsMut};

let mut buffer: audio::Dynamic<i16> = audio::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: ?Sized, T> ChannelsMut<T> for &mut B where
    B: ChannelsMut<T>, 
[src]

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

Loading content...

Implementors

Loading content...