VampPluginSDK  2.10
PluginBufferingAdapter.h
Go to the documentation of this file.
1 /* -*- c-basic-offset: 4 indent-tabs-mode: nil -*- vi:set ts=8 sts=4 sw=4: */
2 
3 /*
4  Vamp
5 
6  An API for audio analysis and feature extraction plugins.
7 
8  Centre for Digital Music, Queen Mary, University of London.
9  Copyright 2006-2009 Chris Cannam and QMUL.
10  This file by Mark Levy and Chris Cannam, Copyright 2007-2008 QMUL.
11 
12  Permission is hereby granted, free of charge, to any person
13  obtaining a copy of this software and associated documentation
14  files (the "Software"), to deal in the Software without
15  restriction, including without limitation the rights to use, copy,
16  modify, merge, publish, distribute, sublicense, and/or sell copies
17  of the Software, and to permit persons to whom the Software is
18  furnished to do so, subject to the following conditions:
19 
20  The above copyright notice and this permission notice shall be
21  included in all copies or substantial portions of the Software.
22 
23  THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
24  EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
25  MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
26  NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS BE LIABLE FOR
27  ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF
28  CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
29  WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
30 
31  Except as contained in this notice, the names of the Centre for
32  Digital Music; Queen Mary, University of London; and Chris Cannam
33  shall not be used in advertising or otherwise to promote the sale,
34  use or other dealings in this Software without prior written
35  authorization.
36 */
37 
38 #ifndef _VAMP_PLUGIN_BUFFERING_ADAPTER_H_
39 #define _VAMP_PLUGIN_BUFFERING_ADAPTER_H_
40 
41 #include "hostguard.h"
42 #include "PluginWrapper.h"
43 
44 _VAMP_SDK_HOSTSPACE_BEGIN(PluginBufferingAdapter.h)
45 
46 namespace Vamp {
47 
48 namespace HostExt {
49 
77 {
78 public:
87 
97  size_t getPreferredStepSize() const;
98 
109  size_t getPreferredBlockSize() const;
110 
120  bool initialise(size_t channels, size_t stepSize, size_t blockSize);
121 
134 
142 
150  void setPluginStepSize(size_t stepSize);
151 
159  void setPluginBlockSize(size_t blockSize);
160 
172  void getActualStepAndBlockSizes(size_t &stepSize, size_t &blockSize);
173 
174  void setParameter(std::string, float);
175  void selectProgram(std::string);
176 
178 
179  void reset();
180 
181  FeatureSet process(const float *const *inputBuffers, RealTime timestamp);
182 
184 
185 protected:
186  class Impl;
187  Impl *m_impl;
188 };
189 
190 }
191 
192 }
193 
194 _VAMP_SDK_HOSTSPACE_END(PluginBufferingAdapter.h)
195 
196 #endif
PluginBufferingAdapter is a Vamp plugin adapter that allows plugins to be used by a host supplying an...
PluginBufferingAdapter(Plugin *plugin)
Construct a PluginBufferingAdapter wrapping the given plugin.
void reset()
Reset the plugin after use, to prepare it for another clean run.
FeatureSet getRemainingFeatures()
After all blocks have been processed, calculate and return any remaining features derived from the co...
size_t getPreferredBlockSize() const
Return the preferred block size for this adapter.
void selectProgram(std::string)
Select a program.
FeatureSet process(const float *const *inputBuffers, RealTime timestamp)
Process a single block of input data.
void setParameter(std::string, float)
Set a named parameter.
bool initialise(size_t channels, size_t stepSize, size_t blockSize)
Initialise the adapter (and therefore the plugin) for the given number of channels.
void getActualStepAndBlockSizes(size_t &stepSize, size_t &blockSize)
Return the step and block sizes that were actually used when initialising the underlying plugin.
void setPluginBlockSize(size_t blockSize)
Set the block size that will be used for the underlying plugin when initialise() is called.
size_t getPluginPreferredStepSize() const
Return the preferred step size of the plugin wrapped by this adapter.
OutputList getOutputDescriptors() const
Get the outputs of this plugin.
void setPluginStepSize(size_t stepSize)
Set the step size that will be used for the underlying plugin when initialise() is called.
size_t getPreferredStepSize() const
Return the preferred step size for this adapter.
size_t getPluginPreferredBlockSize() const
Return the preferred block size of the plugin wrapped by this adapter.
PluginWrapper is a simple base class for adapter plugins.
Definition: PluginWrapper.h:66
Vamp::Plugin is a base class for plugin instance classes that provide feature extraction from audio o...
std::vector< OutputDescriptor > OutputList
std::map< int, FeatureList > FeatureSet
#define _VAMP_SDK_HOSTSPACE_END(h)
Definition: hostguard.h:59
#define _VAMP_SDK_HOSTSPACE_BEGIN(h)
Definition: hostguard.h:56
Definition: FFT.h:43
RealTime represents time values to nanosecond precision with accurate arithmetic and frame-rate conve...