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