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:
@@ -30,7 +30,6 @@ add_executable(${PROJECT_NAME}
|
||||
)
|
||||
|
||||
target_link_libraries(${PROJECT_NAME}
|
||||
effectengine
|
||||
commandline
|
||||
hyperion-utils
|
||||
ssdp
|
||||
@@ -45,6 +44,10 @@ if (ENABLE_AMLOGIC)
|
||||
)
|
||||
endif()
|
||||
|
||||
if(ENABLE_EFFECTENGINE)
|
||||
target_link_libraries(${PROJECT_NAME} effectengine)
|
||||
endif()
|
||||
|
||||
if(APPLE)
|
||||
install ( TARGETS ${PROJECT_NAME} DESTINATION "." COMPONENT "hyperion_remote" )
|
||||
elseif(NOT WIN32)
|
||||
|
@@ -12,6 +12,8 @@
|
||||
#include <QHostInfo>
|
||||
#include <QUrl>
|
||||
|
||||
#include "HyperionConfig.h"
|
||||
|
||||
// hyperion-remote includes
|
||||
#include "JsonConnection.h"
|
||||
|
||||
@@ -106,6 +108,7 @@ void JsonConnection::setImage(QImage &image, int priority, int duration)
|
||||
parseReply(reply);
|
||||
}
|
||||
|
||||
#if defined(ENABLE_EFFECTENGINE)
|
||||
void JsonConnection::setEffect(const QString &effectName, const QString & effectArgs, int priority, int duration)
|
||||
{
|
||||
Debug(_log, "Start effect: %s", QSTRING_CSTR(effectName));
|
||||
@@ -185,6 +188,7 @@ void JsonConnection::deleteEffect(const QString &effectName)
|
||||
// parse reply message
|
||||
parseReply(reply);
|
||||
}
|
||||
#endif
|
||||
|
||||
QString JsonConnection::getServerInfoString()
|
||||
{
|
||||
|
@@ -49,6 +49,7 @@ public:
|
||||
///
|
||||
void setImage(QImage &image, int priority, int duration);
|
||||
|
||||
#if defined(ENABLE_EFFECTENGINE)
|
||||
///
|
||||
/// Start the given effect
|
||||
///
|
||||
@@ -74,6 +75,7 @@ public:
|
||||
/// @param effectName The name of the effect
|
||||
///
|
||||
void deleteEffect(const QString &effectName);
|
||||
#endif
|
||||
|
||||
///
|
||||
/// Retrieve entire serverinfo as String
|
||||
|
@@ -100,11 +100,13 @@ int main(int argc, char * argv[])
|
||||
IntOption & argDuration = parser.add<IntOption> ('d', "duration" , "Specify how long the LEDs should be switched on in milliseconds [default: infinity]");
|
||||
ColorsOption & argColor = parser.add<ColorsOption> ('c', "color" , "Set all LEDs to a constant color (either RRGGBB hex getColors or a color name. The color may be repeated multiple time like: RRGGBBRRGGBB)");
|
||||
ImageOption & argImage = parser.add<ImageOption> ('i', "image" , "Set the LEDs to the colors according to the given image file");
|
||||
#if defined(ENABLE_EFFECTENGINE)
|
||||
Option & argEffect = parser.add<Option> ('e', "effect" , "Enable the effect with the given name");
|
||||
Option & argEffectFile = parser.add<Option> (0x0, "effectFile" , "Arguments to use in combination with --createEffect");
|
||||
Option & argEffectArgs = parser.add<Option> (0x0, "effectArgs" , "Arguments to use in combination with the specified effect. Should be a JSON object string.", "");
|
||||
Option & argCreateEffect = parser.add<Option> (0x0, "createEffect" , "Write a new JSON Effect configuration file.\nFirst parameter = Effect name.\nSecond parameter = Effect file (--effectFile).\nLast parameter = Effect arguments (--effectArgs.)", "");
|
||||
Option & argDeleteEffect = parser.add<Option> (0x0, "deleteEffect" , "Delete a custom created JSON Effect configuration file.");
|
||||
#endif
|
||||
BooleanOption & argServerInfo = parser.add<BooleanOption>('l', "list" , "List server info and active effects with priority and duration");
|
||||
BooleanOption & argSysInfo = parser.add<BooleanOption>('s', "sysinfo" , "show system info");
|
||||
BooleanOption & argClear = parser.add<BooleanOption>('x', "clear" , "Clear data for the priority channel provided by the -p option");
|
||||
@@ -160,7 +162,10 @@ int main(int argc, char * argv[])
|
||||
|| parser.isSet(argBacklightThreshold) || parser.isSet(argBacklightColored);
|
||||
|
||||
// check that exactly one command was given
|
||||
int commandCount = count({ parser.isSet(argColor), parser.isSet(argImage), parser.isSet(argEffect), parser.isSet(argCreateEffect), parser.isSet(argDeleteEffect),
|
||||
int commandCount = count({ parser.isSet(argColor), parser.isSet(argImage),
|
||||
#if defined(ENABLE_EFFECTENGINE)
|
||||
parser.isSet(argEffect), parser.isSet(argCreateEffect), parser.isSet(argDeleteEffect),
|
||||
#endif
|
||||
parser.isSet(argServerInfo), parser.isSet(argSysInfo),parser.isSet(argClear), parser.isSet(argClearAll), parser.isSet(argEnableComponent), parser.isSet(argDisableComponent), colorAdjust,
|
||||
parser.isSet(argSource), parser.isSet(argSourceAuto), parser.isSet(argOff), parser.isSet(argOn), parser.isSet(argConfigGet), parser.isSet(argSchemaGet), parser.isSet(argConfigSet),
|
||||
parser.isSet(argMapping),parser.isSet(argVideoMode) });
|
||||
@@ -169,9 +174,11 @@ int main(int argc, char * argv[])
|
||||
qWarning() << (commandCount == 0 ? "No command found." : "Multiple commands found.") << " Provide exactly one of the following options:";
|
||||
showHelp(argColor);
|
||||
showHelp(argImage);
|
||||
#if defined(ENABLE_EFFECTENGINE)
|
||||
showHelp(argEffect);
|
||||
showHelp(argCreateEffect);
|
||||
showHelp(argDeleteEffect);
|
||||
#endif
|
||||
showHelp(argServerInfo);
|
||||
showHelp(argSysInfo);
|
||||
showHelp(argClear);
|
||||
@@ -247,6 +254,7 @@ int main(int argc, char * argv[])
|
||||
{
|
||||
connection.setImage(argImage.getImage(parser), argPriority.getInt(parser), argDuration.getInt(parser));
|
||||
}
|
||||
#if defined(ENABLE_EFFECTENGINE)
|
||||
else if (parser.isSet(argEffect))
|
||||
{
|
||||
connection.setEffect(argEffect.value(parser), argEffectArgs.value(parser), argPriority.getInt(parser), argDuration.getInt(parser));
|
||||
@@ -259,6 +267,7 @@ int main(int argc, char * argv[])
|
||||
{
|
||||
connection.deleteEffect(argDeleteEffect.value(parser));
|
||||
}
|
||||
#endif
|
||||
else if (parser.isSet(argServerInfo))
|
||||
{
|
||||
std::cout << "Server info:\n" << connection.getServerInfoString().toStdString() << std::endl;
|
||||
|
Reference in New Issue
Block a user