comparison transform/Transform.cpp @ 1138:a2dbedc0cfee

Make it possible to report that a transform is of unknown type (e.g. invalid transform id, user mixed up filename and transform id, etc)
author Chris Cannam
date Tue, 03 Nov 2015 11:34:07 +0000
parents 26cf6d5251ec
children d094598f84bd
comparison
equal deleted inserted replaced
1129:1cc96e03a903 1138:a2dbedc0cfee
16 #include "Transform.h" 16 #include "Transform.h"
17 17
18 #include "plugin/PluginIdentifier.h" 18 #include "plugin/PluginIdentifier.h"
19 19
20 #include "plugin/FeatureExtractionPluginFactory.h" 20 #include "plugin/FeatureExtractionPluginFactory.h"
21 #include "plugin/RealTimePluginFactory.h"
21 22
22 #include <QXmlAttributes> 23 #include <QXmlAttributes>
23 24
24 #include <QDomDocument> 25 #include <QDomDocument>
25 #include <QDomElement> 26 #include <QDomElement>
205 Transform::Type 206 Transform::Type
206 Transform::getType() const 207 Transform::getType() const
207 { 208 {
208 if (FeatureExtractionPluginFactory::instanceFor(getPluginIdentifier())) { 209 if (FeatureExtractionPluginFactory::instanceFor(getPluginIdentifier())) {
209 return FeatureExtraction; 210 return FeatureExtraction;
211 } else if (RealTimePluginFactory::instanceFor(getPluginIdentifier())) {
212 return RealTimeEffect;
210 } else { 213 } else {
211 // We don't have an unknown/invalid return value, so always 214 return UnknownType;
212 // return this
213 return RealTimeEffect;
214 } 215 }
215 } 216 }
216 217
217 QString 218 QString
218 Transform::getPluginIdentifier() const 219 Transform::getPluginIdentifier() const