Mercurial > hg > piper-cpp
changeset 6:d8358afe3f2c
Update build
author | Chris Cannam <c.cannam@qmul.ac.uk> |
---|---|
date | Fri, 13 May 2016 16:28:26 +0100 |
parents | 6e8607ebad03 |
children | 2dc705f24b9b |
files | capnproto/VampnProto.h capnproto/schemamap.csv json/VampJson.h utilities/json-to-capnp.cpp |
diffstat | 4 files changed, 22 insertions(+), 33 deletions(-) [+] |
line wrap: on
line diff
--- a/capnproto/VampnProto.h Fri May 13 13:48:59 2016 +0100 +++ b/capnproto/VampnProto.h Fri May 13 16:28:26 2016 +0100 @@ -14,16 +14,16 @@ /** * Convert the structures laid out in the Vamp SDK classes into Cap'n - * Proto structures. + * Proto structures (and back again). * - * At least some of this will be necessary for any implementation that - * is using the C++ Vamp SDK to provide its reference structures. An - * implementation could alternatively use the Cap'n Proto structures - * directly, and interact with Vamp plugins using the Vamp C API, - * without using the C++ Vamp SDK classes at all. + * At least some of this will be necessary for any implementation + * using Cap'n Proto that uses the C++ Vamp SDK to provide its + * reference structures. An implementation could alternatively use the + * Cap'n Proto structures directly, and interact with Vamp plugins + * using the Vamp C API, without using the C++ Vamp SDK classes at + * all. */ - -class VampSDKConverter +class VampnProto { public: typedef ::capnp::MallocMessageBuilder MsgBuilder;
--- a/capnproto/schemamap.csv Fri May 13 13:48:59 2016 +0100 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,16 +0,0 @@ -basic, -configurationrequest, -configurationresponse, -feature,Feature -featureset,FeatureSet -loadrequest,LoadRequest -loadresponse,LoadResponse -outputdescriptor,OutputDescriptor -parameterdescriptor,ParameterDescriptor -pluginconfiguration,PluginConfiguration -pluginstaticdata,PluginStaticData -processblock, -realtime,RealTime -request, -response, -valueextents,
--- a/json/VampJson.h Fri May 13 13:48:59 2016 +0100 +++ b/json/VampJson.h Fri May 13 16:28:26 2016 +0100 @@ -14,6 +14,11 @@ #include <vamp-hostsdk/Plugin.h> #include <vamp-hostsdk/PluginLoader.h> +/** + * Convert the structures laid out in the Vamp SDK classes into JSON + * (and back again) following the schema in the vamp-json-schema + * project repo. + */ class VampJson { public:
--- a/utilities/json-to-capnp.cpp Fri May 13 13:48:59 2016 +0100 +++ b/utilities/json-to-capnp.cpp Fri May 13 16:28:26 2016 +0100 @@ -1,6 +1,6 @@ #include "VampJson.h" -#include "vampipe-convert.h" +#include "VampnProto.h" #include <iostream> #include <sstream> @@ -55,17 +55,17 @@ } else if (type == "feature") { auto f = message.initRoot<Feature>(); - VampSDKConverter::buildFeature + VampnProto::buildFeature (f, VampJson::toFeature(payload)); } else if (type == "featureset") { auto fs = message.initRoot<FeatureSet>(); - VampSDKConverter::buildFeatureSet + VampnProto::buildFeatureSet (fs, VampJson::toFeatureSet(payload)); } else if (type == "loadrequest") { auto req = message.initRoot<LoadRequest>(); - VampSDKConverter::buildLoadRequest + VampnProto::buildLoadRequest (req, VampJson::toLoadRequest(payload)); } else if (type == "loadresponse") { @@ -76,30 +76,30 @@ } else if (type == "outputdescriptor") { auto od = message.initRoot<OutputDescriptor>(); - VampSDKConverter::buildOutputDescriptor + VampnProto::buildOutputDescriptor (od, VampJson::toOutputDescriptor(payload)); } else if (type == "parameterdescriptor") { auto pd = message.initRoot<ParameterDescriptor>(); - VampSDKConverter::buildParameterDescriptor + VampnProto::buildParameterDescriptor (pd, VampJson::toParameterDescriptor(payload)); } else if (type == "pluginconfiguration") { auto pc = message.initRoot<PluginConfiguration>(); auto config = VampJson::toPluginConfiguration(payload); - VampSDKConverter::buildPluginConfiguration(pc, config); + VampnProto::buildPluginConfiguration(pc, config); } else if (type == "pluginstaticdata") { auto pc = message.initRoot<PluginStaticData>(); auto sd = VampJson::toPluginStaticData(payload); - VampSDKConverter::buildPluginStaticData(pc, sd); + VampnProto::buildPluginStaticData(pc, sd); } else if (type == "processblock") { throw VampJson::Failure("not implemented yet"); ///!!! } else if (type == "realtime") { auto b = message.initRoot<RealTime>(); - VampSDKConverter::buildRealTime + VampnProto::buildRealTime (b, VampJson::toRealTime(payload)); } else if (type == "valueextents") {