| 534 | } |
| 535 | |
| 536 | void HyperAPI::lutDownloaded(QNetworkReply* reply, int hardware_brightness, int hardware_contrast, int hardware_saturation, qint64 time) |
| 537 | { |
| 538 | QString fileName = QDir::cleanPath(_instanceManager->getRootPath() + QDir::separator() + "lut_lin_tables.3d"); |
| 539 | QString error = installLut(reply, fileName, hardware_brightness, hardware_contrast, hardware_saturation, time); |
| 540 | |
| 541 | if (error == nullptr) |
| 542 | { |
| 543 | Info(_log, "Reloading LUT..."); |
| 544 | BaseAPI::setVideoModeHdr(0); |
| 545 | BaseAPI::setVideoModeHdr(1); |
| 546 | |
| 547 | QJsonDocument newSet; |
| 548 | SAFE_CALL_1_RET(_hyperhdr.get(), getSetting, QJsonDocument, newSet, settings::type, settings::type::VIDEOGRABBER); |
| 549 | QJsonObject grabber = QJsonObject(newSet.object()); |
| 550 | grabber["hardware_brightness"] = hardware_brightness; |
| 551 | grabber["hardware_contrast"] = hardware_contrast; |
| 552 | grabber["hardware_saturation"] = hardware_saturation; |
| 553 | QString newConfig = QJsonDocument(grabber).toJson(QJsonDocument::Compact); |
| 554 | BLOCK_CALL_2(_hyperhdr.get(), setSetting, settings::type, settings::type::VIDEOGRABBER, QString, newConfig); |
| 555 | |
| 556 | Info(_log, "New LUT has been installed as: %s (from: %s)", QSTRING_CSTR(fileName), QSTRING_CSTR(reply->url().toString())); |
| 557 | } |
| 558 | else |
| 559 | { |
| 560 | Error(_log, "Error occured while installing new LUT: %s", QSTRING_CSTR(error)); |
| 561 | } |
| 562 | |
| 563 | QJsonObject report; |
| 564 | report["status"] = (error == nullptr) ? 1 : 0; |
| 565 | report["error"] = error; |
| 566 | sendSuccessDataReply(QJsonDocument(report), "lut-install-update"); |
| 567 | } |
| 568 | |
| 569 | void HyperAPI::handleLutInstallCommand(const QJsonObject& message, const QString& command, int tan) |
| 570 | { |
nothing calls this directly
no test coverage detected