Mercurial > hg > svapp
diff framework/TransformUserConfigurator.cpp @ 548:baa11365ebdd bqaudioio
Merge from branch bqresample
author | Chris Cannam |
---|---|
date | Wed, 07 Dec 2016 11:51:42 +0000 |
parents | 36aa947ec962 |
children | b23bebfdfaba |
line wrap: on
line diff
--- a/framework/TransformUserConfigurator.cpp Wed Dec 07 11:50:54 2016 +0000 +++ b/framework/TransformUserConfigurator.cpp Wed Dec 07 11:51:42 2016 +0000 @@ -45,12 +45,12 @@ { if (plugin && plugin->getType() == "Feature Extraction Plugin") { Vamp::Plugin *vp = static_cast<Vamp::Plugin *>(plugin); - SVDEBUG << "TransformUserConfigurator::getChannelRange: is a VP" << endl; + SVDEBUG << "TransformUserConfigurator::getChannelRange: is a Vamp plugin" << endl; minChannels = int(vp->getMinChannelCount()); maxChannels = int(vp->getMaxChannelCount()); return true; } else { - SVDEBUG << "TransformUserConfigurator::getChannelRange: is not a VP" << endl; + SVDEBUG << "TransformUserConfigurator::getChannelRange: is not a Vamp plugin" << endl; return TransformFactory::getInstance()-> getTransformChannelRange(identifier, minChannels, maxChannels); } @@ -80,28 +80,9 @@ if (!plugin) return false; - if (FeatureExtractionPluginFactory::instanceFor(id)) { - - Vamp::Plugin *vp = static_cast<Vamp::Plugin *>(plugin); - - frequency = (vp->getInputDomain() == Vamp::Plugin::FrequencyDomain); - - std::vector<Vamp::Plugin::OutputDescriptor> od = - vp->getOutputDescriptors(); - - cerr << "configure: looking for output: " << output << endl; - - if (od.size() > 1) { - for (size_t i = 0; i < od.size(); ++i) { - if (od[i].identifier == output.toStdString()) { - outputLabel = od[i].name.c_str(); - outputDescription = od[i].description.c_str(); - break; - } - } - } - - } else if (RealTimePluginFactory::instanceFor(id)) { + SVDEBUG << "TransformUserConfigurator::configure: identifier " << id << endl; + + if (RealTimePluginFactory::instanceFor(id)) { RealTimePluginFactory *factory = RealTimePluginFactory::instanceFor(id); const RealTimePluginDescriptor *desc = factory->getPluginDescriptor(id); @@ -130,8 +111,29 @@ SVDEBUG << "Setting auditioning effect" << endl; source->setAuditioningEffect(rtp); } + + } else { + + Vamp::Plugin *vp = static_cast<Vamp::Plugin *>(plugin); + + frequency = (vp->getInputDomain() == Vamp::Plugin::FrequencyDomain); + + std::vector<Vamp::Plugin::OutputDescriptor> od = + vp->getOutputDescriptors(); + +// cerr << "configure: looking for output: " << output << endl; + + if (od.size() > 1) { + for (size_t i = 0; i < od.size(); ++i) { + if (od[i].identifier == output.toStdString()) { + outputLabel = od[i].name.c_str(); + outputDescription = od[i].description.c_str(); + break; + } + } + } } - + int sourceChannels = 1; if (dynamic_cast<DenseTimeValueModel *>(inputModel)) { sourceChannels = dynamic_cast<DenseTimeValueModel *>(inputModel) @@ -182,12 +184,12 @@ if (selectedInput != "") { if (modelMap.contains(selectedInput)) { inputModel = modelMap.value(selectedInput); - cerr << "Found selected input \"" << selectedInput << "\" in model map, result is " << inputModel << endl; + SVDEBUG << "Found selected input \"" << selectedInput << "\" in model map, result is " << inputModel << endl; } else { - cerr << "Failed to find selected input \"" << selectedInput << "\" in model map" << endl; + SVDEBUG << "Failed to find selected input \"" << selectedInput << "\" in model map" << endl; } } else { - cerr << "Selected input empty: \"" << selectedInput << "\"" << endl; + SVDEBUG << "Selected input empty: \"" << selectedInput << "\"" << endl; } // Write parameters back to transform object