# HG changeset patch # User Chris Cannam # Date 1197308233 0 # Node ID 1c68162201851fa05ce819b3af77e067e9b6eaef # Parent f4f9c039c4581df8acf10b04a0487f851ca041a0 * more handy functions diff -r f4f9c039c458 -r 1c6816220185 plugin/transform/Transform.cpp --- a/plugin/transform/Transform.cpp Mon Dec 10 15:32:40 2007 +0000 +++ b/plugin/transform/Transform.cpp Mon Dec 10 17:37:13 2007 +0000 @@ -176,6 +176,25 @@ return m_id.section(':', 3); } +void +Transform::setPluginIdentifier(QString pluginIdentifier) +{ + m_id = pluginIdentifier + ':' + getOutput(); +} + +void +Transform::setOutput(QString output) +{ + m_id = getPluginIdentifier() + ':' + output; +} + +TransformId +Transform::getIdentifierForPluginOutput(QString pluginIdentifier, + QString output) +{ + return pluginIdentifier + ':' + output; +} + const Transform::ParameterMap & Transform::getParameters() const { diff -r f4f9c039c458 -r 1c6816220185 plugin/transform/Transform.h --- a/plugin/transform/Transform.h Mon Dec 10 15:32:40 2007 +0000 +++ b/plugin/transform/Transform.h Mon Dec 10 17:37:13 2007 +0000 @@ -59,15 +59,21 @@ void setIdentifier(TransformId id); TransformId getIdentifier() const; - - void setPlugin(QString pluginIdentifier); - void setOutput(QString output); enum Type { FeatureExtraction, RealTimeEffect }; Type getType() const; QString getPluginIdentifier() const; QString getOutput() const; + + void setPluginIdentifier(QString pluginIdentifier); + void setOutput(QString output); + + // Turn a plugin ID and output name into a transform ID. Note + // that our pluginIdentifier is the same thing as the Vamp SDK's + // PluginLoader::PluginKey. + static TransformId getIdentifierForPluginOutput(QString pluginIdentifier, + QString output = ""); typedef std::map ParameterMap;