disable smoothing for effects (#425)

* no smooth for efx
rework fade effect

* join strobe and fade effects
new effect "breath"

* - make transition efx to smooth mode more smooth
- fixes for pacman
- rework fade base effect - make it more versatile
- fix prios in schema files
- new notify blue effect to demonstrate capability of fade effect
This commit is contained in:
redPanther
2017-03-30 06:20:20 +02:00
committed by GitHub
parent 230c403bba
commit e9040f885d
25 changed files with 271 additions and 133 deletions

View File

@@ -846,9 +846,12 @@ void Hyperion::update()
// Write the data to the device
if (_device->enabled())
{
if (_deviceSmooth->enabled())
_deviceSmooth->setPause(priorityInfo.componentId == hyperion::COMP_EFFECT);
// feed smoothing in pause mode to maintain a smooth transistion back to smoth mode
if (_deviceSmooth->enabled() || _deviceSmooth->pause())
_deviceSmooth->setLedValues(_ledBuffer);
else
if (! _deviceSmooth->enabled())
_device->setLedValues(_ledBuffer);
}

View File

@@ -17,6 +17,7 @@ LinearColorSmoothing::LinearColorSmoothing( LedDevice * ledDevice, double ledUpd
, _outputDelay(updateDelay)
, _writeToLedsEnable(true)
, _continuousOutput(continuousOutput)
, _pause(false)
{
_log = Logger::getInstance("Smoothing");
_timer.setSingleShot(false);
@@ -118,7 +119,7 @@ void LinearColorSmoothing::queueColors(const std::vector<ColorRgb> & ledColors)
if (_outputDelay == 0)
{
// No output delay => immediate write
if ( _writeToLedsEnable )
if ( _writeToLedsEnable && !_pause)
_ledDevice->setLedValues(ledColors);
}
else
@@ -132,7 +133,10 @@ void LinearColorSmoothing::queueColors(const std::vector<ColorRgb> & ledColors)
{
if ( _outputQueue.size() > _outputDelay || !_writeToLedsEnable )
{
_ledDevice->setLedValues(_outputQueue.front());
if (!_pause)
{
_ledDevice->setLedValues(_outputQueue.front());
}
_outputQueue.pop_front();
}
}
@@ -148,6 +152,11 @@ void LinearColorSmoothing::setEnable(bool enable)
{
_timer.stop();
_previousValues.clear();
}
}
void LinearColorSmoothing::setPause(bool pause)
{
_pause = pause;
}

View File

@@ -41,6 +41,9 @@ public:
virtual int switchOff();
void setEnable(bool enable);
void setPause(bool pause);
bool pause() { return _pause; } ;
bool enabled() { return LedDevice::enabled() && !_pause; };
private slots:
/// Timer callback which writes updated led values to the led device
@@ -88,4 +91,7 @@ private:
/// Flag for dis/enable continuous output to led device regardless there is new data or not
bool _continuousOutput;
/// Flag for pausing
bool _pause;
};

View File

@@ -78,7 +78,7 @@ void PriorityMuxer::clearAll()
{
for(auto key : _activeInputs.keys())
{
if (key < LOWEST_PRIORITY)
if (key < LOWEST_PRIORITY-1)
{
_activeInputs.remove(key);
}

View File

@@ -617,7 +617,7 @@ void JsonClientConnection::handleServerInfoCommand(const QJsonObject&, const QSt
const Hyperion::InputInfo & priorityInfo = _hyperion->getPriorityInfo(priority);
QJsonObject item;
item["priority"] = priority;
if (priorityInfo.timeoutTime_ms != -1 && (priorityInfo.componentId == hyperion::COMP_COLOR || priorityInfo.componentId == hyperion::COMP_EFFECT))
if (priorityInfo.timeoutTime_ms != -1 )
{
item["duration_ms"] = int(priorityInfo.timeoutTime_ms - now);
}

View File

@@ -13,7 +13,7 @@
"priority": {
"type": "integer",
"minimum" : 1,
"maximum" : 254,
"maximum" : 253,
"required": true
},
"duration": {

View File

@@ -13,7 +13,7 @@
"priority": {
"type": "integer",
"minimum" : 1,
"maximum" : 254,
"maximum" : 253,
"required": true
},
"duration": {