vamp.h
Go to the documentation of this file.00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023
00024
00025
00026
00027
00028
00029
00030
00031
00032
00033
00034
00035
00036
00037 #ifndef VAMP_HEADER_INCLUDED
00038 #define VAMP_HEADER_INCLUDED
00039
00040 #ifdef __cplusplus
00041 extern "C" {
00042 #endif
00043
00053 #define VAMP_API_VERSION 2
00054
00071 typedef struct _VampParameterDescriptor
00072 {
00074 const char *identifier;
00075
00077 const char *name;
00078
00080 const char *description;
00081
00083 const char *unit;
00084
00086 float minValue;
00087
00089 float maxValue;
00090
00092 float defaultValue;
00093
00095 int isQuantized;
00096
00098 float quantizeStep;
00099
00101 const char **valueNames;
00102
00103 } VampParameterDescriptor;
00104
00105 typedef enum
00106 {
00108 vampOneSamplePerStep,
00109
00111 vampFixedSampleRate,
00112
00114 vampVariableSampleRate
00115
00116 } VampSampleType;
00117
00118 typedef struct _VampOutputDescriptor
00119 {
00121 const char *identifier;
00122
00124 const char *name;
00125
00127 const char *description;
00128
00130 const char *unit;
00131
00133 int hasFixedBinCount;
00134
00136 unsigned int binCount;
00137
00139 const char **binNames;
00140
00142 int hasKnownExtents;
00143
00145 float minValue;
00146
00148 float maxValue;
00149
00151 int isQuantized;
00152
00154 float quantizeStep;
00155
00157 VampSampleType sampleType;
00158
00161 float sampleRate;
00162
00170 int hasDuration;
00171
00172 } VampOutputDescriptor;
00173
00174 typedef struct _VampFeature
00175 {
00177 int hasTimestamp;
00178
00180 int sec;
00181
00183 int nsec;
00184
00186 unsigned int valueCount;
00187
00189 float *values;
00190
00192 char *label;
00193
00194 } VampFeature;
00195
00196 typedef struct _VampFeatureV2
00197 {
00199 int hasDuration;
00200
00202 int durationSec;
00203
00205 int durationNsec;
00206
00207 } VampFeatureV2;
00208
00209 typedef union _VampFeatureUnion
00210 {
00211
00212 VampFeature v1;
00213 VampFeatureV2 v2;
00214
00215 } VampFeatureUnion;
00216
00217 typedef struct _VampFeatureList
00218 {
00220 unsigned int featureCount;
00221
00235 VampFeatureUnion *features;
00236
00237 } VampFeatureList;
00238
00239 typedef enum
00240 {
00241 vampTimeDomain,
00242 vampFrequencyDomain
00243
00244 } VampInputDomain;
00245
00246 typedef void *VampPluginHandle;
00247
00248 typedef struct _VampPluginDescriptor
00249 {
00251 unsigned int vampApiVersion;
00252
00254 const char *identifier;
00255
00257 const char *name;
00258
00260 const char *description;
00261
00263 const char *maker;
00264
00266 int pluginVersion;
00267
00269 const char *copyright;
00270
00272 unsigned int parameterCount;
00273
00275 const VampParameterDescriptor **parameters;
00276
00278 unsigned int programCount;
00279
00281 const char **programs;
00282
00284 VampInputDomain inputDomain;
00285
00287 VampPluginHandle (*instantiate)(const struct _VampPluginDescriptor *,
00288 float inputSampleRate);
00289
00291 void (*cleanup)(VampPluginHandle);
00292
00294 int (*initialise)(VampPluginHandle,
00295 unsigned int inputChannels,
00296 unsigned int stepSize,
00297 unsigned int blockSize);
00298
00300 void (*reset)(VampPluginHandle);
00301
00303 float (*getParameter)(VampPluginHandle, int);
00304
00306 void (*setParameter)(VampPluginHandle, int, float);
00307
00309 unsigned int (*getCurrentProgram)(VampPluginHandle);
00310
00312 void (*selectProgram)(VampPluginHandle, unsigned int);
00313
00315 unsigned int (*getPreferredStepSize)(VampPluginHandle);
00316
00318 unsigned int (*getPreferredBlockSize)(VampPluginHandle);
00319
00321 unsigned int (*getMinChannelCount)(VampPluginHandle);
00322
00324 unsigned int (*getMaxChannelCount)(VampPluginHandle);
00325
00327 unsigned int (*getOutputCount)(VampPluginHandle);
00328
00333 VampOutputDescriptor *(*getOutputDescriptor)(VampPluginHandle,
00334 unsigned int);
00335
00337 void (*releaseOutputDescriptor)(VampOutputDescriptor *);
00338
00344 VampFeatureList *(*process)(VampPluginHandle,
00345 const float *const *inputBuffers,
00346 int sec,
00347 int nsec);
00348
00350 VampFeatureList *(*getRemainingFeatures)(VampPluginHandle);
00351
00353 void (*releaseFeatureSet)(VampFeatureList *);
00354
00355 } VampPluginDescriptor;
00356
00357
00376 const VampPluginDescriptor *vampGetPluginDescriptor
00377 (unsigned int hostApiVersion, unsigned int index);
00378
00379
00381 typedef const VampPluginDescriptor *(*VampGetPluginDescriptorFunction)
00382 (unsigned int, unsigned int);
00383
00384 #ifdef __cplusplus
00385 }
00386 #endif
00387
00388 #endif