This commit is contained in:
Paulchen-Panther
2018-12-31 15:48:29 +01:00
parent 0e3ddb7eca
commit d6b2cfaf9d
49 changed files with 899 additions and 535 deletions

View File

@@ -7,6 +7,7 @@ CaptureCont::CaptureCont(Hyperion* hyperion)
: QObject()
, _hyperion(hyperion)
, _systemCaptEnabled(false)
, _systemInactiveTimer(new QTimer(this))
, _v4lCaptEnabled(false)
, _v4lInactiveTimer(new QTimer(this))
{
@@ -16,6 +17,11 @@ CaptureCont::CaptureCont(Hyperion* hyperion)
// comp changes
connect(_hyperion, &Hyperion::componentStateChanged, this, &CaptureCont::componentStateChanged);
// inactive timer system
connect(_systemInactiveTimer, &QTimer::timeout, this, &CaptureCont::setSystemInactive);
_systemInactiveTimer->setSingleShot(true);
_systemInactiveTimer->setInterval(5000);
// inactive timer v4l
connect(_v4lInactiveTimer, &QTimer::timeout, this, &CaptureCont::setV4lInactive);
_v4lInactiveTimer->setSingleShot(true);
@@ -38,6 +44,7 @@ void CaptureCont::handleV4lImage(const Image<ColorRgb> & image)
void CaptureCont::handleSystemImage(const Image<ColorRgb>& image)
{
_systemInactiveTimer->start();
_hyperion->setInputImage(_systemCaptPrio, image);
}
@@ -118,3 +125,8 @@ void CaptureCont::setV4lInactive()
{
_hyperion->setInputInactive(_v4lCaptPrio);
}
void CaptureCont::setSystemInactive()
{
_hyperion->setInputInactive(_systemCaptPrio);
}

View File

@@ -95,9 +95,7 @@ Hyperion::Hyperion(HyperionDaemon* daemon, const quint8& instance, const QString
, _ledBuffer(_ledString.leds().size(), ColorRgb::BLACK)
{
if (!_raw2ledAdjustment->verifyAdjustments())
{
Warning(_log, "At least one led has no color calibration, please add all leds from your led layout to an 'LED index' field!");
}
// handle hwLedCount
_hwLedCount = qMax(unsigned(getSetting(settings::DEVICE).object()["hardwareLedCount"].toInt(getLedCount())), getLedCount());
@@ -107,6 +105,7 @@ Hyperion::Hyperion(HyperionDaemon* daemon, const quint8& instance, const QString
{
_ledStringColorOrder.push_back(led.colorOrder);
}
for (Led& led : _ledStringClone.leds())
{
_ledStringColorOrder.insert(_ledStringColorOrder.begin() + led.index, led.colorOrder);
@@ -135,7 +134,7 @@ Hyperion::Hyperion(HyperionDaemon* daemon, const quint8& instance, const QString
getComponentRegister().componentStateChanged(hyperion::COMP_LEDDEVICE, _device->componentState());
// create the effect engine and pipe the updateEmit; must be initialized after smoothing!
_effectEngine = new EffectEngine(this,getSetting(settings::EFFECTS).object());
_effectEngine = new EffectEngine(this);
connect(_effectEngine, &EffectEngine::effectListUpdated, this, &Hyperion::effectListUpdated);
// setup config state checks and initial shot
@@ -178,7 +177,6 @@ void Hyperion::freeObjects(bool emitCloseSignal)
{
// switch off all leds
clearall(true);
_device->switchOff();
if (emitCloseSignal)
{
@@ -507,9 +505,14 @@ const Hyperion::InputInfo Hyperion::getPriorityInfo(const int priority) const
return _muxer.getInputInfo(priority);
}
void Hyperion::reloadEffects()
const bool Hyperion::saveEffect(const QJsonObject& obj, QString& resultMsg)
{
_effectEngine->readEffects();
return _effectEngine->saveEffect(obj, resultMsg);
}
const bool Hyperion::deleteEffect(const QString& effectName, QString& resultMsg)
{
return _effectEngine->deleteEffect(effectName, resultMsg);
}
const std::list<EffectDefinition> & Hyperion::getEffects() const
@@ -625,12 +628,14 @@ void Hyperion::update()
{
_ledBuffer = priorityInfo.ledColors;
}
// copy rawLedColors before adjustments
_rawLedBuffer = _ledBuffer;
// emit rawLedColors before transform
emit rawLedColors(_ledBuffer);
// apply adjustments
if(compChanged)
_raw2ledAdjustment->setBacklightEnabled((_prevCompId != hyperion::COMP_COLOR && _prevCompId != hyperion::COMP_EFFECT));
_raw2ledAdjustment->applyAdjustment(_ledBuffer);
// insert cloned leds into buffer

View File

@@ -302,11 +302,10 @@ void PriorityMuxer::setCurrentTime(void)
if(infoIt->timeoutTime_ms >= -1)
newPriority = qMin(newPriority, infoIt->priority);
// call timeTrigger when effect or color is running with timeout > -1, blacklist prio 255
if(infoIt->priority < 254 && infoIt->timeoutTime_ms > -1 && (infoIt->componentId == hyperion::COMP_EFFECT || infoIt->componentId == hyperion::COMP_COLOR))
{
// call timeTrigger when effect or color is running with timeout > 0, blacklist prio 255
if(infoIt->priority < 254 && infoIt->timeoutTime_ms > 0 && (infoIt->componentId == hyperion::COMP_EFFECT || infoIt->componentId == hyperion::COMP_COLOR))
emit signalTimeTrigger(); // as signal to prevent Threading issues
}
++infoIt;
}
}

Binary file not shown.

Before

Width:  |  Height:  |  Size: 2.0 KiB

View File

@@ -1,6 +1,5 @@
<RCC>
<qresource prefix="/">
<file alias="hyperion-icon.png">hyperion-icon_32px.png</file>
<file alias="hyperion-schema">hyperion.schema.json</file>
<file alias="hyperion_default.config">../../config/hyperion.config.json.default</file>
<file alias="schema-general.json">schema/schema-general.json</file>