comparison qm-vamp-plugins/qm-vamp-plugins.cpp @ 27:cae97e9dfa72

Import a couple of builds
author Chris Cannam <c.cannam@qmul.ac.uk>
date Thu, 10 Nov 2016 11:55:22 +0000
parents
children 95ac23360324
comparison
equal deleted inserted replaced
-1:000000000000 27:cae97e9dfa72
1 /* -*- c-basic-offset: 4 indent-tabs-mode: nil -*- vi:set ts=8 sts=4 sw=4: */
2
3 /*
4 Piper
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 "PiperAdapter.h"
36 #include "PiperPluginLibrary.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 piper::PiperAdapter;
53 using piper::PiperPluginLibrary;
54
55 static std::string soname("qm-vamp-plugins");
56
57 static PiperAdapter<BeatTracker> beatTrackerAdapter(soname);
58 static PiperAdapter<OnsetDetector> onsetDetectorAdapter(soname);
59 static PiperAdapter<ChromagramPlugin> chromagramPluginAdapter(soname);
60 static PiperAdapter<ConstantQSpectrogram> constantQAdapter(soname);
61 static PiperAdapter<TonalChangeDetect> tonalChangeDetectorAdapter(soname);
62 static PiperAdapter<KeyDetector> keyDetectorAdapter(soname);
63 static PiperAdapter<MFCCPlugin> mfccPluginAdapter(soname);
64 static PiperAdapter<SegmenterPlugin> segmenterPluginAdapter(soname);
65 static PiperAdapter<SimilarityPlugin> similarityPluginAdapter(soname);
66 static PiperAdapter<BarBeatTracker> barBeatTrackPluginAdapter(soname);
67 //!!!static PiperAdapter<AdaptiveSpectrogram> adaptiveSpectrogramAdapter(soname);
68 static PiperAdapter<DWT> dwtAdapter(soname);
69 static PiperAdapter<Transcription> transcriptionAdapter(soname);
70
71 static PiperPluginLibrary 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 *piperRequestJson(const char *request) {
90 return library.requestJson(request);
91 }
92
93 const char *piperProcessRaw(int handle,
94 const float *const *inputBuffers,
95 int sec,
96 int nsec) {
97 return library.processRaw(handle, inputBuffers, sec, nsec);
98 }
99
100 void piperFreeJson(const char *json) {
101 return library.freeJson(json);
102 }
103
104 }
105