| 303 | } |
| 304 | |
| 305 | void HyperAPI::handleServerInfoCommand(const QJsonObject& message, const QString& command, int tan) |
| 306 | { |
| 307 | try |
| 308 | { |
| 309 | bool subscribeOnly = false; |
| 310 | if (message.contains("subscribe")) |
| 311 | { |
| 312 | QJsonArray subsArr = message["subscribe"].toArray(); |
| 313 | for (const QJsonValueRef entry : subsArr) |
| 314 | { |
| 315 | if (entry == "performance-update" || entry == "lut-calibration-update") |
| 316 | subscribeOnly = true; |
| 317 | } |
| 318 | } |
| 319 | |
| 320 | if (!subscribeOnly) |
| 321 | { |
| 322 | QJsonObject info; |
| 323 | |
| 324 | |
| 325 | ///////////////////// |
| 326 | // Instance report // |
| 327 | ///////////////////// |
| 328 | |
| 329 | BLOCK_CALL_2(_hyperhdr.get(), putJsonInfo, QJsonObject&, info, bool, true); |
| 330 | |
| 331 | /////////////////////////// |
| 332 | // Available LED devices // |
| 333 | /////////////////////////// |
| 334 | |
| 335 | QJsonObject ledDevices; |
| 336 | QJsonArray availableLedDevices; |
| 337 | for (auto dev : hyperhdr::leds::GET_ALL_LED_DEVICE(nullptr)) |
| 338 | { |
| 339 | QJsonObject driver; |
| 340 | driver["name"] = dev.name; |
| 341 | driver["group"] = dev.group; |
| 342 | availableLedDevices.append(driver); |
| 343 | } |
| 344 | |
| 345 | ledDevices["available"] = availableLedDevices; |
| 346 | info["ledDevices"] = ledDevices; |
| 347 | |
| 348 | /////////////////////// |
| 349 | // Sound Device Info // |
| 350 | /////////////////////// |
| 351 | |
| 352 | #if defined(ENABLE_SOUNDCAPLINUX) || defined(ENABLE_SOUNDCAPWINDOWS) || defined(ENABLE_SOUNDCAPMACOS) |
| 353 | |
| 354 | QJsonObject resultSound; |
| 355 | |
| 356 | if (_soundCapture != nullptr) |
| 357 | SAFE_CALL_0_RET(_soundCapture.get(), getJsonInfo, QJsonObject, resultSound); |
| 358 | |
| 359 | if (!resultSound.isEmpty()) |
| 360 | info["sound"] = resultSound; |
| 361 | |
| 362 | #endif |
nothing calls this directly
no test coverage detected