changeset 1141:99acfd2d9f5d

Merge
author Chris Cannam
date Tue, 03 Nov 2015 12:41:15 +0000
parents c7f1300dbf64 (diff) 6d550a16f7d6 (current diff)
children 870acd589a38
files
diffstat 5 files changed, 37 insertions(+), 26 deletions(-) [+]
line wrap: on
line diff
--- a/plugin/FeatureExtractionPluginFactory.cpp	Thu Oct 22 11:53:06 2015 +0100
+++ b/plugin/FeatureExtractionPluginFactory.cpp	Tue Nov 03 12:41:15 2015 +0000
@@ -119,7 +119,7 @@
     for (std::vector<QString>::iterator i = path.begin(); i != path.end(); ++i) {
 
 #ifdef DEBUG_PLUGIN_SCAN_AND_INSTANTIATE
-        SVDEBUG << "FeatureExtractionPluginFactory::getPluginIdentifiers: scanning directory " << i-<< endl;
+        cerr << "FeatureExtractionPluginFactory::getPluginIdentifiers: scanning directory " << *i << endl;
 #endif
 
 	QDir pluginDir(*i, PLUGIN_GLOB,
@@ -131,7 +131,7 @@
             QString soname = pluginDir.filePath(pluginDir[j]);
 
 #ifdef DEBUG_PLUGIN_SCAN_AND_INSTANTIATE
-            SVDEBUG << "FeatureExtractionPluginFactory::getPluginIdentifiers: trying potential library " << soname << endl;
+            cerr << "FeatureExtractionPluginFactory::getPluginIdentifiers: trying potential library " << soname << endl;
 #endif
 
             void *libraryHandle = DLOPEN(soname, RTLD_LAZY | RTLD_LOCAL);
@@ -142,7 +142,7 @@
             }
 
 #ifdef DEBUG_PLUGIN_SCAN_AND_INSTANTIATE
-            SVDEBUG << "FeatureExtractionPluginFactory::getPluginIdentifiers: It's a library all right, checking for descriptor" << endl;
+            cerr << "FeatureExtractionPluginFactory::getPluginIdentifiers: It's a library all right, checking for descriptor" << endl;
 #endif
 
             VampGetPluginDescriptorFunction fn = (VampGetPluginDescriptorFunction)
@@ -157,7 +157,7 @@
             }
 
 #ifdef DEBUG_PLUGIN_SCAN_AND_INSTANTIATE
-            SVDEBUG << "FeatureExtractionPluginFactory::getPluginIdentifiers: Vamp descriptor found" << endl;
+            cerr << "FeatureExtractionPluginFactory::getPluginIdentifiers: Vamp descriptor found" << endl;
 #endif
 
             const VampPluginDescriptor *descriptor = 0;
@@ -175,7 +175,7 @@
                               << descriptor->identifier << "\" at indices "
                               << known[descriptor->identifier] << " and "
                               << index << endl;
-                    SVDEBUG << "FeatureExtractionPluginFactory::getPluginIdentifiers: Avoiding this library (obsolete API?)" << endl;
+                    cerr << "FeatureExtractionPluginFactory::getPluginIdentifiers: Avoiding this library (obsolete API?)" << endl;
                     ok = false;
                     break;
                 } else {
@@ -195,7 +195,7 @@
                         ("vamp", soname, descriptor->identifier);
                     rv.push_back(id);
 #ifdef DEBUG_PLUGIN_SCAN_AND_INSTANTIATE
-                    SVDEBUG << "FeatureExtractionPluginFactory::getPluginIdentifiers: Found plugin id " << id << " at index " << index << endl;
+                    cerr << "FeatureExtractionPluginFactory::getPluginIdentifiers: Found plugin id " << id << " at index " << index << endl;
 #endif
                     ++index;
                 }
@@ -218,7 +218,7 @@
     QString file = "";
 
 #ifdef DEBUG_PLUGIN_SCAN_AND_INSTANTIATE
-    SVDEBUG << "FeatureExtractionPluginFactory::findPluginFile(\""
+    cerr << "FeatureExtractionPluginFactory::findPluginFile(\""
               << soname << "\", \"" << inDir << "\")"
               << endl;
 #endif
