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
@ -393,6 +393,47 @@ void JsonClientConnection::handleServerInfoCommand(const Json::Value &)
|
||||
}
|
||||
}
|
||||
|
||||
// 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
|
||||
Json::Value & transformArray = info["transform"];
|
||||
for (const std::string& transformId : _hyperion->getTransformIds())
|
||||
|
Loading…
Reference in New Issue
Block a user