comparison utilities/json-to-capnp.cpp @ 23:d678cd00e593

Begin vampipe-convert
author Chris Cannam <c.cannam@qmul.ac.uk>
date Fri, 20 May 2016 18:05:02 +0100
parents b0fc4eb51547
children 55d69b26d4db
comparison
equal deleted inserted replaced
22:b0fc4eb51547 23:d678cd00e593
63 63
64 Json j = json_input(input); 64 Json j = json_input(input);
65 string type = j["type"].string_value(); 65 string type = j["type"].string_value();
66 Json payload = j["payload"]; 66 Json payload = j["payload"];
67 67
68 if (type == "basic") { 68 if (type == "configurationrequest") {
69 throw VampJson::Failure("can't convert Basic block on its own");
70
71 } else if (type == "configurationrequest") {
72 auto req = message.initRoot<ConfigurationRequest>(); 69 auto req = message.initRoot<ConfigurationRequest>();
73 PreservingPluginHandleMapper mapper; 70 PreservingPluginHandleMapper mapper;
74 VampnProto::buildConfigurationRequest 71 VampnProto::buildConfigurationRequest
75 (req, VampJson::toConfigurationRequest(payload, mapper), mapper); 72 (req, VampJson::toConfigurationRequest(payload, mapper), mapper);
76 73