implement origin for effects (#408)

* implement rigin for efx

* implement origin for effects and other components
add experimental adalight firmware for arduino with upto 5 pwm channels

* cleanup

* origin ip now with dns lookup

* fix compile

* move some code
This commit is contained in:
redPanther
2017-03-01 15:23:53 +01:00
committed by GitHub
parent 31f352e7ce
commit 221af075a4
24 changed files with 376 additions and 98 deletions

View File

@@ -4,7 +4,6 @@
#include <hyperion/GrabberWrapper.h>
#include <HyperionConfig.h>
#define QSTRING_CSTR(str) str.toLocal8Bit().constData()
GrabberWrapper::GrabberWrapper(QString grabberName, const int priority, hyperion::Components grabberComponentId)
: _grabberName(grabberName)
, _hyperion(Hyperion::getInstance())
@@ -37,7 +36,7 @@ bool GrabberWrapper::start()
{
// Start the timer with the pre configured interval
_timer.start();
_hyperion->registerPriority(_grabberName.toStdString(), _priority);
_hyperion->registerPriority(_grabberName, _priority);
return _timer.isActive();
}
@@ -46,7 +45,7 @@ void GrabberWrapper::stop()
{
// Stop the timer, effectivly stopping the process
_timer.stop();
_hyperion->unRegisterPriority(_grabberName.toStdString());
_hyperion->unRegisterPriority(_grabberName);
}
void GrabberWrapper::componentStateChanged(const hyperion::Components component, bool enable)

View File

@@ -504,22 +504,22 @@ bool Hyperion::configWriteable()
}
void Hyperion::registerPriority(const std::string name, const int priority)
void Hyperion::registerPriority(const QString &name, const int priority/*, const QString &origin*/)
{
Info(_log, "Register new input source named '%s' for priority channel '%d'", name.c_str(), priority );
Info(_log, "Register new input source named '%s' for priority channel '%d'", QSTRING_CSTR(name), priority );
for(auto const &entry : _priorityRegister)
{
WarningIf( ( entry.first != name && entry.second == priority), _log,
"Input source '%s' uses same priority channel (%d) as '%s'.", name.c_str(), priority, entry.first.c_str());
"Input source '%s' uses same priority channel (%d) as '%s'.", QSTRING_CSTR(name), priority, QSTRING_CSTR(entry.first));
}
_priorityRegister.emplace(name,priority);
}
void Hyperion::unRegisterPriority(const std::string name)
void Hyperion::unRegisterPriority(const QString &name)
{
Info(_log, "Unregister input source named '%s' from priority register", name.c_str());
Info(_log, "Unregister input source named '%s' from priority register", QSTRING_CSTR(name));
_priorityRegister.erase(name);
}
@@ -688,14 +688,14 @@ const std::list<EffectSchema> & Hyperion::getEffectSchemas()
return _effectEngine->getEffectSchemas();
}
int Hyperion::setEffect(const QString &effectName, int priority, int timeout)
int Hyperion::setEffect(const QString &effectName, int priority, int timeout, const QString & origin)
{
return _effectEngine->runEffect(effectName, priority, timeout);
return _effectEngine->runEffect(effectName, priority, timeout, origin);
}
int Hyperion::setEffect(const QString &effectName, const QJsonObject &args, int priority, int timeout, QString pythonScript)
int Hyperion::setEffect(const QString &effectName, const QJsonObject &args, int priority, int timeout, const QString & pythonScript, const QString & origin)
{
return _effectEngine->runEffect(effectName, args, priority, timeout, pythonScript);
return _effectEngine->runEffect(effectName, args, priority, timeout, pythonScript, origin);
}
void Hyperion::setLedMappingType(int mappingType)