mirror of
https://github.com/hyperion-project/hyperion.ng.git
synced 2025-03-01 10:33:28 +00:00
* Fix #604 and #605 Signed-off-by: Paulchen-Panther <Paulchen-Panter@protonmail.com> * clear current prio on color command Signed-off-by: Paulchen-Panther <Paulchen-Panter@protonmail.com> * Fix QTimer threading issues * Call QTimer start() stop() from QEvent Signed-off-by: Paulchen-Panther <Paulchen-Panter@protonmail.com> * send initial color/image to WebUI hide error message when opening webbrowser Signed-off-by: Paulchen-Panther <Paulchen-Panter@protonmail.com> * added streaming timer to update WebUI Preview Signed-off-by: Paulchen-Panther <Paulchen-Panter@protonmail.com> * remove QMetaObject::invokeMethod() Signed-off-by: Paulchen-Panther <Paulchen-Panter@protonmail.com> * added parent to streaming timers Signed-off-by: Paulchen-Panther <Paulchen-Panter@protonmail.com> * header cleanup
This commit is contained in:
committed by
brindosch
parent
c419f305f3
commit
24495bbc65
@@ -368,6 +368,9 @@ void Hyperion::setColor(const int priority, const ColorRgb &color, const int tim
|
||||
// create led vector from single color
|
||||
std::vector<ColorRgb> ledColors(_ledString.leds().size(), color);
|
||||
|
||||
if (getPriorityInfo(priority).componentId != hyperion::COMP_COLOR)
|
||||
clear(priority);
|
||||
|
||||
// register color
|
||||
registerInput(priority, hyperion::COMP_COLOR, origin);
|
||||
|
||||
|
@@ -72,7 +72,7 @@ int LinearColorSmoothing::write(const std::vector<ColorRgb> &ledValues)
|
||||
|
||||
_previousTime = QDateTime::currentMSecsSinceEpoch();
|
||||
_previousValues = ledValues;
|
||||
_timer->start();
|
||||
QMetaObject::invokeMethod(_timer, "start", Qt::QueuedConnection, Q_ARG(int, _updateInterval));
|
||||
}
|
||||
else
|
||||
{
|
||||
@@ -182,7 +182,7 @@ void LinearColorSmoothing::setEnable(bool enable)
|
||||
{
|
||||
if (!enable)
|
||||
{
|
||||
_timer->stop();
|
||||
QMetaObject::invokeMethod(_timer, "stop", Qt::QueuedConnection);
|
||||
_previousValues.clear();
|
||||
}
|
||||
// update comp register
|
||||
@@ -218,10 +218,9 @@ bool LinearColorSmoothing::selectConfig(unsigned cfg, const bool& force)
|
||||
|
||||
if (_cfgList[cfg].updateInterval != _updateInterval)
|
||||
{
|
||||
_timer->stop();
|
||||
QMetaObject::invokeMethod(_timer, "stop", Qt::QueuedConnection);
|
||||
_updateInterval = _cfgList[cfg].updateInterval;
|
||||
_timer->setInterval(_updateInterval);
|
||||
_timer->start();
|
||||
QMetaObject::invokeMethod(_timer, "start", Qt::QueuedConnection, Q_ARG(int, _updateInterval));
|
||||
}
|
||||
_currentConfigId = cfg;
|
||||
//DebugIf( enabled() && !_pause, _log, "set smoothing cfg: %d, interval: %d ms, settlingTime: %d ms, updateDelay: %d frames", _currentConfigId, _updateInterval, _settlingTime, _outputDelay );
|
||||
|
@@ -185,6 +185,7 @@ bool PriorityMuxer::setInput(const int priority, const std::vector<ColorRgb>& le
|
||||
// update input
|
||||
input.timeoutTime_ms = timeout_ms;
|
||||
input.ledColors = ledColors;
|
||||
input.image.clear();
|
||||
|
||||
// emit active change
|
||||
if(activeChange)
|
||||
@@ -224,6 +225,7 @@ bool PriorityMuxer::setInputImage(const int priority, const Image<ColorRgb>& ima
|
||||
// update input
|
||||
input.timeoutTime_ms = timeout_ms;
|
||||
input.image = image;
|
||||
input.ledColors.clear();
|
||||
|
||||
// emit active change
|
||||
if(activeChange)
|
||||
|
Reference in New Issue
Block a user