changeset 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 1cc96e03a903
children 205250c5d2a2
files transform/Transform.cpp transform/Transform.h
diffstat 2 files changed, 5 insertions(+), 4 deletions(-) [+]
line wrap: on
line diff
--- a/transform/Transform.cpp	Tue Sep 01 17:05:32 2015 +0100
+++ b/transform/Transform.cpp	Tue Nov 03 11:34:07 2015 +0000
@@ -18,6 +18,7 @@
 #include "plugin/PluginIdentifier.h"
 
 #include "plugin/FeatureExtractionPluginFactory.h"
+#include "plugin/RealTimePluginFactory.h"
 
 #include <QXmlAttributes>
 
@@ -207,10 +208,10 @@
 {
     if (FeatureExtractionPluginFactory::instanceFor(getPluginIdentifier())) {
         return FeatureExtraction;
+    } else if (RealTimePluginFactory::instanceFor(getPluginIdentifier())) {
+        return RealTimeEffect;
     } else {
-        // We don't have an unknown/invalid return value, so always
-        // return this
-        return RealTimeEffect;
+        return UnknownType;
     }
 }
 
--- a/transform/Transform.h	Tue Sep 01 17:05:32 2015 +0100
+++ b/transform/Transform.h	Tue Nov 03 11:34:07 2015 +0000
@@ -67,7 +67,7 @@
     void setIdentifier(TransformId id);
     TransformId getIdentifier() const;
 
-    enum Type { FeatureExtraction, RealTimeEffect };
+    enum Type { FeatureExtraction, RealTimeEffect, UnknownType };
 
     Type getType() const;
     QString getPluginIdentifier() const;