comparison transform/Transform.cpp @ 1206:659372323b45 tony-2.0-integration

Merge latest SV 3.0 branch code
author Chris Cannam
date Fri, 19 Aug 2016 15:58:57 +0100
parents d094598f84bd
children ba16388b937d
comparison
equal deleted inserted replaced
1136:e94719f941ba 1206:659372323b45
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>
51 QString error; 52 QString error;
52 int errorLine; 53 int errorLine;
53 int errorColumn; 54 int errorColumn;
54 55
55 if (!doc.setContent(xml, false, &error, &errorLine, &errorColumn)) { 56 if (!doc.setContent(xml, false, &error, &errorLine, &errorColumn)) {
56 cerr << "Transform::Transform: Error in parsing XML: " 57 m_errorString = QString("%1 at line %2, column %3")
57 << error << " at line " << errorLine 58 .arg(error).arg(errorLine).arg(errorColumn);
58 << ", column " << errorColumn << endl;
59 cerr << "Input follows:" << endl;
60 cerr << xml << endl;
61 cerr << "Input ends." << endl;
62 return; 59 return;
63 } 60 }
64 61
65 QDomElement transformElt = doc.firstChildElement("transform"); 62 QDomElement transformElt = doc.firstChildElement("transform");
66 QDomNamedNodeMap attrNodes = transformElt.attributes(); 63 QDomNamedNodeMap attrNodes = transformElt.attributes();
205 Transform::Type 202 Transform::Type
206 Transform::getType() const 203 Transform::getType() const
207 { 204 {
208 if (FeatureExtractionPluginFactory::instanceFor(getPluginIdentifier())) { 205 if (FeatureExtractionPluginFactory::instanceFor(getPluginIdentifier())) {
209 return FeatureExtraction; 206 return FeatureExtraction;
207 } else if (RealTimePluginFactory::instanceFor(getPluginIdentifier())) {
208 return RealTimeEffect;
210 } else { 209 } else {
211 // We don't have an unknown/invalid return value, so always 210 return UnknownType;
212 // return this
213 return RealTimeEffect;
214 } 211 }
215 } 212 }
216 213
217 QString 214 QString
218 Transform::getPluginIdentifier() const 215 Transform::getPluginIdentifier() const