annotate libmain.cpp @ 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 |
d695fc2baa91 |
children |
3256bfa04ed8 |
rev |
line source |
c@3
|
1 /* -*- c-basic-offset: 4 indent-tabs-mode: nil -*- vi:set ts=8 sts=4 sw=4: */
|
c@3
|
2
|
c@3
|
3 /*
|
c@3
|
4 QM Vamp Plugin Set
|
c@3
|
5
|
c@3
|
6 Centre for Digital Music, Queen Mary, University of London.
|
c@3
|
7 All rights reserved.
|
c@3
|
8 */
|
c@3
|
9
|
c@3
|
10 #include <vamp/vamp.h>
|
c@3
|
11 #include <vamp-sdk/PluginAdapter.h>
|
c@3
|
12
|
c@3
|
13 #include "plugins/BeatDetect.h"
|
c@3
|
14 #include "plugins/ChromagramPlugin.h"
|
c@9
|
15 #include "plugins/ConstantQSpectrogram.h"
|
c@3
|
16 #include "plugins/TonalChangeDetect.h"
|
c@21
|
17 #include "plugins/KeyDetect.h"
|
c@3
|
18
|
c@3
|
19 static Vamp::PluginAdapter<BeatDetector> beatDetectorAdapter;
|
c@3
|
20 static Vamp::PluginAdapter<ChromagramPlugin> chromagramPluginAdapter;
|
c@9
|
21 static Vamp::PluginAdapter<ConstantQSpectrogram> constantQAdapter;
|
c@3
|
22 static Vamp::PluginAdapter<TonalChangeDetect> tonalChangeDetectorAdapter;
|
c@21
|
23 static Vamp::PluginAdapter<KeyDetector> keyDetectorAdapter;
|
c@3
|
24
|
c@23
|
25 const VampPluginDescriptor *vampGetPluginDescriptor(unsigned int vampApiVersion,
|
c@23
|
26 unsigned int index)
|
c@3
|
27 {
|
c@23
|
28 if (vampApiVersion < 1) return 0;
|
c@23
|
29
|
c@3
|
30 switch (index) {
|
c@3
|
31 case 0: return beatDetectorAdapter.getDescriptor();
|
c@3
|
32 case 1: return chromagramPluginAdapter.getDescriptor();
|
c@9
|
33 case 2: return constantQAdapter.getDescriptor();
|
c@9
|
34 case 3: return tonalChangeDetectorAdapter.getDescriptor();
|
c@21
|
35 case 4: return keyDetectorAdapter.getDescriptor();
|
c@3
|
36 default: return 0;
|
c@3
|
37 }
|
c@3
|
38 }
|
c@3
|
39
|