| 220 | } |
| 221 | |
| 222 | void Smoothing::UpdateLedValues(const std::vector<ColorRgb>& ledValues) |
| 223 | { |
| 224 | if (!_enabled) |
| 225 | return; |
| 226 | |
| 227 | _coolDown = 1; |
| 228 | |
| 229 | if (_pause) |
| 230 | { |
| 231 | if (_connected) |
| 232 | clearQueuedColors(); |
| 233 | |
| 234 | if (ledValues.size() == 0) |
| 235 | return; |
| 236 | |
| 237 | queueColors(ledValues); |
| 238 | |
| 239 | return; |
| 240 | } |
| 241 | |
| 242 | try |
| 243 | { |
| 244 | if (_infoInput) |
| 245 | Info(_log, "Using %s smoothing input (%i)", ((_smoothingType == SmoothingType::Alternative) ? "alternative" : "linear"), _currentConfigId); |
| 246 | |
| 247 | _infoInput = false; |
| 248 | linearSetup(ledValues); |
| 249 | } |
| 250 | catch (...) |
| 251 | { |
| 252 | Debug(_log, "Smoothing error detected"); |
| 253 | } |
| 254 | |
| 255 | return; |
| 256 | } |
| 257 | |
| 258 | void Smoothing::linearSetup(const std::vector<ColorRgb>& ledValues) |
| 259 | { |