Mercurial > hg > piper-vamp-js
changeset 83:a6ab5fd80eb7
Rename process -> processRaw
author | Chris Cannam <c.cannam@qmul.ac.uk> |
---|---|
date | Wed, 14 Sep 2016 14:41:24 +0100 |
parents | 5bd5d48a1c21 |
children | 604244038b81 |
files | VamPipePluginLibrary.cpp VamPipePluginLibrary.h example.cpp vampipe.map |
diffstat | 4 files changed, 16 insertions(+), 18 deletions(-) [+] |
line wrap: on
line diff
--- a/VamPipePluginLibrary.cpp Fri Sep 09 15:41:35 2016 +0100 +++ b/VamPipePluginLibrary.cpp Wed Sep 14 14:41:24 2016 +0100 @@ -193,10 +193,10 @@ } string -VamPipePluginLibrary::processImpl(int pluginHandle, - const float *const *inputBuffers, - int sec, - int nsec) +VamPipePluginLibrary::processRawImpl(int pluginHandle, + const float *const *inputBuffers, + int sec, + int nsec) { RequestOrResponse response; response.direction = RequestOrResponse::Response; @@ -212,14 +212,14 @@ response.processResponse.features = plugin->process(inputBuffers, timestamp); response.success = true; + + m_useBase64 = true; return writeResponse(response); } catch (const std::exception &e) { return VampJson::fromException(e, RRType::Process).dump(); } - - m_useBase64 = true; //!!! todo: return something raw as well! } string
--- a/VamPipePluginLibrary.h Fri Sep 09 15:41:35 2016 +0100 +++ b/VamPipePluginLibrary.h Wed Sep 14 14:41:24 2016 +0100 @@ -58,9 +58,9 @@ return strdup(requestJsonImpl(request).c_str()); } - const char *process(int handle, const float *const *inputBuffers, - int sec, int nsec) { - return strdup(processImpl(handle, inputBuffers, sec, nsec).c_str()); + const char *processRaw(int handle, const float *const *inputBuffers, + int sec, int nsec) { + return strdup(processRawImpl(handle, inputBuffers, sec, nsec).c_str()); } void freeJson(const char *json) { @@ -69,7 +69,7 @@ private: std::string requestJsonImpl(std::string req); - std::string processImpl(int, const float *const *, int, int); + std::string processRawImpl(int, const float *const *, int, int); RequestOrResponse readRequest(std::string req); std::string writeResponse(const RequestOrResponse &resp) const;
--- a/example.cpp Fri Sep 09 15:41:35 2016 +0100 +++ b/example.cpp Wed Sep 14 14:41:24 2016 +0100 @@ -69,13 +69,11 @@ return library.requestJson(request); } - //!!! naming problem -- returns json as well, it's just that - //!!! unlike the others, it doesn't take json as input -const char *vampipeProcess(int pluginHandle, - const float *const *inputBuffers, - int sec, - int nsec) { - return library.process(pluginHandle, inputBuffers, sec, nsec); +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) {