[][src]Trait bae_rs::channels::Channel

pub trait Channel {
    fn set_process_time(&mut self, d: Duration);
fn get_output(&self) -> &TrackT;
fn set_gain(&mut self, gain: MathT);
fn process(&mut self);
fn add_sound(&mut self, sound: &mut SoundRc);
fn remove_sound(&mut self, id: usize); }

Trait defining the simplest possible interface for a channel, with the ability to process a batch of samples at a time.

Required methods

fn set_process_time(&mut self, d: Duration)

Sets the amount of time process should calculate samples for. The given duration is truncated to a integer sample value.

fn get_output(&self) -> &TrackT

Returns a reference to the internal track of samples.

fn set_gain(&mut self, gain: MathT)

Sets the gain of the output of the channel.

fn process(&mut self)

Processes the given number of samples, storing the results in the internal track of samples.

fn add_sound(&mut self, sound: &mut SoundRc)

Adds a Sound to the Channel for processing.

fn remove_sound(&mut self, id: usize)

Removes a Sound from the Channel.

The id parameter can be accessed from the registered Sound itself.

Loading content...

Implementors

impl Channel for StandardChannel[src]

Loading content...