Public Member Functions | |
| char * | ErrorString () |
| returns error string | |
| bool | ErrorState () |
| returns true if in error state | |
| GPList * | GetPList () |
| returns a pointer to the generator plugin parameter list | |
| bool | Set (int nParam, float fValue, bool bApply=false) |
| sets plugin parameter value | |
| virtual void | Reset () |
| reset plugin to initial state | |
| virtual GDesc * | GetDesc () |
| returns a pointer to the plugin generator description struct | |
| void | Start () |
| starts sample generation | |
| void | Stop () |
| stops sample generation | |
| virtual bool | Init () |
| override to init plugin | |
| virtual bool | Apply () |
| informs plugin to apply parameters | |
| virtual bool | Command (void *pVoid=NULL) |
| passes custom commands to the plugin | |
Protected Member Functions | |
| void | ErrorSet (const char *strError) |
| set plugin error | |
| void | InitPList (GPList *plist, int nBytes) |
| initialize parameter list | |
| void | SetAmp (float fAmp) |
| set plugin amplitude | |
| virtual float | GenSample () |
| generate sample | |
Protected Attributes | |
| char | m_strError [GPIESL] |
| error string | |
| char | m_pDir [GPI_DIRLEN] |
| plugin directory | |
| bool | m_bStarted |
| sample generation started | |
| float | m_fFs |
| sample rate (set by slabwire) | |
| float | m_fAmp |
| amplitude (see SetAmp()) | |
| GPList * | m_plist |
| generator parameter list | |
| int | m_nNumParams |
| number of parameters | |
| char* CGPlugIn::ErrorString | ( | ) | [inline] |
The ErrorString() function returns the current error string.
References m_strError.
| bool CGPlugIn::ErrorState | ( | ) | [inline] |
The ErrorState() function can be used to query error state.
References m_strError.
| GPList* CGPlugIn::GetPList | ( | ) | [inline] |
The GetPList() function returns a pointer to the generator plugin parameter list. If the plugin includes a header file (e.g., gslab.h), Set() and the header file information can sometimes serve as an alternative to GPList access.
References m_plist.
Referenced by CSIGen::GenPList().
| bool CGPlugIn::Set | ( | int | nParam, | |
| float | fValue, | |||
| bool | bApply = false | |||
| ) | [inline] |
Set() sets a parameter value. Typically, this value isn't applied to the signal generation algorithm until Apply() is called. This allows several parameter values to be applied at once. This behavior can also be used to allow the value to change faster than it is applied, e.g., from a slider with an accept button or another downsampling method.
| nParam | parameter (plist) index | |
| fValue | parameter value | |
| bApply | call Apply() to apply parameter |
References Apply(), m_nNumParams, and m_plist.
Referenced by CSIGen::GenSet().
| virtual void CGPlugIn::Reset | ( | ) | [inline, virtual] |
Override Reset() to support the slabwire rewind feature. The generator should reset itself to its initial state.
| virtual GDesc* CGPlugIn::GetDesc | ( | ) | [inline, virtual] |
The GetDesc() function returns a pointer to the plugin generator description struct.
Plugin Developers:
Override GetDesc() to return a pointer to your description struct.
Referenced by CSIGen::GenDesc().
| void CGPlugIn::Start | ( | ) | [inline] |
Start() starts sample generation (i.e., GetSample() returns GenSample()).
References m_bStarted.
Referenced by CSIGen::GenStart().
| void CGPlugIn::Stop | ( | ) | [inline] |
Stop() stops sample generation (i.e., GetSample() returns 0).
References m_bStarted.
Referenced by CSIGen::GenStop().
| virtual bool CGPlugIn::Init | ( | ) | [inline, virtual] |
| virtual bool CGPlugIn::Apply | ( | ) | [inline, virtual] |
The Apply() function informs a generator plugin to apply parameters.
Plugin Developers:
Apply() should be overridden to apply plugin parameters.
Referenced by CSIGen::GenApply(), and Set().
| virtual bool CGPlugIn::Command | ( | void * | pVoid = NULL |
) | [inline, virtual] |
Command() can be overridden to pass custom commands and/or data to the plugin. A header file defining the command should be provided. Note, the parameter list is the preferred method of passing data to a generator plugin.
| pVoid | custom command and/or data |
Referenced by CSIGen::GenCommand().
| void CGPlugIn::ErrorSet | ( | const char * | strError | ) | [inline, protected] |
The ErrorSet() function can be used by your plugin to notify of an error.
References GPIESL, and m_strError.
| void CGPlugIn::InitPList | ( | GPList * | plist, | |
| int | nBytes | |||
| ) | [inline, protected] |
InitPList() is called from the generator plugin constructor to allocate and initialize the plugin's parameter list.
References m_nNumParams, and m_plist.
| void CGPlugIn::SetAmp | ( | float | fAmp | ) | [inline, protected] |
| virtual float CGPlugIn::GenSample | ( | ) | [inline, protected, virtual] |
GenSample() generates a sample. Override to generate samples for your generator. The override will be called to generate samples when the generator is in a "started" state (Start()). When the plugin is in a "stopped" state (Stop()), the override will not be called and zeroes will be generated by CGPlugIn.