Linear Smooting class.
More...
#include <LinearColorSmoothing.h>
|
void | handleSettingsUpdate (const settings::type &type, const QJsonDocument &config) |
| Handle settings update from Hyperion Settingsmanager emit or this constructor. More...
|
|
virtual void | start () |
| Is called on thread start, all construction tasks and init should run here.
|
|
|
| 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...
|
|
| 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 () |
|
|
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...
|
|
int | rewriteLeds () |
| Write the last data to the leds again.
|
|
virtual bool | init (const QJsonObject &deviceConfig) |
|
virtual int | open () |
| Opens and configures the output device. More...
|
|
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 |
|
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.
§ LinearColorSmoothing()
LinearColorSmoothing::LinearColorSmoothing |
( |
const QJsonDocument & |
config, |
|
|
Hyperion * |
hyperion |
|
) |
| |
Constructor.
- Parameters
-
config | The configuration document smoothing |
hyperion | The hyperion parent instance |
§ 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_ms | The buffer time |
ledUpdateFrequency_hz | The frequency of update |
updateDelay | The 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
-
type | settingyType from enum |
config | configuration object |
§ selectConfig()
bool LinearColorSmoothing::selectConfig |
( |
unsigned |
cfg, |
|
|
const bool & |
force = false |
|
) |
| |
select a smoothing cfg given by cfg index from addConfig()
- Parameters
-
cfg | The index to use |
force | Overwrite 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
-
ledValues | The color-value per led |
- Returns
- Zero on success else negative
Implements LedDevice.
The documentation for this class was generated from the following files: