Added skeleton for effect engine development

Former-commit-id: e1fb69fd4de4b8968075660e3ba7f7add021c152
This commit is contained in:
johan
2013-11-24 16:10:48 +01:00
parent 333cecdca8
commit 5454ddb375
19 changed files with 304 additions and 12 deletions

View File

@@ -18,6 +18,7 @@
// Forward class declaration
class HsvTransform;
class ColorTransform;
class EffectEngine;
///
/// The main class of Hyperion. This gives other 'users' access to the attached LedDevice through
@@ -141,6 +142,17 @@ public:
///
const InputInfo& getPriorityInfo(const int priority) const;
/// Get the list of available effects
/// @return The list of available effects
std::list<std::string> getEffects() const;
/// Run the specified effect on the given priority channel and optionally specify a timeout
/// @param effectName Name of the effec to run
/// @param priority The priority channel of the effect
/// @param timout The timeout of the effect (after the timout, the effect will be cleared)
int setEffect(const std::string & effectName, int priority, int timeout = -1);
public:
static LedDevice * createDevice(const Json::Value & deviceConfig);
static ColorOrder createColorOrder(const Json::Value & deviceConfig);
static LedString createLedString(const Json::Value & ledsConfig);
@@ -148,6 +160,15 @@ public:
static ColorTransform * createColorTransform(const Json::Value & colorConfig);
static LedDevice * createColorSmoothing(const Json::Value & smoothingConfig, LedDevice * ledDevice);
signals:
/// Signal which is emitted when a priority channel is actively cleared
/// This signal will not be emitted when a priority channel time out
void channelCleared(int priority);
/// Signal which is emitted when all priority channels are actively cleared
/// This signal will not be emitted when a priority channel time out
void allChannelsCleared();
private slots:
///
/// Updates the priority muxer with the current time and (re)writes the led color with applied
@@ -185,6 +206,9 @@ private:
/// The actual LedDevice
LedDevice * _device;
/// Effect engine
EffectEngine * _effectEngine;
/// The timer for handling priority channel timeouts
QTimer _timer;
};