Mercurial > hg > piper-cpp
comparison vamp-json/VampJson.h @ 86:5a80e00375b1
Cast number types
author | Chris Cannam <c.cannam@qmul.ac.uk> |
---|---|
date | Wed, 12 Oct 2016 12:51:33 +0100 |
parents | d9e85a65d45b |
children | 427c4c725085 |
comparison
equal
deleted
inserted
replaced
85:1b7c11bc5a88 | 86:5a80e00375b1 |
---|---|
867 fromConfigurationRequest(const Vamp::HostExt::ConfigurationRequest &cr, | 867 fromConfigurationRequest(const Vamp::HostExt::ConfigurationRequest &cr, |
868 const PluginHandleMapper &pmapper) { | 868 const PluginHandleMapper &pmapper) { |
869 | 869 |
870 json11::Json::object jo; | 870 json11::Json::object jo; |
871 | 871 |
872 jo["handle"] = pmapper.pluginToHandle(cr.plugin); | 872 jo["handle"] = double(pmapper.pluginToHandle(cr.plugin)); |
873 jo["configuration"] = fromPluginConfiguration(cr.configuration); | 873 jo["configuration"] = fromPluginConfiguration(cr.configuration); |
874 | 874 |
875 return json11::Json(jo); | 875 return json11::Json(jo); |
876 } | 876 } |
877 | 877 |
897 fromConfigurationResponse(const Vamp::HostExt::ConfigurationResponse &cr, | 897 fromConfigurationResponse(const Vamp::HostExt::ConfigurationResponse &cr, |
898 const PluginHandleMapper &pmapper) { | 898 const PluginHandleMapper &pmapper) { |
899 | 899 |
900 json11::Json::object jo; | 900 json11::Json::object jo; |
901 | 901 |
902 jo["handle"] = pmapper.pluginToHandle(cr.plugin); | 902 jo["handle"] = double(pmapper.pluginToHandle(cr.plugin)); |
903 | 903 |
904 json11::Json::array outs; | 904 json11::Json::array outs; |
905 for (auto &d: cr.outputs) { | 905 for (auto &d: cr.outputs) { |
906 outs.push_back(fromOutputDescriptor(d)); | 906 outs.push_back(fromOutputDescriptor(d)); |
907 } | 907 } |
935 fromProcessRequest(const Vamp::HostExt::ProcessRequest &r, | 935 fromProcessRequest(const Vamp::HostExt::ProcessRequest &r, |
936 const PluginHandleMapper &pmapper, | 936 const PluginHandleMapper &pmapper, |
937 BufferSerialisation serialisation) { | 937 BufferSerialisation serialisation) { |
938 | 938 |
939 json11::Json::object jo; | 939 json11::Json::object jo; |
940 jo["handle"] = pmapper.pluginToHandle(r.plugin); | 940 jo["handle"] = double(pmapper.pluginToHandle(r.plugin)); |
941 | 941 |
942 json11::Json::object io; | 942 json11::Json::object io; |
943 io["timestamp"] = fromRealTime(r.timestamp); | 943 io["timestamp"] = fromRealTime(r.timestamp); |
944 | 944 |
945 json11::Json::array chans; | 945 json11::Json::array chans; |
1169 | 1169 |
1170 json11::Json::object jo; | 1170 json11::Json::object jo; |
1171 markRPC(jo); | 1171 markRPC(jo); |
1172 | 1172 |
1173 json11::Json::object po; | 1173 json11::Json::object po; |
1174 po["handle"] = pmapper.pluginToHandle(resp.plugin); | 1174 po["handle"] = double(pmapper.pluginToHandle(resp.plugin)); |
1175 po["features"] = fromFeatureSet(resp.features, | 1175 po["features"] = fromFeatureSet(resp.features, |
1176 *pmapper.pluginToOutputIdMapper(resp.plugin), | 1176 *pmapper.pluginToOutputIdMapper(resp.plugin), |
1177 serialisation); | 1177 serialisation); |
1178 jo["method"] = "process"; | 1178 jo["method"] = "process"; |
1179 jo["result"] = po; | 1179 jo["result"] = po; |
1188 | 1188 |
1189 json11::Json::object jo; | 1189 json11::Json::object jo; |
1190 markRPC(jo); | 1190 markRPC(jo); |
1191 | 1191 |
1192 json11::Json::object fo; | 1192 json11::Json::object fo; |
1193 fo["handle"] = pmapper.pluginToHandle(req.plugin); | 1193 fo["handle"] = double(pmapper.pluginToHandle(req.plugin)); |
1194 | 1194 |
1195 jo["method"] = "finish"; | 1195 jo["method"] = "finish"; |
1196 jo["params"] = fo; | 1196 jo["params"] = fo; |
1197 addId(jo, id); | 1197 addId(jo, id); |
1198 return json11::Json(jo); | 1198 return json11::Json(jo); |
1206 | 1206 |
1207 json11::Json::object jo; | 1207 json11::Json::object jo; |
1208 markRPC(jo); | 1208 markRPC(jo); |
1209 | 1209 |
1210 json11::Json::object po; | 1210 json11::Json::object po; |
1211 po["handle"] = pmapper.pluginToHandle(resp.plugin); | 1211 po["handle"] = double(pmapper.pluginToHandle(resp.plugin)); |
1212 po["features"] = fromFeatureSet(resp.features, | 1212 po["features"] = fromFeatureSet(resp.features, |
1213 *pmapper.pluginToOutputIdMapper(resp.plugin), | 1213 *pmapper.pluginToOutputIdMapper(resp.plugin), |
1214 serialisation); | 1214 serialisation); |
1215 jo["method"] = "finish"; | 1215 jo["method"] = "finish"; |
1216 jo["result"] = po; | 1216 jo["result"] = po; |