mirror of
https://github.com/hyperion-project/hyperion.ng.git
synced 2025-03-01 10:33:28 +00:00
Threading and more
- webui remove restarts - threading for LedDevice
This commit is contained in:
@@ -9,9 +9,8 @@
|
||||
|
||||
using namespace hyperion;
|
||||
|
||||
LinearColorSmoothing::LinearColorSmoothing( LedDevice * ledDevice, const QJsonDocument& config, Hyperion* hyperion)
|
||||
: LedDevice()
|
||||
, _ledDevice(ledDevice)
|
||||
LinearColorSmoothing::LinearColorSmoothing(const QJsonDocument& config, Hyperion* hyperion)
|
||||
: LedDevice(QJsonObject(), hyperion)
|
||||
, _log(Logger::getInstance("SMOOTHING"))
|
||||
, _hyperion(hyperion)
|
||||
, _updateInterval(1000)
|
||||
@@ -42,8 +41,7 @@ LinearColorSmoothing::LinearColorSmoothing( LedDevice * ledDevice, const QJsonDo
|
||||
|
||||
LinearColorSmoothing::~LinearColorSmoothing()
|
||||
{
|
||||
// Make sure to switch off the underlying led-device (because switchOff is no longer forwarded)
|
||||
_ledDevice->switchOff();
|
||||
|
||||
}
|
||||
|
||||
void LinearColorSmoothing::handleSettingsUpdate(const settings::type& type, const QJsonDocument& config)
|
||||
@@ -148,7 +146,8 @@ void LinearColorSmoothing::queueColors(const std::vector<ColorRgb> & ledColors)
|
||||
{
|
||||
// No output delay => immediate write
|
||||
if ( _writeToLedsEnable && !_pause)
|
||||
_ledDevice->setLedValues(ledColors);
|
||||
emit _hyperion->ledDeviceData(ledColors);
|
||||
|
||||
}
|
||||
else
|
||||
{
|
||||
@@ -163,7 +162,7 @@ void LinearColorSmoothing::queueColors(const std::vector<ColorRgb> & ledColors)
|
||||
{
|
||||
if (!_pause)
|
||||
{
|
||||
_ledDevice->setLedValues(_outputQueue.front());
|
||||
emit _hyperion->ledDeviceData(_outputQueue.front());
|
||||
}
|
||||
_outputQueue.pop_front();
|
||||
}
|
||||
@@ -235,18 +234,3 @@ bool LinearColorSmoothing::selectConfig(unsigned cfg, const bool& force)
|
||||
_currentConfigId = 0;
|
||||
return false;
|
||||
}
|
||||
|
||||
void LinearColorSmoothing::startTimerDelayed()
|
||||
{
|
||||
QTimer::singleShot(500, this, SLOT(delayStartTimer()));
|
||||
}
|
||||
|
||||
void LinearColorSmoothing::stopTimer()
|
||||
{
|
||||
_timer->stop();
|
||||
}
|
||||
|
||||
void LinearColorSmoothing::delayStartTimer()
|
||||
{
|
||||
_timer->start();
|
||||
}
|
||||
|
Reference in New Issue
Block a user