Chris@423: /* -*- c-basic-offset: 4 indent-tabs-mode: nil -*- vi:set ts=8 sts=4 sw=4: */ Chris@423: Chris@423: /* Chris@423: Vamp Chris@423: Chris@423: An API for audio analysis and feature extraction plugins. Chris@423: Chris@423: Centre for Digital Music, Queen Mary, University of London. Chris@423: Copyright 2006-2016 Chris Cannam and QMUL. Chris@423: Chris@423: Permission is hereby granted, free of charge, to any person Chris@423: obtaining a copy of this software and associated documentation Chris@423: files (the "Software"), to deal in the Software without Chris@423: restriction, including without limitation the rights to use, copy, Chris@423: modify, merge, publish, distribute, sublicense, and/or sell copies Chris@423: of the Software, and to permit persons to whom the Software is Chris@423: furnished to do so, subject to the following conditions: Chris@423: Chris@423: The above copyright notice and this permission notice shall be Chris@423: included in all copies or substantial portions of the Software. Chris@423: Chris@423: THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, Chris@423: EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF Chris@423: MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND Chris@423: NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS BE LIABLE FOR Chris@423: ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF Chris@423: CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION Chris@423: WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. Chris@423: Chris@423: Except as contained in this notice, the names of the Centre for Chris@423: Digital Music; Queen Mary, University of London; and Chris Cannam Chris@423: shall not be used in advertising or otherwise to promote the sale, Chris@423: use or other dealings in this Software without prior written Chris@423: authorization. Chris@423: */ Chris@423: Chris@423: #ifndef VAMP_PLUGIN_STATIC_DATA_H Chris@423: #define VAMP_PLUGIN_STATIC_DATA_H Chris@423: Chris@423: #include "hostguard.h" Chris@423: #include "Plugin.h" Chris@423: Chris@423: _VAMP_SDK_HOSTSPACE_BEGIN(PluginStaticData.h) Chris@423: Chris@423: namespace Vamp { Chris@423: Chris@423: namespace HostExt { Chris@423: Chris@423: /** Chris@423: * \class PluginStaticData PluginStaticData.h Chris@423: * Chris@423: * Vamp::HostExt::PluginStaticData is a structure bundling together Chris@423: * all the information about a plugin that cannot be changed by the Chris@423: * plugin after it is loaded. That is, everything that does not depend Chris@423: * on a parameter or initialisation setting. Chris@423: * Chris@426: * All of the information in here can be queried from other sources Chris@426: * directly (notably the Plugin class itself); this structure just Chris@426: * pulls it together in one place and provides something that can be Chris@426: * stored and recalled without having a Plugin object to hand. Chris@426: * Chris@423: * \note This class was introduced in version 2.7 of the Vamp plugin Chris@423: * SDK and is used only by host SDK functions that were also Chris@423: * introduced in that release (or newer). Chris@423: */ Chris@423: struct PluginStaticData Chris@423: { Chris@423: public: Chris@423: struct Basic { Chris@423: std::string identifier; Chris@423: std::string name; Chris@423: std::string description; Chris@423: }; Chris@427: typedef std::vector BasicList; Chris@423: Chris@423: PluginStaticData() : // invalid static data by default Chris@423: pluginVersion(0), minChannelCount(0), maxChannelCount(0), Chris@423: inputDomain(Plugin::TimeDomain) { } Chris@423: Chris@423: std::string pluginKey; Chris@423: Basic basic; Chris@423: std::string maker; Chris@423: std::string copyright; Chris@423: int pluginVersion; Chris@423: std::vector category; Chris@423: int minChannelCount; Chris@423: int maxChannelCount; Chris@423: PluginBase::ParameterList parameters; Chris@423: PluginBase::ProgramList programs; Chris@423: Plugin::InputDomain inputDomain; Chris@427: BasicList basicOutputInfo; Chris@423: Chris@423: static PluginStaticData Chris@423: fromPlugin(std::string pluginKey, Chris@423: std::vector category, Chris@423: Plugin *p) { Chris@423: Chris@423: PluginStaticData d; Chris@423: d.pluginKey = pluginKey; Chris@423: d.basic.identifier = p->getIdentifier(); Chris@423: d.basic.name = p->getName(); Chris@423: d.basic.description = p->getDescription(); Chris@423: d.maker = p->getMaker(); Chris@423: d.copyright = p->getCopyright(); Chris@423: d.pluginVersion = p->getPluginVersion(); Chris@423: d.category = category; Chris@423: d.minChannelCount = p->getMinChannelCount(); Chris@423: d.maxChannelCount = p->getMaxChannelCount(); Chris@423: d.parameters = p->getParameterDescriptors(); Chris@423: d.programs = p->getPrograms(); Chris@423: d.inputDomain = p->getInputDomain(); Chris@423: Chris@423: Plugin::OutputList outputs = p->getOutputDescriptors(); Chris@423: for (Plugin::OutputList::const_iterator i = outputs.begin(); Chris@423: i != outputs.end(); ++i) { Chris@423: Basic b; Chris@423: b.identifier = i->identifier; Chris@423: b.name = i->name; Chris@423: b.description = i->description; Chris@423: d.basicOutputInfo.push_back(b); Chris@423: } Chris@423: Chris@423: return d; Chris@423: } Chris@423: }; Chris@423: Chris@423: } Chris@423: Chris@423: } Chris@423: Chris@423: _VAMP_SDK_HOSTSPACE_END(PluginStaticData.h) Chris@423: Chris@423: #endif