PiPo
Plug In Plug Out / Plugin Interface for Processing Objects
|
Public Types | |
enum | BandsModeE { UndefinedBands = -1, MelBands = 0, HtkMelBands = 1 } |
enum | EqualLoudnessModeE { None = 0, Hynek = 1 } |
Public Types inherited from PiPo | |
enum | Type { Undefined, Bool, Enum, Int, Float, Double, String } |
enum | Enumerate |
Public Member Functions | |
PiPoBands (Parent *parent, PiPo *receiver=NULL) | |
int | streamAttributes (bool hasTimeTags, double rate, double offset, unsigned int width, unsigned int size, const char **labels, bool hasVarSize, double domain, unsigned int maxFrames) |
Configures a PiPo module according to the input stream attributes and propagate output stream attributes. More... | |
int | frames (double time, double weight, float *values, unsigned int size, unsigned int num) |
Processes a single frame or a block of frames. More... | |
Public Member Functions inherited from PiPo | |
PiPo (Parent *parent, PiPo *receiver=NULL) | |
PiPo (const PiPo &other) | |
virtual void | setParent (Parent *parent) |
Sets PiPo parent. More... | |
int | propagateStreamAttributes (bool hasTimeTags, double rate, double offset, unsigned int width, unsigned int height, const char **labels, bool hasVarSize, double domain, unsigned int maxFrames) |
Propagates a module's output stream attributes to its receiver. More... | |
int | propagateReset (void) |
Propagates the reset control event. More... | |
int | propagateFrames (double time, double weight, PiPoValue *values, unsigned int size, unsigned int num) |
Propagates a module's output frames to its receiver. More... | |
int | propagateFinalize (double inputEnd) |
Propagates the finalize control event. More... | |
virtual PiPo * | getReceiver (unsigned int index=0) |
Gets a PiPo modules receiver (call only by the PiPo host) More... | |
virtual void | setReceiver (PiPo *receiver, bool add=false) |
Sets a PiPo modules receiver (call only by the PiPo host) More... | |
virtual int | reset (void) |
Resets processing (optional) More... | |
virtual int | segment (double time, bool start) |
Signals segment start or end. More... | |
virtual int | finalize (double inputEnd) |
Finalizes processing (optinal) More... | |
void | streamAttributesChanged (Attr *attr) |
void | signalError (std::string errorMsg) |
void | signalWarning (std::string errorMsg) |
void | addAttr (PiPo *pipo, const char *name, const char *descr, Attr *attr, bool clear=false) |
att attribute | |
Attr * | getAttr (unsigned int index) |
Gets PiPo attribute by index. More... | |
Attr * | getAttr (const char *name) |
Gets PiPo attribute by name. More... | |
Attr * | getAttr (const char *piponame, const char *name) |
Gets PiPo attribute by qualified name. More... | |
bool | setAttr (unsigned int index, int value, bool silently=false) |
bool | setAttr (unsigned int index, int *values, unsigned int numValues, bool silently=false) |
bool | setAttr (unsigned int index, double val, bool silently=false) |
bool | setAttr (unsigned int index, double *values, unsigned int numValues, bool silently=false) |
unsigned int | getNumAttrs (void) |
Gets number of attributes. More... | |
void | cloneAttrs (PiPo *other) |
Copies current parent and attributes values. More... | |
void | cloneAttr (PiPo::Attr *attr) |
Copies current value(s) of given attribute. More... | |
Public Attributes | |
PiPoScalarAttr< PiPo::Enumerate > | mode |
PiPoScalarAttr< PiPo::Enumerate > | eqlmode |
PiPoScalarAttr< int > | num |
PiPoScalarAttr< bool > | log |
PiPoScalarAttr< float > | power |
Additional Inherited Members | |
Static Public Member Functions inherited from PiPo | |
static float | getVersion () |
Protected Attributes inherited from PiPo | |
Parent * | parent |
std::vector< PiPo * > | receivers |
std::vector< Attr * > | attrs |
|
inlinevirtual |
Processes a single frame or a block of frames.
PiPo module: An implementation of this method may call propagateFrames(), typically like this:
PiPo host: A terminating receiver module provided by a PiPo host handles the received frames and usally returns 0.
time | time-tag for a single frame or a block of frames |
weight | weight associated to frame or block |
values | interleaved frames values, row by row (interleaving channels or columns), frame by frame TODO: should be const!!! |
size | total size of each of all frames (size = number of elements = width * height = number of channels for audio) |
num | number of frames (number of samples for audio input) |
Implements PiPo.
|
inlinevirtual |
Configures a PiPo module according to the input stream attributes and propagate output stream attributes.
PiPo module: Any implementation of this method requires a propagateStreamAttributes() method call and returns its return value, typically like this:
PiPo host: A terminating receiver module provided by a PiPo host handles the final output stream attributes and usally returns 0.
hasTimeTags | a boolean representing whether the elements of the stream are time-tagged |
rate | the frame rate (highest average rate for time-tagged streams, sample rate for audio input) |
offset | the lag of the output stream relative to the input |
width | the frame width (number of channels for audio or data matrix columns) |
height | the frame height (or number of matrix rows, always 1 for audio) |
labels | optional labels for the frames' channels or columns (can be NULL) |
hasVarSize | a boolean representing whether the frames have a variable height (respecting the given frame height as maximum) |
domain | extent of a frame in the given domain (e.g. duration or frequency range) |
maxFrames | maximum number of frames in a block exchanged between two modules (window size for audio) |
Implements PiPo.
PiPoBands::eqlmode |
"none" (no scaling) or "hynek" (Hynek's equal loudness curve)
PiPoBands::log |
enable logarithmic bands
PiPoBands::mode |
"mel" (MEL bands, normalized energy) or "htkmel" (HTK-like MEL bands, preserved peak energy)
PiPoBands::num |
number of bands
PiPoBands::power |
power scaling exponent