mirror of
https://github.com/hyperion-project/hyperion.ng.git
synced 2025-03-01 10:33:28 +00:00
JsonCpp to QTJson (Part 4) (#266)
* Update ActiveEffectDefinition.h * Update EffectDefinition.h * Update EffectEngine.h * Update Hyperion.h * Update LedDevice.h * Update QJsonFactory.h * Update QJsonSchemaChecker.h * Update Effect.cpp * Update Effect.h * Update EffectEngine.cpp * Update Hyperion.cpp * Update JsonClientConnection.cpp * Update JsonClientConnection.h * Update schema-config.json * Update LedDevice.cpp * Update QJsonSchemaChecker.cpp * Update hyperion-remote.cpp * Update JsonConnection.cpp * Update JsonConnection.h * Update hyperiond.cpp
This commit is contained in:
committed by
redPanther
parent
0a142b0e7d
commit
d9c2a2d91a
@@ -56,7 +56,7 @@ HyperionDaemon::HyperionDaemon(QString configFile, QObject *parent)
|
||||
|
||||
_hyperion = Hyperion::initInstance(_config, _qconfig, configFile.toStdString());
|
||||
|
||||
/*
|
||||
|
||||
if (Logger::getLogLevel() == Logger::WARNING)
|
||||
{
|
||||
if (_qconfig.contains("logger"))
|
||||
@@ -75,7 +75,7 @@ HyperionDaemon::HyperionDaemon(QString configFile, QObject *parent)
|
||||
{
|
||||
WarningIf(_qconfig.contains("logger"), Logger::getInstance("LOGGER"), "Logger settings overriden by command line argument");
|
||||
}
|
||||
*/
|
||||
|
||||
Info(_log, "Hyperion initialised");
|
||||
}
|
||||
|
||||
@@ -137,6 +137,7 @@ void HyperionDaemon::loadConfig(const QString & configFile)
|
||||
|
||||
QByteArray schema = schemaData.readAll();
|
||||
QJsonDocument schemaJson = QJsonDocument::fromJson(schema, &error);
|
||||
schemaData.close();
|
||||
|
||||
if (error.error != QJsonParseError::NoError)
|
||||
{
|
||||
@@ -214,12 +215,12 @@ void HyperionDaemon::startInitialEffect()
|
||||
}
|
||||
else if (! fgEffectConfig.isNull() && fgEffectConfig.isArray() && FGCONFIG_ARRAY.size() == 1 && FGCONFIG_ARRAY.at(0).isString())
|
||||
{
|
||||
const std::string fgEffectName = FGCONFIG_ARRAY.at(0).toString().toStdString();
|
||||
const QString fgEffectName = FGCONFIG_ARRAY.at(0).toString();
|
||||
int result = effectConfig.contains("foreground-effect-args")
|
||||
// ? hyperion->setEffect(fgEffectName, effectConfig["foreground-effect-args"], FG_PRIORITY, fg_duration_ms)
|
||||
? hyperion->setEffect(fgEffectName, _config["initialEffect"]["foreground-effect-args"], FG_PRIORITY, fg_duration_ms)
|
||||
? hyperion->setEffect(fgEffectName, _qconfig["initialEffect"].toObject()["foreground-effect-args"].toObject(), FG_PRIORITY, fg_duration_ms)
|
||||
: hyperion->setEffect(fgEffectName, FG_PRIORITY, fg_duration_ms);
|
||||
Info(_log,"Inital foreground effect '%s' %s", fgEffectName.c_str(), ((result == 0) ? "started" : "failed"));
|
||||
Info(_log,"Inital foreground effect '%s' %s", fgEffectName.toUtf8().constData(), ((result == 0) ? "started" : "failed"));
|
||||
}
|
||||
|
||||
// initial background effect/color
|
||||
@@ -236,12 +237,12 @@ void HyperionDaemon::startInitialEffect()
|
||||
}
|
||||
else if (! bgEffectConfig.isNull() && bgEffectConfig.isArray() && BGCONFIG_ARRAY.size() == 1 && BGCONFIG_ARRAY.at(0).isString())
|
||||
{
|
||||
const std::string bgEffectName = BGCONFIG_ARRAY.at(0).toString().toStdString();
|
||||
const QString bgEffectName = BGCONFIG_ARRAY.at(0).toString();
|
||||
int result = effectConfig.contains("background-effect-args")
|
||||
// ? hyperion->setEffect(bgEffectName, effectConfig["background-effect-args"], BG_PRIORITY, fg_duration_ms)
|
||||
? hyperion->setEffect(bgEffectName, _config["initialEffect"]["background-effect-args"], BG_PRIORITY, DURATION_INFINITY)
|
||||
? hyperion->setEffect(bgEffectName, _qconfig["initialEffect"].toObject()["background-effect-args"].toObject(), BG_PRIORITY, DURATION_INFINITY)
|
||||
: hyperion->setEffect(bgEffectName, BG_PRIORITY, DURATION_INFINITY);
|
||||
Info(_log,"Inital background effect '%s' %s", bgEffectName.c_str(), ((result == 0) ? "started" : "failed"));
|
||||
Info(_log,"Inital background effect '%s' %s", bgEffectName.toUtf8().constData(), ((result == 0) ? "started" : "failed"));
|
||||
}
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user