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:
@@ -731,11 +731,12 @@ void JsonClientConnection::handleServerInfoCommand(const QJsonObject&, const QSt
|
||||
yellowAdjust.append(colorAdjustment->_rgbYellowAdjustment.getAdjustmentB());
|
||||
adjustment.insert("yellow", yellowAdjust);
|
||||
|
||||
adjustment["brightnessMin"] = colorAdjustment->_rgbTransform.getBrightnessMin();
|
||||
adjustment["backlightThreshold"] = colorAdjustment->_rgbTransform.getBacklightThreshold();
|
||||
adjustment["backlightColored"] = colorAdjustment->_rgbTransform.getBacklightColored();
|
||||
adjustment["brightness"] = colorAdjustment->_rgbTransform.getBrightness();
|
||||
adjustment["gammaRed"] = colorAdjustment->_rgbTransform.getGammaR();
|
||||
adjustment["gammaRed"] = colorAdjustment->_rgbTransform.getGammaR();
|
||||
adjustment["gammaGreen"] = colorAdjustment->_rgbTransform.getGammaG();
|
||||
adjustment["gammaBlue"] = colorAdjustment->_rgbTransform.getGammaB();
|
||||
adjustment["gammaBlue"] = colorAdjustment->_rgbTransform.getGammaB();
|
||||
|
||||
adjustmentArray.append(adjustment);
|
||||
}
|
||||
@@ -913,9 +914,13 @@ void JsonClientConnection::handleAdjustmentCommand(const QJsonObject& message, c
|
||||
colorAdjustment->_rgbTransform.setGamma(colorAdjustment->_rgbTransform.getGammaR(), colorAdjustment->_rgbTransform.getGammaG(), adjustment["gammaBlue"].toDouble());
|
||||
}
|
||||
|
||||
if (adjustment.contains("brightnessMin"))
|
||||
if (adjustment.contains("backlightThreshold"))
|
||||
{
|
||||
colorAdjustment->_rgbTransform.setBrightnessMin(adjustment["brightnessMin"].toDouble());
|
||||
colorAdjustment->_rgbTransform.setBacklightThreshold(adjustment["backlightThreshold"].toDouble());
|
||||
}
|
||||
if (adjustment.contains("backlightColored"))
|
||||
{
|
||||
colorAdjustment->_rgbTransform.setBacklightColored(adjustment["backlightColored"].toBool());
|
||||
}
|
||||
if (adjustment.contains("brightness"))
|
||||
{
|
||||
|
@@ -351,13 +351,13 @@ private:
|
||||
|
||||
// masks for fields in the basic header
|
||||
static uint8_t const BHB0_OPCODE = 0x0F;
|
||||
static uint8_t const BHB0_RSV3 = 0x10;
|
||||
static uint8_t const BHB0_RSV2 = 0x20;
|
||||
static uint8_t const BHB0_RSV1 = 0x40;
|
||||
static uint8_t const BHB0_FIN = 0x80;
|
||||
static uint8_t const BHB0_RSV3 = 0x10;
|
||||
static uint8_t const BHB0_RSV2 = 0x20;
|
||||
static uint8_t const BHB0_RSV1 = 0x40;
|
||||
static uint8_t const BHB0_FIN = 0x80;
|
||||
|
||||
static uint8_t const BHB1_PAYLOAD = 0x7F;
|
||||
static uint8_t const BHB1_MASK = 0x80;
|
||||
static uint8_t const BHB1_MASK = 0x80;
|
||||
|
||||
static uint8_t const payload_size_code_16bit = 0x7E; // 126
|
||||
static uint8_t const payload_size_code_64bit = 0x7F; // 127
|
||||
|
@@ -124,12 +124,16 @@
|
||||
"minimum" : 0.0,
|
||||
"maximum" : 100.0
|
||||
},
|
||||
"brightnessMin" : {
|
||||
"backlightThreshold" : {
|
||||
"type" : "number",
|
||||
"required" : false,
|
||||
"minimum" : 0.0,
|
||||
"maximum" : 1.0
|
||||
},
|
||||
"backlightColored" : {
|
||||
"type" : "boolean",
|
||||
"required" : false
|
||||
},
|
||||
"brightness" : {
|
||||
"type" : "number",
|
||||
"required" : false,
|
||||
|
Reference in New Issue
Block a user