update build scripts for mingw-w64
[vamp-aubio-plugins.git] / libmain.cpp
1 /* -*- c-basic-offset: 4 indent-tabs-mode: nil -*-  vi:set ts=8 sts=4 sw=4: */
2
3 /*
4     Vamp feature extraction plugins using Paul Brossier's Aubio library.
5
6     Centre for Digital Music, Queen Mary, University of London.
7     This file copyright 2006 Chris Cannam.
8     
9     This file is part of vamp-aubio-plugins.
10
11     vamp-aubio is free software: you can redistribute it and/or modify
12     it under the terms of the GNU General Public License as published by
13     the Free Software Foundation, either version 3 of the License, or
14     (at your option) any later version.
15
16     vamp-aubio is distributed in the hope that it will be useful,
17     but WITHOUT ANY WARRANTY; without even the implied warranty of
18     MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
19     GNU General Public License for more details.
20
21     You should have received a copy of the GNU General Public License
22     along with aubio.  If not, see <http://www.gnu.org/licenses/>.
23
24 */
25
26 #include <vamp/vamp.h>
27 #include <vamp-sdk/PluginAdapter.h>
28
29 #include "plugins/Onset.h"
30 #include "plugins/Pitch.h"
31 #include "plugins/Notes.h"
32 #include "plugins/Tempo.h"
33 #include "plugins/Silence.h"
34 #include "plugins/Mfcc.h"
35 #include "plugins/MelEnergy.h"
36 #include "plugins/SpecDesc.h"
37
38 static Vamp::PluginAdapter<Onset> onsetAdapter;
39 static Vamp::PluginAdapter<Pitch> pitchAdapter;
40 static Vamp::PluginAdapter<Notes> notesAdapter;
41 static Vamp::PluginAdapter<Tempo> tempoAdapter;
42 static Vamp::PluginAdapter<Silence> silenceAdapter;
43 static Vamp::PluginAdapter<Mfcc> mfccAdapter;
44 static Vamp::PluginAdapter<MelEnergy> melenergyAdapter;
45 static Vamp::PluginAdapter<SpecDesc> specdescAdapter;
46
47 const VampPluginDescriptor *vampGetPluginDescriptor(unsigned int vampApiVersion,
48                                                     unsigned int index)
49 {
50     if (vampApiVersion < 2) return 0;
51
52     switch (index) {
53     case  0: return onsetAdapter.getDescriptor();
54     case  1: return pitchAdapter.getDescriptor();
55     case  2: return notesAdapter.getDescriptor();
56     case  3: return tempoAdapter.getDescriptor();
57     case  4: return silenceAdapter.getDescriptor();
58     case  5: return mfccAdapter.getDescriptor();
59     case  6: return melenergyAdapter.getDescriptor();
60     case  7: return specdescAdapter.getDescriptor();
61     default: return 0;
62     }
63 }
64