mirror of
https://github.com/hyperion-project/hyperion.ng.git
synced 2025-03-01 10:33:28 +00:00
per effect smoothing (#456)
* add dynamic smoothing first step * extend prio muxer to hold smoothing preset id * add icons for systray * fix missing changes in prio muxer * implement specific smoothing params for effects * refactoring: std::min/max to qMin/Max * some code optimization * fix schema and translation * revoke change of python include order * fix eol in effect shemas * optimize random,candle and fadecandy json schemas
This commit is contained in:
@@ -8,4 +8,5 @@ struct EffectDefinition
|
||||
{
|
||||
QString name, script, file;
|
||||
QJsonObject args;
|
||||
unsigned smoothCfg;
|
||||
};
|
||||
|
@@ -48,7 +48,7 @@ public slots:
|
||||
int runEffect(const QString &effectName, int priority, int timeout = -1, const QString &origin="System");
|
||||
|
||||
/// Run the specified effect on the given priority channel and optionally specify a timeout
|
||||
int runEffect(const QString &effectName, const QJsonObject & args, int priority, int timeout = -1, const QString &pythonScript = "", const QString &origin = "System");
|
||||
int runEffect(const QString &effectName, const QJsonObject & args, int priority, int timeout = -1, const QString &pythonScript = "", const QString &origin = "System", unsigned smoothCfg=0);
|
||||
|
||||
/// Clear any effect running on the provided channel
|
||||
void channelCleared(int priority);
|
||||
@@ -65,7 +65,7 @@ private:
|
||||
bool loadEffectSchema(const QString & path, const QString & effectSchemaFile, EffectSchema &effectSchema);
|
||||
|
||||
/// Run the specified effect on the given priority channel and optionally specify a timeout
|
||||
int runEffectScript(const QString &script, const QString &name, const QJsonObject & args, int priority, int timeout = -1, const QString & origin="System");
|
||||
int runEffectScript(const QString &script, const QString &name, const QJsonObject & args, int priority, int timeout = -1, const QString & origin="System", unsigned smoothCfg=0);
|
||||
|
||||
private:
|
||||
Hyperion * _hyperion;
|
||||
|
@@ -47,6 +47,7 @@ class EffectEngine;
|
||||
class RgbChannelAdjustment;
|
||||
class MultiColorAdjustment;
|
||||
class KODIVideoChecker;
|
||||
|
||||
///
|
||||
/// The main class of Hyperion. This gives other 'users' access to the attached LedDevice through
|
||||
/// the priority muxer.
|
||||
@@ -187,6 +188,9 @@ public:
|
||||
QString id;
|
||||
|
||||
int getLatchTime() const;
|
||||
|
||||
/// forward smoothing config
|
||||
unsigned addSmoothingConfig(int settlingTime_ms, double ledUpdateFrequency_hz=25.0, unsigned updateDelay=0);
|
||||
|
||||
public slots:
|
||||
///
|
||||
@@ -206,8 +210,9 @@ public slots:
|
||||
/// @param[in] timeout_ms The time the leds are set to the given colors [ms]
|
||||
/// @param[in] component The current component
|
||||
/// @param[in] origin Who set it
|
||||
/// @param[in] smoothCfg smoothing config id
|
||||
///
|
||||
void setColors(int priority, const std::vector<ColorRgb> &ledColors, const int timeout_ms, bool clearEffects = true, hyperion::Components component=hyperion::COMP_INVALID, const QString origin="System");
|
||||
void setColors(int priority, const std::vector<ColorRgb> &ledColors, const int timeout_ms, bool clearEffects = true, hyperion::Components component=hyperion::COMP_INVALID, const QString origin="System", unsigned smoothCfg=SMOOTHING_MODE_DEFAULT);
|
||||
|
||||
///
|
||||
/// Writes the given colors to all leds for the given time and priority
|
||||
|
@@ -15,6 +15,11 @@
|
||||
#include <utils/ColorRgb.h>
|
||||
#include <utils/Components.h>
|
||||
|
||||
// global defines
|
||||
#define SMOOTHING_MODE_DEFAULT 0
|
||||
#define SMOOTHING_MODE_PAUSE 1
|
||||
|
||||
|
||||
///
|
||||
/// 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
|
||||
@@ -40,6 +45,8 @@ public:
|
||||
hyperion::Components componentId;
|
||||
/// Who set it
|
||||
QString origin;
|
||||
/// id fo smoothing config
|
||||
unsigned smooth_cfg;
|
||||
};
|
||||
|
||||
/// The lowest possible priority, which is used when no priority channels are active
|
||||
@@ -99,7 +106,7 @@ public:
|
||||
/// @param[in] component The component of the channel
|
||||
/// @param[in] origin Who set the channel
|
||||
///
|
||||
void setInput(const int priority, const std::vector<ColorRgb>& ledColors, const int64_t timeoutTime_ms=-1, hyperion::Components component=hyperion::COMP_INVALID, const QString origin="System");
|
||||
void setInput(const int priority, const std::vector<ColorRgb>& ledColors, const int64_t timeoutTime_ms=-1, hyperion::Components component=hyperion::COMP_INVALID, const QString origin="System", unsigned smooth_cfg=SMOOTHING_MODE_DEFAULT);
|
||||
|
||||
///
|
||||
/// Clears the specified priority channel
|
||||
|
Reference in New Issue
Block a user