Mercurial > hg > piper-cpp
comparison utilities/json-to-capnp.cpp @ 6:d8358afe3f2c
Update build
author | Chris Cannam <c.cannam@qmul.ac.uk> |
---|---|
date | Fri, 13 May 2016 16:28:26 +0100 |
parents | 6e8607ebad03 |
children | f379b0e9a8e1 |
comparison
equal
deleted
inserted
replaced
5:6e8607ebad03 | 6:d8358afe3f2c |
---|---|
1 | 1 |
2 #include "VampJson.h" | 2 #include "VampJson.h" |
3 #include "vampipe-convert.h" | 3 #include "VampnProto.h" |
4 | 4 |
5 #include <iostream> | 5 #include <iostream> |
6 #include <sstream> | 6 #include <sstream> |
7 #include <stdexcept> | 7 #include <stdexcept> |
8 | 8 |
53 } else if (type == "configurationresponse") { | 53 } else if (type == "configurationresponse") { |
54 throw VampJson::Failure("not implemented yet"); ///!!! | 54 throw VampJson::Failure("not implemented yet"); ///!!! |
55 | 55 |
56 } else if (type == "feature") { | 56 } else if (type == "feature") { |
57 auto f = message.initRoot<Feature>(); | 57 auto f = message.initRoot<Feature>(); |
58 VampSDKConverter::buildFeature | 58 VampnProto::buildFeature |
59 (f, VampJson::toFeature(payload)); | 59 (f, VampJson::toFeature(payload)); |
60 | 60 |
61 } else if (type == "featureset") { | 61 } else if (type == "featureset") { |
62 auto fs = message.initRoot<FeatureSet>(); | 62 auto fs = message.initRoot<FeatureSet>(); |
63 VampSDKConverter::buildFeatureSet | 63 VampnProto::buildFeatureSet |
64 (fs, VampJson::toFeatureSet(payload)); | 64 (fs, VampJson::toFeatureSet(payload)); |
65 | 65 |
66 } else if (type == "loadrequest") { | 66 } else if (type == "loadrequest") { |
67 auto req = message.initRoot<LoadRequest>(); | 67 auto req = message.initRoot<LoadRequest>(); |
68 VampSDKConverter::buildLoadRequest | 68 VampnProto::buildLoadRequest |
69 (req, VampJson::toLoadRequest(payload)); | 69 (req, VampJson::toLoadRequest(payload)); |
70 | 70 |
71 } else if (type == "loadresponse") { | 71 } else if (type == "loadresponse") { |
72 //!!! response types & configure call for plugin handles, but | 72 //!!! response types & configure call for plugin handles, but |
73 //!!! we don't have any context in which a plugin handle can | 73 //!!! we don't have any context in which a plugin handle can |
74 //!!! be persistent here | 74 //!!! be persistent here |
75 throw VampJson::Failure("not implemented yet"); ///!!! | 75 throw VampJson::Failure("not implemented yet"); ///!!! |
76 | 76 |
77 } else if (type == "outputdescriptor") { | 77 } else if (type == "outputdescriptor") { |
78 auto od = message.initRoot<OutputDescriptor>(); | 78 auto od = message.initRoot<OutputDescriptor>(); |
79 VampSDKConverter::buildOutputDescriptor | 79 VampnProto::buildOutputDescriptor |
80 (od, VampJson::toOutputDescriptor(payload)); | 80 (od, VampJson::toOutputDescriptor(payload)); |
81 | 81 |
82 } else if (type == "parameterdescriptor") { | 82 } else if (type == "parameterdescriptor") { |
83 auto pd = message.initRoot<ParameterDescriptor>(); | 83 auto pd = message.initRoot<ParameterDescriptor>(); |
84 VampSDKConverter::buildParameterDescriptor | 84 VampnProto::buildParameterDescriptor |
85 (pd, VampJson::toParameterDescriptor(payload)); | 85 (pd, VampJson::toParameterDescriptor(payload)); |
86 | 86 |
87 } else if (type == "pluginconfiguration") { | 87 } else if (type == "pluginconfiguration") { |
88 auto pc = message.initRoot<PluginConfiguration>(); | 88 auto pc = message.initRoot<PluginConfiguration>(); |
89 auto config = VampJson::toPluginConfiguration(payload); | 89 auto config = VampJson::toPluginConfiguration(payload); |
90 VampSDKConverter::buildPluginConfiguration(pc, config); | 90 VampnProto::buildPluginConfiguration(pc, config); |
91 | 91 |
92 } else if (type == "pluginstaticdata") { | 92 } else if (type == "pluginstaticdata") { |
93 auto pc = message.initRoot<PluginStaticData>(); | 93 auto pc = message.initRoot<PluginStaticData>(); |
94 auto sd = VampJson::toPluginStaticData(payload); | 94 auto sd = VampJson::toPluginStaticData(payload); |
95 VampSDKConverter::buildPluginStaticData(pc, sd); | 95 VampnProto::buildPluginStaticData(pc, sd); |
96 | 96 |
97 } else if (type == "processblock") { | 97 } else if (type == "processblock") { |
98 throw VampJson::Failure("not implemented yet"); ///!!! | 98 throw VampJson::Failure("not implemented yet"); ///!!! |
99 | 99 |
100 } else if (type == "realtime") { | 100 } else if (type == "realtime") { |
101 auto b = message.initRoot<RealTime>(); | 101 auto b = message.initRoot<RealTime>(); |
102 VampSDKConverter::buildRealTime | 102 VampnProto::buildRealTime |
103 (b, VampJson::toRealTime(payload)); | 103 (b, VampJson::toRealTime(payload)); |
104 | 104 |
105 } else if (type == "valueextents") { | 105 } else if (type == "valueextents") { |
106 throw VampJson::Failure("no ValueExtents struct in Cap'n Proto mapping"); | 106 throw VampJson::Failure("no ValueExtents struct in Cap'n Proto mapping"); |
107 | 107 |