mirror of
https://github.com/hyperion-project/hyperion.ng.git
synced 2025-03-01 10:33:28 +00:00
Hyperion Light 2 (#1428)
* Hyperion Light - Have EffectEngine as component * Hyperion light - Build switches for LED Devices (Serial, Network) * Fix file uri generation * Fix missing guard for Windows * Fix file uri generation * Update jsonschema and checkschema * Allow to provide cmake build args to docker build
This commit is contained in:
@@ -4,6 +4,8 @@
|
||||
#include <QObject>
|
||||
#include <QString>
|
||||
|
||||
#include "HyperionConfig.h"
|
||||
|
||||
class SysInfo : public QObject
|
||||
{
|
||||
public:
|
||||
@@ -24,7 +26,9 @@ public:
|
||||
QString domainName;
|
||||
bool isUserAdmin;
|
||||
QString qtVersion;
|
||||
#if defined(ENABLE_EFFECTENGINE)
|
||||
QString pyVersion;
|
||||
#endif
|
||||
};
|
||||
|
||||
static HyperionSysInfo get();
|
||||
|
@@ -10,7 +10,9 @@
|
||||
// fg effect
|
||||
#include <hyperion/Hyperion.h>
|
||||
#include <hyperion/PriorityMuxer.h>
|
||||
#if defined(ENABLE_EFFECTENGINE)
|
||||
#include <effectengine/Effect.h>
|
||||
#endif
|
||||
|
||||
///
|
||||
/// @brief Provide utility methods for Hyperion class
|
||||
@@ -24,12 +26,16 @@ namespace hyperion {
|
||||
// initial foreground effect/color
|
||||
if (FGEffectConfig["enable"].toBool(true))
|
||||
{
|
||||
#if defined(ENABLE_EFFECTENGINE)
|
||||
const QString fgTypeConfig = FGEffectConfig["type"].toString("effect");
|
||||
const QString fgEffectConfig = FGEffectConfig["effect"].toString("Rainbow swirl fast");
|
||||
#else
|
||||
const QString fgTypeConfig = "color";
|
||||
#endif
|
||||
const QJsonValue fgColorConfig = FGEffectConfig["color"];
|
||||
int default_fg_duration_ms = 3000;
|
||||
int fg_duration_ms = FGEffectConfig["duration_ms"].toInt(default_fg_duration_ms);
|
||||
if (fg_duration_ms <= Effect::ENDLESS)
|
||||
if (fg_duration_ms <= PriorityMuxer::ENDLESS )
|
||||
{
|
||||
fg_duration_ms = default_fg_duration_ms;
|
||||
Warning(Logger::getInstance("HYPERION"), "foreground effect duration 'infinity' is forbidden, set to default value %d ms",default_fg_duration_ms);
|
||||
@@ -46,11 +52,13 @@ namespace hyperion {
|
||||
hyperion->setColor(PriorityMuxer::FG_PRIORITY, fg_color, fg_duration_ms);
|
||||
Info(Logger::getInstance("HYPERION","I"+QString::number(hyperion->getInstanceIndex())),"Initial foreground color set (%d %d %d)",fg_color.at(0).red,fg_color.at(0).green,fg_color.at(0).blue);
|
||||
}
|
||||
#if defined(ENABLE_EFFECTENGINE)
|
||||
else
|
||||
{
|
||||
int result = hyperion->setEffect(fgEffectConfig, PriorityMuxer::FG_PRIORITY, fg_duration_ms);
|
||||
Info(Logger::getInstance("HYPERION","I"+QString::number(hyperion->getInstanceIndex())),"Initial foreground effect '%s' %s", QSTRING_CSTR(fgEffectConfig), ((result == 0) ? "started" : "failed"));
|
||||
}
|
||||
#endif
|
||||
}
|
||||
#undef FGCONFIG_ARRAY
|
||||
}
|
||||
|
Reference in New Issue
Block a user