Improve Led Device on/off and background effect (#1502)

* Queue On-Off calls

* Do not switch-off LED-device when Background effect is enabled

* Fix LGTM Warnings

* Address LGTM findings
This commit is contained in:
LordGrey
2022-08-14 23:02:30 +02:00
committed by GitHub
parent e17ce6cd4e
commit a2266b177f
8 changed files with 54 additions and 36 deletions

View File

@@ -617,13 +617,18 @@ void Hyperion::handleVisibleComponentChanged(hyperion::Components comp)
}
void Hyperion::handleSourceAvailability(int priority)
{ int previousPriority = _muxer->getPreviousPriority();
{
int previousPriority = _muxer->getPreviousPriority();
if ( priority == PriorityMuxer::LOWEST_PRIORITY)
{
Debug(_log,"No source left -> Pause output processing and switch LED-Device off");
emit _ledDeviceWrapper->switchOff();
emit _deviceSmooth->setPause(true);
// Keep LED-device on, as background effect will kick-in shortly
if (!_BGEffectHandler->_isEnabled())
{
Debug(_log,"No source left -> Pause output processing and switch LED-Device off");
emit _ledDeviceWrapper->switchOff();
emit _deviceSmooth->setPause(true);
}
}
else
{