Struct oxcable::mixers::multiplexer::Multiplexer [] [src]

pub struct Multiplexer {
    // some fields omitted
}

A multiplexer.

A multiplexer takes in several inputs, and chooses only one of them to send to the output. Since the input can be changed, this can be used as a switch between multiple signals.

Methods

impl Multiplexer

fn new(num_inputs: usize) -> Self

Returns a new multiplexer with num_inputs input and one output.

fn select_input(&mut self, i: usize) -> Result<(), ()>

Selects the ith channel as the output. Returns Err if the channel is out of range.

While this has identical behavior to the SetChannel message, the method is retained so that it may return a result.

Trait Implementations

impl MessageReceiver for Multiplexer

type Msg = Message

fn handle_message(&mut self, msg: Message)

impl AudioDevice for Multiplexer

fn num_inputs(&self) -> usize

fn num_outputs(&self) -> usize

fn tick(&mut self, _: Time, inputs: &[Sample], outputs: &mut [Sample])