hyperion.ng
Classes | Public Slots | Public Member Functions | List of all members
LinearColorSmoothing Class Reference

Linear Smooting class. More...

#include <LinearColorSmoothing.h>

Inheritance diagram for LinearColorSmoothing:
LedDevice

Public Slots

void handleSettingsUpdate (const settings::type &type, const QJsonDocument &config)
 Handle settings update from Hyperion Settingsmanager emit or this constructor. More...
 
- Public Slots inherited from LedDevice
virtual void start ()
 Is called on thread start, all construction tasks and init should run here.
 

Public Member Functions

 LinearColorSmoothing (const QJsonDocument &config, Hyperion *hyperion)
 Constructor. More...
 
virtual ~LinearColorSmoothing ()
 Destructor.
 
virtual int write (const std::vector< ColorRgb > &ledValues)
 write updated values as input for the smoothing filter More...
 
virtual int switchOff ()
 Switch the leds off.
 
void setEnable (bool enable)
 
void setPause (bool pause)
 
bool pause ()
 
bool enabled ()
 
unsigned addConfig (int settlingTime_ms, double ledUpdateFrequency_hz=25.0, unsigned updateDelay=0)
 Add a new smoothing cfg which can be used with selectConfig() More...
 
bool selectConfig (unsigned cfg, const bool &force=false)
 select a smoothing cfg given by cfg index from addConfig() More...
 
- Public Member Functions inherited from LedDevice
 LedDevice (const QJsonObject &config=QJsonObject(), QObject *parent=nullptr)
 
virtual int switchOn ()
 Switch the leds on (led hardware enable), used if reinitialization is required for the device implementation.
 
virtual int setLedValues (const std::vector< ColorRgb > &ledValues)
 
const QString & getColorOrder ()
 Get color order of device. More...
 
void setActiveDevice (QString dev)
 
const QString & getActiveDevice ()
 
void setLedCount (int ledCount)
 
int getLedCount ()
 
void setEnable (bool enable)
 
bool enabled ()
 
int getLatchTime ()
 
bool componentState ()
 

Additional Inherited Members

- Signals inherited from LedDevice
void enableStateChanged (bool newState)
 Emits whenever the led device switches between on/off. More...
 
void visiblePriorityChanged (const quint8 &priority)
 PIPER signal for Priority Muxer -> LedDevice. More...
 
- Protected Slots inherited from LedDevice
int rewriteLeds ()
 Write the last data to the leds again.
 
- Protected Member Functions inherited from LedDevice
virtual bool init (const QJsonObject &deviceConfig)
 
virtual int open ()
 Opens and configures the output device. More...
 
- Protected Attributes inherited from LedDevice
QJsonObject _devConfig
 
Logger_log
 The common Logger instance for all LedDevices.
 
std::vector< uint8_t > _ledBuffer
 The buffer containing the packed RGB values.
 
bool _deviceReady
 
QString _activeDevice
 
int _ledCount
 
int _ledRGBCount
 
int _ledRGBWCount
 
QTimer _refresh_timer
 Timer object which makes sure that led data is written at a minimum rate e.g. More...
 
unsigned int _refresh_timer_interval
 
qint64 _last_write_time
 
unsigned int _latchTime_ms
 

Detailed Description

Linear Smooting class.

This class processes the requested led values and forwards them to the device after applying a linear smoothing effect. This class can be handled as a generic LedDevice.

Constructor & Destructor Documentation

§ LinearColorSmoothing()

LinearColorSmoothing::LinearColorSmoothing ( const QJsonDocument &  config,
Hyperion hyperion 
)

Constructor.

Parameters
configThe configuration document smoothing
hyperionThe hyperion parent instance

Member Function Documentation

§ addConfig()

unsigned LinearColorSmoothing::addConfig ( int  settlingTime_ms,
double  ledUpdateFrequency_hz = 25.0,
unsigned  updateDelay = 0 
)

Add a new smoothing cfg which can be used with selectConfig()

Parameters
settlingTime_msThe buffer time
ledUpdateFrequency_hzThe frequency of update
updateDelayThe delay
Returns
The index of the cfg which can be passed to selectConfig()

§ handleSettingsUpdate

void LinearColorSmoothing::handleSettingsUpdate ( const settings::type &  type,
const QJsonDocument &  config 
)
slot

Handle settings update from Hyperion Settingsmanager emit or this constructor.

Parameters
typesettingyType from enum
configconfiguration object

§ selectConfig()

bool LinearColorSmoothing::selectConfig ( unsigned  cfg,
const bool &  force = false 
)

select a smoothing cfg given by cfg index from addConfig()

Parameters
cfgThe index to use
forceOverwrite in any case the current values (used for cfg 0 settings udpate)
Returns
On success return else false (and falls back to cfg 0)

§ write()

int LinearColorSmoothing::write ( const std::vector< ColorRgb > &  ledValues)
virtual

write updated values as input for the smoothing filter

Parameters
ledValuesThe color-value per led
Returns
Zero on success else negative

Implements LedDevice.


The documentation for this class was generated from the following files: