Public Member Functions | |
Plugin Functions | |
| virtual bool | Init (void *pParams, void **ppDesc) |
| performs one-time constructor initialization | |
| virtual bool | Process (void)=0 |
| processes a frame of input samples | |
| virtual bool | Begin (void) |
| performs plugged-in initialization | |
| virtual bool | End (void) |
| frees plugged-in allocation | |
Private Attributes | |
Error Attributes | |
| char | m_strError [PIESL] |
| for internal use only | |
| bool | m_bError |
| for internal use only | |
Error Functions | |
| bool | ErrorSet (char *strError) |
| sets error string | |
| void | ErrorClear () |
| clears error state | |
| char * | ErrorString () |
| returns error string | |
| bool | ErrorState () |
| returns error state | |
| bool CRPlugIn::ErrorSet | ( | char * | strError | ) | [inline, protected] |
The ErrorSet() function sets the plugin error string, signaling an error. slab3d will catch the error, stop rendering, and report the error to the user. Plugin developers should call this function when they need to signal an error condition.
| strError | error string (max length = PIESL) |
References m_bError, m_strError, and PIESL.
| void CRPlugIn::ErrorClear | ( | ) | [inline] |
The ErrorClear() function clears the error state.
In SRAPI, ErrorClear() is called internally by SRAPI when the user clears the error. SRAPI plugin developers typically do not need to call this function.
References m_bError, and m_strError.
| char* CRPlugIn::ErrorString | ( | ) | [inline] |
The ErrorString() function returns the error string.
In SRAPI, ErrorString() is called internally by SRAPI to retrieve the error string when a plugin signals an error. SRAPI plugin developers typically do not need to call this function.
References m_strError.
| bool CRPlugIn::ErrorState | ( | ) | [inline] |
The ErrorState() function returns the current error state.
References m_bError.
| virtual bool CRPlugIn::Init | ( | void * | pParams, | |
| void ** | ppDesc | |||
| ) | [inline, virtual] |
The Init() function is intended for one-time plugin initialization (e.g., similar to a constructor). It can also be used to provide plugin description information to the app accessing the plugin. This function is not accessed by the slabwire architecture. It is provided for instances where the plugin is implemented in a DLL (e.g., SRAPI).
In SRAPI, the plugin developer must override this function to: (1) access SRAPI via the pParams CSRAPI pointer and (2) return a description struct. This function can be used in place of a constructor to set defaults based on default Scene parameters or to return error information. All plugins are loaded when the CSRAPI object is allocated. After a plugin is loaded, its Init() function is called to initialize the plugin. This is the only time the Init() function is called. Initialization that must occur every time a plugin is plugged-in should be performed in Begin().
| pParams | plugin parameters | |
| ppDesc | description struct set by plugin |
| virtual bool CRPlugIn::Process | ( | void | ) | [pure virtual] |
The Process() function processes a frame of input samples. The plugin developer must override this function to implement their own audio renderer.
In slabwire, Process() processes SSI stream input to SSO stream output. The I/O objects are not members of CRPlugIn because they are sometimes accessed via the Init() plugin parameter data structure maintained by the slabwire user (e.g., CSRAPI*). In the simplest implementation, the user would add SSI and SSO member variables in the CRPlugIn subclass and set them before starting the DSP thread with BeginThread().
SRAPI Use:
Except for extremely simple renderers, the following code should be included at the beginning of Process:
if( m_pSRAPI->Updated() ) { m_pSRAPI->Recalc(); if( !SceneToSigProc() ) return false; }
This code fragment checks if any scene parameters have been updated. If so, the scene is recalculated (e.g. new listener-relative parameters are computed). The plugin developer then calls their own function (SceneToSigProc()) to convert the scene parameters to their renderer's signal processing parameters (e.g., FIR coefficients).
An SRAPI plugin accesses the scene parameters, the input delay lines, and the output stream through the CSRAPI object passed in Init().
| virtual bool CRPlugIn::Begin | ( | void | ) | [inline, virtual] |
| virtual bool CRPlugIn::End | ( | void | ) | [inline, virtual] |
char CRPlugIn::m_strError[PIESL] [private] |
m_strError is for internal use only. This member variable should only be accessed through the Error Functions.
Referenced by ErrorClear(), ErrorSet(), and ErrorString().
bool CRPlugIn::m_bError [private] |
m_bError is for internal use only. This member variable should only be accessed through the Error Functions.
Referenced by ErrorClear(), ErrorSet(), and ErrorState().