mirror of
https://github.com/hyperion-project/hyperion.ng.git
synced 2023-10-10 13:36:59 +02:00
Update JsonConnection.cpp
Former-commit-id: 712db0e3d8e525353d62bd7dfc6e2dd708b09b85
This commit is contained in:
parent
4836bfc863
commit
909112fbfb
@ -264,33 +264,26 @@ void JsonConnection::setTransform(std::string * transformId, double * saturation
|
||||
parseReply(reply);
|
||||
}
|
||||
|
||||
void JsonConnection::setCorrection(std::string * correctionId, int * red, int * green, int * blue)
|
||||
void JsonConnection::setCorrection(std::string * correctionId, ColorCorrectionValues *correction)
|
||||
{
|
||||
std::cout << "Set color corrections" << std::endl;
|
||||
|
||||
// create command
|
||||
Json::Value command;
|
||||
command["command"] = "correction";
|
||||
Json::Value & correction = command["correction"];
|
||||
|
||||
Json::Value & correct = command["correction"];
|
||||
|
||||
if (correctionId != nullptr)
|
||||
{
|
||||
correction["id"] = *correctionId;
|
||||
correct["id"] = *correctionId;
|
||||
}
|
||||
|
||||
if (red != nullptr)
|
||||
if (correction != nullptr)
|
||||
{
|
||||
correction["red"] = *red;
|
||||
}
|
||||
|
||||
if (green != nullptr)
|
||||
{
|
||||
correction["green"] = *green;
|
||||
}
|
||||
|
||||
if (blue != nullptr)
|
||||
{
|
||||
correction["blue"] = *blue;
|
||||
Json::Value & v = correction["correctionValues"];
|
||||
v.append(correction->valueRed);
|
||||
v.append(correction->valueGreen);
|
||||
v.append(correction->valueBlue);
|
||||
}
|
||||
|
||||
// send command message
|
||||
@ -300,33 +293,26 @@ void JsonConnection::setCorrection(std::string * correctionId, int * red, int *
|
||||
parseReply(reply);
|
||||
}
|
||||
|
||||
void JsonConnection::setTemperature(std::string * temperatureId, int * red, int * green, int * blue)
|
||||
void JsonConnection::setTemperature(std::string * temperatureId, ColorCorrectionValues *temperature)
|
||||
{
|
||||
std::cout << "Set color temperature corrections" << std::endl;
|
||||
|
||||
// create command
|
||||
Json::Value command;
|
||||
command["command"] = "temperature";
|
||||
Json::Value & temperature = command["temperature"];
|
||||
Json::Value & temp = command["temperature"];
|
||||
|
||||
if (temperatureId != nullptr)
|
||||
{
|
||||
temperature["id"] = *temperatureId;
|
||||
temp["id"] = *temperatureId;
|
||||
}
|
||||
|
||||
if (red != nullptr)
|
||||
if (temperature != nullptr)
|
||||
{
|
||||
temperature["red"] = *red;
|
||||
}
|
||||
|
||||
if (green != nullptr)
|
||||
{
|
||||
temperature["green"] = *green;
|
||||
}
|
||||
|
||||
if (blue != nullptr)
|
||||
{
|
||||
temperature["blue"] = *blue;
|
||||
Json::Value & v = temp["correctionValues"];
|
||||
v.append(temperature->valueRed);
|
||||
v.append(temperature->valueGreen);
|
||||
v.append(temperature->valueBlue);
|
||||
}
|
||||
|
||||
// send command message
|
||||
|
Loading…
Reference in New Issue
Block a user