# HG changeset patch # User cannam # Date 1216994517 0 # Node ID ff72d97823f7a5d170b965c6ee3dccda4a1162d9 # Parent af8e59f43d1d0ad10a62abd04940b357e4aaae56 * Add means to obtain actually used step & block sizes from buffering adapter diff -r af8e59f43d1d -r ff72d97823f7 vamp-sdk/hostext/PluginBufferingAdapter.cpp --- a/vamp-sdk/hostext/PluginBufferingAdapter.cpp Fri Jul 25 11:49:06 2008 +0000 +++ b/vamp-sdk/hostext/PluginBufferingAdapter.cpp Fri Jul 25 14:01:57 2008 +0000 @@ -58,6 +58,8 @@ bool initialise(size_t channels, size_t stepSize, size_t blockSize); + void getActualStepAndBlockSizes(size_t &stepSize, size_t &blockSize); + OutputList getOutputDescriptors() const; void reset(); @@ -286,6 +288,13 @@ { m_impl->setPluginBlockSize(blockSize); } + +void +PluginBufferingAdapter::getActualStepAndBlockSizes(size_t &stepSize, + size_t &blockSize) +{ + m_impl->getActualStepAndBlockSizes(stepSize, blockSize); +} bool PluginBufferingAdapter::initialise(size_t channels, size_t stepSize, size_t blockSize) @@ -367,6 +376,14 @@ m_setBlockSize = blockSize; } +void +PluginBufferingAdapter::Impl::getActualStepAndBlockSizes(size_t &stepSize, + size_t &blockSize) +{ + stepSize = m_stepSize; + blockSize = m_blockSize; +} + bool PluginBufferingAdapter::Impl::initialise(size_t channels, size_t stepSize, size_t blockSize) { diff -r af8e59f43d1d -r ff72d97823f7 vamp-sdk/hostext/PluginBufferingAdapter.h --- a/vamp-sdk/hostext/PluginBufferingAdapter.h Fri Jul 25 11:49:06 2008 +0000 +++ b/vamp-sdk/hostext/PluginBufferingAdapter.h Fri Jul 25 14:01:57 2008 +0000 @@ -99,6 +99,17 @@ size_t getPreferredBlockSize() const; /** + * Initialise the adapter (and therefore the plugin) for the given + * number of channels. Initialise the adapter for the given step + * and block size, which must be equal. + * + * The step and block size used for the underlying plugin will + * depend on its preferences, or any values previously passed to + * setPluginStepSize and setPluginBlockSize. + */ + bool initialise(size_t channels, size_t stepSize, size_t blockSize); + + /** * Return the preferred step size of the plugin wrapped by this * adapter. * @@ -138,15 +149,17 @@ void setPluginBlockSize(size_t blockSize); /** - * Initialise the adapter (and therefore the plugin) for the given - * number of channels. Initialise the adapter for the given step - * and block size, which must be equal. + * Return the step and block sizes that were actually used when + * initialising the underlying plugin. * - * The step and block size used for the underlying plugin will - * depend on its preferences, or any values previously passed to - * setPluginStepSize and setPluginBlockSize. + * This is included mainly for informational purposes. You will + * not usually need to call this function. If this is called + * before initialise(), it will return 0 for both values. If it + * is called after a failed call to initialise(), it will return + * the values that were used in the failed call to the plugin's + * initialise() function. */ - bool initialise(size_t channels, size_t stepSize, size_t blockSize); + void getActualStepAndBlockSizes(size_t &stepSize, size_t &blockSize); OutputList getOutputDescriptors() const;