Mercurial > hg > vamp-plugin-sdk
diff src/vamp-hostsdk/PluginLoader.cpp @ 466:a94ab90dfd53 vampipe
Remove RequestResponse, PluginConfiguration and PluginStaticData again. I don't think they are proving general enough to be worth adding to this SDK at this point. Will try them out in piper-cpp instead.
author | Chris Cannam |
---|---|
date | Thu, 13 Oct 2016 17:06:53 +0100 |
parents | 85dadd0d482f |
children | 0545cd3f1738 |
line wrap: on
line diff
--- a/src/vamp-hostsdk/PluginLoader.cpp Thu Oct 13 09:09:04 2016 +0100 +++ b/src/vamp-hostsdk/PluginLoader.cpp Thu Oct 13 17:06:53 2016 +0100 @@ -62,15 +62,9 @@ PluginKeyList listPlugins(); - ListResponse listPluginData(); - Plugin *loadPlugin(PluginKey key, float inputSampleRate, int adapterFlags); - - LoadResponse loadPlugin(LoadRequest req); - - ConfigurationResponse configurePlugin(ConfigurationRequest req); PluginKey composePluginKey(string libraryName, string identifier); @@ -150,12 +144,6 @@ return m_impl->listPlugins(); } -ListResponse -PluginLoader::listPluginData() -{ - return m_impl->listPluginData(); -} - Plugin * PluginLoader::loadPlugin(PluginKey key, float inputSampleRate, @@ -164,18 +152,6 @@ return m_impl->loadPlugin(key, inputSampleRate, adapterFlags); } -LoadResponse -PluginLoader::loadPlugin(LoadRequest req) -{ - return m_impl->loadPlugin(req); -} - -ConfigurationResponse -PluginLoader::configurePlugin(ConfigurationRequest req) -{ - return m_impl->configurePlugin(req); -} - PluginLoader::PluginKey PluginLoader::composePluginKey(string libraryName, string identifier) { @@ -223,26 +199,6 @@ return plugins; } -ListResponse -PluginLoader::Impl::listPluginData() -{ - PluginKeyList keys = listPlugins(); - ListResponse response; - - for (PluginKeyList::const_iterator ki = keys.begin(); ki != keys.end(); ++ki) { - string key = *ki; - Plugin *p = loadPlugin(key, 44100, 0); - if (p) { - PluginCategoryHierarchy category = getPluginCategory(key); - response.available.push_back - (PluginStaticData::fromPlugin(key, category, p)); - } - delete p; - } - - return response; -} - void PluginLoader::Impl::enumeratePlugins(PluginKey forPlugin) { @@ -426,62 +382,6 @@ return 0; } -LoadResponse -PluginLoader::Impl::loadPlugin(LoadRequest req) -{ - Plugin *plugin = loadPlugin(req.pluginKey, - req.inputSampleRate, - req.adapterFlags); - LoadResponse response; - response.plugin = plugin; - if (!plugin) return response; - - response.plugin = plugin; - response.staticData = PluginStaticData::fromPlugin - (req.pluginKey, - getPluginCategory(req.pluginKey), - plugin); - - int defaultChannels = 0; - if (plugin->getMinChannelCount() == plugin->getMaxChannelCount()) { - defaultChannels = plugin->getMinChannelCount(); - } - - response.defaultConfiguration = PluginConfiguration::fromPlugin - (plugin, - defaultChannels, - plugin->getPreferredStepSize(), - plugin->getPreferredBlockSize()); - - return response; -} - -ConfigurationResponse -PluginLoader::Impl::configurePlugin(ConfigurationRequest req) -{ - for (PluginConfiguration::ParameterMap::const_iterator i = - req.configuration.parameterValues.begin(); - i != req.configuration.parameterValues.end(); ++i) { - req.plugin->setParameter(i->first, i->second); - } - - if (req.configuration.currentProgram != "") { - req.plugin->selectProgram(req.configuration.currentProgram); - } - - ConfigurationResponse response; - - response.plugin = req.plugin; - - if (req.plugin->initialise(req.configuration.channelCount, - req.configuration.stepSize, - req.configuration.blockSize)) { - response.outputs = req.plugin->getOutputDescriptors(); - } - - return response; -} - void PluginLoader::Impl::generateTaxonomy() {