Fix Uni-/Multicolor assignment

Signed-off-by: Paulchen-Panther <Paulchen-Panter@protonmail.com>
This commit is contained in:
Paulchen-Panther 2019-07-02 20:53:14 +02:00
parent fb850bb40b
commit 16b9bd7baa
No known key found for this signature in database
GPG Key ID: 84E3B692456B6840
2 changed files with 11 additions and 36 deletions

View File

@ -477,12 +477,6 @@ private slots:
/// ///
void handleSettingsUpdate(const settings::type& type, const QJsonDocument& config); 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: private:
/// ///

View File

@ -106,9 +106,6 @@ Hyperion::Hyperion(HyperionDaemon* daemon, const quint8& instance, const QString
_ledStringColorOrder.insert(_ledStringColorOrder.begin() + led.index, led.colorOrder); _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 // 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);
@ -565,18 +562,19 @@ const QString & Hyperion::getActiveDevice()
void Hyperion::updatedComponentState(const hyperion::Components comp, const bool state) void Hyperion::updatedComponentState(const hyperion::Components comp, const bool state)
{ {
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));
}
if(comp == hyperion::COMP_ALL) if(comp == hyperion::COMP_ALL)
{ _muxer.setEnable(state); // first muxer to update all inputs
if(state)
{
// first muxer to update all inputs
_muxer.setEnable(state);
}
else
{
_muxer.setEnable(state);
}
}
} }
void Hyperion::update() void Hyperion::update()
@ -658,20 +656,3 @@ void Hyperion::update()
emit ledDeviceData(_ledBuffer); 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));
}
}