00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016 #ifndef _TRANSFORM_H_
00017 #define _TRANSFORM_H_
00018
00019 #include "base/XmlExportable.h"
00020 #include "base/Window.h"
00021 #include "base/RealTime.h"
00022
00023 #include <QString>
00024
00025 typedef QString TransformId;
00026
00027 class QXmlAttributes;
00028
00029 namespace Vamp {
00030 class PluginBase;
00031 }
00032
00033 class Transform : public XmlExportable
00034 {
00035 public:
00044 Transform();
00045
00050 Transform(QString xml);
00051
00052 virtual ~Transform();
00053
00058 bool operator==(const Transform &);
00059
00060 void setIdentifier(TransformId id);
00061 TransformId getIdentifier() const;
00062
00063 enum Type { FeatureExtraction, RealTimeEffect };
00064
00065 Type getType() const;
00066 QString getPluginIdentifier() const;
00067 QString getOutput() const;
00068
00069 void setPluginIdentifier(QString pluginIdentifier);
00070 void setOutput(QString output);
00071
00072
00073
00074
00075 static TransformId getIdentifierForPluginOutput(QString pluginIdentifier,
00076 QString output = "");
00077
00078 typedef std::map<QString, float> ParameterMap;
00079
00080 const ParameterMap &getParameters() const;
00081 void setParameters(const ParameterMap &pm);
00082 void setParameter(QString name, float value);
00083
00084 typedef std::map<QString, QString> ConfigurationMap;
00085
00086 const ConfigurationMap &getConfiguration() const;
00087 void setConfiguration(const ConfigurationMap &cm);
00088 void setConfigurationValue(QString name, QString value);
00089
00090 QString getPluginVersion() const;
00091 void setPluginVersion(QString version);
00092
00093 QString getProgram() const;
00094 void setProgram(QString program);
00095
00096 size_t getStepSize() const;
00097 void setStepSize(size_t s);
00098
00099 size_t getBlockSize() const;
00100 void setBlockSize(size_t s);
00101
00102 WindowType getWindowType() const;
00103 void setWindowType(WindowType type);
00104
00105 RealTime getStartTime() const;
00106 void setStartTime(RealTime t);
00107
00108 RealTime getDuration() const;
00109 void setDuration(RealTime d);
00110
00111 float getSampleRate() const;
00112 void setSampleRate(float rate);
00113
00114 void toXml(QTextStream &stream, QString indent = "",
00115 QString extraAttributes = "") const;
00116
00130 void setFromXmlAttributes(const QXmlAttributes &);
00131
00132 protected:
00133 TransformId m_id;
00134
00135 static QString createIdentifier
00136 (QString type, QString soName, QString label, QString output);
00137
00138 static void parseIdentifier
00139 (QString identifier,
00140 QString &type, QString &soName, QString &label, QString &output);
00141
00142 ParameterMap m_parameters;
00143 ConfigurationMap m_configuration;
00144 QString m_pluginVersion;
00145 QString m_program;
00146 size_t m_stepSize;
00147 size_t m_blockSize;
00148 WindowType m_windowType;
00149 RealTime m_startTime;
00150 RealTime m_duration;
00151 float m_sampleRate;
00152 };
00153
00154 #endif
00155