cannam@57: /* -*- c-basic-offset: 4 indent-tabs-mode: nil -*- vi:set ts=8 sts=4 sw=4: */ cannam@57: cannam@57: /* cannam@57: Vamp cannam@57: cannam@57: An API for audio analysis and feature extraction plugins. cannam@57: cannam@57: Centre for Digital Music, Queen Mary, University of London. cannam@57: Copyright 2006 Chris Cannam. cannam@57: cannam@57: Permission is hereby granted, free of charge, to any person cannam@57: obtaining a copy of this software and associated documentation cannam@57: files (the "Software"), to deal in the Software without cannam@57: restriction, including without limitation the rights to use, copy, cannam@57: modify, merge, publish, distribute, sublicense, and/or sell copies cannam@57: of the Software, and to permit persons to whom the Software is cannam@57: furnished to do so, subject to the following conditions: cannam@57: cannam@57: The above copyright notice and this permission notice shall be cannam@57: included in all copies or substantial portions of the Software. cannam@57: cannam@57: THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, cannam@57: EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF cannam@57: MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND cannam@57: NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS BE LIABLE FOR cannam@57: ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF cannam@57: CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION cannam@57: WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. cannam@57: cannam@57: Except as contained in this notice, the names of the Centre for cannam@57: Digital Music; Queen Mary, University of London; and Chris Cannam cannam@57: shall not be used in advertising or otherwise to promote the sale, cannam@57: use or other dealings in this Software without prior written cannam@57: authorization. cannam@57: */ cannam@57: cannam@57: #include "PluginWrapper.h" cannam@57: cannam@57: namespace Vamp { cannam@57: cannam@59: namespace HostExt { cannam@59: cannam@61: class PluginRateExtractor : public Plugin cannam@61: { cannam@61: public: cannam@61: float getRate() const { return m_inputSampleRate; } cannam@61: }; cannam@61: cannam@57: PluginWrapper::PluginWrapper(Plugin *plugin) : cannam@61: Plugin(((PluginRateExtractor *)plugin)->getRate()), cannam@59: m_plugin(plugin) cannam@57: { cannam@57: } cannam@57: cannam@57: PluginWrapper::~PluginWrapper() cannam@57: { cannam@57: delete m_plugin; cannam@57: } cannam@61: cannam@57: bool cannam@57: PluginWrapper::initialise(size_t channels, size_t stepSize, size_t blockSize) cannam@57: { cannam@57: return m_plugin->initialise(channels, stepSize, blockSize); cannam@57: } cannam@57: cannam@57: void cannam@57: PluginWrapper::reset() cannam@57: { cannam@57: m_plugin->reset(); cannam@57: } cannam@57: cannam@57: Plugin::InputDomain cannam@57: PluginWrapper::getInputDomain() const cannam@57: { cannam@57: return m_plugin->getInputDomain(); cannam@57: } cannam@57: cannam@57: unsigned int cannam@57: PluginWrapper::getVampApiVersion() const cannam@57: { cannam@57: return m_plugin->getVampApiVersion(); cannam@57: } cannam@57: cannam@57: std::string cannam@57: PluginWrapper::getIdentifier() const cannam@57: { cannam@57: return m_plugin->getIdentifier(); cannam@57: } cannam@57: cannam@57: std::string cannam@57: PluginWrapper::getName() const cannam@57: { cannam@57: return m_plugin->getName(); cannam@57: } cannam@57: cannam@57: std::string cannam@57: PluginWrapper::getDescription() const cannam@57: { cannam@57: return m_plugin->getDescription(); cannam@57: } cannam@57: cannam@57: std::string cannam@57: PluginWrapper::getMaker() const cannam@57: { cannam@57: return m_plugin->getMaker(); cannam@57: } cannam@57: cannam@57: int cannam@57: PluginWrapper::getPluginVersion() const cannam@57: { cannam@57: return m_plugin->getPluginVersion(); cannam@57: } cannam@57: cannam@57: std::string cannam@57: PluginWrapper::getCopyright() const cannam@57: { cannam@57: return m_plugin->getCopyright(); cannam@57: } cannam@57: cannam@57: PluginBase::ParameterList cannam@57: PluginWrapper::getParameterDescriptors() const cannam@57: { cannam@57: return m_plugin->getParameterDescriptors(); cannam@57: } cannam@57: cannam@57: float cannam@57: PluginWrapper::getParameter(std::string parameter) const cannam@57: { cannam@57: return m_plugin->getParameter(parameter); cannam@57: } cannam@57: cannam@57: void cannam@57: PluginWrapper::setParameter(std::string parameter, float value) cannam@57: { cannam@57: m_plugin->setParameter(parameter, value); cannam@57: } cannam@57: cannam@57: PluginBase::ProgramList cannam@57: PluginWrapper::getPrograms() const cannam@57: { cannam@57: return m_plugin->getPrograms(); cannam@57: } cannam@57: cannam@57: std::string cannam@57: PluginWrapper::getCurrentProgram() const cannam@57: { cannam@57: return m_plugin->getCurrentProgram(); cannam@57: } cannam@57: cannam@57: void cannam@57: PluginWrapper::selectProgram(std::string program) cannam@57: { cannam@57: m_plugin->selectProgram(program); cannam@57: } cannam@57: cannam@57: size_t cannam@57: PluginWrapper::getPreferredStepSize() const cannam@57: { cannam@57: return m_plugin->getPreferredStepSize(); cannam@57: } cannam@57: cannam@57: size_t cannam@57: PluginWrapper::getPreferredBlockSize() const cannam@57: { cannam@57: return m_plugin->getPreferredBlockSize(); cannam@57: } cannam@57: cannam@57: size_t cannam@57: PluginWrapper::getMinChannelCount() const cannam@57: { cannam@57: return m_plugin->getMinChannelCount(); cannam@57: } cannam@57: cannam@57: size_t PluginWrapper::getMaxChannelCount() const cannam@57: { cannam@57: return m_plugin->getMaxChannelCount(); cannam@57: } cannam@57: cannam@57: Plugin::OutputList cannam@57: PluginWrapper::getOutputDescriptors() const cannam@57: { cannam@57: return m_plugin->getOutputDescriptors(); cannam@57: } cannam@57: cannam@57: Plugin::FeatureSet cannam@57: PluginWrapper::process(const float *const *inputBuffers, RealTime timestamp) cannam@57: { cannam@57: return m_plugin->process(inputBuffers, timestamp); cannam@57: } cannam@57: cannam@57: Plugin::FeatureSet cannam@57: PluginWrapper::getRemainingFeatures() cannam@57: { cannam@57: return m_plugin->getRemainingFeatures(); cannam@57: } cannam@57: cannam@57: } cannam@57: cannam@59: } cannam@59: