annotate qm-vamp-plugins/qm-vamp-plugins.cpp @ 32:2cd8c30131ac

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