mirror of
https://github.com/hyperion-project/hyperion.ng.git
synced 2025-03-01 10:33:28 +00:00
Merge branch 'master' into add_effect_engine
Conflicts: include/hyperion/Hyperion.h libsrc/hyperion/Hyperion.cpp libsrc/jsonserver/JsonClientConnection.cpp Former-commit-id: 1df163d1880691ded2fc8b5902c6ad3501912c48
This commit is contained in:
@@ -189,7 +189,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;
|
||||
|
||||
@@ -198,6 +198,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;
|
||||
|
@@ -86,6 +86,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
|
||||
@@ -94,6 +95,7 @@ public:
|
||||
/// @param whitelevel The whitelevel
|
||||
///
|
||||
void setTransform(
|
||||
std::string * transformId,
|
||||
double * saturation,
|
||||
double * value,
|
||||
ColorTransformValues * threshold,
|
||||
|
@@ -47,6 +47,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)");
|
||||
@@ -87,6 +88,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;
|
||||
@@ -127,9 +129,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();
|
||||
@@ -138,6 +142,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