diff plugin/FeatureExtractionPluginFactory.cpp @ 1150:fc4cb3901316 3.0-integration

Debug bits
author Chris Cannam
date Fri, 22 Jan 2016 09:52:08 +0000
parents afed8be79032
children ea636412f9fe
line wrap: on
line diff
--- a/plugin/FeatureExtractionPluginFactory.cpp	Tue Jan 19 12:32:30 2016 +0000
+++ b/plugin/FeatureExtractionPluginFactory.cpp	Fri Jan 22 09:52:08 2016 +0000
@@ -164,7 +164,7 @@
             QObject::tr("<b>Failed to load plugins</b>"
                         "<p>Failed to load one or more plugin libraries:</p>\n");
         warningMessage += "<ul>";
-        for (int i = 0; i < bad.size(); ++i) {
+        for (int i = 0; in_range_for(bad, i); ++i) {
             QString m;
             if (badStatuses[i] == PluginLoadFailedToLoadLibrary) {
                 m = QObject::tr("Failed to load library");
@@ -376,7 +376,9 @@
     QString type, soname, label;
     PluginIdentifier::parseIdentifier(identifier, type, soname, label);
     if (type != "vamp") {
-	SVDEBUG << "FeatureExtractionPluginFactory::instantiatePlugin: Wrong factory for plugin type " << type << endl;
+#ifdef DEBUG_PLUGIN_SCAN_AND_INSTANTIATE
+        cerr << "FeatureExtractionPluginFactory::instantiatePlugin: Wrong factory for plugin type " << type << endl;
+#endif
 	return 0;
     }
 
@@ -388,7 +390,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
 
@@ -407,7 +409,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;
     }
 
@@ -439,7 +441,9 @@
         }
     }
 
-//    SVDEBUG << "FeatureExtractionPluginFactory::instantiatePlugin: Instantiated plugin " << label << " from library " << soname << ": descriptor " << descriptor << ", rv "<< rv << ", label " << rv->getName() << ", outputs " << rv->getOutputDescriptors().size() << endl;
+#ifdef DEBUG_PLUGIN_SCAN_AND_INSTANTIATE
+    cerr << "FeatureExtractionPluginFactory::instantiatePlugin: Instantiated plugin " << label << " from library " << soname << ": descriptor " << descriptor << ", rv "<< rv << ", label " << rv->getName() << ", outputs " << rv->getOutputDescriptors().size() << endl;
+#endif
     
     return rv;
 }
@@ -449,7 +453,9 @@
 {
     void *handle = m_handleMap[plugin];
     if (handle) {
-//        SVDEBUG << "unloading library " << handle << " for plugin " << plugin << endl;
+#ifdef DEBUG_PLUGIN_SCAN_AND_INSTANTIATE
+        cerr << "unloading library " << handle << " for plugin " << plugin << endl;
+#endif
         DLCLOSE(handle);
     }
     m_handleMap.erase(plugin);