comparison qm-vamp-plugins.cpp @ 106:1ab9634703ca

Add QM Vamp Plugins build, and separate out object file builds (so we can use the C compiler for .c files). Problem is we are now building in the "client project"'s own directory, so conflicting with its own native .o files -- to be revised.
author Chris Cannam <c.cannam@qmul.ac.uk>
date Fri, 30 Sep 2016 19:06:02 +0100
parents
children a734a7e976fa
comparison
equal deleted inserted replaced
105:4845fbb1a516 106:1ab9634703ca
1 /* -*- c-basic-offset: 4 indent-tabs-mode: nil -*- vi:set ts=8 sts=4 sw=4: */
2
3 /*
4 VamPipe
5
6 Centre for Digital Music, Queen Mary, University of London.
7 Copyright 2015-2016 QMUL.
8
9 Permission is hereby granted, free of charge, to any person
10 obtaining a copy of this software and associated documentation
11 files (the "Software"), to deal in the Software without
12 restriction, including without limitation the rights to use, copy,
13 modify, merge, publish, distribute, sublicense, and/or sell copies
14 of the Software, and to permit persons to whom the Software is
15 furnished to do so, subject to the following conditions:
16
17 The above copyright notice and this permission notice shall be
18 included in all copies or substantial portions of the Software.
19
20 THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
21 EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
22 MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
23 NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS BE LIABLE FOR
24 ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF
25 CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
26 WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
27
28 Except as contained in this notice, the names of the Centre for
29 Digital Music; Queen Mary, University of London; and Chris Cannam
30 shall not be used in advertising or otherwise to promote the sale,
31 use or other dealings in this Software without prior written
32 authorization.
33 */
34
35 #include "VamPipeAdapter.h"
36 #include "VamPipePluginLibrary.h"
37
38 #include "plugins/BeatTrack.h"
39 #include "plugins/OnsetDetect.h"
40 #include "plugins/ChromagramPlugin.h"
41 #include "plugins/ConstantQSpectrogram.h"
42 #include "plugins/TonalChangeDetect.h"
43 #include "plugins/KeyDetect.h"
44 #include "plugins/MFCCPlugin.h"
45 #include "plugins/SegmenterPlugin.h"
46 #include "plugins/SimilarityPlugin.h"
47 #include "plugins/BarBeatTrack.h"
48 //!!!#include "plugins/AdaptiveSpectrogram.h"
49 #include "plugins/DWT.h"
50 #include "plugins/Transcription.h"
51
52 using vampipe::VamPipeAdapter;
53 using vampipe::VamPipePluginLibrary;
54
55 static std::string soname("qm-vamp-plugins");
56
57 static VamPipeAdapter<BeatTracker> beatTrackerAdapter(soname);
58 static VamPipeAdapter<OnsetDetector> onsetDetectorAdapter(soname);
59 static VamPipeAdapter<ChromagramPlugin> chromagramPluginAdapter(soname);
60 static VamPipeAdapter<ConstantQSpectrogram> constantQAdapter(soname);
61 static VamPipeAdapter<TonalChangeDetect> tonalChangeDetectorAdapter(soname);
62 static VamPipeAdapter<KeyDetector> keyDetectorAdapter(soname);
63 static VamPipeAdapter<MFCCPlugin> mfccPluginAdapter(soname);
64 static VamPipeAdapter<SegmenterPlugin> segmenterPluginAdapter(soname);
65 static VamPipeAdapter<SimilarityPlugin> similarityPluginAdapter(soname);
66 static VamPipeAdapter<BarBeatTracker> barBeatTrackPluginAdapter(soname);
67 //!!!static VamPipeAdapter<AdaptiveSpectrogram> adaptiveSpectrogramAdapter(soname);
68 static VamPipeAdapter<DWT> dwtAdapter(soname);
69 static VamPipeAdapter<Transcription> transcriptionAdapter(soname);
70
71 static VamPipePluginLibrary library({
72 &beatTrackerAdapter,
73 &onsetDetectorAdapter,
74 &chromagramPluginAdapter,
75 &constantQAdapter,
76 &tonalChangeDetectorAdapter,
77 &keyDetectorAdapter,
78 &mfccPluginAdapter,
79 &segmenterPluginAdapter,
80 &similarityPluginAdapter,
81 &barBeatTrackPluginAdapter,
82 //!!! &adaptiveSpectrogramAdapter,
83 &dwtAdapter,
84 &transcriptionAdapter
85 });
86
87 extern "C" {
88
89 const char *vampipeRequestJson(const char *request) {
90 return library.requestJson(request);
91 }
92
93 const char *vampipeProcessRaw(int pluginHandle,
94 const float *const *inputBuffers,
95 int sec,
96 int nsec) {
97 return library.processRaw(pluginHandle, inputBuffers, sec, nsec);
98 }
99
100 void vampipeFreeJson(const char *json) {
101 return library.freeJson(json);
102 }
103
104 }
105