From 16b9bd7baa485dbc563e8c483e4a1e6a4945324c Mon Sep 17 00:00:00 2001 From: Paulchen-Panther Date: Tue, 2 Jul 2019 20:53:14 +0200 Subject: [PATCH] Fix Uni-/Multicolor assignment Signed-off-by: Paulchen-Panther --- include/hyperion/Hyperion.h | 6 ------ libsrc/hyperion/Hyperion.cpp | 41 ++++++++++-------------------------- 2 files changed, 11 insertions(+), 36 deletions(-) diff --git a/include/hyperion/Hyperion.h b/include/hyperion/Hyperion.h index c0edc66e..1c80fc06 100644 --- a/include/hyperion/Hyperion.h +++ b/include/hyperion/Hyperion.h @@ -477,12 +477,6 @@ private slots: /// void handleSettingsUpdate(const settings::type& type, const QJsonDocument& config); - /// - /// @brief Handle priority updates from Priority Muxer - /// @param priority The new visible priority - /// - void handlePriorityChanges(const quint8 &priority); - private: /// diff --git a/libsrc/hyperion/Hyperion.cpp b/libsrc/hyperion/Hyperion.cpp index 2f21c326..a2536000 100644 --- a/libsrc/hyperion/Hyperion.cpp +++ b/libsrc/hyperion/Hyperion.cpp @@ -106,9 +106,6 @@ Hyperion::Hyperion(HyperionDaemon* daemon, const quint8& instance, const QString _ledStringColorOrder.insert(_ledStringColorOrder.begin() + led.index, led.colorOrder); } - // connect Hyperion::handlePriorityChanges with Muxer visible priority changes as muxer updates independent - connect(&_muxer, &PriorityMuxer::visiblePriorityChanged, this, &Hyperion::handlePriorityChanges); - // listens for ComponentRegister changes of COMP_ALL to perform core enable/disable actions connect(&_componentRegister, &ComponentRegister::updatedComponentState, this, &Hyperion::updatedComponentState); @@ -565,18 +562,19 @@ const QString & Hyperion::getActiveDevice() void Hyperion::updatedComponentState(const hyperion::Components comp, const bool state) { - if(comp == hyperion::COMP_ALL) + QMutexLocker lock(&_changes); + + // evaluate comp change + if (comp != _prevCompId) { - if(state) - { - // first muxer to update all inputs - _muxer.setEnable(state); - } - else - { - _muxer.setEnable(state); - } + _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)); } + + if(comp == hyperion::COMP_ALL) + _muxer.setEnable(state); // first muxer to update all inputs } void Hyperion::update() @@ -658,20 +656,3 @@ void Hyperion::update() emit ledDeviceData(_ledBuffer); } } - -void Hyperion::handlePriorityChanges(const quint8 &priority) -{ - QMutexLocker lock(&_changes); - - // Obtain the current priority channel - const PriorityMuxer::InputInfo priorityInfo = _muxer.getInputInfo(priority); - - // evaluate comp change - if (priorityInfo.componentId != _prevCompId) - { - _imageProcessor->setBlackbarDetectDisable((_prevCompId == hyperion::COMP_EFFECT)); - _imageProcessor->setHardLedMappingType((_prevCompId == hyperion::COMP_EFFECT) ? 0 : -1); - _prevCompId = priorityInfo.componentId; - _raw2ledAdjustment->setBacklightEnabled((_prevCompId != hyperion::COMP_COLOR && _prevCompId != hyperion::COMP_EFFECT)); - } -}