diff vampyhost.cpp @ 6:aacfd14a0ae2

Various further fixes. Now we core dump instead of throwing an exception in the test program. Hurrah
author Chris Cannam
date Mon, 18 Feb 2013 16:18:22 +0000
parents 825d787f12df
children d29c25695f5e
line wrap: on
line diff
--- a/vampyhost.cpp	Thu Jan 31 17:54:46 2013 +0000
+++ b/vampyhost.cpp	Mon Feb 18 16:18:22 2013 +0000
@@ -306,7 +306,8 @@
     PluginLoader *loader = PluginLoader::getInstance();
 	
     //load plugin
-    Plugin *plugin = loader->loadPlugin (pluginKey, inputSampleRate);
+    Plugin *plugin = loader->loadPlugin (pluginKey, inputSampleRate, 
+                                         PluginLoader::ADAPT_ALL_SAFE);
     if (!plugin) { 		
 	string pyerr("Failed to load plugin: "); pyerr += pluginKey;
 	PyErr_SetString(PyExc_TypeError,pyerr.c_str()); 
@@ -398,9 +399,11 @@
     plugDesc->blockSize = blockSize;
 
     if (!plugin->initialise(channels, stepSize, blockSize)) {
+        std::cerr << "Failed to initialise native plugin adapter with channels = " << channels << ", stepSize = " << stepSize << ", blockSize = " << blockSize << " and ADAPT_ALL_SAFE set" << std::endl;
 	PyErr_SetString(PyExc_TypeError,
 			"Plugin initialization failed.");
-	return NULL; }
+	return NULL;
+    }
 
     plugDesc->identifier = 
 	plugDesc->key.substr(plugDesc->key.rfind(':')+1);
@@ -520,6 +523,7 @@
     }
 
     if (PyList_GET_SIZE(pyBuffer) != channels) {
+        std::cerr << "Wrong number of channels: got " << PyList_GET_SIZE(pyBuffer) << ", expected " << channels << std::endl;
 	PyErr_SetString(PyExc_TypeError, "Wrong number of channels");
         return NULL;
     }