Skip to content

Commit 4c9bb18

Browse files
committed
Update HyperHdrInstance.cpp
1 parent 21452d8 commit 4c9bb18

File tree

1 file changed

+14
-12
lines changed

1 file changed

+14
-12
lines changed

Diff for: sources/base/HyperHdrInstance.cpp

+14-12
Original file line numberDiff line numberDiff line change
@@ -237,7 +237,7 @@ void HyperHdrInstance::handleSettingsUpdate(settings::type type, const QJsonDocu
237237

238238
if (!_raw2ledAdjustment->verifyAdjustments())
239239
{
240-
Warning(_log, "At least one led has no color calibration, please add all leds from your led layout to an 'LED index' field!");
240+
Warning(_log, "At least one led has no color calibration, please add all leds from your led layout to an 'LED index' field (if you disabled these LEDs you can ignore this message)");
241241
}
242242

243243
emit imageToLedsMappingChanged(_imageProcessor->getLedMappingType());
@@ -444,27 +444,29 @@ bool HyperHdrInstance::setInputInactive(quint8 priority)
444444

445445
void HyperHdrInstance::setColor(int priority, const std::vector<ColorRgb>& ledColors, int timeout_ms, const QString& origin, bool clearEffects)
446446
{
447+
if (ledColors.size() == 0)
448+
return;
449+
447450
// clear effect if this call does not come from an effect
448451
if (clearEffects)
449452
{
450453
_effectEngine->channelCleared(priority);
451454
}
452455

453456
// create full led vector from single/multiple colors
454-
size_t size = _ledString.leds().size();
455457
std::vector<ColorRgb> newLedColors;
456-
while (true)
458+
auto currentCol = ledColors.begin();
459+
460+
for (const Led& led: _ledString.leds())
457461
{
458-
for (const auto& entry : ledColors)
459-
{
460-
newLedColors.emplace_back(entry);
461-
if (newLedColors.size() == size)
462-
{
463-
goto end;
464-
}
465-
}
462+
if (led.disabled)
463+
newLedColors.emplace_back(ColorRgb::BLACK);
464+
else
465+
newLedColors.emplace_back(*currentCol);
466+
467+
if (++currentCol == ledColors.end())
468+
currentCol = ledColors.begin();
466469
}
467-
end:
468470

469471
if (getPriorityInfo(priority).componentId != hyperhdr::COMP_COLOR)
470472
{

0 commit comments

Comments
 (0)