Mercurial > hg > vampy-host
comparison vampyhost.cpp @ 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 |
comparison
equal
deleted
inserted
replaced
2:e30eda0b5e2d | 3:f12ab1553882 |
---|---|
239 | 239 |
240 //This code creates new instance of the plugin anyway | 240 //This code creates new instance of the plugin anyway |
241 PluginLoader *loader = PluginLoader::getInstance(); | 241 PluginLoader *loader = PluginLoader::getInstance(); |
242 | 242 |
243 //load plugin | 243 //load plugin |
244 Plugin *plugin = loader->loadPlugin (pluginKey, 48000); | 244 Plugin *plugin = loader->loadPlugin |
245 (pluginKey, 48000, PluginLoader::ADAPT_ALL_SAFE); | |
245 if (!plugin) { | 246 if (!plugin) { |
246 string pyerr("Failed to load plugin: "); pyerr += pluginKey; | 247 string pyerr("Failed to load plugin: "); pyerr += pluginKey; |
247 PyErr_SetString(PyExc_TypeError,pyerr.c_str()); | 248 PyErr_SetString(PyExc_TypeError,pyerr.c_str()); |
248 return NULL; | 249 return NULL; |
249 } | 250 } |
393 plugDesc->channels = channels; | 394 plugDesc->channels = channels; |
394 plugDesc->stepSize = stepSize; | 395 plugDesc->stepSize = stepSize; |
395 plugDesc->blockSize = blockSize; | 396 plugDesc->blockSize = blockSize; |
396 plugDesc->inputSampleType = PyPluginDescriptor::int16; | 397 plugDesc->inputSampleType = PyPluginDescriptor::int16; |
397 plugDesc->sampleSize = 2; | 398 plugDesc->sampleSize = 2; |
399 | |
400 /*!!! not a problem with plugin loader adapter | |
398 plugDesc->mixChannels = mixChannels; | 401 plugDesc->mixChannels = mixChannels; |
399 | 402 |
400 size_t minch = plugin->getMinChannelCount(); | 403 size_t minch = plugin->getMinChannelCount(); |
401 size_t maxch = plugin->getMaxChannelCount(); | 404 size_t maxch = plugin->getMaxChannelCount(); |
402 if (mixChannels) channels = 1; | 405 if (mixChannels) channels = 1; |
403 | 406 */ |
404 /* TODO: DO WE WANT TO MIX IT DOWN? */ | 407 /* TODO: DO WE WANT TO MIX IT DOWN? */ |
408 /* | |
405 if (maxch < channels || channels < minch) { | 409 if (maxch < channels || channels < minch) { |
406 PyErr_SetString(PyExc_TypeError, | 410 PyErr_SetString(PyExc_TypeError, |
407 "Invalid number of channels."); | 411 "Invalid number of channels."); |
408 return NULL; } | 412 return NULL; } |
409 | 413 */ |
410 if (!plugin->initialise(channels, stepSize, blockSize)) { | 414 if (!plugin->initialise(channels, stepSize, blockSize)) { |
411 PyErr_SetString(PyExc_TypeError, | 415 PyErr_SetString(PyExc_TypeError, |
412 "Plugin initialization failed."); | 416 "Plugin initialization failed."); |
413 return NULL; } | 417 return NULL; } |
414 | 418 |