Main Page | Modules | Class Hierarchy | Alphabetical List | Class List | Directories | File List | Class Members | File Members | Related Pages

CPin Class Reference

#include <FEAPIPluginBase.h>

List of all members.


Detailed Description

This class provides an abstraction of a pin of a FEAPI plugin. A pin can be a signal (input), a result, or a parameter pin. You can use this class as a helper for specifying the signature of a FEAPI plugin, i.e., its inputs, outputs, parameters, and their properties (e.g., name, description, unit, range, etc.). Information on pins is used for providing the default implementation of the following FEAPI methods: GetPluginNumOfInputs, GetPluginInputDescription, GetPluginNumOfResults, GetPluginResultDescription, GetPluginNumOfParameters, and GetPluginParameterDescription. Here are some examples of how to use this class. For setting an input pin, you can write:
 SetPluginInputPinInfo(CPin::SetIndex(0) // put here the correct input index
    .SetName("My input pin")
    .SetUnit("")
    .SetDescription("An input just for documentation")
    .SetRangeMin(-1.0f)
    .SetRangeMax(1.0f)
    .SetSampleRate(44100.0f)
 );
A result can be set in a similar way: just use CFeatureExtractBase::SetPluginResultPinInfo (helper method of CFeatureExtractBase, the base class for FEAPI plugins) instead of CFeatureExtractBase::SetPluginInputPinInfo. You can set a parameter as follows:
 SetPluginParameterPinInfo(CPin::SetIndex(0) // put here the correct parameter index
    .SetName("My parameter pin")
    .SetUnit("")
    .SetDescription("A parameter just for documentation")
    .SetRangeMin(0.0f)
    .SetRangeMax(1.0f)
    .SetDefaultValue(0.5f)
    .SetQuantizedTo(-1.0f)
    .SetIsChangeableInRealTime(1)
 );

Definition at line 88 of file FEAPIPluginBase.h.

Public Member Functions

 CPin (const CPin &OtherPin)
virtual ~CPin ()
 Destructor.
int GetIndex () const
CPinSetName (const std::string &Name)
const std::string & GetName () const
CPinSetUnit (const std::string &Unit)
const std::string & GetUnit () const
CPinSetDescription (const std::string &Description)
const std::string & GetDescription () const
CPinSetRangeMin (float fRangeMin)
float GetRangeMin () const
CPinSetRangeMax (float fRangeMax)
float GetRangeMax () const
CPinSetSampleRate (float fSampleRate)
float GetSampleRate () const
CPinSetQuantizedTo (float fQuantizedTo)
float GetQuantizedTo () const
CPinSetDefaultValue (float fDefaultValue)
float GetDefaultValue () const
CPinSetIsChangeableInRealTime (int bIsChangeableInRealTime)
int GetIsChangeableInRealTime () const

Static Public Member Functions

CPin SetIndex (int iIndex)

Protected Member Functions

 CPin ()
 Default constructor: it should not be used!
 CPin (int iIndex)
 Creates a pin with the given index.
void Copy (const CPin &OtherPin)
 Copies information from the pin passed as parameter.

Friends

class std::map<int, CPin>


Constructor & Destructor Documentation

CPin::CPin const CPin OtherPin  ) 
 

Constructs a copy of an object of type pin.

Parameters:
OtherPin : the pin that has to be copied.

Definition at line 104 of file FEAPIPluginBase.cpp.

References Copy().

Here is the call graph for this function:

CPin::~CPin  )  [virtual]
 

Destructor.

Definition at line 110 of file FEAPIPluginBase.cpp.

CPin::CPin  )  [protected]
 

Default constructor: it should not be used!

Definition at line 76 of file FEAPIPluginBase.cpp.

Referenced by SetIndex().

CPin::CPin int  iIndex  )  [protected]
 

Creates a pin with the given index.

Definition at line 90 of file FEAPIPluginBase.cpp.


Member Function Documentation

void CPin::Copy const CPin OtherPin  )  [protected]
 

Copies information from the pin passed as parameter.

Definition at line 114 of file FEAPIPluginBase.cpp.

References m_bIsChangeableInRealTime, m_Description, m_fDefaultValue, m_fQuantizedTo, m_fRangeMax, m_fRangeMin, m_fSampleRate, m_iIndex, m_Name, and m_Unit.

Referenced by CPin().

float CPin::GetDefaultValue  )  const
 

Retrieves the default value for the parameter associated to this pin (parameter pins only).

Returns:
float : the default value for the parameter associated to this pin.

Definition at line 236 of file FEAPIPluginBase.cpp.

const std::string & CPin::GetDescription  )  const
 

Retrieves the description of the pin.

Returns:
const std::string& : the description of this pin.

Definition at line 171 of file FEAPIPluginBase.cpp.

int CPin::GetIndex  )  const
 

Retrieves the identifier of the pin.

Returns:
int : the index of this pin (note that the index is used as identifier for the pin within its category).

Definition at line 138 of file FEAPIPluginBase.cpp.

Referenced by CFeatureExtractBase::SetPluginInputPinInfo(), CFeatureExtractBase::SetPluginParameterPinInfo(), and CFeatureExtractBase::SetPluginResultPinInfo().

int CPin::GetIsChangeableInRealTime  )  const
 

