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: #ifndef VAMPIPE_PLUGIN_LIBRARY_H c@69: #define VAMPIPE_PLUGIN_LIBRARY_H c@69: c@69: #include "bits/CountingPluginHandleMapper.h" c@69: c@69: #include c@69: #include c@69: c@69: #include c@69: #include c@69: #include c@69: c@69: namespace vampipe { c@69: c@88: class VamPipeAdapterInterface; c@69: c@69: class VamPipePluginLibrary c@69: { c@69: public: c@88: VamPipePluginLibrary(std::vector pp); c@69: c@69: const char *requestJson(const char *request) { c@69: return strdup(requestJsonImpl(request).c_str()); c@69: } c@69: c@83: const char *processRaw(int handle, const float *const *inputBuffers, c@83: int sec, int nsec) { c@83: return strdup(processRawImpl(handle, inputBuffers, sec, nsec).c_str()); c@82: } c@82: c@69: void freeJson(const char *json) { c@69: free(const_cast(json)); c@69: } c@69: c@69: private: c@69: std::string requestJsonImpl(std::string req); c@83: std::string processRawImpl(int, const float *const *, int, int); c@69: c@94: Vamp::HostExt::ListResponse listPluginData() const; c@99: Vamp::HostExt::LoadResponse loadPlugin(Vamp::HostExt::LoadRequest r, c@99: std::string &err) const; c@69: Vamp::HostExt::ConfigurationResponse configurePlugin(Vamp::HostExt:: c@99: ConfigurationRequest r, c@99: std::string &err) c@94: const; c@69: c@94: // map from pluginKey -> adapter c@94: std::map m_adapters; c@69: CountingPluginHandleMapper m_mapper; c@81: bool m_useBase64; c@69: }; c@69: c@69: } c@69: c@69: #endif