hyperion.ng/include/effectengine/EffectEngine.h
johan 1ec84005c0 Changed hyperion args variable in module from string to dict
Former-commit-id: ae94dca70590e3ed15e991172b7458cf4298e655
2013-11-30 17:41:38 +01:00

52 lines
1020 B
C++

#pragma once
// Json includes
#include <json/value.h>
// Hyperion includes
#include <hyperion/Hyperion.h>
// pre-declarioation
class Effect;
typedef struct _ts PyThreadState;
class EffectEngine : public QObject
{
Q_OBJECT
public:
EffectEngine(Hyperion * hyperion, const Json::Value & jsonEffectConfig);
virtual ~EffectEngine();
std::list<std::string> getEffects() const;
public slots:
/// Run the specified effect on the given priority channel and optionally specify a timeout
int runEffect(const std::string &effectName, int priority, int timeout = -1);
/// Clear any effect running on the provided channel
void channelCleared(int priority);
/// Clear all effects
void allChannelsCleared();
public:
struct EffectDefinition
{
std::string script;
Json::Value args;
};
private slots:
void effectFinished(Effect * effect);
private:
Hyperion * _hyperion;
std::map<std::string, EffectDefinition> _availableEffects;
std::list<Effect *> _activeEffects;
PyThreadState * _mainThreadState;
};