Retrieves whether the parameter associated to this pin can be changed in real time or not (parameter pins only).

Returns:
int : 0 (false) if the parameter cannot be changed in real-time, different from 0 (true) otherwise.

Definition at line 247 of file FEAPIPluginBase.cpp.

const std::string & CPin::GetName  )  const
 

Retrieves the name of the pin.

Returns:
const std::string& : the name of this pin.

Definition at line 149 of file FEAPIPluginBase.cpp.

float CPin::GetQuantizedTo  )  const
 

Retrieves the quantization step size of the pin (input and result pins only).

Returns:
float : the quantization step size of this pin.

Definition at line 209 of file FEAPIPluginBase.cpp.

float CPin::GetRangeMax  )  const
 

Retrieves the maximum value of the pin.

Returns:
float : the maximum value of this pin.

Definition at line 193 of file FEAPIPluginBase.cpp.

float CPin::GetRangeMin  )  const
 

Retrieves the minimum value of the pin.

Returns:
float : the minimum value of this pin.

Definition at line 182 of file FEAPIPluginBase.cpp.

float CPin::GetSampleRate  )  const
 

Retrieves the sample rate in Hz of the input/result pin.

Returns:
float : the sample rate of this pin.

Definition at line 220 of file FEAPIPluginBase.cpp.

const std::string & CPin::GetUnit  )  const
 

Retrieves the unit of the pin.

Returns:
const std::string& : the unit of this pin.

Definition at line 160 of file FEAPIPluginBase.cpp.

CPin & CPin::SetDefaultValue float  fDefaultValue  ) 
 

Changes the default value for the parameter associated to this pin (parameter pins only). Default: 0.

Parameters:
fDefaultValue : the new default value for the pin.
Returns:
CPin& : a reference to this pin.

Definition at line 230 of file FEAPIPluginBase.cpp.

CPin & CPin::SetDescription const std::string &  Description  ) 
 

Changes the description of the pin. Default: empty string.

Parameters:
Description : the new description of the pin.
Returns:
CPin& : a reference to this pin.

Definition at line 165 of file FEAPIPluginBase.cpp.

CPin CPin::SetIndex int  iIndex  )  [static]
 

Constructs an object of type pin with the given identifier.

Parameters:
iIndex : the index of the new pin. This index is used as identifier for a pin within its category (inputs, results, parameters). So, it must be unique in each category of pins. Suggestion: assign a progressive number to each input, result, and parameter pin.
Returns:
CPin : the constructed pin object.

Definition at line 133 of file FEAPIPluginBase.cpp.

References CPin().

Here is the call graph for this function:

CPin & CPin::SetIsChangeableInRealTime int  bIsChangeableInRealTime  ) 
 

Changes the default value for the parameter to be changeable in real time or not (parameter pins only). Default: true, i.e., the parameter can be changed in real time.

Parameters:
bIsChangeableInRealTime : set it to 0 (false) if the parameter cannot be changed in real-time, different from 0 (true) otherwise.
Returns:
CPin& : a reference to this pin.

Definition at line 241 of file FEAPIPluginBase.cpp.

CPin & CPin::SetName const std::string &  Name  ) 
 

Changes the name of the pin. Default: empty string.

Parameters:
Name : the new name of the pin.
Returns:
CPin& : a reference to this pin.

Definition at line 143 of file FEAPIPluginBase.cpp.

CPin & CPin::SetQuantizedTo float  fQuantizedTo  ) 
 

Changes the quantization step size of the pin (input and result pins only). Default: -1, i.e., no quantization.

Parameters:
fQuantizedTo : the new quantization step size for the pin.
Returns:
CPin& : a reference to this pin.

Definition at line 203 of file FEAPIPluginBase.cpp.

CPin & CPin::SetRangeMax float  fRangeMax  ) 
 

Changes the maximum value of the pin. Default: maximum floating point value.

Parameters:
fRangeMax : the new maximum value for the pin.
Returns:
CPin& : a reference to this pin.

Definition at line 187 of file FEAPIPluginBase.cpp.

CPin & CPin::SetRangeMin float  fRangeMin  ) 
 

Changes the minimum value of the pin. Default: minimum floating point value.

Parameters:
fRangeMin : the new minimum value for the pin.
Returns:
CPin& : a reference to this pin.

Definition at line 176 of file FEAPIPluginBase.cpp.

CPin & CPin::SetSampleRate float  fSampleRate  ) 
 

Changes the sample rate in Hz of the input/result pin. Default: -1, i.e., equals input block length.

Parameters:
fSampleRate : the new sample rate for the pin.
Returns:
CPin& : a reference to this pin.

Definition at line 214 of file FEAPIPluginBase.cpp.

CPin & CPin::SetUnit const std::string &  Unit  ) 
 

Changes the unit of the pin. Default: empty string.

Parameters:
Unit : the new unit of the pin.
Returns:
CPin& : a reference to this pin.

Definition at line 154 of file FEAPIPluginBase.cpp.


Friends And Related Function Documentation

friend class std::map<int, CPin> [friend]
 

Definition at line 304 of file FEAPIPluginBase.h.


The documentation for this class was generated from the following files:
Generated on Fri Mar 23 10:28:58 2007 for FEAPI Plugin Documentation by  doxygen 1.3.9.1