mirror of
https://github.com/hyperion-project/hyperion.ng.git
synced 2025-03-01 10:33:28 +00:00
Effects added to configuration file
Former-commit-id: 2ff4700ee5d5bc3a7dd5a29ecd35c1c9dd189873
This commit is contained in:
@@ -1,16 +1,14 @@
|
||||
// Qt includes
|
||||
#include <QMetaType>
|
||||
|
||||
// Python includes
|
||||
#include <Python.h>
|
||||
|
||||
// Qt includes
|
||||
#include <QMetaType>
|
||||
|
||||
// effect engine includes
|
||||
#include <effectengine/EffectEngine.h>
|
||||
#include "Effect.h"
|
||||
|
||||
//static PyThreadState *_mainThreadState = 0;
|
||||
|
||||
EffectEngine::EffectEngine(Hyperion * hyperion) :
|
||||
EffectEngine::EffectEngine(Hyperion * hyperion, const Json::Value & jsonEffectConfig) :
|
||||
_hyperion(hyperion),
|
||||
_availableEffects(),
|
||||
_activeEffects(),
|
||||
@@ -23,7 +21,12 @@ EffectEngine::EffectEngine(Hyperion * hyperion) :
|
||||
connect(_hyperion, SIGNAL(allChannelsCleared()), this, SLOT(allChannelsCleared()));
|
||||
|
||||
// read all effects
|
||||
_availableEffects["test"] = {"test.py", "{\"speed\":0.2}"};
|
||||
std::vector<std::string> effectNames = jsonEffectConfig.getMemberNames();
|
||||
for (const std::string & name : effectNames)
|
||||
{
|
||||
const Json::Value & info = jsonEffectConfig[name];
|
||||
_availableEffects[name] = {info["script"].asString(), Json::FastWriter().write(info["args"])};
|
||||
}
|
||||
|
||||
// initialize the python interpreter
|
||||
std::cout << "Initializing Python interpreter" << std::endl;
|
||||
|
Reference in New Issue
Block a user