CSIGen Class Reference

CSIGen StreamIn signal generator class interface. More...

Inheritance diagram for CSIGen:

Inheritance graph
[legend]
Collaboration diagram for CSIGen:

Collaboration graph
[legend]

List of all members.

Public Member Functions

virtual SSIError SSInBegin ()
 begins sample stream input
virtual SSIError SSInEnd ()
 ends sample stream input
virtual SSIError SSInRead ()
 requests a buffer of input
virtual char * SSInPtr ()
 returns a pointer to the current input sample buffer
virtual long SSInBytes ()
 returns the size of the SSInPtr() buffer in bytes
virtual StreamType SSInStreamType ()
 returns the CSSI subclass's stream type
virtual SSIError SSInRewind ()
 rewinds stream (not supported by all streams)
GMapGenEnum ()
 enumerates signal generator plugins
GDescGenDesc ()
 see CGPlugIn::GetDesc()
GPList * GenPList ()
 see CGPlugIn::GetPList()
bool GenStart ()
 see CGPlugIn::Start()
bool GenStop ()
 see CGPlugIn::Stop()
bool GenSet (int nParam, float fValue, bool bApply=false)
 see CGPlugIn::Set()
bool GenApply ()
 see CGPlugIn::Apply()
bool GenCommand (void *pVoid=NULL)
 see CGPlugIn::Command()
SSIError GenSelect (char *pName)
 selects a signal generator


Detailed Description

CSIGen is the StreamIn signal generator class interface. Some functions are based on CGPlugIn generator plugin functions. If a plugin is not attached, these functions return false or NULL.

See also:
gplugin.h, gslab.h
Header: sigen.h
Library: slabw

Member Function Documentation

virtual SSIError CSIGen::SSInBegin (  )  [virtual]

SSInBegin() begins sample stream input. Subclasses should call the base class function to init the Sample interface and reset the overflow counter.

Reimplemented from CSSI.

virtual SSIError CSIGen::SSInEnd (  )  [virtual]

SSInEnd() ends sample stream input.

Reimplemented from CSSI.

virtual SSIError CSIGen::SSInRead (  )  [virtual]

SSInRead() requests a buffer of input. For continuous streams, this function can suspend, waiting for input samples. Subclasses should call the base class function to reset the Sample interface for the new buffer. After SSInRead() returns, SSInPtr() will point to the new sample data and SSInBytes() will indicate the number of bytes read.

Reimplemented from CSSI.

virtual char* CSIGen::SSInPtr (  )  [inline, virtual]

SSInPtr() returns a pointer to the current input sample buffer. The buffer samples are channel-interleaved and in their native format (e.g., 8 or 16-bit int, float). The Sample interface provides a slightly higher-level of buffer access, retrieving samples one at a time in float format. Some SSIs might choose to only support one type of sample access.

Reimplemented from CSSI.

virtual long CSIGen::SSInBytes (  )  [inline, virtual]

SSInBytes() returns the size of the SSInPtr() buffer in bytes.

Reimplemented from CSSI.

GMap* CSIGen::GenEnum (  )  [inline]

The GenEnum() function enumerates signal generator plugins. The available plugins are returned in the GMap array. The GMap struct maps generator names (pGenName string field) to generator DLLs (pGenDLL string field). The generator name is used with GenSelect() to select and initialize the generator.

Returns:
GMap array or NULL
See also:
GMap struct, GenSelect()

bool CSIGen::GenCommand ( void *  pVoid = NULL  )  [inline]

Parameters:
pVoid custom command and/or data

References CGPlugIn::Command().

SSIError CSIGen::GenSelect ( char *  pName  ) 

The GenSelect() function selects a signal generator. To obtain a list of available generators, use the GenEnum() function. The generator is initially in a stopped state (samples are zeroed if rendering). To set initial conditions, call GenApply() before calling GenStart() to start sample generation. Generator parameters are set via the "parameter list" (see GenSet(), GenPList(), and the GPList struct). Calling GenApply() informs the plugin that parameters have been set.

Example 1 - Using gslab.h enums for parameter list access:

   pGen->GenSelect( "sine" );
   pGen->GetSet( Gsine::frequency, 1000.0f );
   pGen->GetSet( Gsine::amplitude, 1.0f );
   pGen->GenApply();
   pGen->GenStart();

Example 2 - Using parameter list directly with GUI slider:

   // init slider code fragment:
   pGen->GenSelect( "sine" );
   pGen->GenStart();  // start with default params
   plist = pGen->GenPList();
   int i = 0;
   while( plist[i].pName[0] )
   {
     // slider id, string label, min value, max value, default value
     SliderInit( i, plist[i].pName, plist[i].fMin, plist[i].fMax, 
                 plist[i].fDef );
     ++i;
   }

   // on slider movement code fragment:
   // Set() sets the plist fVal and bSet fields
   pGen->Set( nSliderID, fSliderValue );
   pGen->GenApply();

gslab.h lists the slab3d generators and generator parameters. The default generator is "square".

Returns:
SSIError
See also:
Gen*() functions
Parameters:
pName generator name


slabwire Reference Manual generated Fri Nov 20 18:50:01 2009 by doxygen 1.5.9