VampPluginSDK
2.1
Main Page
Namespaces
Classes
Files
File List
File Members
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
71
typedef
struct
_VampParameterDescriptor
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
95
int
isQuantized
;
96
98
float
quantizeStep
;
99
101
const
char
**
valueNames
;
102
103
}
VampParameterDescriptor
;
104
105
typedef
enum
106
{
108
vampOneSamplePerStep
,
109
111
vampFixedSampleRate
,
112
114
vampVariableSampleRate
115
116
}
VampSampleType
;
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
133
int
hasFixedBinCount
;
134
136
unsigned
int
binCount
;
137
139
const
char
**
binNames
;
140
142
int
hasKnownExtents
;
143
145
float
minValue
;
146
148
float
maxValue
;
149
151
int
isQuantized
;
152
154
float
quantizeStep
;
155
157
VampSampleType
sampleType
;
158
161
float
sampleRate
;
162
170
int
hasDuration
;
171
172
}
VampOutputDescriptor
;
173
174
typedef
struct
_VampFeature
175
{
177
int
hasTimestamp
;
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
{
199
int
hasDuration
;
200
202
int
durationSec
;
203
205
int
durationNsec
;
206
207
}
VampFeatureV2
;
208
209
typedef
union
_VampFeatureUnion
210
{
211
// sizeof(featureV1) >= sizeof(featureV2) for backward compatibility
212
VampFeature
v1
;
213
VampFeatureV2
v2
;
214
215
}
VampFeatureUnion
;
216
217
typedef
struct
_VampFeatureList
218
{
220
unsigned
int
featureCount
;
221
235
VampFeatureUnion
*
features
;
236
237
}
VampFeatureList
;
238
239
typedef
enum
240
{
241
vampTimeDomain
,
242
vampFrequencyDomain
243
244
}
VampInputDomain
;
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
266
int
pluginVersion
;
267
269
const
char
*
copyright
;
270
272
unsigned
int
parameterCount
;
273
275
const
VampParameterDescriptor
**
parameters
;
276
278
unsigned
int
programCount
;
279
281
const
char
**
programs
;
282
284
VampInputDomain
inputDomain
;
285
287
VampPluginHandle
(*
instantiate
)(
const
struct
_VampPluginDescriptor
*,
288
float
inputSampleRate);
289
291
void (*
cleanup
)(
VampPluginHandle
);
292
294
int (*
initialise
)(
VampPluginHandle
,
295
unsigned
int
inputChannels,
296
unsigned
int
stepSize,
297
unsigned
int
blockSize);
298
300
void (*
reset
)(
VampPluginHandle
);
301
303
float (*
getParameter
)(
VampPluginHandle
, int);
304
306
void (*
setParameter
)(
VampPluginHandle
, int, float);
307
309
unsigned
int (*
getCurrentProgram
)(
VampPluginHandle
);
310
312
void (*
selectProgram
)(
VampPluginHandle
,
unsigned
int);
313
315
unsigned
int (*
getPreferredStepSize
)(
VampPluginHandle
);
316
318
unsigned
int (*
getPreferredBlockSize
)(
VampPluginHandle
);
319
321
unsigned
int (*
getMinChannelCount
)(
VampPluginHandle
);
322
324
unsigned
int (*
getMaxChannelCount
)(
VampPluginHandle
);
325
327
unsigned
int (*
getOutputCount
)(
VampPluginHandle
);
328
333
VampOutputDescriptor
*(*getOutputDescriptor)(
VampPluginHandle
,
334
unsigned
int);
335
337
void (*
releaseOutputDescriptor
)(
VampOutputDescriptor
*);
338
344
VampFeatureList
*(*process)(
VampPluginHandle
,
345
const
float
*
const
*inputBuffers,
346
int
sec,
347
int
nsec);
348
350
VampFeatureList
*(*getRemainingFeatures)(
VampPluginHandle
);
351
353
void (*
releaseFeatureSet
)(
VampFeatureList
*);
354
355
}
VampPluginDescriptor
;
356
357
376
const
VampPluginDescriptor
*
vampGetPluginDescriptor
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
vamp
vamp.h
Generated on Thu Nov 21 2013 22:36:43 for VampPluginSDK by
1.8.1.2