Mercurial > hg > qm-vamp-plugins
changeset 23:bec0d544984b
* Update to support API versioning
author | Chris Cannam <c.cannam@qmul.ac.uk> |
---|---|
date | Tue, 27 Feb 2007 12:29:19 +0000 |
parents | 6d014fb538db |
children | 135df3b478ac |
files | libmain.cpp plugins/TonalChangeDetect.cpp |
diffstat | 2 files changed, 18 insertions(+), 16 deletions(-) [+] |
line wrap: on
line diff
--- a/libmain.cpp Mon Feb 26 17:49:15 2007 +0000 +++ b/libmain.cpp Tue Feb 27 12:29:19 2007 +0000 @@ -22,8 +22,11 @@ static Vamp::PluginAdapter<TonalChangeDetect> tonalChangeDetectorAdapter; static Vamp::PluginAdapter<KeyDetector> keyDetectorAdapter; -const VampPluginDescriptor *vampGetPluginDescriptor(unsigned int index) +const VampPluginDescriptor *vampGetPluginDescriptor(unsigned int vampApiVersion, + unsigned int index) { + if (vampApiVersion < 1) return 0; + switch (index) { case 0: return beatDetectorAdapter.getDescriptor(); case 1: return chromagramPluginAdapter.getDescriptor();
--- a/plugins/TonalChangeDetect.cpp Mon Feb 26 17:49:15 2007 +0000 +++ b/plugins/TonalChangeDetect.cpp Tue Feb 27 12:29:19 2007 +0000 @@ -111,8 +111,8 @@ ParameterList list; ParameterDescriptor desc; - desc.name = "smoothingwidth"; - desc.description = "Gaussian smoothing"; + desc.identifier = "smoothingwidth"; + desc.name = "Gaussian smoothing"; desc.unit = "frames"; desc.minValue = 0; desc.maxValue = 20; @@ -121,9 +121,8 @@ desc.quantizeStep = 1; list.push_back(desc); - desc; - desc.name = "minpitch"; - desc.description = "Chromagram minimum pitch"; + desc.identifier = "minpitch"; + desc.name = "Chromagram minimum pitch"; desc.unit = "MIDI units"; desc.minValue = 0; desc.maxValue = 127; @@ -132,8 +131,8 @@ desc.quantizeStep = 1; list.push_back(desc); - desc.name = "maxpitch"; - desc.description = "Chromagram maximum pitch"; + desc.identifier = "maxpitch"; + desc.name = "Chromagram maximum pitch"; desc.unit = "MIDI units"; desc.minValue = 0; desc.maxValue = 127; @@ -142,8 +141,8 @@ desc.quantizeStep = 1; list.push_back(desc); - desc.name = "tuning"; - desc.description = "Chromagram tuning frequency"; + desc.identifier = "tuning"; + desc.name = "Chromagram tuning frequency"; desc.unit = "Hz"; desc.minValue = 420; desc.maxValue = 460; @@ -254,9 +253,9 @@ OutputList list; OutputDescriptor hc; - hc.name = "tcstransform"; + hc.identifier = "tcstransform"; + hc.name = "Transform to 6D Tonal Content Space"; hc.unit = ""; - hc.description = "Transform to 6D Tonal Content Space"; hc.hasFixedBinCount = true; hc.binCount = 6; hc.hasKnownExtents = true; @@ -266,11 +265,11 @@ hc.sampleType = OutputDescriptor::OneSamplePerStep; OutputDescriptor d; - d.name = "tcfunction"; + d.identifier = "tcfunction"; + d.name = "Tonal Change Detection Function"; d.unit = ""; d.minValue = 0; d.minValue = 2; - d.description = "Tonal Change Detection Function"; d.hasFixedBinCount = true; d.binCount = 1; d.hasKnownExtents = true; @@ -280,9 +279,9 @@ d.sampleRate = 1.0f / dStepSecs; OutputDescriptor changes; - changes.name = "changepositions"; + changes.identifier = "changepositions"; + changes.name = "Tonal Change Positions"; changes.unit = ""; - changes.description = "Tonal Change Positions"; changes.hasFixedBinCount = true; changes.binCount = 0; changes.sampleType = OutputDescriptor::VariableSampleRate;