view silvet.cpp @ 30:e18e15bedd72 noexcept

Replace exceptions throughout the JSON-handling and adapter code with string-arg error handling. No longer need exception handling enabled in Emscripten (with its consequent runtime overhead - though we still need to check whether this error handling regime is actually faster).
author Chris Cannam
date Tue, 20 Sep 2016 16:35:47 +0100
parents d63f2ade049b
children a734a7e976fa
line wrap: on
line source

#include "VamPipeAdapter.h"
#include "VamPipePluginLibrary.h"

#include "Silvet.h"

using vampipe::VamPipeAdapter;
using vampipe::VamPipePluginLibrary;

static std::string soname("silvet");

static VamPipeAdapter<Silvet> silvetAdapter(soname);

static VamPipePluginLibrary library({
    &silvetAdapter
});

extern "C" {

const char *vampipeRequestJson(const char *request) {
    return library.requestJson(request);
}

const char *vampipeProcessRaw(int pluginHandle,
                              const float *const *inputBuffers,
                              int sec,
                              int nsec) {
    return library.processRaw(pluginHandle, inputBuffers, sec, nsec);
}
    
void vampipeFreeJson(const char *json) {
    return library.freeJson(json);
}

}