mirror of
https://github.com/hyperion-project/hyperion.ng.git
synced 2025-03-01 10:33:28 +00:00
fix: Backlight/BBDetector during effects (#682)
This commit is contained in:
@@ -54,7 +54,6 @@ Hyperion::Hyperion(const quint8& instance)
|
||||
, _log(Logger::getInstance("HYPERION"))
|
||||
, _hwLedCount()
|
||||
, _ledGridSize(hyperion::getLedLayoutGridSize(getSetting(settings::LEDS).array()))
|
||||
, _prevCompId(hyperion::COMP_INVALID)
|
||||
, _ledBuffer(_ledString.leds().size(), ColorRgb::BLACK)
|
||||
{
|
||||
|
||||
@@ -89,9 +88,10 @@ void Hyperion::start()
|
||||
|
||||
// connect Hyperion::update with Muxer visible priority changes as muxer updates independent
|
||||
connect(&_muxer, &PriorityMuxer::visiblePriorityChanged, this, &Hyperion::update);
|
||||
connect(&_muxer, &PriorityMuxer::visibleComponentChanged, this, &Hyperion::handleVisibleComponentChanged);
|
||||
|
||||
// listens for ComponentRegister changes of COMP_ALL to perform core enable/disable actions
|
||||
connect(&_componentRegister, &ComponentRegister::updatedComponentState, this, &Hyperion::updatedComponentState);
|
||||
// connect(&_componentRegister, &ComponentRegister::updatedComponentState, this, &Hyperion::updatedComponentState);
|
||||
|
||||
// listen for settings updates of this instance (LEDS & COLOR)
|
||||
connect(_settingsManager, &SettingsManager::settingsChanged, this, &Hyperion::handleSettingsUpdate);
|
||||
@@ -518,18 +518,11 @@ const QString & Hyperion::getActiveDeviceType()
|
||||
return _ledDeviceWrapper->getActiveDeviceType();
|
||||
}
|
||||
|
||||
void Hyperion::updatedComponentState(const hyperion::Components comp, const bool state)
|
||||
void Hyperion::handleVisibleComponentChanged(const hyperion::Components &comp)
|
||||
{
|
||||
QMutexLocker lock(&_changes);
|
||||
|
||||
// evaluate comp change
|
||||
if (comp != _prevCompId)
|
||||
{
|
||||
_imageProcessor->setBlackbarDetectDisable((_prevCompId == hyperion::COMP_EFFECT));
|
||||
_imageProcessor->setHardLedMappingType((_prevCompId == hyperion::COMP_EFFECT) ? 0 : -1);
|
||||
_prevCompId = comp;
|
||||
_raw2ledAdjustment->setBacklightEnabled((_prevCompId != hyperion::COMP_COLOR && _prevCompId != hyperion::COMP_EFFECT));
|
||||
}
|
||||
_imageProcessor->setBlackbarDetectDisable((comp == hyperion::COMP_EFFECT));
|
||||
_imageProcessor->setHardLedMappingType((comp == hyperion::COMP_EFFECT) ? 0 : -1);
|
||||
_raw2ledAdjustment->setBacklightEnabled((comp != hyperion::COMP_COLOR && comp != hyperion::COMP_EFFECT));
|
||||
}
|
||||
|
||||
void Hyperion::update()
|
||||
|
@@ -133,6 +133,11 @@ const PriorityMuxer::InputInfo PriorityMuxer::getInputInfo(const int priority) c
|
||||
return elemIt.value();
|
||||
}
|
||||
|
||||
hyperion::Components PriorityMuxer::getComponentOfPriority(const int &priority)
|
||||
{
|
||||
return _activeInputs[priority].componentId;
|
||||
}
|
||||
|
||||
void PriorityMuxer::registerInput(const int priority, const hyperion::Components& component, const QString& origin, const QString& owner, unsigned smooth_cfg)
|
||||
{
|
||||
// detect new registers
|
||||
@@ -322,16 +327,18 @@ void PriorityMuxer::setCurrentTime(void)
|
||||
}
|
||||
}
|
||||
// apply & emit on change (after apply!)
|
||||
bool changed = false;
|
||||
if(_currentPriority != newPriority)
|
||||
changed = true;
|
||||
|
||||
_currentPriority = newPriority;
|
||||
|
||||
if(changed)
|
||||
if (_currentPriority != newPriority)
|
||||
{
|
||||
_currentPriority = newPriority;
|
||||
Debug(_log, "Set visible priority to %d", newPriority);
|
||||
emit visiblePriorityChanged(newPriority);
|
||||
// check for visible comp change
|
||||
hyperion::Components comp = getComponentOfPriority(newPriority);
|
||||
if (comp != _prevVisComp)
|
||||
{
|
||||
_prevVisComp = comp;
|
||||
emit visibleComponentChanged(comp);
|
||||
}
|
||||
emit prioritiesChanged();
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user