SPKitMux


User's Guide

SPKitMux is a signal multiplexer. It produces copies of its input samples for objects using it as their input.

Note:

For an example of an application of SPKitMux, see SPKitSchroeder.


Programmer's Reference

Defined in <spkit/mux.h>
Inherits from SPKitProcessor

SPKitSum overrides the setOutput() function for counting the number of objects using it as their input. The class also overrides getSample().

Public Members

SPKitError setInput(SPKitProcessor* newInput)
connect an input to the object and initialize it.

Calls SPKitProcessor::setInput().

void addInput(SPKitProcessor* newInput)
connect an additional input to the object. Adds newInput to inputList.
void setOutput(SPKitProcessor*)
increments outputCount.
int getSample(SPKitSample& outputSample)
retrieve a processed audio sample

On the first call, getSample() requests a sample from its input and stores the summed result in outputSample. On successive calls (depending on the number of the object's outputs) getSample() returns the sample in outputSample. When all outputs have received a copy of the first input sample, the object requests a new sample from its input.

getSample() returns 0 on end of input, 1 otherwise.

Protected Members

int outputCount
amount of signal outputs
int outputIndex
a variable for calculating, when to request a new sample from input.
int endOfInput
indication of end of signal input.

Return to SPKit home

Kai Lassfolk / University of Helsinki / kpl@elisir.helsinki.fi