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