Transform Class Reference

#include <Transform.h>

Inherits XmlExportable.

Inheritance diagram for Transform:

Inheritance graph
[legend]
Collaboration diagram for Transform:

Collaboration graph
[legend]
List of all members.

Detailed Description

Definition at line 33 of file Transform.h.

Public Types

enum  Type { FeatureExtraction, RealTimeEffect }
typedef std::map< QString,
float > 
ParameterMap
typedef std::map< QString,
QString > 
ConfigurationMap

Public Member Functions

 Transform ()
 Construct a new Transform with default data and no identifier.
 Transform (QString xml)
 Construct a Transform by parsing the given XML data string.
virtual ~Transform ()
bool operator== (const Transform &)
 Compare two Transforms.
void setIdentifier (TransformId id)
TransformId getIdentifier () const
Type getType () const
QString getPluginIdentifier () const
QString getOutput () const
void setPluginIdentifier (QString pluginIdentifier)
void setOutput (QString output)
const ParameterMapgetParameters () const
void setParameters (const ParameterMap &pm)
void setParameter (QString name, float value)
const ConfigurationMapgetConfiguration () const
void setConfiguration (const ConfigurationMap &cm)
void setConfigurationValue (QString name, QString value)
QString getPluginVersion () const
void setPluginVersion (QString version)
QString getProgram () const
void setProgram (QString program)
size_t getStepSize () const
void setStepSize (size_t s)
size_t getBlockSize () const
void setBlockSize (size_t s)
WindowType getWindowType () const
void setWindowType (WindowType type)
RealTime getStartTime () const
void setStartTime (RealTime t)
RealTime getDuration () const
void setDuration (RealTime d)
float getSampleRate () const
void setSampleRate (float rate)
void toXml (QTextStream &stream, QString indent="", QString extraAttributes="") const
 Stream this exportable object out to XML on a text stream.
void setFromXmlAttributes (const QXmlAttributes &)
 Set the main transform data from the given XML attributes.
virtual QString toXmlString (QString indent="", QString extraAttributes="") const
 Convert this exportable object to XML in a string.

Static Public Member Functions

static TransformId getIdentifierForPluginOutput (QString pluginIdentifier, QString output="")
static QString encodeEntities (QString)
static QString encodeColour (QColor)
static int getObjectExportId (const void *)

Static Protected Member Functions

static QString createIdentifier (QString type, QString soName, QString label, QString output)
static void parseIdentifier (QString identifier, QString &type, QString &soName, QString &label, QString &output)

Protected Attributes

TransformId m_id
ParameterMap m_parameters
ConfigurationMap m_configuration
QString m_pluginVersion
QString m_program
size_t m_stepSize
size_t m_blockSize
WindowType m_windowType
RealTime m_startTime
RealTime m_duration
float m_sampleRate


Member Typedef Documentation

typedef std::map<QString, float> Transform::ParameterMap

Definition at line 78 of file Transform.h.

typedef std::map<QString, QString> Transform::ConfigurationMap

Definition at line 84 of file Transform.h.


Member Enumeration Documentation

enum Transform::Type

Enumerator:
FeatureExtraction 
RealTimeEffect 

Definition at line 63 of file Transform.h.


Constructor & Destructor Documentation

Transform::Transform (  ) 

Construct a new Transform with default data and no identifier.

The Transform object will be meaningless until some data and an identifier have been set on it.

To construct a Transform for use with a particular transform identifier, use TransformFactory::getDefaultTransformFor.

Definition at line 33 of file Transform.cpp.

Transform::Transform ( QString  xml  ) 

Construct a Transform by parsing the given XML data string.

This is the inverse of toXml.

Definition at line 41 of file Transform.cpp.

References setConfigurationValue(), setFromXmlAttributes(), and setParameter().

Transform::~Transform (  )  [virtual]

Definition at line 105 of file Transform.cpp.


Member Function Documentation

bool Transform::operator== ( const Transform  ) 

Compare two Transforms.

They only compare equal if every data element matches.

Definition at line 110 of file Transform.cpp.

References m_blockSize, m_configuration, m_duration, m_id, m_parameters, m_program, m_sampleRate, m_startTime, m_stepSize, and m_windowType.

void Transform::setIdentifier ( TransformId  id  ) 

Definition at line 126 of file Transform.cpp.

References m_id.

Referenced by TransformFactory::getDefaultTransformFor(), TransformFactory::getTransformInputDomain(), TransformFactory::instantiateDefaultPluginFor(), SVFileReader::readDerivation(), and setFromXmlAttributes().

TransformId Transform::getIdentifier (  )  const

Definition at line 132 of file Transform.cpp.

References m_id.

Referenced by Document::addDerivedModel(), Document::createDerivedLayer(), SVFileReader::endElement(), TransformFactory::getPluginConfigurationXml(), TransformFactory::instantiatePluginFor(), RealTimeEffectModelTransformer::RealTimeEffectModelTransformer(), Document::setMainModel(), TransformFactory::setParametersFromPluginConfigurationXml(), and Document::writeBackwardCompatibleDerivation().

Transform::Type Transform::getType (  )  const

Definition at line 156 of file Transform.cpp.

References FeatureExtraction, getPluginIdentifier(), FeatureExtractionPluginFactory::instanceFor(), and RealTimeEffect.

Referenced by TransformFactory::getTransformInputDomain(), and TransformFactory::instantiateDefaultPluginFor().

QString Transform::getPluginIdentifier (  )  const

Definition at line 168 of file Transform.cpp.

References m_id.

Referenced by FeatureExtractionModelTransformer::FeatureExtractionModelTransformer(), getType(), TransformFactory::instantiateDefaultPluginFor(), RealTimeEffectModelTransformer::RealTimeEffectModelTransformer(), and setOutput().

QString Transform::getOutput (  )  const

Definition at line 174 of file Transform.cpp.

References m_id.

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

void Transform::setPluginIdentifier ( QString  pluginIdentifier  ) 

Definition at line 180 of file Transform.cpp.

References getOutput(), and m_id.

void Transform::setOutput ( QString  output  ) 

Definition at line 186 of file Transform.cpp.

References getPluginIdentifier(), and m_id.

TransformId Transform::getIdentifierForPluginOutput ( QString  pluginIdentifier,
QString  output = "" 
) [static]

Definition at line 192 of file Transform.cpp.

const Transform::ParameterMap & Transform::getParameters (  )  const

Definition at line 199 of file Transform.cpp.

References m_parameters.

Referenced by TransformFactory::setPluginParameters().

void Transform::setParameters ( const ParameterMap pm  ) 

Definition at line 205 of file Transform.cpp.

References m_parameters.

Referenced by TransformFactory::setParametersFromPlugin().

void Transform::setParameter ( QString  name,
float  value 
)

Definition at line 211 of file Transform.cpp.

References m_parameters.

Referenced by Document::alignModel(), SVFileReader::readParameter(), and Transform().

const Transform::ConfigurationMap & Transform::getConfiguration (  )  const

Definition at line 219 of file Transform.cpp.

References m_configuration.

Referenced by TransformFactory::setPluginParameters().

void Transform::setConfiguration ( const ConfigurationMap cm  ) 

Definition at line 225 of file Transform.cpp.

References m_configuration.

Referenced by TransformFactory::setParametersFromPlugin().

void Transform::setConfigurationValue ( QString  name,
QString  value 
)

Definition at line 231 of file Transform.cpp.

References m_configuration.

Referenced by Transform().

QString Transform::getPluginVersion (  )  const

Definition at line 239 of file Transform.cpp.

References m_pluginVersion.

Referenced by FeatureExtractionModelTransformer::FeatureExtractionModelTransformer().

void Transform::setPluginVersion ( QString  version  ) 

Definition at line 245 of file Transform.cpp.

References m_pluginVersion.

Referenced by Document::addDerivedModel(), TransformFactory::getDefaultTransformFor(), and setFromXmlAttributes().

QString Transform::getProgram (  )  const

Definition at line 251 of file Transform.cpp.

References m_program.

Referenced by TransformFactory::setPluginParameters().

void Transform::setProgram ( QString  program  ) 

Definition at line 257 of file Transform.cpp.

References m_program.

Referenced by setFromXmlAttributes(), and TransformFactory::setParametersFromPlugin().

