mirror of
https://github.com/hyperion-project/hyperion.ng.git
synced 2025-03-01 10:33:28 +00: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);
|
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;
|
std::cout << "Set color corrections" << std::endl;
|
||||||
|
|
||||||
// create command
|
// create command
|
||||||
Json::Value command;
|
Json::Value command;
|
||||||
command["command"] = "correction";
|
command["command"] = "correction";
|
||||||
Json::Value & correction = command["correction"];
|
Json::Value & correct = command["correction"];
|
||||||
|
|
||||||
if (correctionId != nullptr)
|
if (correctionId != nullptr)
|
||||||
{
|
{
|
||||||
correction["id"] = *correctionId;
|
correct["id"] = *correctionId;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (red != nullptr)
|
if (correction != nullptr)
|
||||||
{
|
{
|
||||||
correction["red"] = *red;
|
Json::Value & v = correction["correctionValues"];
|
||||||
}
|
v.append(correction->valueRed);
|
||||||
|
v.append(correction->valueGreen);
|
||||||
if (green != nullptr)
|
v.append(correction->valueBlue);
|
||||||
{
|
|
||||||
correction["green"] = *green;
|
|
||||||
}
|
|
||||||
|
|
||||||
if (blue != nullptr)
|
|
||||||
{
|
|
||||||
correction["blue"] = *blue;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
// send command message
|
// send command message
|
||||||
@ -300,33 +293,26 @@ void JsonConnection::setCorrection(std::string * correctionId, int * red, int *
|
|||||||
parseReply(reply);
|
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;
|
std::cout << "Set color temperature corrections" << std::endl;
|
||||||
|
|
||||||
// create command
|
// create command
|
||||||
Json::Value command;
|
Json::Value command;
|
||||||
command["command"] = "temperature";
|
command["command"] = "temperature";
|
||||||
Json::Value & temperature = command["temperature"];
|
Json::Value & temp = command["temperature"];
|
||||||
|
|
||||||
if (temperatureId != nullptr)
|
if (temperatureId != nullptr)
|
||||||
{
|
{
|
||||||
temperature["id"] = *temperatureId;
|
temp["id"] = *temperatureId;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (red != nullptr)
|
if (temperature != nullptr)
|
||||||
{
|
{
|
||||||
temperature["red"] = *red;
|
Json::Value & v = temp["correctionValues"];
|
||||||
}
|
v.append(temperature->valueRed);
|
||||||
|
v.append(temperature->valueGreen);
|
||||||
if (green != nullptr)
|
v.append(temperature->valueBlue);
|
||||||
{
|
|
||||||
temperature["green"] = *green;
|
|
||||||
}
|
|
||||||
|
|
||||||
if (blue != nullptr)
|
|
||||||
{
|
|
||||||
temperature["blue"] = *blue;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
// send command message
|
// send command message
|
||||||
|
Loading…
x
Reference in New Issue
Block a user