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:
LordGrey
2022-02-11 20:36:15 +01:00
committed by GitHub
parent 9e4b58d5c6
commit 5078688dc8
47 changed files with 1920 additions and 938 deletions

View File

@@ -224,6 +224,7 @@ void API::setVideoMode(VideoMode mode, hyperion::Components callerComp)
QMetaObject::invokeMethod(_hyperion, "setVideoMode", Qt::QueuedConnection, Q_ARG(VideoMode, mode));
}
#if defined(ENABLE_EFFECTENGINE)
bool API::setEffect(const EffectCmdData &dat, hyperion::Components callerComp)
{
int res;
@@ -238,6 +239,7 @@ bool API::setEffect(const EffectCmdData &dat, hyperion::Components callerComp)
return res >= 0;
}
#endif
void API::setSourceAutoSelect(bool state, hyperion::Components callerComp)
{
@@ -358,6 +360,7 @@ QString API::setInstanceName(quint8 index, const QString &name)
return NO_AUTH;
}
#if defined(ENABLE_EFFECTENGINE)
QString API::deleteEffect(const QString &name)
{
if (_adminAuthorized)
@@ -379,6 +382,7 @@ QString API::saveEffect(const QJsonObject &data)
}
return NO_AUTH;
}
#endif
bool API::saveSettings(const QJsonObject &data)
{

View File

@@ -185,12 +185,14 @@ proceed:
handleColorCommand(message, command, tan);
else if (command == "image")
handleImageCommand(message, command, tan);
#if defined(ENABLE_EFFECTENGINE)
else if (command == "effect")
handleEffectCommand(message, command, tan);
else if (command == "create-effect")
handleCreateEffectCommand(message, command, tan);
else if (command == "delete-effect")
handleDeleteEffectCommand(message, command, tan);
#endif
else if (command == "sysinfo")
handleSysInfoCommand(message, command, tan);
else if (command == "serverinfo")
@@ -275,6 +277,7 @@ void JsonAPI::handleImageCommand(const QJsonObject &message, const QString &comm
sendSuccessReply(command, tan);
}
#if defined(ENABLE_EFFECTENGINE)
void JsonAPI::handleEffectCommand(const QJsonObject &message, const QString &command, int tan)
{
emit forwardJsonMessage(message);
@@ -305,6 +308,7 @@ void JsonAPI::handleDeleteEffectCommand(const QJsonObject &message, const QStrin
const QString res = API::deleteEffect(message["name"].toString());
res.isEmpty() ? sendSuccessReply(command, tan) : sendErrorReply(res, command, tan);
}
#endif
void JsonAPI::handleSysInfoCommand(const QJsonObject &, const QString &command, int tan)
{
@@ -332,7 +336,9 @@ void JsonAPI::handleSysInfoCommand(const QJsonObject &, const QString &command,
system["domainName"] = data.domainName;
system["isUserAdmin"] = data.isUserAdmin;
system["qtVersion"] = data.qtVersion;
#if defined(ENABLE_EFFECTENGINE)
system["pyVersion"] = data.pyVersion;
#endif
info["system"] = system;
QJsonObject hyperion;
@@ -485,6 +491,7 @@ void JsonAPI::handleServerInfoCommand(const QJsonObject &message, const QString
info["adjustment"] = adjustmentArray;
#if defined(ENABLE_EFFECTENGINE)
// collect effect info
QJsonArray effects;
const std::list<EffectDefinition> &effectsDefinitions = _hyperion->getEffects();
@@ -499,6 +506,7 @@ void JsonAPI::handleServerInfoCommand(const QJsonObject &message, const QString
}
info["effects"] = effects;
#endif
// get available led devices
QJsonObject ledDevices;
@@ -596,6 +604,10 @@ void JsonAPI::handleServerInfoCommand(const QJsonObject &message, const QString
services.append("cec");
#endif
#if defined(ENABLE_EFFECTENGINE)
services.append("effectengine");
#endif
#if defined(ENABLE_FORWARDER)
services.append("forwarder");
#endif
@@ -701,6 +713,7 @@ void JsonAPI::handleServerInfoCommand(const QJsonObject &message, const QString
}
info["transform"] = transformArray;
#if defined(ENABLE_EFFECTENGINE)
// ACTIVE EFFECT INFO
QJsonArray activeEffects;
for (const ActiveEffectDefinition &activeEffectDefinition : _hyperion->getActiveEffects())
@@ -717,6 +730,7 @@ void JsonAPI::handleServerInfoCommand(const QJsonObject &message, const QString
}
}
info["activeEffects"] = activeEffects;
#endif
// ACTIVE STATIC LED COLOR
QJsonArray activeLedColors;
@@ -1036,6 +1050,7 @@ void JsonAPI::handleSchemaGetCommand(const QJsonObject &message, const QString &
alldevices = LedDeviceWrapper::getLedDeviceSchemas();
properties.insert("alldevices", alldevices);
#if defined(ENABLE_EFFECTENGINE)
// collect all available effect schemas
QJsonArray schemaList;
const std::list<EffectSchema>& effectsSchemas = _hyperion->getEffectSchemas();
@@ -1056,6 +1071,7 @@ void JsonAPI::handleSchemaGetCommand(const QJsonObject &message, const QString &
schemaList.append(schema);
}
properties.insert("effectSchemas", schemaList);
#endif
schemaJson.insert("properties", properties);

View File

@@ -39,7 +39,11 @@ JsonCB::JsonCB(QObject* parent)
, _prioMuxer(nullptr)
{
_availableCommands << "components-update" << "sessions-update" << "priorities-update" << "imageToLedMapping-update"
<< "adjustment-update" << "videomode-update" << "effects-update" << "settings-update" << "leds-update" << "instance-update" << "token-update";
<< "adjustment-update" << "videomode-update" << "settings-update" << "leds-update" << "instance-update" << "token-update";
#if defined(ENABLE_EFFECTENGINE)
_availableCommands << "effects-update";
#endif
}
bool JsonCB::subscribeFor(const QString& type, bool unsubscribe)
@@ -102,6 +106,7 @@ bool JsonCB::subscribeFor(const QString& type, bool unsubscribe)
connect(_hyperion, &Hyperion::newVideoMode, this, &JsonCB::handleVideoModeChange, Qt::UniqueConnection);
}
#if defined(ENABLE_EFFECTENGINE)
if(type == "effects-update")
{
if(unsubscribe)
@@ -109,6 +114,7 @@ bool JsonCB::subscribeFor(const QString& type, bool unsubscribe)
else
connect(_hyperion, &Hyperion::effectListUpdated, this, &JsonCB::handleEffectListChange, Qt::UniqueConnection);
}
#endif
if(type == "settings-update")
{
@@ -367,6 +373,7 @@ void JsonCB::handleVideoModeChange(VideoMode mode)
doCallback("videomode-update", QVariant(data));
}
#if defined(ENABLE_EFFECTENGINE)
void JsonCB::handleEffectListChange()
{
QJsonArray effectList;
@@ -384,6 +391,7 @@ void JsonCB::handleEffectListChange()
effects["effects"] = effectList;
doCallback("effects-update", QVariant(effects));
}
#endif
void JsonCB::handleSettingsChange(settings::type type, const QJsonDocument& data)
{