size_t Transform::getStepSize (  )  const

Definition at line 264 of file Transform.cpp.

References m_stepSize.

Referenced by Document::alignModel(), FeatureExtractionModelTransformer::FeatureExtractionModelTransformer(), TransformFactory::makeContextConsistentWithPlugin(), FeatureExtractionModelTransformer::run(), and Document::writeBackwardCompatibleDerivation().

void Transform::setStepSize ( size_t  s  ) 

Definition at line 270 of file Transform.cpp.

References m_stepSize.

Referenced by Document::alignModel(), FeatureExtractionModelTransformer::FeatureExtractionModelTransformer(), TransformFactory::makeContextConsistentWithPlugin(), SVFileReader::readDerivation(), and setFromXmlAttributes().

size_t Transform::getBlockSize (  )  const

Definition at line 276 of file Transform.cpp.

References m_blockSize.

Referenced by Document::alignModel(), FeatureExtractionModelTransformer::FeatureExtractionModelTransformer(), TransformFactory::makeContextConsistentWithPlugin(), RealTimeEffectModelTransformer::RealTimeEffectModelTransformer(), FeatureExtractionModelTransformer::run(), and Document::writeBackwardCompatibleDerivation().

void Transform::setBlockSize ( size_t  s  ) 

Definition at line 282 of file Transform.cpp.

References m_blockSize.

Referenced by FeatureExtractionModelTransformer::FeatureExtractionModelTransformer(), TransformFactory::makeContextConsistentWithPlugin(), SVFileReader::readDerivation(), RealTimeEffectModelTransformer::RealTimeEffectModelTransformer(), and setFromXmlAttributes().

WindowType Transform::getWindowType (  )  const

Definition at line 288 of file Transform.cpp.

References m_windowType.

Referenced by FeatureExtractionModelTransformer::run(), and Document::writeBackwardCompatibleDerivation().

void Transform::setWindowType ( WindowType  type  ) 

Definition at line 294 of file Transform.cpp.

References m_windowType.

Referenced by SVFileReader::readDerivation(), and setFromXmlAttributes().

RealTime Transform::getStartTime (  )  const

Definition at line 300 of file Transform.cpp.

References m_startTime.

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

void Transform::setStartTime ( RealTime  t  ) 

Definition at line 306 of file Transform.cpp.

References m_startTime.

Referenced by SVFileReader::readDerivation(), and setFromXmlAttributes().

RealTime Transform::getDuration (  )  const

Definition at line 312 of file Transform.cpp.

References m_duration.

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

void Transform::setDuration ( RealTime  d  ) 

Definition at line 318 of file Transform.cpp.

References m_duration.

Referenced by SVFileReader::readDerivation().

float Transform::getSampleRate (  )  const

Definition at line 324 of file Transform.cpp.

References m_sampleRate.

Referenced by Document::addDerivedModel(), and TransformFactory::instantiatePluginFor().

void Transform::setSampleRate ( float  rate  ) 

Definition at line 330 of file Transform.cpp.

References m_sampleRate.

Referenced by TransformFactory::getDefaultTransformFor(), and setFromXmlAttributes().

void Transform::toXml ( QTextStream &  stream,
QString  indent = "",
QString  extraAttributes = "" 
) const [virtual]

Stream this exportable object out to XML on a text stream.

Implements XmlExportable.

Definition at line 336 of file Transform.cpp.

References XmlExportable::encodeEntities(), m_blockSize, m_configuration, m_duration, m_id, m_parameters, m_pluginVersion, m_program, m_sampleRate, m_startTime, m_stepSize, m_windowType, and RealTime::toString().

Referenced by Document::writeBackwardCompatibleDerivation().

void Transform::setFromXmlAttributes ( const QXmlAttributes &   ) 

Set the main transform data from the given XML attributes.

This does not set the parameters or configuration, which are exported to separate XML elements rather than attributes of the transform element.

Note that this only sets those attributes which are actually present in the argument. Any attributes not defined in the attribute will remain unchanged in the Transform. If your aim is to create a transform exactly matching the given attributes, ensure you start from an empty transform rather than one that has already been configured.

Definition at line 387 of file Transform.cpp.

