FeatureExtractionModelTransformer Class Reference

#include <FeatureExtractionModelTransformer.h>

Inherits ModelTransformer.

Inheritance diagram for FeatureExtractionModelTransformer:

Inheritance graph
[legend]
Collaboration diagram for FeatureExtractionModelTransformer:

Collaboration graph
[legend]
List of all members.

Detailed Description

Definition at line 29 of file FeatureExtractionModelTransformer.h.

Public Types

enum  Type { RTThread, NonRTThread }

Public Slots

void start ()

Public Member Functions

 FeatureExtractionModelTransformer (Input input, const Transform &transform)
virtual ~FeatureExtractionModelTransformer ()
void abandon ()
 Hint to the processing thread that it should give up, for example because the process is going to exit or we want to get rid of the input model.
ModelgetInputModel ()
 Return the input model for the transform.
int getInputChannel ()
 Return the input channel spec for the transform.
ModelgetOutputModel ()
 Return the output model created by the transform.
ModeldetachOutputModel ()
 Return the output model, also detaching it from the transformer so that it will not be deleted when the transformer is.
QString getMessage () const
 Return a warning or error message.

Protected Member Functions

virtual void run ()
void addFeature (size_t blockFrame, const Vamp::Plugin::Feature &feature)
void setCompletion (int)
void getFrames (int channelCount, long startFrame, long size, float **buffer)
DenseTimeValueModelgetConformingInput ()
template<typename ModelClass>
ModelClass * getConformingOutput ()

Protected Attributes

Vamp::Plugin * m_plugin
Vamp::Plugin::OutputDescriptor * m_descriptor
int m_outputFeatureNo
Transform m_transform
Input m_input
Modelm_output
bool m_detached
bool m_abandoned
QString m_message


Member Enumeration Documentation

enum Thread::Type [inherited]

Enumerator:
RTThread 
NonRTThread 

Definition at line 27 of file Thread.h.


Constructor & Destructor Documentation

FeatureExtractionModelTransformer::FeatureExtractionModelTransformer ( Input  input,
const Transform transform 
)

Definition at line 38 of file FeatureExtractionModelTransformer.cpp.

References Transform::getBlockSize(), DenseTimeValueModel::getChannelCount(), getConformingInput(), TransformFactory::getInstance(), Transform::getOutput(), Transform::getPluginIdentifier(), Transform::getPluginVersion(), Model::getSampleRate(), Transform::getStepSize(), FeatureExtractionPluginFactory::instanceFor(), FeatureExtractionPluginFactory::instantiatePlugin(), m_descriptor, ModelTransformer::m_message, ModelTransformer::m_output, m_outputFeatureNo, m_plugin, ModelTransformer::m_transform, TransformFactory::makeContextConsistentWithPlugin(), EditableDenseThreeDimensionalModel::setBinNames(), Transform::setBlockSize(), TransformFactory::setPluginParameters(), SparseValueModel< PointType >::setScaleUnits(), Model::setSourceModel(), and Transform::setStepSize().

FeatureExtractionModelTransformer::~FeatureExtractionModelTransformer (  )  [virtual]

Definition at line 272 of file FeatureExtractionModelTransformer.cpp.

References m_descriptor, and m_plugin.


Member Function Documentation

void FeatureExtractionModelTransformer::run (  )  [protected, virtual]

Definition at line 291 of file FeatureExtractionModelTransformer.cpp.

References addFeature(), Transform::getBlockSize(), DenseTimeValueModel::getChannelCount(), getConformingInput(), Transform::getDuration(), getFrames(), Model::getSampleRate(), Transform::getStartTime(), Transform::getStepSize(), Transform::getWindowType(), Model::isReady(), ModelTransformer::m_abandoned, ModelTransformer::m_input, ModelTransformer::m_output, m_outputFeatureNo, m_plugin, ModelTransformer::m_transform, StorageAdviser::PrecisionCritical, RealTime::realTime2Frame(), and setCompletion().

void FeatureExtractionModelTransformer::addFeature ( size_t  blockFrame,
const Vamp::Plugin::Feature &  feature 
) [protected]

Definition at line 512 of file FeatureExtractionModelTransformer.cpp.

References SparseValueModel< PointType >::addPoint(), SparseModel< PointType >::addPoint(), Model::getEndFrame(), EditableDenseThreeDimensionalModel::getResolution(), m_descriptor, ModelTransformer::m_input, ModelTransformer::m_output, and EditableDenseThreeDimensionalModel::setColumn().

Referenced by run().

void FeatureExtractionModelTransformer::setCompletion ( int   )  [protected]

Definition at line 607 of file FeatureExtractionModelTransformer.cpp.

References m_descriptor, EditableDenseThreeDimensionalModel::setCompletion(), and SparseModel< PointType >::setCompletion().

Referenced by run().

void FeatureExtractionModelTransformer::getFrames ( int  channelCount,
long  startFrame,
long  size,
float **  buffer 
) [protected]

Definition at line 452 of file FeatureExtractionModelTransformer.cpp.

References DenseTimeValueModel::getChannelCount(), getConformingInput(), DenseTimeValueModel::getData(), and ModelTransformer::m_input.

Referenced by run().

DenseTimeValueModel * FeatureExtractionModelTransformer::getConformingInput (  )  [protected]

Definition at line 280 of file FeatureExtractionModelTransformer.cpp.

References ModelTransformer::getInputModel().

Referenced by FeatureExtractionModelTransformer(), getFrames(), and run().

