comparison src/vamp-hostsdk/PluginLoader.cpp @ 431:2819b5c9a395 vampipe

Use ConfigurationRequest/Response, introduce ProcessRequest/Response.
author Chris Cannam
date Wed, 18 May 2016 10:53:19 +0100
parents 5502a06537f6
children c053e5e79b8f
comparison
equal deleted inserted replaced
430:fbdb06ce1e9a 431:2819b5c9a395
67 float inputSampleRate, 67 float inputSampleRate,
68 int adapterFlags); 68 int adapterFlags);
69 69
70 LoadResponse loadPlugin(LoadRequest req); 70 LoadResponse loadPlugin(LoadRequest req);
71 71
72 Plugin::OutputList configurePlugin(Plugin *plugin, PluginConfiguration config); 72 ConfigurationResponse configurePlugin(ConfigurationRequest req);
73 73
74 PluginKey composePluginKey(string libraryName, string identifier); 74 PluginKey composePluginKey(string libraryName, string identifier);
75 75
76 PluginCategoryHierarchy getPluginCategory(PluginKey key); 76 PluginCategoryHierarchy getPluginCategory(PluginKey key);
77 77
167 PluginLoader::loadPlugin(LoadRequest req) 167 PluginLoader::loadPlugin(LoadRequest req)
168 { 168 {
169 return m_impl->loadPlugin(req); 169 return m_impl->loadPlugin(req);
170 } 170 }
171 171
172 Plugin::OutputList 172 ConfigurationResponse
173 PluginLoader::configurePlugin(Plugin *plugin, PluginConfiguration config) 173 PluginLoader::configurePlugin(ConfigurationRequest req)
174 { 174 {
175 return m_impl->configurePlugin(plugin, config); 175 return m_impl->configurePlugin(req);
176 } 176 }
177 177
178 PluginLoader::PluginKey 178 PluginLoader::PluginKey
179 PluginLoader::composePluginKey(string libraryName, string identifier) 179 PluginLoader::composePluginKey(string libraryName, string identifier)
180 { 180 {
453 plugin->getPreferredBlockSize()); 453 plugin->getPreferredBlockSize());
454 454
455 return response; 455 return response;
456 } 456 }
457 457
458 Plugin::OutputList 458 ConfigurationResponse
459 PluginLoader::Impl::configurePlugin(Plugin *plugin, PluginConfiguration config) 459 PluginLoader::Impl::configurePlugin(ConfigurationRequest req)
460 { 460 {
461 for (PluginConfiguration::ParameterMap::const_iterator i = 461 for (PluginConfiguration::ParameterMap::const_iterator i =
462 config.parameterValues.begin(); 462 req.configuration.parameterValues.begin();
463 i != config.parameterValues.end(); ++i) { 463 i != req.configuration.parameterValues.end(); ++i) {
464 plugin->setParameter(i->first, i->second); 464 req.plugin->setParameter(i->first, i->second);
465 } 465 }
466 466
467 if (config.currentProgram != "") { 467 if (req.configuration.currentProgram != "") {
468 plugin->selectProgram(config.currentProgram); 468 req.plugin->selectProgram(req.configuration.currentProgram);
469 } 469 }
470 470
471 if (plugin->initialise(config.channelCount, 471 ConfigurationResponse response;
472 config.stepSize, 472
473 config.blockSize)) { 473 if (req.plugin->initialise(req.configuration.channelCount,
474 return plugin->getOutputDescriptors(); 474 req.configuration.stepSize,
475 } else { 475 req.configuration.blockSize)) {
476 return Plugin::OutputList(); 476 response.outputs = req.plugin->getOutputDescriptors();
477 } 477 }
478
479 return response;
478 } 480 }
479 481
480 void 482 void
481 PluginLoader::Impl::generateTaxonomy() 483 PluginLoader::Impl::generateTaxonomy()
482 { 484 {