References RealTime::fromString(), setBlockSize(), setIdentifier(), setPluginVersion(), setProgram(), setSampleRate(), setStartTime(), setStepSize(), and setWindowType().

Referenced by SVFileReader::readTransform(), and Transform().

QString Transform::createIdentifier ( QString  type,
QString  soName,
QString  label,
QString  output 
) [static, protected]

Definition at line 138 of file Transform.cpp.

References PluginIdentifier::createIdentifier().

void Transform::parseIdentifier ( QString  identifier,
QString &  type,
QString &  soName,
QString &  label,
QString &  output 
) [static, protected]

Definition at line 146 of file Transform.cpp.

References PluginIdentifier::parseIdentifier().

QString XmlExportable::toXmlString ( QString  indent = "",
QString  extraAttributes = "" 
) const [virtual, inherited]

Convert this exportable object to XML in a string.

The default implementation calls toXml and returns the result as a string. Do not override this unless you really know what you're doing.

Definition at line 25 of file XmlExportable.cpp.

References XmlExportable::toXml().

Referenced by LayerFactory::setLayerDefaultProperties().

QString XmlExportable::encodeEntities ( QString   )  [static, inherited]

Definition at line 41 of file XmlExportable.cpp.

Referenced by AudioGenerator::getDefaultPlayPluginConfiguration(), SVFileReader::readPlugin(), Layer::toBriefXml(), WaveFileModel::toXml(), toXml(), TextPoint::toXml(), PluginXml::toXml(), Model::toXml(), Layer::toXml(), ImagePoint::toXml(), and Document::writeBackwardCompatibleDerivation().

QString XmlExportable::encodeColour ( QColor   )  [static, inherited]

Definition at line 54 of file XmlExportable.cpp.

Referenced by ColourDatabase::getStringValues().

int XmlExportable::getObjectExportId ( const void *   )  [static, inherited]

Definition at line 71 of file XmlExportable.cpp.

Referenced by FFTDataServer::generateFileBasename(), View::getTextLabelHeight(), Layer::toBriefXml(), SparseModel< PointType >::toXml(), Model::toXml(), Layer::toXml(), EditableDenseThreeDimensionalModel::toXml(), Document::toXml(), and Document::writeBackwardCompatibleDerivation().


Member Data Documentation

TransformId Transform::m_id [protected]

Definition at line 133 of file Transform.h.

Referenced by getIdentifier(), getOutput(), getPluginIdentifier(), operator==(), setIdentifier(), setOutput(), setPluginIdentifier(), and toXml().

ParameterMap Transform::m_parameters [protected]

Definition at line 142 of file Transform.h.

Referenced by getParameters(), operator==(), setParameter(), setParameters(), and toXml().

ConfigurationMap Transform::m_configuration [protected]

Definition at line 143 of file Transform.h.

Referenced by getConfiguration(), operator==(), setConfiguration(), setConfigurationValue(), and toXml().

QString Transform::m_pluginVersion [protected]

Definition at line 144 of file Transform.h.

Referenced by getPluginVersion(), setPluginVersion(), and toXml().

QString Transform::m_program [protected]

Definition at line 145 of file Transform.h.

Referenced by getProgram(), operator==(), setProgram(), and toXml().

size_t Transform::m_stepSize [protected]

Definition at line 146 of file Transform.h.

Referenced by getStepSize(), operator==(), setStepSize(), and toXml().

size_t Transform::m_blockSize [protected]

Definition at line 147 of file Transform.h.

Referenced by getBlockSize(), operator==(), setBlockSize(), and toXml().

WindowType Transform::m_windowType [protected]

Definition at line 148 of file Transform.h.

Referenced by getWindowType(), operator==(), setWindowType(), and toXml().

RealTime Transform::m_startTime [protected]

Definition at line 149 of file Transform.h.

Referenced by getStartTime(), operator==(), setStartTime(), and toXml().

RealTime Transform::m_duration [protected]

Definition at line 150 of file Transform.h.

Referenced by getDuration(), operator==(), setDuration(), and toXml().

float Transform::m_sampleRate [protected]

Definition at line 151 of file Transform.h.

Referenced by getSampleRate(), operator==(), setSampleRate(), and toXml().


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