mirror of
https://github.com/hyperion-project/hyperion.ng.git
synced 2025-03-01 10:33:28 +00:00
Implemented the multi-color transform including in hyperion-remote
Former-commit-id: ebdb0688b47d51bd6dccf6dafd580d3ce9ed80a7
This commit is contained in:
@@ -160,7 +160,7 @@ void JsonConnection::clearAll()
|
||||
parseReply(reply);
|
||||
}
|
||||
|
||||
void JsonConnection::setTransform(double * saturation, double * value, ColorTransformValues *threshold, ColorTransformValues *gamma, ColorTransformValues *blacklevel, ColorTransformValues *whitelevel)
|
||||
void JsonConnection::setTransform(std::string * transformId, double * saturation, double * value, ColorTransformValues *threshold, ColorTransformValues *gamma, ColorTransformValues *blacklevel, ColorTransformValues *whitelevel)
|
||||
{
|
||||
std::cout << "Set color transforms" << std::endl;
|
||||
|
||||
@@ -169,6 +169,11 @@ void JsonConnection::setTransform(double * saturation, double * value, ColorTran
|
||||
command["command"] = "transform";
|
||||
Json::Value & transform = command["transform"];
|
||||
|
||||
if (transformId != nullptr)
|
||||
{
|
||||
transform["id"] = *transformId;
|
||||
}
|
||||
|
||||
if (saturation != nullptr)
|
||||
{
|
||||
transform["saturationGain"] = *saturation;
|
||||
|
@@ -76,6 +76,7 @@ public:
|
||||
///
|
||||
/// @note Note that providing a NULL will leave the settings on the server unchanged
|
||||
///
|
||||
/// @param transformId The identifier of the transform to set
|
||||
/// @param saturation The HSV saturation gain
|
||||
/// @param value The HSV value gain
|
||||
/// @param threshold The threshold
|
||||
@@ -84,6 +85,7 @@ public:
|
||||
/// @param whitelevel The whitelevel
|
||||
///
|
||||
void setTransform(
|
||||
std::string * transformId,
|
||||
double * saturation,
|
||||
double * value,
|
||||
ColorTransformValues * threshold,
|
||||
|
@@ -45,6 +45,7 @@ int main(int argc, char * argv[])
|
||||
SwitchParameter<> & argServerInfo = parameters.add<SwitchParameter<> >('l', "list" , "List server info");
|
||||
SwitchParameter<> & argClear = parameters.add<SwitchParameter<> >('x', "clear" , "Clear data for the priority channel provided by the -p option");
|
||||
SwitchParameter<> & argClearAll = parameters.add<SwitchParameter<> >(0x0, "clearall" , "Clear data for all active priority channels");
|
||||
StringParameter & argId = parameters.add<StringParameter> ('q', "qualifier" , "Identifier(qualifier) of the transform to set");
|
||||
DoubleParameter & argSaturation = parameters.add<DoubleParameter> ('s', "saturation", "Set the HSV saturation gain of the leds");
|
||||
DoubleParameter & argValue = parameters.add<DoubleParameter> ('v', "value" , "Set the HSV value gain of the leds");
|
||||
TransformParameter & argGamma = parameters.add<TransformParameter>('g', "gamma" , "Set the gamma of the leds (requires 3 space seperated values)");
|
||||
@@ -83,6 +84,7 @@ int main(int argc, char * argv[])
|
||||
std::cerr << " " << argClear.usageLine() << std::endl;
|
||||
std::cerr << " " << argClearAll.usageLine() << std::endl;
|
||||
std::cerr << "or one or more of the available color transformations:" << std::endl;
|
||||
std::cerr << " " << argId.usageLine() << std::endl;
|
||||
std::cerr << " " << argSaturation.usageLine() << std::endl;
|
||||
std::cerr << " " << argValue.usageLine() << std::endl;
|
||||
std::cerr << " " << argThreshold.usageLine() << std::endl;
|
||||
@@ -119,9 +121,11 @@ int main(int argc, char * argv[])
|
||||
}
|
||||
else if (colorTransform)
|
||||
{
|
||||
std::string transId;
|
||||
double saturation, value;
|
||||
ColorTransformValues threshold, gamma, blacklevel, whitelevel;
|
||||
|
||||
if (argId.isSet()) transId = argId.getValue();
|
||||
if (argSaturation.isSet()) saturation = argSaturation.getValue();
|
||||
if (argValue.isSet()) value = argValue.getValue();
|
||||
if (argThreshold.isSet()) threshold = argThreshold.getValue();
|
||||
@@ -130,6 +134,7 @@ int main(int argc, char * argv[])
|
||||
if (argWhitelevel.isSet()) whitelevel = argWhitelevel.getValue();
|
||||
|
||||
connection.setTransform(
|
||||
argId.isSet() ? &transId : nullptr,
|
||||
argSaturation.isSet() ? &saturation : nullptr,
|
||||
argValue.isSet() ? &value : nullptr,
|
||||
argThreshold.isSet() ? &threshold : nullptr,
|
||||
|
Reference in New Issue
Block a user