mirror of
https://github.com/hyperion-project/hyperion.ng.git
synced 2025-03-01 10:33:28 +00:00
common ledbuffer for color transform (#77)
* common ledbuffer for color transform hyperion class uses a common buffer for all operations on ledColors got from muxer all color transforms uses new ledBuffer instead of making copies of ledbuffer other fixes: fix compile bug in profiler update doxygen config * migrate logging for color transform classes * prepare new logger in hyperion class * implement hwledcount * Update Hyperion.cpp Fix off color * remove ledscount equivalent from apa102 migrate logging in hyperion.cpp remove unused and duuplicate colorcorrection - but same is available through tempertature * remove colorcorrection completly fix compile * set colororder back to static * in remote: using correction is the same as using temperature - correction is obsolete, command not delete atm for compat reasons
This commit is contained in:
@@ -251,8 +251,6 @@ void JsonClientConnection::handleMessage(const std::string &messageString)
|
||||
handleClearallCommand(message);
|
||||
else if (command == "transform")
|
||||
handleTransformCommand(message);
|
||||
else if (command == "correction")
|
||||
handleCorrectionCommand(message);
|
||||
else if (command == "temperature")
|
||||
handleTemperatureCommand(message);
|
||||
else if (command == "adjustment")
|
||||
@@ -398,26 +396,6 @@ 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 << "JSONCLIENT ERROR: 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())
|
||||
@@ -706,32 +684,7 @@ void JsonClientConnection::handleTransformCommand(const Json::Value &message)
|
||||
sendSuccessReply();
|
||||
}
|
||||
|
||||
void JsonClientConnection::handleCorrectionCommand(const Json::Value &message)
|
||||
{
|
||||
const Json::Value & correction = message["correction"];
|
||||
|
||||
const std::string correctionId = correction.get("id", _hyperion->getCorrectionIds().front()).asString();
|
||||
ColorCorrection * colorCorrection = _hyperion->getCorrection(correctionId);
|
||||
if (colorCorrection == nullptr)
|
||||
{
|
||||
//sendErrorReply(std::string("Incorrect correction identifier: ") + correctionId);
|
||||
return;
|
||||
}
|
||||
|
||||
if (correction.isMember("correctionValues"))
|
||||
{
|
||||
const Json::Value & values = correction["correctionValues"];
|
||||
colorCorrection->_rgbCorrection.setcorrectionR(values[0u].asInt());
|
||||
colorCorrection->_rgbCorrection.setcorrectionG(values[1u].asInt());
|
||||
colorCorrection->_rgbCorrection.setcorrectionB(values[2u].asInt());
|
||||
}
|
||||
|
||||
// commit the changes
|
||||
_hyperion->correctionsUpdated();
|
||||
|
||||
sendSuccessReply();
|
||||
}
|
||||
|
||||
void JsonClientConnection::handleTemperatureCommand(const Json::Value &message)
|
||||
{
|
||||
const Json::Value & temperature = message["temperature"];
|
||||
|
Reference in New Issue
Block a user