A Voice Processor class. More...
#include <voiceprocessor.h>
Public Member Functions | |
VoiceProcessor () | |
virtual | ~VoiceProcessor () |
virtual tresult | process (ProcessData &data)=0 |
int32 | getActiveVoices () const |
Returns the number of active voices. | |
Protected Attributes | |
int32 | activeVoices |
A Voice Processor class.
A virtual base class for a voice manager implementation.
The idea behind this class is to make it easier to support either single precision or double precision samples (float or double) or different channel layouts.
Example:
class MySynthProcessor : public AudioEffect { public: tresult PLUGIN_API setActive (TBool state); tresult PLUGIN_API process (ProcessData& data); protected: VoiceProcessor* voiceProcessor; }; tresult PLUGIN_API MySynthProcessor::setActive (TBool state) { if (state) { if (processSetup.symbolicSampleSize == kSample32) voiceProcessor = new VoiceProcessorImplementation<float, Voice<float>, 2, MAX_VOICES, void> (processSetup.sampleRate, 0); else if (processSetup.symbolicSampleSize == kSample64) voiceProcessor = new VoiceProcessorImplementation<double, Voice<double>, 2, MAX_VOICES, void> (processSetup.sampleRate, 0); else return kInvalidArgument; } else { delete voiceProcessor; voiceProcessor = 0; } return kResultTrue; } tresult PLUGIN_API MySynthProcessor::process (ProcessData& data) { return voiceProcessor->process (data); }
VoiceProcessor | ( | ) | [inline] |
virtual ~VoiceProcessor | ( | ) | [inline, virtual] |
virtual tresult process | ( | ProcessData & | data | ) | [pure virtual] |
int32 getActiveVoices | ( | ) | const [inline] |
Returns the number of active voices.
int32 activeVoices [protected] |