VstPlugin Class Reference

VST plugin class. More...

#include <VstPlugin.h>

List of all members.

Public Types

enum  
 Enum for enumerating the plugin's parameters.

Public Member Functions

 VstPlugin (audioMasterCallback audioMaster)
 Constructor.
 ~VstPlugin ()
 Destructor.
void process (float **inputs, float **outputs, VstInt32 sampleFrames)
 Processes a block of audio, accumulating.
void processReplacing (float **inputs, float **outputs, VstInt32 sampleFrames)
 Processes a block of audio, replacing.
VstInt32 processEvents (VstEvents *events)
 Called by the host to inform the plugin of certain events.
void resume ()
 Called when audio processing begins.
void suspend ()
 Called when audio processing stops.
void setProgram (VstInt32 program)
 Called to set the plugin's current program.
void setProgramName (char *name)
 Called to set the name of the current program.
void getProgramName (char *name)
 Returns the name of the current program.
bool getProgramNameIndexed (VstInt32 category, VstInt32 index, char *text)
 Returns the name of the current program.
bool copyProgram (VstInt32 destination)
 Copies the current program to the destination program.
void setParameter (VstInt32 index, float value)
 Called to set the plugin's parameters.
float getParameter (VstInt32 index)
 Returns the value of the indexed parameter.
void getParameterLabel (VstInt32 index, char *label)
 Returns the label (units) of the indexed parameter.
void getParameterDisplay (VstInt32 index, char *text)
 Returns the value of the indexed parameter as text.
void getParameterName (VstInt32 index, char *text)
 Returns the name of the indexed parameter.
VstInt32 canDo (char *text)
 Called by the host to determine the plugin's capabilities.
float getVu ()
 Returns the value of the plugin's VU meter?
bool getEffectName (char *name)
 Returns the name of the plugin.
bool getVendorString (char *text)
 Returns the name of the plugin author.
bool getProductString (char *text)
 Returns the name of the plugin.
VstInt32 getVendorVersion ()
 Returns the plugin's version.
VstPlugCategory getPlugCategory ()
 Returns the plugin's category.
bool getInputProperties (VstInt32 index, VstPinProperties *properties)
 Returns certain information about the plugin's inputs.
bool getOutputProperties (VstInt32 index, VstPinProperties *properties)
 Returns certain information about the plugin's outputs.
VstInt32 getGetTailSize ()
 Stupid name method...

Private Types

enum  { numPrograms = 1, versionNumber = 100, maxNumEvents = 250 }
 Various constants. More...

Private Member Functions

strictinline void processMIDI (VstInt32 pos)
 Called for every sample, to dispatch MIDI events appropriately.
strictinline void MIDI_NoteOn (int ch, int note, int val, int delta)
 Called when a MIDI Note On message is received.
strictinline void MIDI_NoteOff (int ch, int note, int val, int delta)
 Called when a MIDI Note Off message is received.
strictinline void MIDI_PolyAftertouch (int ch, int note, int val, int delta)
 Called when a MIDI Aftertouch message is received.
strictinline void MIDI_CC (int ch, int num, int val, int delta)
 Called when a MIDI CC message is received.
strictinline void MIDI_ProgramChange (int ch, int val, int delta)
 Called when a MIDI Program Change message is received.
strictinline void MIDI_ChannelAftertouch (int ch, int val, int delta)
 Called when a MIDI Aftertouch message is received.
strictinline void MIDI_PitchBend (int ch, int x1, int x2, int delta)
 Called when a MIDI Pitchbend message is received.

Private Attributes

PluginProgramprograms
 Array of our plugin's programs.
float samplerate
 The current samplerate.
float tempo
 The current tempo.
float parameters [numParameters]
 Array of our plugin's parameters.
VstEvents * tempEvents
 VstEvents pointer for outputting events to the host.
VstMidiEvent * midiEvent [maxNumEvents]
 Our MIDI event queue.
int numEvents
 The number of events in our event queue.
int eventNumArray [maxNumEvents]
 Sorted array holding the indices of pending events (in midiEvent), for speed.
int numPendingEvents
 Number of events in eventNumArray (same as numEvents?).
VstInt32 frames
 Number of samples in the current processing block.
std::string effectName
 Name of the plugin.
std::string vendorName
 Name of the plugin's author.


Detailed Description

VST plugin class.


Member Enumeration Documentation

anonymous enum [private]
 

Various constants.

Enumerator:
numPrograms  Number of programs this plugin has.
versionNumber  The current version of the plugin.
maxNumEvents  The maximum number of events in our MIDI queue.


Constructor & Destructor Documentation

VstPlugin::VstPlugin audioMasterCallback  audioMaster  ) 
 

Constructor.

Parameters:
audioMaster This is a callback function used by AudioEffect to communicate with the host. Subclasses of AudioEffect/AudioEffectX should not ever need to make use of it directly.


Member Function Documentation

VstInt32 VstPlugin::canDo char *  text  ) 
 

Called by the host to determine the plugin's capabilities.

Returns:
1=can do, -1=cannot do, 0=don't know.

bool VstPlugin::getInputProperties VstInt32  index,
VstPinProperties *  properties
 

Returns certain information about the plugin's inputs.

This is used to assign names to the plugin's inputs.

bool VstPlugin::getOutputProperties VstInt32  index,
VstPinProperties *  properties
 

Returns certain information about the plugin's outputs.

See also:
getInputProperties()

bool VstPlugin::getProgramNameIndexed VstInt32  category,
VstInt32  index,
char *  text
 

Returns the name of the current program.

Parameters:
category If your programs are arranged into categories?
index Index of the program whose name the host wants to query.
text String to put the return name into.
Returns:
True if successful, false otherwise?
The aim of this method is to allow hosts to get the names for each program in a plugin, without having to call setProgram() first.

void VstPlugin::process float **  inputs,
float **  outputs,
VstInt32  sampleFrames
 

Processes a block of audio, accumulating.

Parameters:
inputs Pointer to an array of an array of audio samples containing the audio input to the plugin (well, it won't necessarily be an actual, contiguous array, but it's simpler to view it that way).
outputs Pointer to an array of an array of audio samples which will contain the audio output of the plugin (again, won't necessarily be a contiguous array...).
sampleFrames The number of samples to process for this block.

VstInt32 VstPlugin::processEvents VstEvents *  events  ) 
 

Called by the host to inform the plugin of certain events.

Parameters:
events Pointer to the events.
The main events will be MIDI messages.

void VstPlugin::processReplacing float **  inputs,
float **  outputs,
VstInt32  sampleFrames
 

Processes a block of audio, replacing.

See also:
process()

void VstPlugin::resume  ) 
 

Called when audio processing begins.

Use this to set up buffers etc.

void VstPlugin::setProgram VstInt32  program  ) 
 

Called to set the plugin's current program.

Parameters:
program Index of the program to make current.


The documentation for this class was generated from the following files:
Generated on Mon Aug 7 19:03:50 2006 for VSTGL by  doxygen 1.4.5