# HG changeset patch # User Chris Cannam # Date 1476460834 -3600 # Node ID a75fdb8b368c706a4c033090dcdc4e9e50ebf681 # Parent 1cdcd2ee3d9132ae5b843ee28dbdc0150f2fdb83# Parent bd8484e193539a1c8382144342b260e7455e04f9 Merge from vampipe branch. This removes 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. diff -r 1cdcd2ee3d91 -r a75fdb8b368c Makefile.in --- a/Makefile.in Fri Oct 14 09:32:11 2016 +0100 +++ b/Makefile.in Fri Oct 14 17:00:34 2016 +0100 @@ -153,9 +153,6 @@ $(HOSTSDKDIR)/PluginSummarisingAdapter.h \ $(HOSTSDKDIR)/PluginWrapper.h \ $(HOSTSDKDIR)/RealTime.h \ - $(HOSTSDKDIR)/PluginConfiguration.h \ - $(HOSTSDKDIR)/PluginStaticData.h \ - $(HOSTSDKDIR)/RequestResponse.h \ $(HOSTSDKDIR)/hostguard.h \ $(HOSTSDKDIR)/host-c.h \ $(HOSTSDKDIR)/vamp-hostsdk.h diff -r 1cdcd2ee3d91 -r a75fdb8b368c build/Makefile.mingw32 --- a/build/Makefile.mingw32 Fri Oct 14 09:32:11 2016 +0100 +++ b/build/Makefile.mingw32 Fri Oct 14 17:00:34 2016 +0100 @@ -132,9 +132,6 @@ $(HOSTSDKDIR)/PluginLoader.h \ $(HOSTSDKDIR)/PluginSummarisingAdapter.h \ $(HOSTSDKDIR)/PluginWrapper.h \ - $(HOSTSDKDIR)/PluginConfiguration.h \ - $(HOSTSDKDIR)/PluginStaticData.h \ - $(HOSTSDKDIR)/RequestResponse.h \ $(HOSTSDKDIR)/hostguard.h \ $(HOSTSDKDIR)/host-c.h \ $(HOSTSDKDIR)/vamp-hostsdk.h diff -r 1cdcd2ee3d91 -r a75fdb8b368c build/Makefile.mingw64 --- a/build/Makefile.mingw64 Fri Oct 14 09:32:11 2016 +0100 +++ b/build/Makefile.mingw64 Fri Oct 14 17:00:34 2016 +0100 @@ -132,9 +132,6 @@ $(HOSTSDKDIR)/PluginLoader.h \ $(HOSTSDKDIR)/PluginSummarisingAdapter.h \ $(HOSTSDKDIR)/PluginWrapper.h \ - $(HOSTSDKDIR)/PluginConfiguration.h \ - $(HOSTSDKDIR)/PluginStaticData.h \ - $(HOSTSDKDIR)/RequestResponse.h \ $(HOSTSDKDIR)/hostguard.h \ $(HOSTSDKDIR)/host-c.h \ $(HOSTSDKDIR)/vamp-hostsdk.h diff -r 1cdcd2ee3d91 -r a75fdb8b368c build/Makefile.osx --- a/build/Makefile.osx Fri Oct 14 09:32:11 2016 +0100 +++ b/build/Makefile.osx Fri Oct 14 17:00:34 2016 +0100 @@ -140,9 +140,6 @@ $(HOSTSDKDIR)/PluginLoader.h \ $(HOSTSDKDIR)/PluginSummarisingAdapter.h \ $(HOSTSDKDIR)/PluginWrapper.h \ - $(HOSTSDKDIR)/PluginConfiguration.h \ - $(HOSTSDKDIR)/PluginStaticData.h \ - $(HOSTSDKDIR)/RequestResponse.h \ $(HOSTSDKDIR)/hostguard.h \ $(HOSTSDKDIR)/host-c.h \ $(HOSTSDKDIR)/vamp-hostsdk.h diff -r 1cdcd2ee3d91 -r a75fdb8b368c build/Makefile.osx.106 --- a/build/Makefile.osx.106 Fri Oct 14 09:32:11 2016 +0100 +++ b/build/Makefile.osx.106 Fri Oct 14 17:00:34 2016 +0100 @@ -161,9 +161,6 @@ $(HOSTSDKDIR)/PluginLoader.h \ $(HOSTSDKDIR)/PluginSummarisingAdapter.h \ $(HOSTSDKDIR)/PluginWrapper.h \ - $(HOSTSDKDIR)/PluginConfiguration.h \ - $(HOSTSDKDIR)/PluginStaticData.h \ - $(HOSTSDKDIR)/RequestResponse.h \ $(HOSTSDKDIR)/hostguard.h \ $(HOSTSDKDIR)/host-c.h \ $(HOSTSDKDIR)/vamp-hostsdk.h diff -r 1cdcd2ee3d91 -r a75fdb8b368c src/vamp-hostsdk/PluginLoader.cpp --- a/src/vamp-hostsdk/PluginLoader.cpp Fri Oct 14 09:32:11 2016 +0100 +++ b/src/vamp-hostsdk/PluginLoader.cpp Fri Oct 14 17:00:34 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() { diff -r 1cdcd2ee3d91 -r a75fdb8b368c vamp-hostsdk/PluginConfiguration.h --- a/vamp-hostsdk/PluginConfiguration.h Fri Oct 14 09:32:11 2016 +0100 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,113 +0,0 @@ -/* -*- c-basic-offset: 4 indent-tabs-mode: nil -*- vi:set ts=8 sts=4 sw=4: */ - -/* - Vamp - - An API for audio analysis and feature extraction plugins. - - Centre for Digital Music, Queen Mary, University of London. - Copyright 2006-2016 Chris Cannam and QMUL. - - Permission is hereby granted, free of charge, to any person - obtaining a copy of this software and associated documentation - files (the "Software"), to deal in the Software without - restriction, including without limitation the rights to use, copy, - modify, merge, publish, distribute, sublicense, and/or sell copies - of the Software, and to permit persons to whom the Software is - furnished to do so, subject to the following conditions: - - The above copyright notice and this permission notice shall be - included in all copies or substantial portions of the Software. - - THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, - EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF - MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND - NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS BE LIABLE FOR - ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF - CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION - WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. - - Except as contained in this notice, the names of the Centre for - Digital Music; Queen Mary, University of London; and Chris Cannam - shall not be used in advertising or otherwise to promote the sale, - use or other dealings in this Software without prior written - authorization. -*/ - -#ifndef VAMP_PLUGIN_CONFIGURATION_H -#define VAMP_PLUGIN_CONFIGURATION_H - -#include "hostguard.h" - -#include "Plugin.h" - -#include -#include - -_VAMP_SDK_HOSTSPACE_BEGIN(PluginConfiguration.h) - -namespace Vamp { - -namespace HostExt { - -/** - * \class PluginConfiguration PluginConfiguration.h - * - * Vamp::HostExt::PluginConfiguration is a structure bundling together - * data that affect the configuration of a plugin: parameter values, - * programs, and initialisation settings. Although an interactive Vamp - * plugin host may configure a plugin in stages, for example to take - * into account that a plugin's preferred step and block size may - * change when its parameters are changed, a batch host or a host - * supporting store and recall of configurations may wish to keep all - * configuration settings together. - * - * \note This class was introduced in version 2.7 of the Vamp plugin - * SDK. - */ -struct PluginConfiguration -{ - PluginConfiguration() : // invalid configuration by default - channelCount(0), stepSize(0), blockSize(0) { } - - int channelCount; - int stepSize; - int blockSize; - typedef std::map ParameterMap; - ParameterMap parameterValues; - std::string currentProgram; - - static PluginConfiguration - fromPlugin(Plugin *p, - int channelCount, - int stepSize, - int blockSize) { - - PluginConfiguration c; - - c.channelCount = channelCount; - c.stepSize = stepSize; - c.blockSize = blockSize; - - PluginBase::ParameterList params = p->getParameterDescriptors(); - for (PluginBase::ParameterList::const_iterator i = params.begin(); - i != params.end(); ++i) { - std::string pid = i->identifier; - c.parameterValues[pid] = p->getParameter(pid); - } - - if (!p->getPrograms().empty()) { - c.currentProgram = p->getCurrentProgram(); - } - - return c; - } -}; - -} - -} - -_VAMP_SDK_HOSTSPACE_END(PluginConfiguration.h) - -#endif diff -r 1cdcd2ee3d91 -r a75fdb8b368c vamp-hostsdk/PluginLoader.h --- a/vamp-hostsdk/PluginLoader.h Fri Oct 14 09:32:11 2016 +0100 +++ b/vamp-hostsdk/PluginLoader.h Fri Oct 14 17:00:34 2016 +0100 @@ -43,7 +43,6 @@ #include "hostguard.h" #include "PluginWrapper.h" -#include "RequestResponse.h" _VAMP_SDK_HOSTSPACE_BEGIN(PluginLoader.h) @@ -129,16 +128,6 @@ PluginKeyList listPlugins(); /** - * Search for all available Vamp plugins, and return a list of - * static data about each plugin in the order in which they were - * found. This is slower but returns more comprehensive - * information than listPlugins(). - * - * \see ListResponse, PluginStaticData - */ - ListResponse listPluginData(); - - /** * AdapterFlags contains a set of values that may be OR'd together * to indicate in which circumstances PluginLoader should use a * plugin adapter to make a plugin easier to use for a host that @@ -211,33 +200,6 @@ Plugin *loadPlugin(PluginKey key, float inputSampleRate, int adapterFlags = 0); - - /** - * Load a Vamp plugin, given its key, inputSampleRate and the - * adapter flags, bundled into a LoadRequest structure. The loaded - * plugin is returned along with its static data and default - * configuration in a LoadResponse. - * - * \see AdapterFlags, PluginInputDomainAdapter, PluginChannelAdapter, LoadRequest, LoadResponse - */ - LoadResponse loadPlugin(LoadRequest req); - - /** - * Configure and initialise a Vamp plugin. This applies the - * parameter and program settings found in the PluginConfiguration - * part of the supplied ConfigurationRequest and initialises the - * plugin. (Many hosts will prefer to do this themselves in - * stages, by calling methods on the plugin directly.) - * - * Return a ConfigurationResponse containing the result of calling - * getOutputDescriptors() on the configured and initialised - * plugin, representing the outputs of the plugin following - * configuration (since output ranges etc can depend on the - * parameters). If initialisation fails, returns an empty list. - * - * \see PluginConfiguration, ConfigurationRequest, ConfigurationResponse - */ - ConfigurationResponse configurePlugin(ConfigurationRequest req); /** * Given a Vamp plugin library name and plugin identifier, return diff -r 1cdcd2ee3d91 -r a75fdb8b368c vamp-hostsdk/PluginStaticData.h --- a/vamp-hostsdk/PluginStaticData.h Fri Oct 14 09:32:11 2016 +0100 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,133 +0,0 @@ -/* -*- c-basic-offset: 4 indent-tabs-mode: nil -*- vi:set ts=8 sts=4 sw=4: */ - -/* - Vamp - - An API for audio analysis and feature extraction plugins. - - Centre for Digital Music, Queen Mary, University of London. - Copyright 2006-2016 Chris Cannam and QMUL. - - Permission is hereby granted, free of charge, to any person - obtaining a copy of this software and associated documentation - files (the "Software"), to deal in the Software without - restriction, including without limitation the rights to use, copy, - modify, merge, publish, distribute, sublicense, and/or sell copies - of the Software, and to permit persons to whom the Software is - furnished to do so, subject to the following conditions: - - The above copyright notice and this permission notice shall be - included in all copies or substantial portions of the Software. - - THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, - EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF - MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND - NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS BE LIABLE FOR - ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF - CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION - WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. - - Except as contained in this notice, the names of the Centre for - Digital Music; Queen Mary, University of London; and Chris Cannam - shall not be used in advertising or otherwise to promote the sale, - use or other dealings in this Software without prior written - authorization. -*/ - -#ifndef VAMP_PLUGIN_STATIC_DATA_H -#define VAMP_PLUGIN_STATIC_DATA_H - -#include "hostguard.h" -#include "Plugin.h" - -_VAMP_SDK_HOSTSPACE_BEGIN(PluginStaticData.h) - -namespace Vamp { - -namespace HostExt { - -/** - * \class PluginStaticData PluginStaticData.h - * - * Vamp::HostExt::PluginStaticData is a structure bundling together - * all the information about a plugin that cannot be changed by the - * plugin after it is loaded. That is, everything that does not depend - * on a parameter or initialisation setting. - * - * All of the information in here can be queried from other sources - * directly (notably the Plugin class itself); this structure just - * pulls it together in one place and provides something that can be - * stored and recalled without having a Plugin object to hand. - * - * \note This class was introduced in version 2.7 of the Vamp plugin - * SDK and is used only by host SDK functions that were also - * introduced in that release (or newer). - */ -struct PluginStaticData -{ -public: - struct Basic { - std::string identifier; - std::string name; - std::string description; - }; - typedef std::vector BasicList; - - PluginStaticData() : // invalid static data by default - pluginVersion(0), minChannelCount(0), maxChannelCount(0), - inputDomain(Plugin::TimeDomain) { } - - std::string pluginKey; - Basic basic; - std::string maker; - std::string copyright; - int pluginVersion; - std::vector category; - int minChannelCount; - int maxChannelCount; - PluginBase::ParameterList parameters; - PluginBase::ProgramList programs; - Plugin::InputDomain inputDomain; - BasicList basicOutputInfo; - - static PluginStaticData - fromPlugin(std::string pluginKey, - std::vector category, - Plugin *p) { - - PluginStaticData d; - d.pluginKey = pluginKey; - d.basic.identifier = p->getIdentifier(); - d.basic.name = p->getName(); - d.basic.description = p->getDescription(); - d.maker = p->getMaker(); - d.copyright = p->getCopyright(); - d.pluginVersion = p->getPluginVersion(); - d.category = category; - d.minChannelCount = p->getMinChannelCount(); - d.maxChannelCount = p->getMaxChannelCount(); - d.parameters = p->getParameterDescriptors(); - d.programs = p->getPrograms(); - d.inputDomain = p->getInputDomain(); - - Plugin::OutputList outputs = p->getOutputDescriptors(); - for (Plugin::OutputList::const_iterator i = outputs.begin(); - i != outputs.end(); ++i) { - Basic b; - b.identifier = i->identifier; - b.name = i->name; - b.description = i->description; - d.basicOutputInfo.push_back(b); - } - - return d; - } -}; - -} - -} - -_VAMP_SDK_HOSTSPACE_END(PluginStaticData.h) - -#endif diff -r 1cdcd2ee3d91 -r a75fdb8b368c vamp-hostsdk/RequestResponse.h --- a/vamp-hostsdk/RequestResponse.h Fri Oct 14 09:32:11 2016 +0100 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,297 +0,0 @@ -/* -*- c-basic-offset: 4 indent-tabs-mode: nil -*- vi:set ts=8 sts=4 sw=4: */ - -/* - Vamp - - An API for audio analysis and feature extraction plugins. - - Centre for Digital Music, Queen Mary, University of London. - Copyright 2006-2016 Chris Cannam and QMUL. - - Permission is hereby granted, free of charge, to any person - obtaining a copy of this software and associated documentation - files (the "Software"), to deal in the Software without - restriction, including without limitation the rights to use, copy, - modify, merge, publish, distribute, sublicense, and/or sell copies - of the Software, and to permit persons to whom the Software is - furnished to do so, subject to the following conditions: - - The above copyright notice and this permission notice shall be - included in all copies or substantial portions of the Software. - - THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, - EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF - MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND - NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS BE LIABLE FOR - ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF - CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION - WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. - - Except as contained in this notice, the names of the Centre for - Digital Music; Queen Mary, University of London; and Chris Cannam - shall not be used in advertising or otherwise to promote the sale, - use or other dealings in this Software without prior written - authorization. -*/ - -#ifndef VAMP_REQUEST_RESPONSE_H -#define VAMP_REQUEST_RESPONSE_H - -#include "PluginStaticData.h" -#include "PluginConfiguration.h" - -#include "hostguard.h" - -#include -#include - -_VAMP_SDK_HOSTSPACE_BEGIN(RequestResponse.h) - -namespace Vamp { - -class Plugin; - -namespace HostExt { - -/** - * \class ListResponse RequestResponse.h - * - * Vamp::HostExt::ListResponse is a structure containing the - * information returned by PluginLoader when asked to list static - * information about the available plugins. - * - * \see PluginLoader::listPluginData, PluginStaticData - * - * \note This class was introduced in version 2.7 of the Vamp plugin - * SDK, along with the PluginLoader method that returns this structure. - */ -struct ListResponse -{ - ListResponse() { } // empty by default - - std::vector available; -}; - -/** - * \class LoadRequest RequestResponse.h - * - * Vamp::HostExt::LoadRequest is a structure containing the - * information necessary to load a plugin. When a request is made to - * load a plugin using a LoadRequest, the response is typically - * returned in a LoadResponse structure. - * - * \see LoadResponse - * - * \note This class was introduced in version 2.7 of the Vamp plugin - * SDK, along with the PluginLoader method that accepts this structure - * rather than accepting its elements individually. - */ -struct LoadRequest -{ - LoadRequest() : // invalid request by default - inputSampleRate(0.f), - adapterFlags(0) { } - - /** - * PluginKey is a string type that is used to identify a plugin - * uniquely within the scope of "the current system". For further - * details \see PluginLoader::PluginKey. - */ - typedef std::string PluginKey; - - /** - * The identifying key for the plugin to be loaded. - */ - PluginKey pluginKey; - - /** - * Sample rate to be passed to the plugin's constructor. - */ - float inputSampleRate; - - /** - * A bitwise OR of the values in the PluginLoader::AdapterFlags - * enumeration, indicating under which circumstances an adapter - * should be used to wrap the original plugin. If adapterFlags is - * 0, no optional adapters will be used. - * - * \see PluginLoader::AdapterFlags, PluginLoader::loadPlugin - */ - int adapterFlags; -}; - -/** - * \class LoadResponse RequestResponse.h - * - * Vamp::HostExt::LoadResponse is a structure containing the - * information returned by PluginLoader when asked to load a plugin - * using a LoadRequest. - * - * If the plugin could not be loaded, the plugin field will be 0. - * - * The caller takes ownership of the plugin contained here, which - * should be deleted (using the standard C++ delete keyword) after - * use. - * - * \see LoadRequest - * - * \note This class was introduced in version 2.7 of the Vamp plugin - * SDK, along with the PluginLoader method that returns this structure. - */ -struct LoadResponse -{ - LoadResponse() : // invalid (failed) response by default - plugin(0) { } - - /** - * A pointer to the loaded plugin, or 0 if loading failed. Caller - * takes ownership of the plugin and must delete it after use. - */ - Plugin *plugin; - - /** - * The static data associated with the loaded plugin, that is, all - * information about it that does not depend on its configuration - * (parameters, programs, initialisation parameters). The contents - * of this structure are only valid if plugin is non-0. - * - * Much of the data in here is duplicated with the plugin itself. - */ - PluginStaticData staticData; - - /** - * The default configuration for this plugin, that is, default - * values for parameters etc. The contents of this structure are - * only valid if plugin is non-0. - */ - PluginConfiguration defaultConfiguration; -}; - -/** - * \class ConfigurationRequest RequestResponse.h - * - * A wrapper for a plugin pointer and PluginConfiguration, bundling up - * the data needed to configure a plugin after it has been loaded. - * - * \see PluginConfiguration, ConfigurationResponse, LoadRequest, LoadResponse - * - * \note This class was introduced in version 2.7 of the Vamp plugin - * SDK, along with the PluginLoader method that returns this structure. - */ -struct ConfigurationRequest -{ -public: - ConfigurationRequest() : // invalid request by default - plugin(0) { } - - Plugin *plugin; - PluginConfiguration configuration; -}; - -/** - * \class ConfigurationResponse RequestResponse.h - * - * The return value from a configuration request (i.e. setting the - * parameters and initialising the plugin). If the configuration was - * successful, the output list will contain the final - * post-initialisation output descriptors. If configuration failed, - * the output list will be empty. - * - * \see PluginConfiguration, ConfigurationRequest, LoadRequest, LoadResponse - * - * \note This class was introduced in version 2.7 of the Vamp plugin - * SDK, along with the PluginLoader method that returns this structure. - */ -struct ConfigurationResponse -{ -public: - ConfigurationResponse() : // failed by default - plugin(0) { } - - Plugin *plugin; - Plugin::OutputList outputs; -}; - -/** - * \class ProcessRequest RequestResponse.h - * - * A structure that bundles the necessary data for making a process - * call: plugin, input buffers, and timestamp. Caller retains - * ownership of the plugin, but the buffers are passed "by value" to - * avoid ownership concerns. - * - * \see Plugin::process() - * - * \note This class was introduced in version 2.7 of the Vamp plugin - * SDK, but it is not currently used by the SDK. It is supplied as a - * convenience for code using the SDK, and for symmetry with the load - * and configuration request structs. - */ -struct ProcessRequest -{ -public: - ProcessRequest() : // invalid by default - plugin(0) { } - - Plugin *plugin; - std::vector > inputBuffers; - RealTime timestamp; -}; - -/** - * \class ProcessResponse RequestResponse.h - * - * A structure that bundles the data returned by a process call and by - * Plugin::getRemainingFeatures(). This is simply a FeatureSet - * wrapper that happens to reference the plugin as well. - * - * \see Plugin::process(), Plugin::getRemainingFeatures() - * - * \note This class was introduced in version 2.7 of the Vamp plugin - * SDK, but it is not currently used by the SDK. It is supplied as a - * convenience for code using the SDK, and for symmetry with the load - * and configuration request structs. - */ -struct ProcessResponse -{ -public: - ProcessResponse() : // invalid by default - plugin(0) { } - - Plugin *plugin; - Plugin::FeatureSet features; -}; - -/** - * \class FinishRequest RequestResponse.h - * - * A structure that bundles the necessary data for finishing - * processing, i.e. calling getRemainingFeatures(). This consists only - * of the plugin pointer. Caller retains ownership of the plugin. - * - * \see Plugin::getRemainingFeatures() - * - * \note This class was introduced in version 2.7 of the Vamp plugin - * SDK, but it is not currently used by the SDK. It is supplied as a - * convenience for code using the SDK, and for symmetry with the load - * and configuration request structs. - * - * \note The response to a finish request (getRemainingFeatures()) is - * a ProcessResponse, just as it is for a process request. - */ -struct FinishRequest -{ -public: - FinishRequest() : // invalid by default - plugin(0) { } - - Plugin *plugin; -}; - -} - -} - -_VAMP_SDK_HOSTSPACE_END(RequestResponse.h) - -#endif