comparison transform/TransformFactory.cpp @ 686:b4a8d8221eaf debug-output

Remove most toStdString calls (no longer needed, with debug header)
author Chris Cannam
date Thu, 12 May 2011 17:31:24 +0100
parents 3f6d9930bc28
children 06f13a3b9e9e
comparison
equal deleted inserted replaced
685:99222d4bfc78 686:b4a8d8221eaf
111 111
112 std::set<TransformDescription> dset; 112 std::set<TransformDescription> dset;
113 for (TransformDescriptionMap::const_iterator i = m_transforms.begin(); 113 for (TransformDescriptionMap::const_iterator i = m_transforms.begin();
114 i != m_transforms.end(); ++i) { 114 i != m_transforms.end(); ++i) {
115 #ifdef DEBUG_TRANSFORM_FACTORY 115 #ifdef DEBUG_TRANSFORM_FACTORY
116 cerr << "inserting transform into set: id = " << i->second.identifier.toStdString() << endl; 116 cerr << "inserting transform into set: id = " << i->second.identifier << endl;
117 #endif 117 #endif
118 dset.insert(i->second); 118 dset.insert(i->second);
119 } 119 }
120 120
121 TransformList list; 121 TransformList list;
122 for (std::set<TransformDescription>::const_iterator i = dset.begin(); 122 for (std::set<TransformDescription>::const_iterator i = dset.begin();
123 i != dset.end(); ++i) { 123 i != dset.end(); ++i) {
124 #ifdef DEBUG_TRANSFORM_FACTORY 124 #ifdef DEBUG_TRANSFORM_FACTORY
125 cerr << "inserting transform into list: id = " << i->identifier.toStdString() << endl; 125 cerr << "inserting transform into list: id = " << i->identifier << endl;
126 #endif 126 #endif
127 list.push_back(*i); 127 list.push_back(*i);
128 } 128 }
129 129
130 return list; 130 return list;
157 157
158 std::set<TransformDescription> dset; 158 std::set<TransformDescription> dset;
159 for (TransformDescriptionMap::const_iterator i = m_uninstalledTransforms.begin(); 159 for (TransformDescriptionMap::const_iterator i = m_uninstalledTransforms.begin();
160 i != m_uninstalledTransforms.end(); ++i) { 160 i != m_uninstalledTransforms.end(); ++i) {
161 #ifdef DEBUG_TRANSFORM_FACTORY 161 #ifdef DEBUG_TRANSFORM_FACTORY
162 cerr << "inserting transform into set: id = " << i->second.identifier.toStdString() << endl; 162 cerr << "inserting transform into set: id = " << i->second.identifier << endl;
163 #endif 163 #endif
164 dset.insert(i->second); 164 dset.insert(i->second);
165 } 165 }
166 166
167 TransformList list; 167 TransformList list;
168 for (std::set<TransformDescription>::const_iterator i = dset.begin(); 168 for (std::set<TransformDescription>::const_iterator i = dset.begin();
169 i != dset.end(); ++i) { 169 i != dset.end(); ++i) {
170 #ifdef DEBUG_TRANSFORM_FACTORY 170 #ifdef DEBUG_TRANSFORM_FACTORY
171 cerr << "inserting transform into uninstalled list: id = " << i->identifier.toStdString() << endl; 171 cerr << "inserting transform into uninstalled list: id = " << i->identifier << endl;
172 #endif 172 #endif
173 list.push_back(*i); 173 list.push_back(*i);
174 } 174 }
175 175
176 return list; 176 return list;
476 476
477 bool configurable = (!plugin->getPrograms().empty() || 477 bool configurable = (!plugin->getPrograms().empty() ||
478 !plugin->getParameterDescriptors().empty()); 478 !plugin->getParameterDescriptors().empty());
479 479
480 #ifdef DEBUG_TRANSFORM_FACTORY 480 #ifdef DEBUG_TRANSFORM_FACTORY
481 cerr << "Feature extraction plugin transform: " << transformId.toStdString() << " friendly name: " << friendlyName.toStdString() << endl; 481 cerr << "Feature extraction plugin transform: " << transformId << " friendly name: " << friendlyName << endl;
482 #endif 482 #endif
483 483
484 transforms[transformId] = 484 transforms[transformId] =
485 TransformDescription(TransformDescription::Analysis, 485 TransformDescription(TransformDescription::Analysis,
486 category, 486 category,
528 } 528 }
529 529
530 //!!! if (descriptor->controlOutputPortCount == 0 || 530 //!!! if (descriptor->controlOutputPortCount == 0 ||
531 // descriptor->audioInputPortCount == 0) continue; 531 // descriptor->audioInputPortCount == 0) continue;
532 532
533 // std::cout << "TransformFactory::populateRealTimePlugins: plugin " << pluginId.toStdString() << " has " << descriptor->controlOutputPortCount << " control output ports, " << descriptor->audioOutputPortCount << " audio outputs, " << descriptor->audioInputPortCount << " audio inputs" << endl; 533 // std::cout << "TransformFactory::populateRealTimePlugins: plugin " << pluginId << " has " << descriptor->controlOutputPortCount << " control output ports, " << descriptor->audioOutputPortCount << " audio outputs, " << descriptor->audioInputPortCount << " audio inputs" << endl;
534 534
535 QString pluginName = descriptor->name.c_str(); 535 QString pluginName = descriptor->name.c_str();
536 QString category = factory->getPluginCategory(pluginId); 536 QString category = factory->getPluginCategory(pluginId);
537 bool configurable = (descriptor->parameterCount > 0); 537 bool configurable = (descriptor->parameterCount > 0);
538 QString maker = descriptor->maker.c_str(); 538 QString maker = descriptor->maker.c_str();
677 TransformId tid = Transform::getIdentifierForPluginOutput(*i, *j); 677 TransformId tid = Transform::getIdentifierForPluginOutput(*i, *j);
678 678
679 if (m_transforms.find(tid) != m_transforms.end()) { 679 if (m_transforms.find(tid) != m_transforms.end()) {
680 #ifdef DEBUG_TRANSFORM_FACTORY 680 #ifdef DEBUG_TRANSFORM_FACTORY
681 std::cerr << "TransformFactory::populateUninstalledTransforms: " 681 std::cerr << "TransformFactory::populateUninstalledTransforms: "
682 << tid.toStdString() << " is installed; adding info url if appropriate, skipping rest" << std::endl; 682 << tid << " is installed; adding info url if appropriate, skipping rest" << std::endl;
683 #endif 683 #endif
684 if (infoUrl != "") { 684 if (infoUrl != "") {
685 if (m_transforms[tid].infoUrl == "") { 685 if (m_transforms[tid].infoUrl == "") {
686 m_transforms[tid].infoUrl = infoUrl; 686 m_transforms[tid].infoUrl = infoUrl;
687 } 687 }
689 continue; 689 continue;
690 } 690 }
691 691
692 #ifdef DEBUG_TRANSFORM_FACTORY 692 #ifdef DEBUG_TRANSFORM_FACTORY
693 std::cerr << "TransformFactory::populateUninstalledTransforms: " 693 std::cerr << "TransformFactory::populateUninstalledTransforms: "
694 << "adding " << tid.toStdString() << std::endl; 694 << "adding " << tid << std::endl;
695 #endif 695 #endif
696 696
697 QString oname = desc.getOutputName(*j); 697 QString oname = desc.getOutputName(*j);
698 if (oname == "") oname = *j; 698 if (oname == "") oname = *j;
699 699
1068 Vamp::PluginBase *plugin = instantiateDefaultPluginFor 1068 Vamp::PluginBase *plugin = instantiateDefaultPluginFor
1069 (t.getIdentifier(), 0); 1069 (t.getIdentifier(), 0);
1070 if (!plugin) { 1070 if (!plugin) {
1071 cerr << "TransformFactory::getPluginConfigurationXml: " 1071 cerr << "TransformFactory::getPluginConfigurationXml: "
1072 << "Unable to instantiate plugin for transform \"" 1072 << "Unable to instantiate plugin for transform \""
1073 << t.getIdentifier().toStdString() << "\"" << endl; 1073 << t.getIdentifier() << "\"" << endl;
1074 return xml; 1074 return xml;
1075 } 1075 }
1076 1076
1077 setPluginParameters(t, plugin); 1077 setPluginParameters(t, plugin);
1078 1078
1090 Vamp::PluginBase *plugin = instantiateDefaultPluginFor 1090 Vamp::PluginBase *plugin = instantiateDefaultPluginFor
1091 (t.getIdentifier(), 0); 1091 (t.getIdentifier(), 0);
1092 if (!plugin) { 1092 if (!plugin) {
1093 cerr << "TransformFactory::setParametersFromPluginConfigurationXml: " 1093 cerr << "TransformFactory::setParametersFromPluginConfigurationXml: "
1094 << "Unable to instantiate plugin for transform \"" 1094 << "Unable to instantiate plugin for transform \""
1095 << t.getIdentifier().toStdString() << "\"" << endl; 1095 << t.getIdentifier() << "\"" << endl;
1096 return; 1096 return;
1097 } 1097 }
1098 1098
1099 PluginXml(plugin).setParametersFromXml(xml); 1099 PluginXml(plugin).setParametersFromXml(xml);
1100 setParametersFromPlugin(t, plugin); 1100 setParametersFromPlugin(t, plugin);