| 1302 | } |
| 1303 | |
| 1304 | bool PipelineParser::parse_multi_swipe( |
| 1305 | const json::value& input, |
| 1306 | Action::MultiSwipeParam& output, |
| 1307 | const Action::MultiSwipeParam& default_multi, |
| 1308 | const Action::SwipeParam& default_single) |
| 1309 | { |
| 1310 | auto swipes_opt = input.find("swipes"); |
| 1311 | if (!swipes_opt) { |
| 1312 | output = default_multi; |
| 1313 | return true; |
| 1314 | } |
| 1315 | |
| 1316 | if (!swipes_opt->is_array()) { |
| 1317 | LogError << "failed to parse swipes, is not array" << VAR(input); |
| 1318 | return false; |
| 1319 | } |
| 1320 | |
| 1321 | output.swipes.clear(); |
| 1322 | for (const json::value& swipe : swipes_opt->as_array()) { |
| 1323 | Action::SwipeParam res; |
| 1324 | if (!parse_swipe(swipe, res, default_single)) { |
| 1325 | return false; |
| 1326 | } |
| 1327 | |
| 1328 | output.swipes.emplace_back(std::move(res)); |
| 1329 | } |
| 1330 | |
| 1331 | return true; |
| 1332 | } |
| 1333 | |
| 1334 | bool PipelineParser::parse_key_param(const json::value& input, Action::KeyParam& output, const Action::KeyParam& default_value) |
| 1335 | { |