diff options
author | David Robillard <d@drobilla.net> | 2008-02-02 17:22:04 +0000 |
---|---|---|
committer | David Robillard <d@drobilla.net> | 2008-02-02 17:22:04 +0000 |
commit | 80c3677c837cc9eb432df3d65a34aba543fa7258 (patch) | |
tree | ca23bb7e5bff6c35c151d73221002a9ce3abfe1a /libs/vamp-sdk | |
parent | 9f63ab9931e6478472853bdda58da47ea29ac125 (diff) |
Merge with 2.0-ongoing R2988
git-svn-id: svn://localhost/ardour2/branches/3.0@2991 d708f5d6-7413-0410-9779-e7cbd77b26cf
Diffstat (limited to 'libs/vamp-sdk')
4 files changed, 55 insertions, 19 deletions
diff --git a/libs/vamp-sdk/vamp-sdk/hostext/PluginBufferingAdapter.cpp b/libs/vamp-sdk/vamp-sdk/hostext/PluginBufferingAdapter.cpp index 406d4978c4..cbe179fb6b 100644 --- a/libs/vamp-sdk/vamp-sdk/hostext/PluginBufferingAdapter.cpp +++ b/libs/vamp-sdk/vamp-sdk/hostext/PluginBufferingAdapter.cpp @@ -57,6 +57,8 @@ public: OutputList getOutputDescriptors() const; + void reset(); + FeatureSet process(const float *const *inputBuffers, RealTime timestamp); FeatureSet getRemainingFeatures(); @@ -225,7 +227,8 @@ protected: vector<RingBuffer *> m_queue; float **m_buffers; float m_inputSampleRate; - RealTime m_timestamp; + RealTime m_timestamp; + bool m_unrun; OutputList m_outputs; void processBlock(FeatureSet& allFeatureSets, RealTime timestamp); @@ -253,6 +256,12 @@ PluginBufferingAdapter::getOutputDescriptors() const { return m_impl->getOutputDescriptors(); } + +void +PluginBufferingAdapter::reset() +{ + m_impl->reset(); +} PluginBufferingAdapter::FeatureSet PluginBufferingAdapter::process(const float *const *inputBuffers, @@ -277,7 +286,8 @@ PluginBufferingAdapter::Impl::Impl(Plugin *plugin, float inputSampleRate) : m_queue(0), m_buffers(0), m_inputSampleRate(inputSampleRate), - m_timestamp() + m_timestamp(RealTime::zeroTime), + m_unrun(true) { m_outputs = plugin->getOutputDescriptors(); } @@ -333,8 +343,8 @@ PluginBufferingAdapter::Impl::initialise(size_t channels, size_t stepSize, size_ } } - std::cerr << "PluginBufferingAdapter::initialise: stepSize " << m_inputStepSize << " -> " << m_stepSize - << ", blockSize " << m_inputBlockSize << " -> " << m_blockSize << std::endl; + // std::cerr << "PluginBufferingAdapter::initialise: stepSize " << m_inputStepSize << " -> " << m_stepSize + // << ", blockSize " << m_inputBlockSize << " -> " << m_blockSize << std::endl; // current implementation breaks if step is greater than block if (m_stepSize > m_blockSize) { @@ -365,11 +375,27 @@ PluginBufferingAdapter::Impl::getOutputDescriptors() const return outs; } +void +PluginBufferingAdapter::Impl::reset() +{ + m_timestamp = RealTime::zeroTime; + m_unrun = true; + + for (size_t i = 0; i < m_queue.size(); ++i) { + m_queue[i]->reset(); + } +} + PluginBufferingAdapter::FeatureSet PluginBufferingAdapter::Impl::process(const float *const *inputBuffers, RealTime timestamp) { FeatureSet allFeatureSets; + + if (m_unrun) { + m_timestamp = timestamp; + m_unrun = false; + } // queue the new input diff --git a/libs/vamp-sdk/vamp-sdk/hostext/PluginBufferingAdapter.h b/libs/vamp-sdk/vamp-sdk/hostext/PluginBufferingAdapter.h index 96a958b9e5..24ca6f8db8 100644 --- a/libs/vamp-sdk/vamp-sdk/hostext/PluginBufferingAdapter.h +++ b/libs/vamp-sdk/vamp-sdk/hostext/PluginBufferingAdapter.h @@ -81,6 +81,8 @@ public: OutputList getOutputDescriptors() const; + void reset(); + FeatureSet process(const float *const *inputBuffers, RealTime timestamp); FeatureSet getRemainingFeatures(); diff --git a/libs/vamp-sdk/vamp-sdk/hostext/PluginChannelAdapter.cpp b/libs/vamp-sdk/vamp-sdk/hostext/PluginChannelAdapter.cpp index 3ce51cedd2..fe676bcafd 100644 --- a/libs/vamp-sdk/vamp-sdk/hostext/PluginChannelAdapter.cpp +++ b/libs/vamp-sdk/vamp-sdk/hostext/PluginChannelAdapter.cpp @@ -143,7 +143,7 @@ PluginChannelAdapter::Impl::initialise(size_t channels, size_t stepSize, size_t m_pluginChannels = minch; - std::cerr << "PluginChannelAdapter::initialise: expanding " << m_inputChannels << " to " << m_pluginChannels << " for plugin" << std::endl; + // std::cerr << "PluginChannelAdapter::initialise: expanding " << m_inputChannels << " to " << m_pluginChannels << " for plugin" << std::endl; } else if (m_inputChannels > maxch) { @@ -155,18 +155,18 @@ PluginChannelAdapter::Impl::initialise(size_t channels, size_t stepSize, size_t m_buffer = new float *[1]; m_buffer[0] = new float[blockSize]; - std::cerr << "PluginChannelAdapter::initialise: mixing " << m_inputChannels << " to mono for plugin" << std::endl; + // std::cerr << "PluginChannelAdapter::initialise: mixing " << m_inputChannels << " to mono for plugin" << std::endl; } else { - std::cerr << "PluginChannelAdapter::initialise: reducing " << m_inputChannels << " to " << m_pluginChannels << " for plugin" << std::endl; + // std::cerr << "PluginChannelAdapter::initialise: reducing " << m_inputChannels << " to " << m_pluginChannels << " for plugin" << std::endl; } m_pluginChannels = maxch; } else { - std::cerr << "PluginChannelAdapter::initialise: accepting given number of channels (" << m_inputChannels << ")" << std::endl; + // std::cerr << "PluginChannelAdapter::initialise: accepting given number of channels (" << m_inputChannels << ")" << std::endl; m_pluginChannels = m_inputChannels; } diff --git a/libs/vamp-sdk/vamp-sdk/hostext/PluginInputDomainAdapter.cpp b/libs/vamp-sdk/vamp-sdk/hostext/PluginInputDomainAdapter.cpp index e706414ae2..273925f96d 100644 --- a/libs/vamp-sdk/vamp-sdk/hostext/PluginInputDomainAdapter.cpp +++ b/libs/vamp-sdk/vamp-sdk/hostext/PluginInputDomainAdapter.cpp @@ -8,6 +8,9 @@ Centre for Digital Music, Queen Mary, University of London. Copyright 2006-2007 Chris Cannam and QMUL. + This file is based in part on Don Cross's public domain FFT + implementation. + 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 @@ -38,28 +41,33 @@ #include <cmath> - /** * If you want to compile using FFTW instead of the built-in FFT * implementation for the PluginInputDomainAdapter, define HAVE_FFTW3 * in the Makefile. * - * Remember that FFTW is licensed under the GPL (unlike this SDK, which - * is licensed liberally in order to permit closed-source usage), so - * you should not define this symbol unless your code is also under the - * GPL. Also, parties redistributing this SDK for use in other - * programs should be careful _not_ to define this symbol in order not - * to affect the stated license of this SDK. + * Be aware that FFTW is licensed under the GPL -- unlike this SDK, + * which is provided under a more liberal BSD license in order to + * permit use in closed source applications. The use of FFTW would + * mean that your code would need to be licensed under the GPL as + * well. Do not define this symbol unless you understand and accept + * the implications of this. + * + * Parties such as Linux distribution packagers who redistribute this + * SDK for use in other programs should _not_ define this symbol, as + * it would change the effective licensing terms under which the SDK + * was available to third party developers. + * + * The default is not to use FFTW, and to use the built-in FFT instead. * - * Note: This code uses FFTW_MEASURE, and will perform badly on its - * first invocation unless the host has saved and restored FFTW wisdom - * (see the FFTW documentation). + * Note: The FFTW code uses FFTW_MEASURE, and so will perform badly on + * its first invocation unless the host has saved and restored FFTW + * wisdom (see the FFTW documentation). */ #ifdef HAVE_FFTW3 #include <fftw3.h> #endif - namespace Vamp { namespace HostExt { |