mirror of
https://github.com/hyperion-project/hyperion.ng.git
synced 2025-03-01 10:33:28 +00:00
Moved all devices to separate library and added 'Factory' for device creation.
Former-commit-id: 26cab1b85b00406240689ad9c1018f0307028fe4
This commit is contained in:
@@ -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);
|
||||
|
||||
|
@@ -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
|
||||
|
27
include/leddevice/LedDeviceFactory.h
Normal file
27
include/leddevice/LedDeviceFactory.h
Normal file
@@ -0,0 +1,27 @@
|
||||
|
||||
#pragma once
|
||||
|
||||
// Json includes
|
||||
#include <json/json.h>
|
||||
|
||||
// Leddevice includes
|
||||
#include <leddevice/LedDevice.h>
|
||||
|
||||
|
||||
///
|
||||
/// The LedDeviceFactory is responsible for constructing 'LedDevices'
|
||||
///
|
||||
class LedDeviceFactory
|
||||
{
|
||||
public:
|
||||
|
||||
///
|
||||
/// Constructs a LedDevice based on the given configuration
|
||||
///
|
||||
/// @param deviceConfig The configuration of the led-device
|
||||
///
|
||||
/// @return The constructed LedDevice or nullptr if configuration is invalid. The ownership of
|
||||
/// the constructed LedDevice is tranferred to the caller
|
||||
///
|
||||
static LedDevice * construct(const Json::Value & deviceConfig);
|
||||
};
|
Reference in New Issue
Block a user