changeset 3:f12ab1553882

Use plugin adapter flags; don't need to concern ourselves with mixdown
author Chris Cannam
date Thu, 31 Jan 2013 13:31:52 +0000
parents e30eda0b5e2d
children 825d787f12df
files vampyhost.cpp vampyhost_test.py
diffstat 2 files changed, 9 insertions(+), 5 deletions(-) [+]
line wrap: on
line diff
--- a/vampyhost.cpp	Thu Jan 31 13:03:47 2013 +0000
+++ b/vampyhost.cpp	Thu Jan 31 13:31:52 2013 +0000
@@ -241,7 +241,8 @@
     PluginLoader *loader = PluginLoader::getInstance();
 	
     //load plugin
-    Plugin *plugin = loader->loadPlugin (pluginKey, 48000);
+    Plugin *plugin = loader->loadPlugin
+        (pluginKey, 48000, PluginLoader::ADAPT_ALL_SAFE);
     if (!plugin) { 		
 	string pyerr("Failed to load plugin: "); pyerr += pluginKey;
 	PyErr_SetString(PyExc_TypeError,pyerr.c_str()); 
@@ -395,18 +396,21 @@
     plugDesc->blockSize = blockSize;
     plugDesc->inputSampleType = PyPluginDescriptor::int16;
     plugDesc->sampleSize = 2;
+
+/*!!! not a problem with plugin loader adapter
     plugDesc->mixChannels = mixChannels; 
-	
+
     size_t minch = plugin->getMinChannelCount();
     size_t maxch = plugin->getMaxChannelCount();
     if (mixChannels) channels = 1;
-
+*/
     /* TODO: DO WE WANT TO MIX IT DOWN? */
+/*
     if (maxch < channels || channels < minch) {
 	PyErr_SetString(PyExc_TypeError,
 			"Invalid number of channels.");
 	return NULL; }
-
+*/
     if (!plugin->initialise(channels, stepSize, blockSize)) {
 	PyErr_SetString(PyExc_TypeError,
 			"Plugin initialization failed.");
--- a/vampyhost_test.py	Thu Jan 31 13:03:47 2013 +0000
+++ b/vampyhost_test.py	Thu Jan 31 13:31:52 2013 +0000
@@ -32,7 +32,7 @@
 print "channels: ",channels
 print "sample-width: ",wavobj.getsampwidth()
 print "position: ",wavobj.tell()
-wavobj.setpos(1000000)
+#wavobj.setpos(1000000)
 
 print wavobj.tell()
 audio = wavobj.readframes(1024) #returns an 8-bit buffer