changeset 276:64724dbc5f05 tonioni

Some debug and warnings
author Chris Cannam
date Mon, 15 Apr 2013 17:38:17 +0100
parents 6bbf62a333c1
children e647e880e711
files audioio/AudioGenerator.cpp
diffstat 1 files changed, 14 insertions(+), 4 deletions(-) [+]
line wrap: on
line diff
--- a/audioio/AudioGenerator.cpp	Sat Apr 13 20:03:40 2013 +0100
+++ b/audioio/AudioGenerator.cpp	Mon Apr 15 17:38:17 2013 +0100
@@ -204,11 +204,19 @@
         configurationXml = parameters->getPlayPluginConfiguration();
     }
 
-    if (pluginId == "") return 0;
+    std::cerr << "AudioGenerator::loadPluginFor(" << model << "): id = " << pluginId << std::endl;
+
+    if (pluginId == "") {
+        SVDEBUG << "AudioGenerator::loadPluginFor(" << model << "): parameters contain empty plugin ID, skipping" << endl;
+        return 0;
+    }
 
     RealTimePluginInstance *plugin = loadPlugin(pluginId, "");
     if (!plugin) return 0;
 
+    std::cerr << "AudioGenerator::loadPluginFor(" << model << "): loaded plugin "
+              << plugin << std::endl;
+
     if (configurationXml != "") {
         PluginXml(plugin).setParametersFromXml(configurationXml);
         setSampleDir(plugin);
@@ -232,7 +240,7 @@
     
     if (!factory) {
 	std::cerr << "Failed to get plugin factory" << std::endl;
-	return false;
+	return 0;
     }
 	
     RealTimePluginInstance *instance =
@@ -251,11 +259,11 @@
     }
     std::string defaultProgram = instance->getProgram(0, 0);
     if (defaultProgram != "") {
-//        std::cerr << "first selecting default program " << defaultProgram << std::endl;
+        std::cerr << "first selecting default program " << defaultProgram << std::endl;
         instance->selectProgram(defaultProgram);
     }
     if (program != "") {
-//        std::cerr << "now selecting desired program " << program << std::endl;
+        std::cerr << "now selecting desired program " << program << std::endl;
         instance->selectProgram(program.toStdString());
     }
     instance->setIdealChannelCount(m_targetChannelCount); // reset!
@@ -400,6 +408,8 @@
 			    buffer, gain, pan, fadeIn, fadeOut);
     }
 
+    std::cerr << "AudioGenerator::mixModel: WARNING: Model " << model << " of type " << model->getTypeName() << " is marked as playable, but I have no mechanism to play it" << std::endl;
+
     return frameCount;
 }