template<typename ModelClass>
ModelClass* FeatureExtractionModelTransformer::getConformingOutput (  )  [inline, protected]

Definition at line 55 of file FeatureExtractionModelTransformer.h.

References ModelTransformer::m_output.

void ModelTransformer::abandon (  )  [inline, inherited]

Hint to the processing thread that it should give up, for example because the process is going to exit or we want to get rid of the input model.

Caller should still wait() and/or delete the transform before assuming its input and output models are no longer required.

Definition at line 66 of file ModelTransformer.h.

References ModelTransformer::m_abandoned.

Model* ModelTransformer::getInputModel (  )  [inline, inherited]

Return the input model for the transform.

Definition at line 71 of file ModelTransformer.h.

References ModelTransformer::Input::getModel(), and ModelTransformer::m_input.

Referenced by RealTimeEffectModelTransformer::getConformingInput(), and getConformingInput().

int ModelTransformer::getInputChannel (  )  [inline, inherited]

Return the input channel spec for the transform.

Definition at line 76 of file ModelTransformer.h.

References ModelTransformer::Input::getChannel(), and ModelTransformer::m_input.

Model* ModelTransformer::getOutputModel (  )  [inline, inherited]

Return the output model created by the transform.

Returns a null model if the transform could not be initialised; an error message may be available via getMessage() in this situation.

Definition at line 83 of file ModelTransformer.h.

References ModelTransformer::m_output.

Model* ModelTransformer::detachOutputModel (  )  [inline, inherited]

Return the output model, also detaching it from the transformer so that it will not be deleted when the transformer is.

The caller takes ownership of the model.

Definition at line 90 of file ModelTransformer.h.

References ModelTransformer::m_detached, and ModelTransformer::m_output.

Referenced by ModelTransformerFactory::transform().

QString ModelTransformer::getMessage (  )  const [inline, inherited]

Return a warning or error message.

If getOutputModel returned a null pointer, this should contain a fatal error message for the transformer; otherwise it may contain a warning to show to the user about e.g. suboptimal block size or whatever.

Definition at line 98 of file ModelTransformer.h.

References ModelTransformer::m_message.

Referenced by ModelTransformerFactory::transform().

void Thread::start (  )  [slot, inherited]

Definition at line 34 of file Thread.cpp.

References Thread::m_type, and Thread::RTThread.

Referenced by AudioCallbackPlaySource::addModel(), WaveFileModel::fillCache(), FFTDataServer::getCacheAux(), FFTDataServer::isColumnReady(), MatrixFile::MatrixFile(), MP3FileReader::MP3FileReader(), OggVorbisFileReader::OggVorbisFileReader(), DSSIPluginInstance::requestNonRTThread(), ResamplingWavFileReader::ResamplingWavFileReader(), FFTDataServer::FillThread::run(), and ModelTransformerFactory::transform().


Member Data Documentation

Vamp::Plugin* FeatureExtractionModelTransformer::m_plugin [protected]

Definition at line 41 of file FeatureExtractionModelTransformer.h.

Referenced by FeatureExtractionModelTransformer(), run(), and ~FeatureExtractionModelTransformer().

Vamp::Plugin::OutputDescriptor* FeatureExtractionModelTransformer::m_descriptor [protected]

Definition at line 42 of file FeatureExtractionModelTransformer.h.

Referenced by addFeature(), FeatureExtractionModelTransformer(), setCompletion(), and ~FeatureExtractionModelTransformer().

int FeatureExtractionModelTransformer::m_outputFeatureNo [protected]

Definition at line 43 of file FeatureExtractionModelTransformer.h.

Referenced by FeatureExtractionModelTransformer(), and run().

Transform ModelTransformer::m_transform [protected, inherited]

Definition at line 103 of file ModelTransformer.h.

Referenced by FeatureExtractionModelTransformer(), RealTimeEffectModelTransformer::RealTimeEffectModelTransformer(), RealTimeEffectModelTransformer::run(), and run().

Input ModelTransformer::m_input [protected, inherited]

Definition at line 104 of file ModelTransformer.h.

Referenced by addFeature(), getFrames(), ModelTransformer::getInputChannel(), ModelTransformer::getInputModel(), RealTimeEffectModelTransformer::run(), and run().

Model* ModelTransformer::m_output [protected, inherited]

Definition at line 105 of file ModelTransformer.h.

Referenced by addFeature(), ModelTransformer::detachOutputModel(), FeatureExtractionModelTransformer(), getConformingOutput(), ModelTransformer::getOutputModel(), RealTimeEffectModelTransformer::RealTimeEffectModelTransformer(), RealTimeEffectModelTransformer::run(), run(), and ModelTransformer::~ModelTransformer().

bool ModelTransformer::m_detached [protected, inherited]

Definition at line 106 of file ModelTransformer.h.

Referenced by ModelTransformer::detachOutputModel(), and ModelTransformer::~ModelTransformer().

bool ModelTransformer::m_abandoned [protected, inherited]

Definition at line 107 of file ModelTransformer.h.

Referenced by ModelTransformer::abandon(), RealTimeEffectModelTransformer::run(), run(), and ModelTransformer::~ModelTransformer().

QString ModelTransformer::m_message [protected, inherited]

Definition at line 108 of file ModelTransformer.h.

Referenced by FeatureExtractionModelTransformer(), and ModelTransformer::getMessage().


The documentation for this class was generated from the following files:
Generated on Wed Feb 20 15:45:32 2008 for SonicVisualiser by  doxygen 1.5.1