mirror of
https://github.com/hyperion-project/hyperion.ng.git
synced 2023-10-10 13:36:59 +02:00
Merge pull request #564 from AEtHeLsYn/master
Allow hyperion-remote to send correction and transform at the same time Former-commit-id: bb69c6c9eb43ca0d1185fef80418ba3dcade3877
This commit is contained in:
commit
c427081ac5
@ -1,3 +1,4 @@
|
||||
IMPORTANT: Please don´t commit to master, we will test your changes first at the beta branch!
|
||||
**1.** Tell us something about your changes.
|
||||
**2.** If this changes affect the .conf file. Please provide the changed section
|
||||
**3.** Reference a issue (optional)
|
||||
|
2
bin/openelec/hyperion-v4l2.sh
Normal file
2
bin/openelec/hyperion-v4l2.sh
Normal file
@ -0,0 +1,2 @@
|
||||
#!/bin/sh
|
||||
LD_LIBRARY_PATH=$LD_LIBRARY_PATH:/storage/hyperion/bin /storage/hyperion/bin/hyperion-v4l2 "$@"
|
@ -79,7 +79,7 @@ int main(int argc, char * argv[])
|
||||
SwitchParameter<> & argHelp = parameters.add<SwitchParameter<> >('h', "help" , "Show this help message and exit");
|
||||
StringParameter & argIdC = parameters.add<StringParameter> ('y', "qualifier" , "Identifier(qualifier) of the correction to set");
|
||||
CorrectionParameter & argCorrection = parameters.add<CorrectionParameter>('Y', "correction" , "Set the correction of the leds (requires 3 space seperated values between 0 and 255)");
|
||||
StringParameter & argIdT = parameters.add<StringParameter> ('z', "qualifier" , "Identifier(qualifier) of the temperature to set");
|
||||
StringParameter & argIdT = parameters.add<StringParameter> ('z', "qualifier" , "Identifier(qualifier) of the temperature correction to set");
|
||||
CorrectionParameter & argTemperature = parameters.add<CorrectionParameter>('Z', "temperature" , "Set the temperature correction of the leds (requires 3 space seperated values between 0 and 255)");
|
||||
|
||||
// set the default values
|
||||
@ -100,9 +100,10 @@ int main(int argc, char * argv[])
|
||||
|
||||
// check if at least one of the available color transforms is set
|
||||
bool colorTransform = argSaturation.isSet() || argValue.isSet() || argSaturationL.isSet() || argLuminance.isSet() || argThreshold.isSet() || argGamma.isSet() || argBlacklevel.isSet() || argWhitelevel.isSet();
|
||||
|
||||
bool colorModding = colorTransform || argCorrection.isSet() || argTemperature.isSet();
|
||||
|
||||
// check that exactly one command was given
|
||||
int commandCount = count({argColor.isSet(), argImage.isSet(), argEffect.isSet(), argServerInfo.isSet(), argClear.isSet(), argClearAll.isSet(), colorTransform, argCorrection.isSet(), argTemperature.isSet()});
|
||||
int commandCount = count({argColor.isSet(), argImage.isSet(), argEffect.isSet(), argServerInfo.isSet(), argClear.isSet(), argClearAll.isSet(), colorModding});
|
||||
if (commandCount != 1)
|
||||
{
|
||||
std::cerr << (commandCount == 0 ? "No command found." : "Multiple commands found.") << " Provide exactly one of the following options:" << std::endl;
|
||||
@ -112,7 +113,7 @@ int main(int argc, char * argv[])
|
||||
std::cerr << " " << argServerInfo.usageLine() << std::endl;
|
||||
std::cerr << " " << argClear.usageLine() << std::endl;
|
||||
std::cerr << " " << argClearAll.usageLine() << std::endl;
|
||||
std::cerr << "one or more of the available color transformations:" << std::endl;
|
||||
std::cerr << "or one or more of the available color modding operations:" << std::endl;
|
||||
std::cerr << " " << argId.usageLine() << std::endl;
|
||||
std::cerr << " " << argSaturation.usageLine() << std::endl;
|
||||
std::cerr << " " << argValue.usageLine() << std::endl;
|
||||
@ -122,10 +123,8 @@ int main(int argc, char * argv[])
|
||||
std::cerr << " " << argGamma.usageLine() << std::endl;
|
||||
std::cerr << " " << argBlacklevel.usageLine() << std::endl;
|
||||
std::cerr << " " << argWhitelevel.usageLine() << std::endl;
|
||||
std::cerr << "one or more of the available color corrections:" << std::endl;
|
||||
std::cerr << " " << argIdC.usageLine() << std::endl;
|
||||
std::cerr << " " << argCorrection.usageLine() << std::endl;
|
||||
std::cerr << "or one or more of the available color temperature adjustment:" << std::endl;
|
||||
std::cerr << " " << argIdT.usageLine() << std::endl;
|
||||
std::cerr << " " << argTemperature.usageLine() << std::endl;
|
||||
return 1;
|
||||
@ -160,23 +159,50 @@ int main(int argc, char * argv[])
|
||||
{
|
||||
connection.clearAll();
|
||||
}
|
||||
else if (colorTransform)
|
||||
{
|
||||
std::string transId;
|
||||
double saturation, value, saturationL, luminance;
|
||||
ColorTransformValues threshold, gamma, blacklevel, whitelevel;
|
||||
else if (colorModding)
|
||||
{
|
||||
if (argCorrection.isSet())
|
||||
{
|
||||
std::string corrId;
|
||||
ColorCorrectionValues correction;
|
||||
|
||||
if (argId.isSet()) transId = argId.getValue();
|
||||
if (argSaturation.isSet()) saturation = argSaturation.getValue();
|
||||
if (argValue.isSet()) value = argValue.getValue();
|
||||
if (argSaturationL.isSet()) saturationL = argSaturationL.getValue();
|
||||
if (argLuminance.isSet()) luminance = argLuminance.getValue();
|
||||
if (argThreshold.isSet()) threshold = argThreshold.getValue();
|
||||
if (argGamma.isSet()) gamma = argGamma.getValue();
|
||||
if (argBlacklevel.isSet()) blacklevel = argBlacklevel.getValue();
|
||||
if (argWhitelevel.isSet()) whitelevel = argWhitelevel.getValue();
|
||||
if (argIdC.isSet()) corrId = argIdC.getValue();
|
||||
if (argCorrection.isSet()) correction = argCorrection.getValue();
|
||||
|
||||
connection.setCorrection(
|
||||
argIdC.isSet() ? &corrId : nullptr,
|
||||
argCorrection.isSet() ? &correction : nullptr);
|
||||
}
|
||||
|
||||
if (argTemperature.isSet())
|
||||
{
|
||||
std::string tempId;
|
||||
ColorCorrectionValues temperature;
|
||||
|
||||
if (argIdT.isSet()) tempId = argIdT.getValue();
|
||||
if (argTemperature.isSet()) temperature = argTemperature.getValue();
|
||||
|
||||
connection.setTransform(
|
||||
connection.setTemperature(
|
||||
argIdT.isSet() ? &tempId : nullptr,
|
||||
argTemperature.isSet() ? &temperature : nullptr);
|
||||
}
|
||||
if (colorTransform)
|
||||
{
|
||||
std::string transId;
|
||||
double saturation, value, saturationL, luminance;
|
||||
ColorTransformValues threshold, gamma, blacklevel, whitelevel;
|
||||
|
||||
if (argId.isSet()) transId = argId.getValue();
|
||||
if (argSaturation.isSet()) saturation = argSaturation.getValue();
|
||||
if (argValue.isSet()) value = argValue.getValue();
|
||||
if (argSaturationL.isSet()) saturationL = argSaturationL.getValue();
|
||||
if (argLuminance.isSet()) luminance = argLuminance.getValue();
|
||||
if (argThreshold.isSet()) threshold = argThreshold.getValue();
|
||||
if (argGamma.isSet()) gamma = argGamma.getValue();
|
||||
if (argBlacklevel.isSet()) blacklevel = argBlacklevel.getValue();
|
||||
if (argWhitelevel.isSet()) whitelevel = argWhitelevel.getValue();
|
||||
|
||||
connection.setTransform(
|
||||
argId.isSet() ? &transId : nullptr,
|
||||
argSaturation.isSet() ? &saturation : nullptr,
|
||||
argValue.isSet() ? &value : nullptr,
|
||||
@ -186,30 +212,7 @@ int main(int argc, char * argv[])
|
||||
argGamma.isSet() ? &gamma : nullptr,
|
||||
argBlacklevel.isSet() ? &blacklevel : nullptr,
|
||||
argWhitelevel.isSet() ? &whitelevel : nullptr);
|
||||
}
|
||||
else if (argCorrection.isSet())
|
||||
{
|
||||
std::string corrId;
|
||||
ColorCorrectionValues correction;
|
||||
|
||||
if (argIdC.isSet()) corrId = argIdC.getValue();
|
||||
if (argCorrection.isSet()) correction = argCorrection.getValue();
|
||||
|
||||
connection.setCorrection(
|
||||
argIdC.isSet() ? &corrId : nullptr,
|
||||
argCorrection.isSet() ? &correction : nullptr);
|
||||
}
|
||||
else if (argTemperature.isSet())
|
||||
{
|
||||
std::string tempId;
|
||||
ColorCorrectionValues temperature;
|
||||
|
||||
if (argIdT.isSet()) tempId = argIdT.getValue();
|
||||
if (argTemperature.isSet()) temperature = argTemperature.getValue();
|
||||
|
||||
connection.setTemperature(
|
||||
argIdT.isSet() ? &tempId : nullptr,
|
||||
argTemperature.isSet() ? &temperature : nullptr);
|
||||
}
|
||||
}
|
||||
}
|
||||
catch (const std::runtime_error & e)
|
||||
|
Loading…
Reference in New Issue
Block a user