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:
86  virtual ~PluginBufferingAdapter();
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 
133  size_t getPluginPreferredStepSize() const;
134 
141  size_t getPluginPreferredBlockSize() const;
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 
177  OutputList getOutputDescriptors() const;
178 
179  void reset();
180 
181  FeatureSet process(const float *const *inputBuffers, RealTime timestamp);
182 
183  FeatureSet getRemainingFeatures();
184 
185 protected:
186  class Impl;
187  Impl *m_impl;
188 };
189 
190 }
191 
192 }
193 
195 
196 #endif
std::vector< OutputDescriptor > OutputList
Vamp::Plugin is a base class for plugin instance classes that provide feature extraction from audio o...
#define _VAMP_SDK_HOSTSPACE_BEGIN(h)
Definition: hostguard.h:56
std::map< int, FeatureList > FeatureSet
Definition: FFT.h:43
PluginBufferingAdapter is a Vamp plugin adapter that allows plugins to be used by a host supplying an...
RealTime represents time values to nanosecond precision with accurate arithmetic and frame-rate conve...
PluginWrapper is a simple base class for adapter plugins.
Definition: PluginWrapper.h:65
#define _VAMP_SDK_HOSTSPACE_END(h)
Definition: hostguard.h:59