mirror of
https://github.com/hyperion-project/hyperion.ng.git
synced 2025-03-01 10:33:28 +00:00
Adding the possibility to test new Effects ... (#282)
* Update effects_configurator.html * Update content_effectsconfigurator.js * Update hyperion.js * Update de.json * Add argument QString "pythonScript" to runEffect function * Update Hyperion.h * Update EffectEngine.cpp * Update Hyperion.cpp * Update JsonClientConnection.cpp * Update schema-effect.json
This commit is contained in:
committed by
brindosch
parent
864538f188
commit
08dfec20c5
@@ -345,27 +345,31 @@ int EffectEngine::runEffect(const QString &effectName, int priority, int timeout
|
||||
return runEffect(effectName, QJsonObject(), priority, timeout);
|
||||
}
|
||||
|
||||
int EffectEngine::runEffect(const QString &effectName, const QJsonObject &args, int priority, int timeout)
|
||||
int EffectEngine::runEffect(const QString &effectName, const QJsonObject &args, int priority, int timeout, QString pythonScript)
|
||||
{
|
||||
Info( _log, "run effect %s on channel %d", effectName.toUtf8().constData(), priority);
|
||||
|
||||
const EffectDefinition * effectDefinition = nullptr;
|
||||
for (const EffectDefinition & e : _availableEffects)
|
||||
if (pythonScript == "")
|
||||
{
|
||||
if (e.name == effectName)
|
||||
const EffectDefinition * effectDefinition = nullptr;
|
||||
for (const EffectDefinition & e : _availableEffects)
|
||||
{
|
||||
effectDefinition = &e;
|
||||
break;
|
||||
if (e.name == effectName)
|
||||
{
|
||||
effectDefinition = &e;
|
||||
break;
|
||||
}
|
||||
}
|
||||
if (effectDefinition == nullptr)
|
||||
{
|
||||
// no such effect
|
||||
Error(_log, "effect %s not found", effectName.toUtf8().constData());
|
||||
return -1;
|
||||
}
|
||||
}
|
||||
if (effectDefinition == nullptr)
|
||||
{
|
||||
// no such effect
|
||||
Error(_log, "effect %s not found", effectName.toUtf8().constData());
|
||||
return -1;
|
||||
}
|
||||
|
||||
return runEffectScript(effectDefinition->script, effectName, args.isEmpty() ? effectDefinition->args : args, priority, timeout);
|
||||
return runEffectScript(effectDefinition->script, effectName, args.isEmpty() ? effectDefinition->args : args, priority, timeout);
|
||||
} else
|
||||
return runEffectScript(pythonScript, effectName, args, priority, timeout);
|
||||
}
|
||||
|
||||
int EffectEngine::runEffectScript(const QString &script, const QString &name, const QJsonObject &args, int priority, int timeout)
|
||||
|
Reference in New Issue
Block a user