comparison vamp/vamp.h @ 50:b907557b2fb9

* Add a structure for API versioning
author cannam
date Tue, 27 Feb 2007 12:48:17 +0000
parents aa64a46320d4
children 933fee59d33a
comparison
equal deleted inserted replaced
49:aa64a46320d4 50:b907557b2fb9
56 #ifdef __cplusplus 56 #ifdef __cplusplus
57 extern "C" { 57 extern "C" {
58 #endif 58 #endif
59 59
60 /** 60 /**
61 * Plugin API version. Incompatible changes to the API may be expected 61 * Plugin API version. This is incremented when a change is made that
62 * prior to version 1.0. 62 * changes the binary layout of the descriptor records. When this
63 * happens, there should be a mechanism for retaining compatibility
64 * with older hosts and/or plugins.
65 *
66 * See also the vampApiVersion field in the plugin descriptor, and the
67 * hostApiVersion argument to the vampGetPluginDescriptor function.
63 */ 68 */
64 #define VAMP_API_VERSION "1.0" 69 #define VAMP_API_VERSION 1
65 #define VAMP_API_VERSION_MAJOR 1
66 #define VAMP_API_VERSION_MINOR 0
67 70
68 typedef struct _VampParameterDescriptor 71 typedef struct _VampParameterDescriptor
69 { 72 {
70 /** Computer-usable name of the parameter. Must not change. [a-zA-Z0-9_] */ 73 /** Computer-usable name of the parameter. Must not change. [a-zA-Z0-9_] */
71 const char *identifier; 74 const char *identifier;
200 203
201 typedef void *VampPluginHandle; 204 typedef void *VampPluginHandle;
202 205
203 typedef struct _VampPluginDescriptor 206 typedef struct _VampPluginDescriptor
204 { 207 {
208 /** API version with which this descriptor is compatible. */
209 unsigned int vampApiVersion;
210
205 /** Computer-usable name of the plugin. Must not change. [a-zA-Z0-9_] */ 211 /** Computer-usable name of the plugin. Must not change. [a-zA-Z0-9_] */
206 const char *identifier; 212 const char *identifier;
207 213
208 /** Human-readable name of the plugin. May be translatable. */ 214 /** Human-readable name of the plugin. May be translatable. */
209 const char *name; 215 const char *name;
306 312
307 } VampPluginDescriptor; 313 } VampPluginDescriptor;
308 314
309 /** Get the descriptor for a given plugin index in this library. 315 /** Get the descriptor for a given plugin index in this library.
310 Return NULL if the index is outside the range of valid indices for 316 Return NULL if the index is outside the range of valid indices for
311 this plugin library. */ 317 this plugin library.
312 const VampPluginDescriptor *vampGetPluginDescriptor(unsigned int index); 318
319 The hostApiVersion argument tells the library code the highest
320 Vamp API version supported by the host. The function should
321 return a plugin descriptor compatible with the highest API version
322 supported by the library that is no higher than that supported by
323 the host. Provided the descriptor has the correct vampApiVersion
324 field for its actual compatibility level, the host should be able
325 to do the right thing with it: use it if possible, discard it
326 otherwise.
327 */
328 const VampPluginDescriptor *vampGetPluginDescriptor
329 (unsigned int hostApiVersion, unsigned int index);
313 330
314 /** Function pointer type for vampGetPluginDescriptor. */ 331 /** Function pointer type for vampGetPluginDescriptor. */
315 typedef const VampPluginDescriptor *(*VampGetPluginDescriptorFunction)(unsigned int); 332 typedef const VampPluginDescriptor *(*VampGetPluginDescriptorFunction)
333 (unsigned int, unsigned int);
316 334
317 #ifdef __cplusplus 335 #ifdef __cplusplus
318 } 336 }
319 #endif 337 #endif
320 338