comparison examples/plugins.cpp @ 50:b907557b2fb9

* Add a structure for API versioning
author cannam
date Tue, 27 Feb 2007 12:48:17 +0000
parents 31cd55174467
children fa79c4ec847d
comparison
equal deleted inserted replaced
49:aa64a46320d4 50:b907557b2fb9
45 static Vamp::PluginAdapter<ZeroCrossing> zeroCrossingAdapter; 45 static Vamp::PluginAdapter<ZeroCrossing> zeroCrossingAdapter;
46 static Vamp::PluginAdapter<SpectralCentroid> spectralCentroidAdapter; 46 static Vamp::PluginAdapter<SpectralCentroid> spectralCentroidAdapter;
47 static Vamp::PluginAdapter<PercussionOnsetDetector> percussionOnsetAdapter; 47 static Vamp::PluginAdapter<PercussionOnsetDetector> percussionOnsetAdapter;
48 static Vamp::PluginAdapter<AmplitudeFollower> amplitudeAdapter; 48 static Vamp::PluginAdapter<AmplitudeFollower> amplitudeAdapter;
49 49
50 const VampPluginDescriptor *vampGetPluginDescriptor(unsigned int index) 50 const VampPluginDescriptor *vampGetPluginDescriptor(unsigned int version,
51 unsigned int index)
51 { 52 {
53 if (version < 1) return 0;
54
52 switch (index) { 55 switch (index) {
53 case 0: return zeroCrossingAdapter.getDescriptor(); 56 case 0: return zeroCrossingAdapter.getDescriptor();
54 case 1: return spectralCentroidAdapter.getDescriptor(); 57 case 1: return spectralCentroidAdapter.getDescriptor();
55 case 2: return percussionOnsetAdapter.getDescriptor(); 58 case 2: return percussionOnsetAdapter.getDescriptor();
56 case 3: return amplitudeAdapter.getDescriptor(); 59 case 3: return amplitudeAdapter.getDescriptor();