Moved all devices to separate library and added 'Factory' for device creation.

Former-commit-id: 26cab1b85b00406240689ad9c1018f0307028fe4
This commit is contained in:
T. van der Zwan
2013-12-17 18:50:15 +00:00
parent 9bfaffe93b
commit b63753f5dc
37 changed files with 240 additions and 175 deletions

View File

@@ -12,13 +12,13 @@
// Hyperion includes
#include <hyperion/LedString.h>
#include <hyperion/LedDevice.h>
#include <hyperion/PriorityMuxer.h>
// Effect engine includes
#include <effectengine/EffectDefinition.h>
// Forward class declaration
class LedDevice;
class ColorTransform;
class EffectEngine;
class HsvTransform;
@@ -158,7 +158,6 @@ public slots:
int setEffect(const std::string & effectName, const Json::Value & args, 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);

View File

@@ -1,35 +0,0 @@
#pragma once
// STL incldues
#include <vector>
// Utility includes
#include <utils/ColorRgb.h>
///
/// Interface (pure virtual base class) for LedDevices.
///
class LedDevice
{
public:
///
/// Empty virtual destructor for pure virtual base class
///
virtual ~LedDevice()
{
// empty
}
///
/// Writes the RGB-Color values to the leds.
///
/// @param[in] ledValues The RGB-color per led
///
/// @return Zero on success else negative
///
virtual int write(const std::vector<ColorRgb>& ledValues) = 0;
/// Switch the leds off
virtual int switchOff() = 0;
};

View File

@@ -12,9 +12,6 @@
// Utils includes
#include <utils/ColorRgb.h>
// Hyperion includes
#include <hyperion/LedDevice.h>
///
/// The PriorityMuxer handles the priority channels. Led values input is written to the priority map
/// and the muxer keeps track of all active priorities. The current priority can be queried and per