#include <audioeffect.h>
Inheritance diagram for AudioEffect:
Public Member Functions | |
AudioEffect (audioMasterCallback audioMaster, VstInt32 numPrograms, VstInt32 numParams) | |
Create an AudioEffect object. | |
virtual | ~AudioEffect () |
Destroy an AudioEffect object. | |
virtual VstIntPtr | dispatcher (VstInt32 opcode, VstInt32 index, VstIntPtr value, void *ptr, float opt) |
Opcodes dispatcher. | |
State Transitions | |
virtual void | open () |
Called when plug-in is initialized. | |
virtual void | close () |
Called when plug-in will be released. | |
virtual void | suspend () |
Called when plug-in is switched to off. | |
virtual void | resume () |
Called when plug-in is switched to on. | |
Processing | |
virtual void | setSampleRate (float sampleRate) |
Called when the sample rate changes (always in a suspend state). | |
virtual void | setBlockSize (VstInt32 blockSize) |
Called when the Maximun block size changes (always in a suspend state). Note that the sampleFrames in Process Calls could be smaller than this block size, but NOT bigger. | |
virtual void | processReplacing (float **inputs, float **outputs, VstInt32 sampleFrames)=0 |
Process 32 bit (single precision) floats (always in a resume state). | |
virtual void | processDoubleReplacing (double **inputs, double **outputs, VstInt32 sampleFrames) |
Process 64 bit (double precision) floats (always in a resume state). | |
Parameters | |
virtual void | setParameter (VstInt32 index, float value) |
Called when a parameter changed. | |
virtual float | getParameter (VstInt32 index) |
Return the value of the parameter with index. | |
virtual void | setParameterAutomated (VstInt32 index, float value) |
Called after a control has changed in the editor and when the associated parameter should be automated. | |
Programs and Persistence | |
virtual VstInt32 | getProgram () |
Return the index to the current program. | |
virtual void | setProgram (VstInt32 program) |
Set the current program to program. | |
virtual void | setProgramName (char *name) |
Stuff the name field of the current program with name. Limited to kVstMaxProgNameLen. | |
virtual void | getProgramName (char *name) |
Stuff name with the name of the current program. Limited to kVstMaxProgNameLen. | |
virtual void | getParameterLabel (VstInt32 index, char *label) |
Stuff label with the units in which parameter index is displayed (i.e. "sec", "dB", "type", etc...). Limited to kVstMaxParamStrLen. | |
virtual void | getParameterDisplay (VstInt32 index, char *text) |
Stuff text with a string representation ("0.5", "-3", "PLATE", etc...) of the value of parameter index. Limited to kVstMaxParamStrLen. | |
virtual void | getParameterName (VstInt32 index, char *text) |
Stuff text with the name ("Time", "Gain", "RoomType", etc...) of parameter index. Limited to kVstMaxParamStrLen. | |
virtual VstInt32 | getChunk (void **data, bool isPreset=false) |
Host stores plug-in state. Returns the size in bytes of the chunk (plug-in allocates the data array). | |
virtual VstInt32 | setChunk (void *data, VstInt32 byteSize, bool isPreset=false) |
Host restores plug-in state. | |
Internal Setup | |
virtual void | setUniqueID (VstInt32 iD) |
Must be called to set the plug-ins unique ID! | |
virtual void | setNumInputs (VstInt32 inputs) |
Set the number of inputs the plug-in will handle. For a plug-in which could change its IO configuration, this number is the maximun available inputs. | |
virtual void | setNumOutputs (VstInt32 outputs) |
Set the number of outputs the plug-in will handle. For a plug-in which could change its IO configuration, this number is the maximun available ouputs. | |
virtual void | canProcessReplacing (bool state=true) |
Tells that processReplacing() could be used. Mandatory in VST 2.4! | |
virtual void | canDoubleReplacing (bool state=true) |
Tells that processDoubleReplacing() is implemented. | |
virtual void | programsAreChunks (bool state=true) |
Program data is handled in formatless chunks (using getChunk-setChunks). | |
virtual void | setInitialDelay (VstInt32 delay) |
Use to report the plug-in's latency (Group Delay). | |
Editor | |
void | setEditor (AEffEditor *editor) |
Should be called if you want to define your own editor. | |
virtual AEffEditor * | getEditor () |
Returns the attached editor. | |
Inquiry | |
virtual AEffect * | getAeffect () |
Returns the AEffect structure. | |
virtual float | getSampleRate () |
Returns the current sample rate. | |
virtual VstInt32 | getBlockSize () |
Returns the current Maximum block size. | |
Host Communication | |
virtual VstInt32 | getMasterVersion () |
Returns the Host's version (for example 2400 for VST 2.4). | |
virtual VstInt32 | getCurrentUniqueId () |
Returns current unique identifier when loading shell plug-ins. | |
virtual void | masterIdle () |
Give idle time to Host application. | |
virtual bool | isInputConnected (VstInt32 input) |
Returns the input's connection state. | |
virtual bool | isOutputConnected (VstInt32 output) |
Returns the output's connection state. | |
Tools (helpers) | |
virtual void | dB2string (float value, char *text, VstInt32 maxLen) |
Stuffs text with an amplitude on the [0.0, 1.0] scale converted to its value in decibels. | |
virtual void | Hz2string (float samples, char *text, VstInt32 maxLen) |
Stuffs text with the frequency in Hertz that has a period of samples. | |
virtual void | ms2string (float samples, char *text, VstInt32 maxLen) |
Stuffs text with the duration in milliseconds of samples frames. | |
virtual void | float2string (float value, char *text, VstInt32 maxLen) |
Stuffs text with a string representation on the floating point value. | |
virtual void | int2string (VstInt32 value, char *text, VstInt32 maxLen) |
Stuffs text with a string representation on the integer value. | |
Protected Attributes | |
audioMasterCallback | audioMaster |
Host callback. | |
AEffEditor * | editor |
Pointer to the plug-in's editor. | |
float | sampleRate |
Current sample rate. | |
VstInt32 | blockSize |
Maximum block size. | |
VstInt32 | numPrograms |
Number of programs. | |
VstInt32 | numParams |
Number of parameters. | |
VstInt32 | curProgram |
Current program. | |
AEffect | cEffect |
AEffect object |
|
Create an AudioEffect object. The constructor of your class is passed a parameter of the type audioMasterCallback. The actual mechanism in which your class gets constructed is not important right now. Effectively your class is constructed by the hosting application, which passes an object of type audioMasterCallback that handles the interaction with the plug-in. You pass this on to the base class' constructor and then can forget about it.
MyPlug::MyPlug (audioMasterCallback audioMaster) : AudioEffectX (audioMaster, 1, 1) // 1 program, 1 parameter only { setNumInputs (2); // stereo in setNumOutputs (2); // stereo out setUniqueID ('MyPl'); // you must change this for other plug-ins! canProcessReplacing (); // supports replacing mode }
|
|
Destroy an AudioEffect object.
|
|
Tells that processDoubleReplacing() is implemented.
|
|
Tells that processReplacing() could be used. Mandatory in VST 2.4!
|
|
Called when plug-in will be released.
|
|
Stuffs text with an amplitude on the [0.0, 1.0] scale converted to its value in decibels.
|
|
Opcodes dispatcher.
|
|
Stuffs text with a string representation on the floating point value.
|
|
Returns the AEffect structure.
|
|
Returns the current Maximum block size.
|
|
Host stores plug-in state. Returns the size in bytes of the chunk (plug-in allocates the data array).
|
|
Returns current unique identifier when loading shell plug-ins.
|
|
Returns the attached editor.
|
|
Returns the Host's version (for example 2400 for VST 2.4). Use to ask for the Host's version
|
|
Return the value of the parameter with index. Return the value of parameter index
|
|
Stuff text with a string representation ("0.5", "-3", "PLATE", etc...) of the value of parameter index. Limited to kVstMaxParamStrLen.
|
|
Stuff label with the units in which parameter index is displayed (i.e. "sec", "dB", "type", etc...). Limited to kVstMaxParamStrLen.
|
|
Stuff text with the name ("Time", "Gain", "RoomType", etc...) of parameter index. Limited to kVstMaxParamStrLen.
|
|
Return the index to the current program.
|
|
Stuff name with the name of the current program. Limited to kVstMaxProgNameLen. The program name is displayed in the rack, and can be edited by the user.
|
|
Returns the current sample rate.
|
|
Stuffs text with the frequency in Hertz that has a period of samples.
|
|
Stuffs text with a string representation on the integer value.
|
|
Returns the input's connection state. There is no negotiation currently, thus numInputs must not change at any time. A VST plug-in is taken to be a device with a fixed number of i/o pins. How these are beeing used depends on the application.
|
|
Returns the output's connection state. There is no negotiation currently, thus numOutputs must not change at any time. A VST plug-in is taken to be a device with a fixed number of i/o pins. How these are beeing used depends on the application.
|
|
Give idle time to Host application. Give idle time to Host application, e.g. if plug-in editor is doing mouse tracking in a modal loop. |
|
Stuffs text with the duration in milliseconds of samples frames.
|
|
Called when plug-in is initialized.
|
|
Process 64 bit (double precision) floats (always in a resume state).
|
|
Process 32 bit (single precision) floats (always in a resume state). This process method must be provided. It takes input data, applies its pocessing algorithm, and then puts the result to the output by overwriting the output buffer.
|
|
Program data is handled in formatless chunks (using getChunk-setChunks).
|
|
Called when plug-in is switched to on.
|
|
Called when the Maximun block size changes (always in a suspend state). Note that the sampleFrames in Process Calls could be smaller than this block size, but NOT bigger. This is called by the Host, and tells the plug-in that the maximum block size passed to processReplacing() will be blockSize.
|
|
Host restores plug-in state.
|
|
Should be called if you want to define your own editor.
|
|
Use to report the plug-in's latency (Group Delay). Use to report the Plug-in's latency (Group Delay)
|
|
Set the number of inputs the plug-in will handle. For a plug-in which could change its IO configuration, this number is the maximun available inputs. This number is fixed at construction time and can't change until the plug-in is destroyed.
|
|
Set the number of outputs the plug-in will handle. For a plug-in which could change its IO configuration, this number is the maximun available ouputs. This number is fixed at construction time and can't change until the plug-in is destroyed.
|
|
Called when a parameter changed. Parameters are the individual parameter settings the user can adjust. A VST Host can automate these parameters. Set parameter index to value.
|
|
Called after a control has changed in the editor and when the associated parameter should be automated.
|
|
Set the current program to program.
|
|
Stuff the name field of the current program with name. Limited to kVstMaxProgNameLen. The program name is displayed in the rack, and can be edited by the user.
|
|
Called when the sample rate changes (always in a suspend state).
|
|
Must be called to set the plug-ins unique ID! Must call this! Set the plug-in's unique identifier. The Host uses this to identify the plug-in, for instance when it is loading effect programs and banks. On Steinberg Web Page you can find an UniqueID Database where you can record your UniqueID, it will check if the ID is already used by an another vendor. You can use CCONST('a','b','c','d') (defined in VST 2.0) to be platform independent to initialize an UniqueID.
|
|
Called when plug-in is switched to off.
|
|
Host callback.
|
|
Maximum block size.
|
|
AEffect object
|
|
Current program.
|
|
Pointer to the plug-in's editor.
|
|
Number of parameters.
|
|
Number of programs.
|
|
Current sample rate.
|