SPKitProcessor contains member functions common to all SPKit classes. The setInput(SPKitProcessor* ip) function is used for initialization and connecting a signal input to the object. A derived class may have its own initialization function, which must be used instead of the standard setInput() function. For example, SPKitDelay has a setInputAndDelayTime(SPKitProcessor* ip, SPKitFloat dt) function for connecting to the signal input and setting the delay time.
Other important functions inherited from SPKitProcesssor are getSamplingRate() and getChannelCount() for retrieving the sampling rate and number of channels of the object's output signal.
All SPKit classes inherit from SPKitProcessor. It provides several useful member functions and variables which can be accessed from subclasses. Most importantly, SPKitProcessor defines a setInput() function for connecting and initializing signal processing objects and a getSample() function for retrieving and processing signal samples.
setInput() initializes a sound processing module by reading values for inputSamplingRate, inputChannelCount and originalDataFormat. setInput also initializes input to newInput.
Derived classes may re-define setInput() to do any initialization that requires data of the members in the paragraph above. A derived class should always call the base class setInput() before accessing any inherited members (e.g. those mentioned above). from its own setInput() or equivalent initialization function (e.g. see SPKitDelay::setInputAndDelayTime()).
Note: SPKit objects are not fully initialized before setInput() is called. While it is error-prone and not good C++ practice to leave an object in an un-initialized state after construction, there is a good reason for allowing this in SPKit: a derived class may call its base class' setInput() anywhere in its own definition of setInput(). This was found very useful and would not have been possible with standard C++ constructors.
getSample() stores the processed sample in outputSample. The function returns 0 on end of signal, 1 otherwise.
returns inputSamplingRate. A sampling rate converter class should override it.
The following member functions are declared non-virtual:
Kai Lassfolk / University of Helsinki / kpl@elisir.helsinki.fi