c@69: /* -*- c-basic-offset: 4 indent-tabs-mode: nil -*- vi:set ts=8 sts=4 sw=4: */ c@69: c@69: /* c@69: VamPipe c@69: c@69: Centre for Digital Music, Queen Mary, University of London. c@69: Copyright 2015-2016 QMUL. c@69: c@69: Permission is hereby granted, free of charge, to any person c@69: obtaining a copy of this software and associated documentation c@69: files (the "Software"), to deal in the Software without c@69: restriction, including without limitation the rights to use, copy, c@69: modify, merge, publish, distribute, sublicense, and/or sell copies c@69: of the Software, and to permit persons to whom the Software is c@69: furnished to do so, subject to the following conditions: c@69: c@69: The above copyright notice and this permission notice shall be c@69: included in all copies or substantial portions of the Software. c@69: c@69: THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, c@69: EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF c@69: MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND c@69: NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS BE LIABLE FOR c@69: ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF c@69: CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION c@69: WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. c@69: c@69: Except as contained in this notice, the names of the Centre for c@69: Digital Music; Queen Mary, University of London; and Chris Cannam c@69: shall not be used in advertising or otherwise to promote the sale, c@69: use or other dealings in this Software without prior written c@69: authorization. c@69: */ c@69: c@69: #include "VamPipeAdapter.h" c@69: #include "VamPipePluginLibrary.h" c@69: c@69: #include "vamp-plugin-sdk/examples/ZeroCrossing.h" c@69: #include "vamp-plugin-sdk/examples/SpectralCentroid.h" c@69: #include "vamp-plugin-sdk/examples/PercussionOnsetDetector.h" c@69: #include "vamp-plugin-sdk/examples/FixedTempoEstimator.h" c@69: #include "vamp-plugin-sdk/examples/AmplitudeFollower.h" c@69: #include "vamp-plugin-sdk/examples/PowerSpectrum.h" c@69: c@69: using vampipe::VamPipeAdapter; c@69: using vampipe::VamPipePluginLibrary; c@69: c@69: static std::string soname("vamp-example-plugins"); c@69: c@69: static VamPipeAdapter zeroCrossingAdapter(soname); c@69: static VamPipeAdapter spectralCentroidAdapter(soname); c@69: static VamPipeAdapter percussionOnsetAdapter(soname); c@69: static VamPipeAdapter fixedTempoAdapter(soname); c@69: static VamPipeAdapter amplitudeAdapter(soname); c@69: static VamPipeAdapter powerSpectrumAdapter(soname); c@69: c@69: static VamPipePluginLibrary library({ c@69: &zeroCrossingAdapter, c@69: &spectralCentroidAdapter, c@69: &percussionOnsetAdapter, c@69: &fixedTempoAdapter, c@69: &litudeAdapter, c@69: &powerSpectrumAdapter c@69: }); c@69: c@69: extern "C" { c@69: c@69: const char *vampipeRequestJson(const char *request) { c@69: return library.requestJson(request); c@69: } c@69: c@83: const char *vampipeProcessRaw(int pluginHandle, c@83: const float *const *inputBuffers, c@83: int sec, c@83: int nsec) { c@83: return library.processRaw(pluginHandle, inputBuffers, sec, nsec); c@82: } c@82: c@69: void vampipeFreeJson(const char *json) { c@69: return library.freeJson(json); c@69: } c@69: c@69: } c@69: