mirror of
https://github.com/hyperion-project/hyperion.ng.git
synced 2023-10-10 13:36:59 +02:00
317a903b14
* rework structure of leddevice source tree * fix data type vor v4l sig detection value in webui * automate leddevicefactory.cpp
51 lines
1.0 KiB
C++
51 lines
1.0 KiB
C++
#pragma once
|
|
|
|
// STL includes
|
|
#include <fstream>
|
|
|
|
// Leddevice includes
|
|
#include <leddevice/LedDevice.h>
|
|
|
|
///
|
|
/// Implementation of the LedDevice that write the led-colors to an
|
|
/// ASCII-textfile('/home/pi/LedDevice.out')
|
|
///
|
|
class LedDeviceFile : public LedDevice
|
|
{
|
|
public:
|
|
///
|
|
/// Constructs specific LedDevice
|
|
///
|
|
/// @param deviceConfig json device config
|
|
///
|
|
LedDeviceFile(const QJsonObject &deviceConfig);
|
|
|
|
///
|
|
/// Destructor of this test-device
|
|
///
|
|
virtual ~LedDeviceFile();
|
|
|
|
/// constructs leddevice
|
|
static LedDevice* construct(const QJsonObject &deviceConfig);
|
|
|
|
///
|
|
/// Sets configuration
|
|
///
|
|
/// @param deviceConfig the json device config
|
|
/// @return true if success
|
|
virtual bool init(const QJsonObject &deviceConfig);
|
|
|
|
protected:
|
|
///
|
|
/// Writes the given led-color values to the output stream
|
|
///
|
|
/// @param ledValues The color-value per led
|
|
///
|
|
/// @return Zero on success else negative
|
|
///
|
|
virtual int write(const std::vector<ColorRgb> & ledValues);
|
|
|
|
/// The outputstream
|
|
std::ofstream _ofs;
|
|
};
|