hyperion.ng/libsrc/leddevice/dev_other/LedDeviceFile.h
redPanther 317a903b14 Leddevices source tree refactoring (#461)
* rework structure of leddevice source tree

* fix data type vor v4l sig detection value in webui

* automate leddevicefactory.cpp
2017-08-07 10:05:46 +02:00

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;
};