Chris@60: /* -*- c-basic-offset: 4 indent-tabs-mode: nil -*- vi:set ts=8 sts=4 sw=4: */ Chris@60: Chris@60: /* Chris@60: Piper Vamp JSON Adapter Chris@60: Chris@60: Centre for Digital Music, Queen Mary, University of London. Chris@60: Copyright 2015-2016 QMUL. Chris@60: Chris@60: Permission is hereby granted, free of charge, to any person Chris@60: obtaining a copy of this software and associated documentation Chris@60: files (the "Software"), to deal in the Software without Chris@60: restriction, including without limitation the rights to use, copy, Chris@60: modify, merge, publish, distribute, sublicense, and/or sell copies Chris@60: of the Software, and to permit persons to whom the Software is Chris@60: furnished to do so, subject to the following conditions: Chris@60: Chris@60: The above copyright notice and this permission notice shall be Chris@60: included in all copies or substantial portions of the Software. Chris@60: Chris@60: THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, Chris@60: EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF Chris@60: MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND Chris@60: NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS BE LIABLE FOR Chris@60: ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF Chris@60: CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION Chris@60: WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. Chris@60: Chris@60: Except as contained in this notice, the names of the Centre for Chris@60: Digital Music; Queen Mary, University of London; and Chris Cannam Chris@60: shall not be used in advertising or otherwise to promote the sale, Chris@60: use or other dealings in this Software without prior written Chris@60: authorization. Chris@60: */ Chris@60: Chris@60: #ifndef PIPER_EXPORT_H Chris@60: #define PIPER_EXPORT_H Chris@60: Chris@60: #ifdef _VAMP_IN_PLUGINSDK Chris@60: #error You must include PiperExport.h before any other files that use the Vamp SDK Chris@60: #endif Chris@60: Chris@60: // Include all the Piper headers that an export program may need here: Chris@60: // for a simple Vamp plugin library, this one should be the only Piper Chris@60: // #include Chris@60: Chris@60: #include "PiperAdapter.h" Chris@60: #include "PiperPluginLibrary.h" Chris@60: Chris@60: // Convenience macros for the usual case with a static Chris@60: // PiperPluginLibrary object to export C wrappers for Chris@60: Chris@60: #define PIPER_EXPORT_LIBRARY(library) \ Chris@60: extern "C" { \ Chris@60: const char *piperRequestJson(const char *request) { \ Chris@60: return library.requestJson(request); \ Chris@60: } \ Chris@60: const char *piperProcessRaw(int handle, \ Chris@60: const float *const *inputBuffers, \ Chris@60: int sec, \ Chris@60: int nsec) { \ Chris@60: return library.processRaw(handle, inputBuffers, sec, nsec); \ Chris@60: } \ Chris@60: void piperFreeJson(const char *json) { \ Chris@60: return library.freeJson(json); \ Chris@60: } \ Chris@60: } Chris@60: Chris@60: #endif