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 1
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
00163 } VampOutputDescriptor;
00164
00165 typedef struct _VampFeature
00166 {
00168 int hasTimestamp;
00169
00171 int sec;
00172
00174 int nsec;
00175
00177 unsigned int valueCount;
00178
00180 float *values;
00181
00183 char *label;
00184
00185 } VampFeature;
00186
00187 typedef struct _VampFeatureList
00188 {
00190 unsigned int featureCount;
00191
00193 VampFeature *features;
00194
00195 } VampFeatureList;
00196
00197 typedef enum
00198 {
00199 vampTimeDomain,
00200 vampFrequencyDomain
00201
00202 } VampInputDomain;
00203
00204 typedef void *VampPluginHandle;
00205
00206 typedef struct _VampPluginDescriptor
00207 {
00209 unsigned int vampApiVersion;
00210
00212 const char *identifier;
00213
00215 const char *name;
00216
00218 const char *description;
00219
00221 const char *maker;
00222
00224 int pluginVersion;
00225
00227 const char *copyright;
00228
00230 unsigned int parameterCount;
00231
00233 const VampParameterDescriptor **parameters;
00234
00236 unsigned int programCount;
00237
00239 const char **programs;
00240
00242 VampInputDomain inputDomain;
00243
00245 VampPluginHandle (*instantiate)(const struct _VampPluginDescriptor *,
00246 float inputSampleRate);
00247
00249 void (*cleanup)(VampPluginHandle);
00250
00252 int (*initialise)(VampPluginHandle,
00253 unsigned int inputChannels,
00254 unsigned int stepSize,
00255 unsigned int blockSize);
00256
00258 void (*reset)(VampPluginHandle);
00259
00261 float (*getParameter)(VampPluginHandle, int);
00262
00264 void (*setParameter)(VampPluginHandle, int, float);
00265
00267 unsigned int (*getCurrentProgram)(VampPluginHandle);
00268
00270 void (*selectProgram)(VampPluginHandle, unsigned int);
00271
00273 unsigned int (*getPreferredStepSize)(VampPluginHandle);
00274
00276 unsigned int (*getPreferredBlockSize)(VampPluginHandle);
00277
00279 unsigned int (*getMinChannelCount)(VampPluginHandle);
00280
00282 unsigned int (*getMaxChannelCount)(VampPluginHandle);
00283
00285 unsigned int (*getOutputCount)(VampPluginHandle);
00286
00291 VampOutputDescriptor *(*getOutputDescriptor)(VampPluginHandle,
00292 unsigned int);
00293
00295 void (*releaseOutputDescriptor)(VampOutputDescriptor *);
00296
00302 VampFeatureList *(*process)(VampPluginHandle,
00303 const float *const *inputBuffers,
00304 int sec,
00305 int nsec);
00306
00308 VampFeatureList *(*getRemainingFeatures)(VampPluginHandle);
00309
00311 void (*releaseFeatureSet)(VampFeatureList *);
00312
00313 } VampPluginDescriptor;
00314
00328 const VampPluginDescriptor *vampGetPluginDescriptor
00329 (unsigned int hostApiVersion, unsigned int index);
00330
00332 typedef const VampPluginDescriptor *(*VampGetPluginDescriptorFunction)
00333 (unsigned int, unsigned int);
00334
00335 #ifdef __cplusplus
00336 }
00337 #endif
00338
00339 #endif