mirror of
https://github.com/hyperion-project/hyperion.ng.git
synced 2025-03-01 10:33:28 +00:00
fix/refactor backlight stuff (#394)
* fix/refactor backlight stuff: - fix colors dont turn of when backlight 0 and black is set - add option to use not colored backlight - fix colored backlight not colored on very low color values - various code style tunings * apply needed change to wizard * backlight disabled on static color and efects * fix warnings * try fix udp compiler warnings
This commit is contained in:
@@ -51,11 +51,11 @@ bool MultiColorAdjustment::verifyAdjustments() const
|
||||
Error(_log, "No adjustment set for %d", iLed);
|
||||
return false;
|
||||
}
|
||||
if (adjustment->_rgbTransform.getBrightness() <= adjustment->_rgbTransform.getBrightnessMin() )
|
||||
if (adjustment->_rgbTransform.getBrightness() <= adjustment->_rgbTransform.getBacklightThreshold() )
|
||||
{
|
||||
adjustment->_rgbTransform.setBrightnessMin(0);
|
||||
adjustment->_rgbTransform.setBacklightThreshold(0.0);
|
||||
adjustment->_rgbTransform.setBrightness(0.5);
|
||||
Warning(_log, "Adjustment for %d has invalid Brightness values, values set to default. (brightnessMin is bigger then brightness)", iLed);
|
||||
Warning(_log, "Adjustment for %d has invalid Brightness values, values set to default. (setBacklightThreshold is bigger then brightness)", iLed);
|
||||
}
|
||||
}
|
||||
return true;
|
||||
@@ -81,6 +81,15 @@ ColorAdjustment* MultiColorAdjustment::getAdjustment(const std::string& id)
|
||||
return nullptr;
|
||||
}
|
||||
|
||||
void MultiColorAdjustment::setBacklightEnabled(bool enable)
|
||||
{
|
||||
for (ColorAdjustment* adjustment : _adjustment)
|
||||
{
|
||||
adjustment->_rgbTransform.setBackLightEnabled(enable);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
void MultiColorAdjustment::applyAdjustment(std::vector<ColorRgb>& ledColors)
|
||||
{
|
||||
const size_t itCnt = std::min(_ledAdjustments.size(), ledColors.size());
|
||||
|
Reference in New Issue
Block a user