@@ -235,7 +235,7 @@
         if (QFileInfo(file).exists() && QFileInfo(file).isFile()) {
 
 #ifdef DEBUG_PLUGIN_SCAN_AND_INSTANTIATE
-            SVDEBUG << "FeatureExtractionPluginFactory::findPluginFile: "
+            cerr << "FeatureExtractionPluginFactory::findPluginFile: "
                       << "found trivially at " << file << endl;
 #endif
 
@@ -247,7 +247,7 @@
             if (QFileInfo(file).baseName() == QFileInfo(soname).baseName()) {
 
 #ifdef DEBUG_PLUGIN_SCAN_AND_INSTANTIATE
-                SVDEBUG << "FeatureExtractionPluginFactory::findPluginFile: "
+                cerr << "FeatureExtractionPluginFactory::findPluginFile: "
                           << "found \"" << soname << "\" at " << file << endl;
 #endif
 
@@ -256,7 +256,7 @@
         }
 
 #ifdef DEBUG_PLUGIN_SCAN_AND_INSTANTIATE
-        SVDEBUG << "FeatureExtractionPluginFactory::findPluginFile (with dir): "
+        cerr << "FeatureExtractionPluginFactory::findPluginFile (with dir): "
                   << "not found" << endl;
 #endif
 
@@ -268,7 +268,7 @@
 
         if (fi.isAbsolute() && fi.exists() && fi.isFile()) {
 #ifdef DEBUG_PLUGIN_SCAN_AND_INSTANTIATE
-            SVDEBUG << "FeatureExtractionPluginFactory::findPluginFile: "
+            cerr << "FeatureExtractionPluginFactory::findPluginFile: "
                       << "found trivially at " << soname << endl;
 #endif
             return soname;
@@ -289,7 +289,7 @@
         }
 
 #ifdef DEBUG_PLUGIN_SCAN_AND_INSTANTIATE
-        SVDEBUG << "FeatureExtractionPluginFactory::findPluginFile: "
+        cerr << "FeatureExtractionPluginFactory::findPluginFile: "
                   << "not found" << endl;
 #endif
 
@@ -312,7 +312,7 @@
     QString type, soname, label;
     PluginIdentifier::parseIdentifier(identifier, type, soname, label);
     if (type != "vamp") {
-	SVDEBUG << "FeatureExtractionPluginFactory::instantiatePlugin: Wrong factory for plugin type " << type << endl;
+	cerr << "FeatureExtractionPluginFactory::instantiatePlugin: Wrong factory for plugin type " << type << endl;
 	return 0;
     }
 
@@ -324,7 +324,7 @@
     } else if (found != soname) {
 
 #ifdef DEBUG_PLUGIN_SCAN_AND_INSTANTIATE
-        SVDEBUG << "FeatureExtractionPluginFactory::instantiatePlugin: Given library name was " << soname << ", found at " << found << endl;
+        cerr << "FeatureExtractionPluginFactory::instantiatePlugin: Given library name was " << soname << ", found at " << found << endl;
         cerr << soname << " -> " << found << endl;
 #endif
 
@@ -343,7 +343,7 @@
         DLSYM(libraryHandle, "vampGetPluginDescriptor");
     
     if (!fn) {
-        SVDEBUG << "FeatureExtractionPluginFactory::instantiatePlugin: No descriptor function in " << soname << endl;
+        cerr << "FeatureExtractionPluginFactory::instantiatePlugin: No descriptor function in " << soname << endl;
         goto done;
     }
 
--- a/transform/FileFeatureWriter.cpp	Thu Oct 22 11:53:06 2015 +0100
+++ b/transform/FileFeatureWriter.cpp	Tue Nov 03 12:41:15 2015 +0000
@@ -46,7 +46,7 @@
         } else if (m_support & SupportOneFileTotal) {
             m_singleFileName = QString("output.%1").arg(m_extension);
         } else {
-            SVDEBUG << "FileFeatureWriter::FileFeatureWriter: ERROR: Invalid support specification " << support << endl;
+            cerr << "FileFeatureWriter::FileFeatureWriter: ERROR: Invalid support specification " << support << endl;
         }
     }
 }
