Mercurial > hg > piper-cpp
comparison vamp-json/VampJson.h @ 275:292ec9b50280
Tidy
author | Chris Cannam <cannam@all-day-breakfast.com> |
---|---|
date | Wed, 17 Oct 2018 15:43:00 +0100 |
parents | 82f86151bc4b |
children | 26027c3a99a0 |
comparison
equal
deleted
inserted
replaced
274:532a146b5229 | 275:292ec9b50280 |
---|---|
980 err = "malformed load response: " + err; | 980 err = "malformed load response: " + err; |
981 return {}; | 981 return {}; |
982 } | 982 } |
983 | 983 |
984 LoadResponse resp; | 984 LoadResponse resp; |
985 resp.plugin = pmapper.handleToPlugin(j["handle"].int_value()); | 985 auto h = j["handle"].int_value(); |
986 resp.plugin = pmapper.handleToPlugin(h); | |
986 resp.staticData = toPluginStaticData(j["staticData"], err); | 987 resp.staticData = toPluginStaticData(j["staticData"], err); |
987 if (failed(err)) return {}; | 988 if (failed(err)) return {}; |
988 resp.defaultConfiguration = toPluginConfiguration(j["defaultConfiguration"], | 989 resp.defaultConfiguration = toPluginConfiguration(j["defaultConfiguration"], |
989 err); | 990 err); |
990 if (failed(err)) return {}; | 991 if (failed(err)) return {}; |
1013 err = "malformed configuration request: " + err; | 1014 err = "malformed configuration request: " + err; |
1014 return {}; | 1015 return {}; |
1015 } | 1016 } |
1016 | 1017 |
1017 ConfigurationRequest cr; | 1018 ConfigurationRequest cr; |
1018 cr.plugin = pmapper.handleToPlugin(j["handle"].int_value()); | 1019 auto h = j["handle"].int_value(); |
1020 cr.plugin = pmapper.handleToPlugin(h); | |
1019 cr.configuration = toPluginConfiguration(j["configuration"], err); | 1021 cr.configuration = toPluginConfiguration(j["configuration"], err); |
1020 if (failed(err)) return {}; | 1022 if (failed(err)) return {}; |
1021 return cr; | 1023 return cr; |
1022 } | 1024 } |
1023 | 1025 |
1064 if (!j["outputList"].is_array()) { | 1066 if (!j["outputList"].is_array()) { |
1065 err = "array expected for output list"; | 1067 err = "array expected for output list"; |
1066 return {}; | 1068 return {}; |
1067 } | 1069 } |
1068 | 1070 |
1069 cr.plugin = pmapper.handleToPlugin(j["handle"].int_value()); | 1071 auto h = j["handle"].int_value(); |
1072 cr.plugin = pmapper.handleToPlugin(h); | |
1070 | 1073 |
1071 for (const auto &o: j["outputList"].array_items()) { | 1074 for (const auto &o: j["outputList"].array_items()) { |
1072 auto odpair = toOutputDescriptor(o, err); | 1075 auto odpair = toOutputDescriptor(o, err); |
1073 if (failed(err)) return {}; | 1076 if (failed(err)) return {}; |
1074 cr.outputs.push_back(odpair.first); | 1077 cr.outputs.push_back(odpair.first); |
1128 err = "malformed process request: " + err; | 1131 err = "malformed process request: " + err; |
1129 return {}; | 1132 return {}; |
1130 } | 1133 } |
1131 | 1134 |
1132 ProcessRequest r; | 1135 ProcessRequest r; |
1133 r.plugin = pmapper.handleToPlugin(j["handle"].int_value()); | 1136 auto h = j["handle"].int_value(); |
1137 r.plugin = pmapper.handleToPlugin(h); | |
1134 | 1138 |
1135 r.timestamp = toRealTime(input["timestamp"], err); | 1139 r.timestamp = toRealTime(input["timestamp"], err); |
1136 if (failed(err)) return {}; | 1140 if (failed(err)) return {}; |
1137 | 1141 |
1138 for (const auto &a: input["inputBuffers"].array_items()) { | 1142 for (const auto &a: input["inputBuffers"].array_items()) { |
1543 std::string &err) { | 1547 std::string &err) { |
1544 | 1548 |
1545 checkRpcRequestType(j, "finish", err); | 1549 checkRpcRequestType(j, "finish", err); |
1546 if (failed(err)) return {}; | 1550 if (failed(err)) return {}; |
1547 FinishRequest req; | 1551 FinishRequest req; |
1548 req.plugin = pmapper.handleToPlugin | 1552 auto h = j["params"]["handle"].int_value(); |
1549 (j["params"]["handle"].int_value()); | 1553 req.plugin = pmapper.handleToPlugin(h); |
1550 return req; | 1554 return req; |
1551 } | 1555 } |
1552 | 1556 |
1553 static FinishResponse | 1557 static FinishResponse |
1554 toRpcResponse_Finish(json11::Json j, | 1558 toRpcResponse_Finish(json11::Json j, |