VampPluginSDK  2.4
vamp.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 Chris Cannam.
10 
11  Permission is hereby granted, free of charge, to any person
12  obtaining a copy of this software and associated documentation
13  files (the "Software"), to deal in the Software without
14  restriction, including without limitation the rights to use, copy,
15  modify, merge, publish, distribute, sublicense, and/or sell copies
16  of the Software, and to permit persons to whom the Software is
17  furnished to do so, subject to the following conditions:
18 
19  The above copyright notice and this permission notice shall be
20  included in all copies or substantial portions of the Software.
21 
22  THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
23  EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
24  MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
25  NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS BE LIABLE FOR
26  ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF
27  CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
28  WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
29 
30  Except as contained in this notice, the names of the Centre for
31  Digital Music; Queen Mary, University of London; and Chris Cannam
32  shall not be used in advertising or otherwise to promote the sale,
33  use or other dealings in this Software without prior written
34  authorization.
35 */
36 
37 #ifndef VAMP_HEADER_INCLUDED
38 #define VAMP_HEADER_INCLUDED
39 
40 #ifdef __cplusplus
41 extern "C" {
42 #endif
43 
53 #define VAMP_API_VERSION 2
54 
72 {
74  const char *identifier;
75 
77  const char *name;
78 
80  const char *description;
81 
83  const char *unit;
84 
86  float minValue;
87 
89  float maxValue;
90 
92  float defaultValue;
93 
96 
98  float quantizeStep;
99 
101  const char **valueNames;
102 
104 
105 typedef enum
106 {
109 
112 
115 
117 
118 typedef struct _VampOutputDescriptor
119 {
121  const char *identifier;
122 
124  const char *name;
125 
127  const char *description;
128 
130  const char *unit;
131 
134 
136  unsigned int binCount;
137 
139  const char **binNames;
140 
143 
145  float minValue;
146 
148  float maxValue;
149 
152 
155 
158 
161  float sampleRate;
162 
171 
173 
174 typedef struct _VampFeature
175 {
178 
180  int sec;
181 
183  int nsec;
184 
186  unsigned int valueCount;
187 
189  float *values;
190 
192  char *label;
193 
194 } VampFeature;
195 
196 typedef struct _VampFeatureV2
197 {
200 
203 
206 
207 } VampFeatureV2;
208 
209 typedef union _VampFeatureUnion
210 {
211  // sizeof(featureV1) >= sizeof(featureV2) for backward compatibility
214 
216 
217 typedef struct _VampFeatureList
218 {
220  unsigned int featureCount;
221 
236 
238 
239 typedef enum
240 {
243 
245 
246 typedef void *VampPluginHandle;
247 
248 typedef struct _VampPluginDescriptor
249 {
251  unsigned int vampApiVersion;
252 
254  const char *identifier;
255 
257  const char *name;
258 
260  const char *description;
261 
263  const char *maker;
264 
267 
269  const char *copyright;
270 
272  unsigned int parameterCount;
273 
276 
278  unsigned int programCount;
279 
281  const char **programs;
282 
285 
288  float inputSampleRate);
289 
292 
295  unsigned int inputChannels,
296  unsigned int stepSize,
297  unsigned int blockSize);
298 
301 
304 
306  void (*setParameter)(VampPluginHandle, int, float);
307 
310 
312  void (*selectProgram)(VampPluginHandle, unsigned int);
313 
316 
319 
322 
325 
328 
333  VampOutputDescriptor *(*getOutputDescriptor)(VampPluginHandle,
334  unsigned int);
335 
338 
345  const float *const *inputBuffers,
346  int sec,
347  int nsec);
348 
350  VampFeatureList *(*getRemainingFeatures)(VampPluginHandle);
351 
354 
356 
357 
377  (unsigned int hostApiVersion, unsigned int index);
378 
379 
381 typedef const VampPluginDescriptor *(*VampGetPluginDescriptorFunction)
382  (unsigned int, unsigned int);
383 
384 #ifdef __cplusplus
385 }
386 #endif
387 
388 #endif