@@ -130,7 +130,7 @@
             if (m_support & SupportOneFilePerTrackTransform &&
                 m_support & SupportOneFilePerTrack) {
                 if (m_singleFileName != "") {
-                    SVDEBUG << "FileFeatureWriter::setParameters: WARNING: Both one-file and many-files parameters provided, ignoring many-files" << endl;
+                    cerr << "FileFeatureWriter::setParameters: WARNING: Both one-file and many-files parameters provided, ignoring many-files" << endl;
                 } else {
                     m_manyFiles = true;
                 }
@@ -144,7 +144,7 @@
                     // OneFilePerTrack), so we need to be able to
                     // override it
 //                    if (m_manyFiles) {
-//                        SVDEBUG << "FileFeatureWriter::setParameters: WARNING: Both many-files and one-file parameters provided, ignoring one-file" << endl;
+//                        cerr << "FileFeatureWriter::setParameters: WARNING: Both many-files and one-file parameters provided, ignoring one-file" << endl;
 //                    } else {
                         m_singleFileName = i->second.c_str();
 //                    }
@@ -153,7 +153,7 @@
         } else if (i->first == "stdout") {
             if (m_support & SupportStdOut) {
                 if (m_singleFileName != "") {
-                    SVDEBUG << "FileFeatureWriter::setParameters: WARNING: Both stdout and one-file provided, ignoring stdout" << endl;
+                    cerr << "FileFeatureWriter::setParameters: WARNING: Both stdout and one-file provided, ignoring stdout" << endl;
                 } else {
                     m_stdout = true;
                 }
@@ -173,7 +173,7 @@
     if (m_singleFileName != "") {
         if (QFileInfo(m_singleFileName).exists() && !(m_force || m_append)) {
             cerr << endl << "FileFeatureWriter: ERROR: Specified output file \"" << m_singleFileName << "\" exists and neither --" << getWriterTag() << "-force nor --" << getWriterTag() << "-append flag is specified -- not overwriting" << endl;
-            SVDEBUG << "NOTE: To find out how to fix this problem, read the help for the --" << getWriterTag() << "-force" << endl << "and --" << getWriterTag() << "-append options" << endl;
+            cerr << "NOTE: To find out how to fix this problem, read the help for the --" << getWriterTag() << "-force" << endl << "and --" << getWriterTag() << "-append options" << endl;
             return "";
         }
         return m_singleFileName;
@@ -220,7 +220,7 @@
 
     if (QFileInfo(filename).exists() && !(m_force || m_append)) {
         cerr << endl << "FileFeatureWriter: ERROR: Output file \"" << filename << "\" exists (for input file or URL \"" << trackId << "\" and transform \"" << transformId << "\") and neither --" << getWriterTag() << "-force nor --" << getWriterTag() << "-append is specified -- not overwriting" << endl;
-        SVDEBUG << "NOTE: To find out how to fix this problem, read the help for the --" << getWriterTag() << "-force" << endl << "and --" << getWriterTag() << "-append options" << endl;
+        cerr << "NOTE: To find out how to fix this problem, read the help for the --" << getWriterTag() << "-force" << endl << "and --" << getWriterTag() << "-append options" << endl;
         return "";
     }
     
--- a/transform/Transform.cpp	Thu Oct 22 11:53:06 2015 +0100
+++ b/transform/Transform.cpp	Tue Nov 03 12:41:15 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	Thu Oct 22 11:53:06 2015 +0100
+++ b/transform/Transform.h	Tue Nov 03 12:41:15 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;
--- a/transform/TransformFactory.cpp	Thu Oct 22 11:53:06 2015 +0100
+++ b/transform/TransformFactory.cpp	Tue Nov 03 12:41:15 2015 +0000
@@ -794,6 +794,9 @@
 
     if (t.getType() == Transform::FeatureExtraction) {
 
+//        cerr << "TransformFactory::instantiateDefaultPluginFor: identifier \""
+//             << identifier << "\" is a feature extraction transform" << endl;
+        
         FeatureExtractionPluginFactory *factory = 
             FeatureExtractionPluginFactory::instanceFor(pluginId);
 
@@ -801,7 +804,10 @@
             plugin = factory->instantiatePlugin(pluginId, rate);
         }
 
-    } else {
+    } else if (t.getType() == Transform::RealTimeEffect) {
+
+//        cerr << "TransformFactory::instantiateDefaultPluginFor: identifier \""
+//             << identifier << "\" is a real-time transform" << endl;
 
         RealTimePluginFactory *factory = 
             RealTimePluginFactory::instanceFor(pluginId);
@@ -809,6 +815,10 @@
         if (factory) {
             plugin = factory->instantiatePlugin(pluginId, 0, 0, rate, 1024, 1);
         }
+
+    } else {
+        cerr << "TransformFactory: ERROR: transform id \""
+             << identifier << "\" is of unknown type" << endl;
     }
 
     return plugin;