mirror of
https://github.com/hyperion-project/hyperion.ng.git
synced 2023-10-10 13:36:59 +02:00
Update JsonClientConnection.cpp
Former-commit-id: 53b8cf73df6f3cec49886169b870e5490828716b
This commit is contained in:
parent
ef1f269c51
commit
642de44c7c
@ -392,6 +392,47 @@ void JsonClientConnection::handleServerInfoCommand(const Json::Value &)
|
|||||||
item["duration_ms"] = Json::Value::UInt(priorityInfo.timeoutTime_ms - now);
|
item["duration_ms"] = Json::Value::UInt(priorityInfo.timeoutTime_ms - now);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// collect correction information
|
||||||
|
Json::Value & correctionArray = info["correction"];
|
||||||
|
for (const std::string& correctionId : _hyperion->getCorrectionIds())
|
||||||
|
{
|
||||||
|
const ColorCorrection * colorCorrection = _hyperion->getCorrection(correctionId);
|
||||||
|
if (colorCorrection == nullptr)
|
||||||
|
{
|
||||||
|
std::cerr << "Incorrect color correction id: " << correctionId << std::endl;
|
||||||
|
continue;
|
||||||
|
}
|
||||||
|
|
||||||
|
Json::Value & correction = correctionArray.append(Json::Value());
|
||||||
|
correction["id"] = correctionId;
|
||||||
|
|
||||||
|
Json::Value & corrValues = correction["correctionValues"];
|
||||||
|
corrValues.append(colorCorrection->_rgbCorrection.getcorrectionR());
|
||||||
|
corrValues.append(colorCorrection->_rgbCorrection.getcorrectionG());
|
||||||
|
corrValues.append(colorCorrection->_rgbCorrection.getcorrectionB());
|
||||||
|
}
|
||||||
|
|
||||||
|
// collect temperature correction information
|
||||||
|
Json::Value & temperatureArray = info["temperature"];
|
||||||
|
for (const std::string& tempId : _hyperion->getTemperatureIds())
|
||||||
|
{
|
||||||
|
const ColorCorrection * colorTemp = _hyperion->getTemperature(tempId);
|
||||||
|
if (colorTemp == nullptr)
|
||||||
|
{
|
||||||
|
std::cerr << "Incorrect color temperature correction id: " << tempId << std::endl;
|
||||||
|
continue;
|
||||||
|
}
|
||||||
|
|
||||||
|
Json::Value & temperature = temperatureArray.append(Json::Value());
|
||||||
|
temperature["id"] = tempId;
|
||||||
|
|
||||||
|
Json::Value & tempValues = temperature["correctionValues"];
|
||||||
|
tempValues.append(colorTemp->_rgbCorrection.getcorrectionR());
|
||||||
|
tempValues.append(colorTemp->_rgbCorrection.getcorrectionG());
|
||||||
|
tempValues.append(colorTemp->_rgbCorrection.getcorrectionB());
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
// collect transform information
|
// collect transform information
|
||||||
Json::Value & transformArray = info["transform"];
|
Json::Value & transformArray = info["transform"];
|
||||||
|
Loading…
Reference in New Issue
Block a user