| 87 | } |
| 88 | |
| 89 | void Smoothing::clearQueuedColors(bool deviceEnabled, bool restarting) |
| 90 | { |
| 91 | QMutexLocker locker(&_setupSynchro); |
| 92 | |
| 93 | try |
| 94 | { |
| 95 | Info(_log, "Clearing queued colors before: %s%s", |
| 96 | (deviceEnabled) ? "enabling" : "disabling", |
| 97 | (restarting) ? ". Smoothing configuration changed: restarting timer." : ""); |
| 98 | |
| 99 | if ((!deviceEnabled || restarting || _pause) && _connected) |
| 100 | { |
| 101 | _connected = false; |
| 102 | disconnect(this, &Smoothing::SignalMasterClockTick, this, &Smoothing::updateLeds); |
| 103 | } |
| 104 | |
| 105 | _currentColors.clear(); |
| 106 | _currentTimeouts.clear(); |
| 107 | _previousTime = 0; |
| 108 | _targetColorsUnsafe.clear(); |
| 109 | _targetColorsCopy.clear(); |
| 110 | _targetTimeUnsafe = 0; |
| 111 | _targetTimeCopy = 0; |
| 112 | _flushFrame = false; |
| 113 | _infoUpdate = true; |
| 114 | _infoInput = true; |
| 115 | _coolDown = 0; |
| 116 | |
| 117 | if (deviceEnabled && !_pause && !_connected) |
| 118 | { |
| 119 | _connected = true; |
| 120 | connect(this, &Smoothing::SignalMasterClockTick, this, &Smoothing::updateLeds, Qt::DirectConnection); |
| 121 | } |
| 122 | |
| 123 | emit _hyperhdr->SignalSmoothingRestarted(this->GetSuggestedInterval()); |
| 124 | |
| 125 | Info(_log, "Smoothing queue is cleared"); |
| 126 | } |
| 127 | catch (...) |
| 128 | { |
| 129 | Debug(_log, "Smoothing error detected"); |
| 130 | } |
| 131 | } |
| 132 | |
| 133 | void Smoothing::handleSettingsUpdate(settings::type type, const QJsonDocument& config) |
| 134 | { |
nothing calls this directly
no test coverage detected