Mercurial > hg > piper-cpp
comparison utilities/json-to-capnp.cpp @ 22:b0fc4eb51547
More conversions
author | Chris Cannam <c.cannam@qmul.ac.uk> |
---|---|
date | Fri, 20 May 2016 17:07:04 +0100 |
parents | dff96610ac05 |
children | d678cd00e593 |
comparison
equal
deleted
inserted
replaced
21:dff96610ac05 | 22:b0fc4eb51547 |
---|---|
118 } else if (type == "pluginstaticdata") { | 118 } else if (type == "pluginstaticdata") { |
119 auto pc = message.initRoot<PluginStaticData>(); | 119 auto pc = message.initRoot<PluginStaticData>(); |
120 auto sd = VampJson::toPluginStaticData(payload); | 120 auto sd = VampJson::toPluginStaticData(payload); |
121 VampnProto::buildPluginStaticData(pc, sd); | 121 VampnProto::buildPluginStaticData(pc, sd); |
122 | 122 |
123 } else if (type == "processblock") { | 123 } else if (type == "processrequest") { |
124 throw VampJson::Failure("not implemented yet"); ///!!! | 124 auto p = message.initRoot<ProcessRequest>(); |
125 PreservingPluginHandleMapper mapper; | |
126 VampnProto::buildProcessRequest | |
127 (p, VampJson::toProcessRequest(payload, mapper), mapper); | |
125 | 128 |
126 } else if (type == "realtime") { | 129 } else if (type == "realtime") { |
127 auto b = message.initRoot<RealTime>(); | 130 auto b = message.initRoot<RealTime>(); |
128 VampnProto::buildRealTime | 131 VampnProto::buildRealTime |
129 (b, VampJson::toRealTime(payload)); | 132 (b, VampJson::toRealTime(payload)); |
130 | |
131 } else if (type == "valueextents") { | |
132 throw VampJson::Failure("no ValueExtents struct in Cap'n Proto mapping"); | |
133 | 133 |
134 } else { | 134 } else { |
135 throw VampJson::Failure("unknown or unsupported JSON schema type " + | 135 throw VampJson::Failure("unknown or unsupported JSON schema type " + |
136 type); | 136 type); |
137 } | 137 } |