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
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
47 changed files with 1920 additions and 938 deletions

View File

@ -38,16 +38,6 @@ if ( CCACHE_FOUND )
set_property(GLOBAL PROPERTY RULE_LAUNCH_LINK ccache)
endif(CCACHE_FOUND)
if ("${CMAKE_VERSION}" VERSION_LESS "3.12.0")
set(Python_ADDITIONAL_VERSIONS 3.5)
find_package(PythonInterp 3.5 REQUIRED)
else()
find_package(Python3 3.5 COMPONENTS Interpreter Development REQUIRED)
if(Python3_FOUND)
set(PYTHON_EXECUTABLE ${Python3_EXECUTABLE})
endif()
endif()
# Set build variables
# Grabber
SET ( DEFAULT_AMLOGIC OFF )
@ -71,43 +61,47 @@ SET ( DEFAULT_FORWARDER ON )
SET ( DEFAULT_FLATBUF_CONNECT ON )
# LED-Devices
SET ( DEFAULT_SPIDEV OFF )
SET ( DEFAULT_TINKERFORGE OFF )
SET ( DEFAULT_USB_HID OFF )
SET ( DEFAULT_WS281XPWM OFF )
SET ( DEFAULT_DEV_NETWORK ON )
SET ( DEFAULT_DEV_SERIAL ON )
SET ( DEFAULT_DEV_SPI OFF )
SET ( DEFAULT_DEV_TINKERFORGE OFF )
SET ( DEFAULT_DEV_USB_HID OFF )
SET ( DEFAULT_DEV_WS281XPWM OFF )
# Services
SET ( DEFAULT_AVAHI ON )
SET ( DEFAULT_EFFECTENGINE ON )
SET ( DEFAULT_EXPERIMENTAL OFF )
# Build
SET ( DEFAULT_TESTS OFF )
SET ( DEFAULT_JSONCHECKS ON )
SET ( DEFAULT_DEPLOY_DEPENDENCIES ON )
SET ( DEFAULT_USE_SHARED_AVAHI_LIBS ON )
SET ( DEFAULT_USE_SYSTEM_FLATBUFFERS_LIBS OFF )
SET ( DEFAULT_USE_SYSTEM_PROTO_LIBS OFF )
SET ( DEFAULT_USE_SYSTEM_MBEDTLS_LIBS OFF )
SET ( DEFAULT_TESTS OFF )
# Build Hyperion with a reduced set of functionality, overwrites other default values
SET ( DEFAULT_HYPERION_LIGHT OFF )
IF ( ${CMAKE_SYSTEM} MATCHES "Linux" )
SET ( DEFAULT_FB ON )
SET ( DEFAULT_V4L2 ON )
SET ( DEFAULT_SPIDEV ON )
SET ( DEFAULT_TINKERFORGE ON )
SET ( DEFAULT_USB_HID ON )
SET ( DEFAULT_CEC ON )
SET ( DEFAULT_FB ON )
SET ( DEFAULT_V4L2 ON )
SET ( DEFAULT_DEV_SPIV ON )
SET ( DEFAULT_DEV_TINKERFORGE ON )
SET ( DEFAULT_DEV_USB_HID ON )
SET ( DEFAULT_CEC ON )
ELSEIF ( WIN32 )
SET ( DEFAULT_DX ON )
SET ( DEFAULT_MF ON )
ELSE()
SET ( DEFAULT_FB OFF )
SET ( DEFAULT_V4L2 OFF )
SET ( DEFAULT_SPIDEV OFF )
SET ( DEFAULT_TINKERFORGE OFF )
SET ( DEFAULT_USB_HID OFF )
SET ( DEFAULT_CEC OFF )
SET ( DEFAULT_FB OFF )
SET ( DEFAULT_V4L2 OFF )
SET ( DEFAULT_DEV_SPI OFF )
SET ( DEFAULT_DEV_TINKERFORGE OFF )
SET ( DEFAULT_DEV_USB_HID OFF )
SET ( DEFAULT_CEC OFF )
ENDIF()
if ( NOT DEFINED PLATFORM )
@ -158,10 +152,10 @@ if ( "${PLATFORM}" MATCHES "osx" )
include_directories("/opt/X11/include/")
SET ( DEFAULT_OSX ON )
SET ( DEFAULT_USB_HID ON )
SET ( DEFAULT_DEV_USB_HID ON )
elseif ( "${PLATFORM}" MATCHES "rpi" )
SET ( DEFAULT_DISPMANX ON )
SET ( DEFAULT_WS281XPWM ON )
SET ( DEFAULT_DEV_WS281XPWM ON )
elseif ( "${PLATFORM}" STREQUAL "amlogic" )
SET ( DEFAULT_AMLOGIC ON )
elseif ( "${PLATFORM}" STREQUAL "amlogic-dev" )
@ -176,7 +170,7 @@ elseif ( "${PLATFORM}" MATCHES "x11" )
SET ( DEFAULT_XCB ON )
if ( "${PLATFORM}" STREQUAL "x11-dev" )
SET ( DEFAULT_AMLOGIC ON)
SET ( DEFAULT_WS281XPWM ON )
SET ( DEFAULT_DEV_WS281XPWM ON )
endif()
elseif ( "${PLATFORM}" STREQUAL "imx6" )
SET ( DEFAULT_FB ON )
@ -221,6 +215,9 @@ if (HYPERION_LIGHT)
# Disable Output Connectors
SET ( DEFAULT_FORWARDER OFF )
SET ( DEFAULT_FLATBUF_CONNECT OFF )
# Disable Services
SET ( DEFAULT_EFFECTENGINE OFF )
endif()
message(STATUS "Grabber options:")
@ -298,23 +295,32 @@ removeIndent()
message(STATUS "LED-Device options:")
addIndent(" - ")
option(ENABLE_SPIDEV "Enable the SPIDEV device" ${DEFAULT_SPIDEV} )
message(STATUS "ENABLE_SPIDEV = ${ENABLE_SPIDEV}")
option(ENABLE_DEV_NETWORK "Enable the Network devices" ${DEFAULT_DEV_NETWORK} )
message(STATUS "DEFAULT_DEV_NETWORK = ${DEFAULT_DEV_NETWORK}")
option(ENABLE_TINKERFORGE "Enable the TINKERFORGE device" ${DEFAULT_TINKERFORGE})
message(STATUS "ENABLE_TINKERFORGE = ${ENABLE_TINKERFORGE}")
option(ENABLE_DEV_SERIAL "Enable the Serial devices" ${DEFAULT_DEV_SERIAL} )
message(STATUS "DEFAULT_DEV_SERIAL = ${DEFAULT_DEV_SERIAL}")
option(ENABLE_USB_HID "Enable the libusb and hid devices" ${DEFAULT_USB_HID} )
message(STATUS "ENABLE_USB_HID = ${ENABLE_USB_HID}")
option(ENABLE_DEV_SPI "Enable the SPI device" ${DEFAULT_DEV_SPI} )
message(STATUS "ENABLE_DEV_SPI = ${ENABLE_DEV_SPI}")
option(ENABLE_WS281XPWM "Enable the WS281x-PWM device" ${DEFAULT_WS281XPWM} )
message(STATUS "ENABLE_WS281XPWM = ${ENABLE_WS281XPWM}")
option(ENABLE_DEV_TINKERFORGE "Enable the TINKERFORGE device" ${DEFAULT_DEV_TINKERFORGE})
message(STATUS "ENABLE_DEV_TINKERFORGE = ${ENABLE_DEV_TINKERFORGE}")
option(ENABLE_DEV_USB_HID "Enable the libusb and hid devices" ${DEFAULT_DEV_USB_HID} )
message(STATUS "ENABLE_DEV_USB_HID = ${ENABLE_DEV_USB_HID}")
option(ENABLE_DEV_WS281XPWM "Enable the WS281x-PWM device" ${DEFAULT_DEV_WS281XPWM} )
message(STATUS "ENABLE_DEV_WS281XPWM = ${ENABLE_DEV_WS281XPWM}")
removeIndent()
message(STATUS "Services options:")
addIndent(" - ")
option(ENABLE_EFFECTENGINE "Enable Effect-Engine" ${DEFAULT_EFFECTENGINE})
message(STATUS "ENABLE_EFFECTENGINE = " ${ENABLE_EFFECTENGINE})
option(ENABLE_AVAHI "Enable Zeroconf" ${DEFAULT_AVAHI})
message(STATUS "ENABLE_AVAHI = " ${ENABLE_AVAHI})
@ -326,11 +332,8 @@ removeIndent()
message(STATUS "Build options:")
addIndent(" - ")
option(ENABLE_TESTS "Compile additional test applications" ${DEFAULT_TESTS})
message(STATUS "ENABLE_TESTS = ${ENABLE_TESTS}")
option(ENABLE_PROFILER "enable profiler capabilities - not for release code" OFF)
message(STATUS "ENABLE_PROFILER = ${ENABLE_PROFILER}")
option(ENABLE_JSONCHECKS "Validate json schema files" ${DEFAULT_JSONCHECKS})
message(STATUS "ENABLE_JSONCHECKS = ${ENABLE_JSONCHECKS}")
option(ENABLE_DEPLOY_DEPENDENCIES "Deploy with dependencies" ${DEFAULT_DEPLOY_DEPENDENCIES})
message(STATUS "ENABLE_DEPLOY_DEPENDENCIES = ${ENABLE_DEPLOY_DEPENDENCIES}")
@ -342,6 +345,12 @@ message(STATUS "DEFAULT_USE_SYSTEM_FLATBUFFERS_LIBS = ${DEFAULT_USE_SYSTEM_FLATB
message(STATUS "DEFAULT_USE_SYSTEM_MBEDTLS_LIBS = ${DEFAULT_USE_SYSTEM_MBEDTLS_LIBS}")
message(STATUS "DEFAULT_USE_SYSTEM_PROTO_LIBS = ${DEFAULT_USE_SYSTEM_PROTO_LIBS}")
option(ENABLE_PROFILER "enable profiler capabilities - not for release code" OFF)
message(STATUS "ENABLE_PROFILER = ${ENABLE_PROFILER}")
option(ENABLE_TESTS "Compile additional test applications" ${DEFAULT_TESTS})
message(STATUS "ENABLE_TESTS = ${ENABLE_TESTS}")
removeIndent()
SET ( FLATBUFFERS_INSTALL_BIN_DIR ${CMAKE_BINARY_DIR}/flatbuf )
@ -350,40 +359,53 @@ SET ( FLATBUFFERS_INSTALL_LIB_DIR ${CMAKE_BINARY_DIR}/flatbuf )
SET ( PROTOBUF_INSTALL_BIN_DIR ${CMAKE_BINARY_DIR}/proto )
SET ( PROTOBUF_INSTALL_LIB_DIR ${CMAKE_BINARY_DIR}/proto )
# check all json files
FILE ( GLOB_RECURSE HYPERION_SCHEMAS RELATIVE ${CMAKE_SOURCE_DIR} ${CMAKE_SOURCE_DIR}/libsrc/*schema*.json )
SET( JSON_FILES ${CMAKE_BINARY_DIR}/config/hyperion.config.json.default ${HYPERION_SCHEMAS})
if(ENABLE_JSONCHECKS OR ENABLE_EFFECTENGINE)
if ("${CMAKE_VERSION}" VERSION_LESS "3.12.0")
set(Python_ADDITIONAL_VERSIONS 3.5)
find_package(PythonInterp 3.5 REQUIRED)
else()
find_package(Python3 3.5 COMPONENTS Interpreter Development REQUIRED)
if(Python3_FOUND)
set(PYTHON_EXECUTABLE ${Python3_EXECUTABLE})
endif()
endif()
endif()
EXECUTE_PROCESS (
COMMAND ${PYTHON_EXECUTABLE} test/jsonchecks/checkjson.py ${JSON_FILES}
WORKING_DIRECTORY ${CMAKE_SOURCE_DIR}
RESULT_VARIABLE CHECK_JSON_FAILED
)
IF ( ${CHECK_JSON_FAILED} )
MESSAGE (FATAL_ERROR "check of json files failed" )
ENDIF ()
if(ENABLE_JSONCHECKS)
# check all json files
FILE ( GLOB_RECURSE HYPERION_SCHEMAS RELATIVE ${CMAKE_SOURCE_DIR} ${CMAKE_SOURCE_DIR}/libsrc/*schema*.json )
SET( JSON_FILES ${CMAKE_BINARY_DIR}/config/hyperion.config.json.default ${HYPERION_SCHEMAS})
EXECUTE_PROCESS (
COMMAND ${PYTHON_EXECUTABLE} test/jsonchecks/checkeffects.py effects effects/schema
WORKING_DIRECTORY ${CMAKE_SOURCE_DIR}
RESULT_VARIABLE CHECK_EFFECTS_FAILED
)
IF ( ${CHECK_EFFECTS_FAILED} )
MESSAGE (FATAL_ERROR "check of json effect files failed" )
ENDIF ()
# for python 3 the checkschema.py file must be rewritten
# TODO on windows it can't resolve the path inside the file (Das System kann den angegebenen Pfad nicht finden: '\\schema\\schema-general.json')
IF (NOT WIN32)
EXECUTE_PROCESS (
COMMAND python test/jsonchecks/checkschema.py ${CMAKE_BINARY_DIR}/config/hyperion.config.json.default libsrc/hyperion/hyperion.schema.json
COMMAND ${PYTHON_EXECUTABLE} test/jsonchecks/checkjson.py ${JSON_FILES}
WORKING_DIRECTORY ${CMAKE_SOURCE_DIR}
RESULT_VARIABLE CHECK_JSON_FAILED
)
IF ( ${CHECK_JSON_FAILED} )
MESSAGE (FATAL_ERROR "check of json files failed" )
ENDIF ()
if(ENABLE_EFFECTENGINE)
EXECUTE_PROCESS (
COMMAND ${PYTHON_EXECUTABLE} test/jsonchecks/checkeffects.py effects effects/schema
WORKING_DIRECTORY ${CMAKE_SOURCE_DIR}
RESULT_VARIABLE CHECK_EFFECTS_FAILED
)
IF ( ${CHECK_EFFECTS_FAILED} )
MESSAGE (FATAL_ERROR "check of json effect files failed" )
ENDIF ()
endif()
EXECUTE_PROCESS (
COMMAND ${PYTHON_EXECUTABLE} test/jsonchecks/checkschema.py ${CMAKE_BINARY_DIR}/config/hyperion.config.json.default libsrc/hyperion/hyperion.schema.json
WORKING_DIRECTORY ${CMAKE_SOURCE_DIR}
RESULT_VARIABLE CHECK_CONFIG_FAILED
)
ENDIF()
IF ( ${CHECK_CONFIG_FAILED} )
MESSAGE (FATAL_ERROR "check of json default config failed" )
ENDIF ()
IF ( ${CHECK_CONFIG_FAILED} )
MESSAGE (FATAL_ERROR "check of json default config failed" )
ENDIF ()
endif(ENABLE_JSONCHECKS)
# Add project specific cmake modules (find, etc)
set(CMAKE_MODULE_PATH ${CMAKE_MODULE_PATH} ${CMAKE_CURRENT_SOURCE_DIR}/cmake)
@ -481,7 +503,7 @@ endif()
message( STATUS "CMAKE_PREFIX_PATH used: ${CMAKE_PREFIX_PATH}" )
# find QT libs
find_package(QT NAMES Qt6 Qt5 COMPONENTS Core Gui Network SerialPort Sql Widgets REQUIRED)
find_package(QT NAMES Qt6 Qt5 COMPONENTS Core Gui Network Sql Widgets REQUIRED)
message( STATUS "Found Qt Version: ${QT_VERSION}" )
if (${QT_VERSION_MAJOR} GREATER_EQUAL 6 )
@ -494,7 +516,7 @@ IF ( "${QT_VERSION}" VERSION_LESS "${QT_MIN_VERSION}" )
message( FATAL_ERROR "Your Qt version is to old! Minimum required ${QT_MIN_VERSION}" )
ENDIF()
find_package(Qt${QT_VERSION_MAJOR} ${QT_VERSION} COMPONENTS Core Gui Network SerialPort Sql Widgets REQUIRED)
find_package(Qt${QT_VERSION_MAJOR} ${QT_VERSION} COMPONENTS Core Gui Network Sql Widgets REQUIRED)
message( STATUS "Qt version used: ${QT_VERSION}" )
@ -519,10 +541,16 @@ add_subdirectory(resources)
# remove generated files on make cleaan too
LIST( APPEND GENERATED_QRC
${CMAKE_BINARY_DIR}/EffectEngine.qrc
${CMAKE_BINARY_DIR}/WebConfig.qrc
${CMAKE_BINARY_DIR}/HyperionConfig.h
)
if(ENABLE_EFFECTENGINE)
LIST( APPEND GENERATED_QRC
${CMAKE_BINARY_DIR}/EffectEngine.qrc
)
endif ()
set_directory_properties(PROPERTIES ADDITIONAL_MAKE_CLEAN_FILES "${GENERATED_QRC}" )
# enable C++11; MSVC doesn't have c++11 feature switch

View File

@ -51,21 +51,30 @@
// Define to enable protocol buffer connect
#cmakedefine ENABLE_PROTOBUF_CONNECT
// Define to enable the SPI-Device
#cmakedefine ENABLE_SPIDEV
// Define to enable the network devices
#cmakedefine ENABLE_DEV_NETWORK
// Define to enable the Tinkerforge device
#cmakedefine ENABLE_TINKERFORGE
// Define to enable the Serial devices
#cmakedefine ENABLE_DEV_SERIAL
// Define to enable the SPI devices
#cmakedefine ENABLE_DEV_SPI
// Define to enable the Tinkerforge devices
#cmakedefine ENABLE_DEV_TINKERFORGE
// Define to enable the USB / HID devices
#cmakedefine ENABLE_USB_HID
#cmakedefine ENABLE_DEV_USB_HID
// Define to enable the WS281x-PWM-via-DMA-device using jgarff's library
#cmakedefine ENABLE_WS281XPWM
#cmakedefine ENABLE_DEV_WS281XPWM
// Define to enable AVAHI
#cmakedefine ENABLE_AVAHI
// Define to enable EFFECTENGINE
#cmakedefine ENABLE_EFFECTENGINE
// Define to enable experimental features
#cmakedefine ENABLE_EXPERIMENTAL

View File

@ -1,106 +1,107 @@
<div class="container-fluid">
<h3 class="page-header"><i class="fa fa-wifi fa-fw"></i><span data-i18n="main_menu_remotecontrol_token">Remote Control</span></h3>
<h3 class="page-header"><i class="fa fa-wifi fa-fw"></i><span data-i18n="main_menu_remotecontrol_token">Remote Control</span></h3>
<div class="panel panel-default" style="border:0px;">
<div class="panel-heading panel-instance" style="border-radius:3px; border-bottom:0px;">
<div class="dropdown">
<a id="active_instance_dropdown" class="dropdown-toggle" data-toggle="dropdown" href="#" style="text-decoration:none;display:flex;align-items:center;">
<div id="active_instance_friendly_name"></div>
<div id="btn_hypinstanceswitch" style="white-space:nowrap;"><span class="mdi mdi-lightbulb-group mdi-24px" style="margin-right:0; margin-left:5px;"></span><span class="mdi mdi-menu-down mdi-24px"></span></div>
</a>
<ul id="hyp_inst_listing" class="dropdown-menu dropdown-alerts" style="cursor:pointer;"></ul>
</div>
</div>
</div>
<div class="panel panel-default" style="border:0px;">
<div class="panel-heading panel-instance" style="border-radius:3px; border-bottom:0px;">
<div class="dropdown">
<a id="active_instance_dropdown" class="dropdown-toggle" data-toggle="dropdown" href="#" style="text-decoration:none;display:flex;align-items:center;">
<div id="active_instance_friendly_name"></div>
<div id="btn_hypinstanceswitch" style="white-space:nowrap;"><span class="mdi mdi-lightbulb-group mdi-24px" style="margin-right:0; margin-left:5px;"></span><span class="mdi mdi-menu-down mdi-24px"></span></div>
</a>
<ul id="hyp_inst_listing" class="dropdown-menu dropdown-alerts" style="cursor:pointer;"></ul>
</div>
</div>
</div>
<div class="row">
<div class="col-md-12 col-lg-8 col-xxl-8">
<div class="panel panel-default">
<div class="panel-heading"><i class="fa fa-wifi fa-fw"></i><span data-i18n="remote_input_label">Source selection</span></div>
<div class="panel-body">
<div id="sstcont"></div>
<div id="auto_btn"></div>
</div>
</div>
</div>
<div class="row">
<div class="col-md-12 col-lg-8 col-xxl-8">
<div class="panel panel-default">
<div class="panel-heading"><i class="fa fa-wifi fa-fw"></i><span data-i18n="remote_input_label">Source selection</span></div>
<div class="panel-body">
<div id="sstcont"></div>
<div id="auto_btn"></div>
</div>
</div>
</div>
<div class="col-md-6 col-lg-4 col-xxl-4">
<div class="panel panel-default">
<div class="panel-heading"><i class="fa fa-wifi fa-fw"></i><span data-i18n="remote_components_label">Components control</span></div>
<div class="panel-body" id="comp_intro">
<div id="componentsbutton"></div>
</div>
</div>
</div>
</div>
<div class="col-md-6 col-lg-4 col-xxl-4">
<div class="panel panel-default">
<div class="panel-heading"><i class="fa fa-wifi fa-fw"></i><span data-i18n="remote_components_label">Components control</span></div>
<div class="panel-body" id="comp_intro">
<div id="componentsbutton"></div>
</div>
</div>
</div>
</div>
<div class="row">
<div class="col-md-6 col-lg-6 col-xxl-4">
<div class="panel panel-default">
<div class="panel-heading"><i class="fa fa-wifi fa-fw"></i><span data-i18n="remote_color_label">Colors/Effects</span></div>
<div class="panel-body" id="color_intro">
<table class="table borderless">
<tbody>
<tr>
<td style="vertical-align:middle"><label for="cpeff" data-i18n="remote_color_label_color"></label></td>
<td>
<div id="cp2" class="colorpicker-component input-group">
<input type="text" id="cpeff" class="form-control" />
<span class="input-group-addon"><i></i></span>
<span class="input-group-addon" id="remote_input_rescol" title="Repeat Color" style="cursor:pointer"><i class="fa fa-repeat"></i></span>
</div>
</td>
</tr>
<tr>
<td style="vertical-align:middle"><label for="effect_select" data-i18n="remote_effects_label_effects">Effect:</label></td>
<td class="input-group">
<select id="effect_select" class="form-control"></select>
<span class="input-group-addon" id="remote_input_reseff" title="Repeat Effect" style="cursor:pointer"><i class="fa fa-repeat"></i></span>
</td>
</tr>
<tr>
<td style="vertical-align:middle"><label for="remote_input_img" data-i18n="remote_effects_label_picture">Picture:</label></td>
<td class="input-group custom-file">
<input class="form-control" id="remote_input_img" type="file" accept="image/*" />
<span class="input-group-addon" id="remote_input_repimg" title="Repeat Image" style="cursor:pointer"><i class="fa fa-repeat"></i></span>
</td>
</tr>
<tr>
<td style="vertical-align:middle"><label for="remote_duration" data-i18n="remote_input_duration"></label></td>
<td class="input-group">
<input id="remote_duration" type="number" class="form-control" value="0" min="0" />
<span class="input-group-addon" data-i18n="edt_append_s"></span>
</td>
</tr>
</tbody>
</table>
<button data-i18n="remote_color_button_reset" type="button" class="btn btn-primary" id="reset_color" style="margin-top:10px;">Reset Color/Effect</button>
</div>
</div>
</div>
<div class="col-md-6 col-lg-6 col-xxl-3">
<div class="panel panel-default">
<div class="panel-heading"><i class="fa fa-wifi fa-fw"></i><span data-i18n="remote_maptype_label">Mapping types</span></div>
<div class="panel-body" id="maptype_intro">
<div id="mappingsbutton"></div>
</div>
</div>
</div>
<div class="col-md-6 col-lg-6 col-xxl-5">
<div class="panel panel-default">
<div class="panel-heading"><i class="fa fa-wifi fa-fw"></i><span data-i18n="remote_videoMode_label"></span></div>
<div class="panel-body" id="videomode_intro">
<div id="videomodebtns"></div>
</div>
</div>
</div>
<div class="col-md-6 col-lg-6 col-xxl-5">
<div class="panel panel-default">
<div class="panel-heading"><i class="fa fa-wifi fa-fw"></i><span data-i18n="remote_adjustment_label"></span></div>
<div class="panel-body" id="adjust_content">
</div>
</div>
</div>
</div>
<div class="row">
<div class="col-md-6 col-lg-6 col-xxl-4">
<div class="panel panel-default">
<div class="panel-heading"><i class="fa fa-wifi fa-fw"></i><span data-i18n="remote_color_label">Colors/Effects</span></div>
<div class="panel-body" id="color_intro">
<table class="table borderless">
<tbody>
<tr>
<td style="vertical-align:middle"><label for="cpeff" data-i18n="remote_color_label_color"></label></td>
<td>
<div id="cp2" class="colorpicker-component input-group">
<input type="text" id="cpeff" class="form-control" />
<span class="input-group-addon"><i></i></span>
<span class="input-group-addon" id="remote_input_rescol" title="Repeat Color" style="cursor:pointer"><i class="fa fa-repeat"></i></span>
</div>
</td>
</tr>
<tr id="effect_row">
<td style="vertical-align:middle"><label for="effect_select" data-i18n="remote_effects_label_effects">Effect:</label></td>
<td class="input-group">
<select id="effect_select" class="form-control"></select>
<span class="input-group-addon" id="remote_input_reseff" title="Repeat Effect" style="cursor:pointer"><i class="fa fa-repeat"></i></span>
</td>
</tr>
<tr>
<td style="vertical-align:middle"><label for="remote_input_img" data-i18n="remote_effects_label_picture">Picture:</label></td>
<td class="input-group custom-file">
<input class="form-control" id="remote_input_img" type="file" accept="image/*" />
<span class="input-group-addon" id="remote_input_repimg" title="Repeat Image" style="cursor:pointer"><i class="fa fa-repeat"></i></span>
</td>
</tr>
<tr>
<td style="vertical-align:middle"><label for="remote_duration" data-i18n="remote_input_duration"></label></td>
<td class="input-group">
<input id="remote_duration" type="number" class="form-control" value="0" min="0" />
<span class="input-group-addon" data-i18n="edt_append_s"></span>
</td>
</tr>
</tbody>
</table>
<button data-i18n="remote_color_button_reset" type="button" class="btn btn-primary" id="reset_color" style="margin-top:10px;">Reset Color/Effect</button>
</div>
</div>
</div>
<div class="col-md-6 col-lg-6 col-xxl-3">
<div class="panel panel-default">
<div class="panel-heading"><i class="fa fa-wifi fa-fw"></i><span data-i18n="remote_maptype_label">Mapping types</span></div>
<div class="panel-body" id="maptype_intro">
<div id="mappingsbutton"></div>
</div>
</div>
</div>
<div class="col-md-6 col-lg-6 col-xxl-5">
<div class="panel panel-default">
<div class="panel-heading"><i class="fa fa-wifi fa-fw"></i><span data-i18n="remote_videoMode_label"></span></div>
<div class="panel-body" id="videomode_intro">
<div id="videomodebtns"></div>
</div>
</div>
</div>
<div class="col-md-6 col-lg-6 col-xxl-5">
<div class="panel panel-default">
<div class="panel-heading"><i class="fa fa-wifi fa-fw"></i><span data-i18n="remote_adjustment_label"></span></div>
<div class="panel-body" id="adjust_content">
</div>
</div>
</div>
</div>
</div>
<script src="/js/content_remote.js" ></script>
<script src="/js/content_remote.js"></script>

View File

@ -222,7 +222,7 @@
<li> <a class="inactive mnava" id="MenuItemGrabber" href="#conf_grabber"><i class="fa fa-camera fa-fw"></i><span data-i18n="main_menu_grabber_conf_token">Capturing Hardware</span></a> </li>
<li> <a class="inactive mnava" id="MenuItemNetwork" href="#conf_network"><i class="fa fa-sitemap fa-fw"></i><span data-i18n="main_menu_network_conf_token">Network</span></a> </li>
<li> <a class="inactive mnava" href="#remote"><i class="fa fa-wifi fa-fw"></i><span data-i18n="main_menu_remotecontrol_token">Remote Control</span></a> </li>
<li> <a class="inactive mnava" href="#effects_configurator"><i class="fa fa-cogs fa-fw"></i><span data-i18n="main_menu_effectsconfigurator_token">Effects Configurator</span></a> </li>
<li> <a class="inactive mnava" id="MenuItemEffectsConfig" href="#effects_configurator"><i class="fa fa-cogs fa-fw"></i><span data-i18n="main_menu_effectsconfigurator_token">Effects Configurator</span></a> </li>
<li> <a class="inactive mnava" href="#support"><i class="fa fa-info fa-fw"></i><span data-i18n="main_menu_support_token">Support</span></a> </li>
<li>
<a class="inactive"><i class="fa fa-industry fa-fw"></i><span data-i18n="main_menu_system_token">System</span><span class="fa arrow"></span></a>

View File

@ -1,72 +1,89 @@
$(document).ready( function() {
performTranslation();
$(document).ready(function () {
performTranslation();
// update instance listing
updateHyperionInstanceListing();
var EFFECTENGINE_ENABLED = (jQuery.inArray("effectengine", window.serverInfo.services) !== -1);
var oldEffects = [];
var effects_editor = null;
var confFgEff = window.serverConfig.foregroundEffect.effect;
var confBgEff = window.serverConfig.backgroundEffect.effect;
var foregroundEffect_editor = null;
var backgroundEffect_editor = null;
// update instance listing
updateHyperionInstanceListing();
if(window.showOptHelp)
{
//foreground effect
$('#conf_cont').append(createRow('conf_cont_fge'));
$('#conf_cont_fge').append(createOptPanel('fa-spinner', $.i18n("edt_conf_fge_heading_title"), 'editor_container_foregroundEffect', 'btn_submit_foregroundEffect'));
var oldEffects = [];
var effects_editor = null;
var confFgEff = window.serverConfig.foregroundEffect.effect;
var confBgEff = window.serverConfig.backgroundEffect.effect;
var foregroundEffect_editor = null;
var backgroundEffect_editor = null;
if (!EFFECTENGINE_ENABLED) {
window.schema.foregroundEffect.properties.type.enum.splice(1, 1);
window.schema.foregroundEffect.properties.type.options.enum_titles.splice(1, 1);
window.schema.foregroundEffect.properties.type.default = "color";
delete window.schema.foregroundEffect.properties.effect;
window.schema.backgroundEffect.properties.type.enum.splice(1, 1);
window.schema.backgroundEffect.properties.type.options.enum_titles.splice(1, 1);
window.schema.backgroundEffect.properties.type.default = "color";
delete window.schema.backgroundEffect.properties.effect;
}
if (window.showOptHelp) {
//foreground effect
$('#conf_cont').append(createRow('conf_cont_fge'));
$('#conf_cont_fge').append(createOptPanel('fa-spinner', $.i18n("edt_conf_fge_heading_title"), 'editor_container_foregroundEffect', 'btn_submit_foregroundEffect'));
$('#conf_cont_fge').append(createHelpTable(window.schema.foregroundEffect.properties, $.i18n("edt_conf_fge_heading_title"), "foregroundEffectHelpPanelId"));
//background effect
$('#conf_cont').append(createRow('conf_cont_bge'));
$('#conf_cont_bge').append(createOptPanel('fa-spinner', $.i18n("edt_conf_bge_heading_title"), 'editor_container_backgroundEffect', 'btn_submit_backgroundEffect'));
//background effect
$('#conf_cont').append(createRow('conf_cont_bge'));
$('#conf_cont_bge').append(createOptPanel('fa-spinner', $.i18n("edt_conf_bge_heading_title"), 'editor_container_backgroundEffect', 'btn_submit_backgroundEffect'));
$('#conf_cont_bge').append(createHelpTable(window.schema.backgroundEffect.properties, $.i18n("edt_conf_bge_heading_title"), "backgroundEffectHelpPanelId"));
//effect path
if(storedAccess != 'default')
{
$('#conf_cont').append(createRow('conf_cont_ef'));
$('#conf_cont_ef').append(createOptPanel('fa-spinner', $.i18n("edt_conf_effp_heading_title"), 'editor_container_effects', 'btn_submit_effects'));
$('#conf_cont_ef').append(createHelpTable(window.schema.effects.properties, $.i18n("edt_conf_effp_heading_title")));
}
}
else
{
$('#conf_cont').addClass('row');
$('#conf_cont').append(createOptPanel('fa-spinner', $.i18n("edt_conf_fge_heading_title"), 'editor_container_foregroundEffect', 'btn_submit_foregroundEffect'));
$('#conf_cont').append(createOptPanel('fa-spinner', $.i18n("edt_conf_bge_heading_title"), 'editor_container_backgroundEffect', 'btn_submit_backgroundEffect'));
if(storedAccess != 'default')
$('#conf_cont').append(createOptPanel('fa-spinner', $.i18n("edt_conf_effp_heading_title"), 'editor_container_effects', 'btn_submit_effects'));
}
if (EFFECTENGINE_ENABLED) {
//effect path
if (storedAccess != 'default') {
$('#conf_cont').append(createRow('conf_cont_ef'));
$('#conf_cont_ef').append(createOptPanel('fa-spinner', $.i18n("edt_conf_effp_heading_title"), 'editor_container_effects', 'btn_submit_effects'));
$('#conf_cont_ef').append(createHelpTable(window.schema.effects.properties, $.i18n("edt_conf_effp_heading_title")));
}
}
}
else {
$('#conf_cont').addClass('row');
$('#conf_cont').append(createOptPanel('fa-spinner', $.i18n("edt_conf_fge_heading_title"), 'editor_container_foregroundEffect', 'btn_submit_foregroundEffect'));
$('#conf_cont').append(createOptPanel('fa-spinner', $.i18n("edt_conf_bge_heading_title"), 'editor_container_backgroundEffect', 'btn_submit_backgroundEffect'));
if (EFFECTENGINE_ENABLED) {
if (storedAccess != 'default')
$('#conf_cont').append(createOptPanel('fa-spinner', $.i18n("edt_conf_effp_heading_title"), 'editor_container_effects', 'btn_submit_effects'));
}
}
if(storedAccess != 'default')
{
effects_editor = createJsonEditor('editor_container_effects', {
effects : window.schema.effects
}, true, true);
if (EFFECTENGINE_ENABLED) {
if (storedAccess != 'default') {
effects_editor = createJsonEditor('editor_container_effects', {
effects: window.schema.effects
}, true, true);
effects_editor.on('change',function() {
effects_editor.validate().length || window.readOnlyMode ? $('#btn_submit_effects').attr('disabled', true) : $('#btn_submit_effects').attr('disabled', false);
});
effects_editor.on('change', function () {
effects_editor.validate().length || window.readOnlyMode ? $('#btn_submit_effects').attr('disabled', true) : $('#btn_submit_effects').attr('disabled', false);
});
$('#btn_submit_effects').off().on('click',function() {
requestWriteConfig(effects_editor.getValue());
});
}
$('#btn_submit_effects').off().on('click', function () {
requestWriteConfig(effects_editor.getValue());
});
}
}
foregroundEffect_editor = createJsonEditor('editor_container_foregroundEffect', {
foregroundEffect : window.schema.foregroundEffect
}, true, true);
foregroundEffect_editor = createJsonEditor('editor_container_foregroundEffect', {
foregroundEffect: window.schema.foregroundEffect
}, true, true);
backgroundEffect_editor = createJsonEditor('editor_container_backgroundEffect', {
backgroundEffect : window.schema.backgroundEffect
}, true, true);
backgroundEffect_editor = createJsonEditor('editor_container_backgroundEffect', {
backgroundEffect: window.schema.backgroundEffect
}, true, true);
foregroundEffect_editor.on('ready',function() {
updateEffectlist();
});
foregroundEffect_editor.on('ready', function () {
if (EFFECTENGINE_ENABLED) {
updateEffectlist();
}
});
foregroundEffect_editor.on('change', function () {
var foregroundEffectEnable = foregroundEffect_editor.getEditor("root.foregroundEffect.enable").getValue();
@ -79,8 +96,8 @@ $(document).ready( function() {
$('#foregroundEffectHelpPanelId').hide();
}
foregroundEffect_editor.validate().length || window.readOnlyMode ? $('#btn_submit_foregroundEffect').attr('disabled', true) : $('#btn_submit_foregroundEffect').attr('disabled', false);
});
foregroundEffect_editor.validate().length || window.readOnlyMode ? $('#btn_submit_foregroundEffect').attr('disabled', true) : $('#btn_submit_foregroundEffect').attr('disabled', false);
});
backgroundEffect_editor.on('change', function () {
var backgroundEffectEnable = backgroundEffect_editor.getEditor("root.backgroundEffect.enable").getValue();
@ -93,62 +110,62 @@ $(document).ready( function() {
$('#backgroundEffectHelpPanelId').hide();
}
backgroundEffect_editor.validate().length || window.readOnlyMode ? $('#btn_submit_backgroundEffect').attr('disabled', true) : $('#btn_submit_backgroundEffect').attr('disabled', false);
});
backgroundEffect_editor.validate().length || window.readOnlyMode ? $('#btn_submit_backgroundEffect').attr('disabled', true) : $('#btn_submit_backgroundEffect').attr('disabled', false);
});
$('#btn_submit_foregroundEffect').off().on('click',function() {
var value = foregroundEffect_editor.getValue();
if(typeof value.foregroundEffect.effect == 'undefined')
value.foregroundEffect.effect = window.serverConfig.foregroundEffect.effect;
requestWriteConfig(value);
});
$('#btn_submit_foregroundEffect').off().on('click', function () {
var value = foregroundEffect_editor.getValue();
if (typeof value.foregroundEffect.effect == 'undefined')
value.foregroundEffect.effect = window.serverConfig.foregroundEffect.effect;
requestWriteConfig(value);
});
$('#btn_submit_backgroundEffect').off().on('click',function() {
var value = backgroundEffect_editor.getValue();
if(typeof value.backgroundEffect.effect == 'undefined')
value.backgroundEffect.effect = window.serverConfig.backgroundEffect.effect;
requestWriteConfig(value);
});
$('#btn_submit_backgroundEffect').off().on('click', function () {
var value = backgroundEffect_editor.getValue();
if (typeof value.backgroundEffect.effect == 'undefined')
value.backgroundEffect.effect = window.serverConfig.backgroundEffect.effect;
requestWriteConfig(value);
});
//create introduction
if(window.showOptHelp)
{
createHint("intro", $.i18n('conf_effect_path_intro'), "editor_container_effects");
createHint("intro", $.i18n('conf_effect_fgeff_intro'), "editor_container_foregroundEffect");
createHint("intro", $.i18n('conf_effect_bgeff_intro'), "editor_container_backgroundEffect");
}
//create introduction
if (window.showOptHelp) {
if (EFFECTENGINE_ENABLED) {
createHint("intro", $.i18n('conf_effect_path_intro'), "editor_container_effects");
}
createHint("intro", $.i18n('conf_effect_fgeff_intro'), "editor_container_foregroundEffect");
createHint("intro", $.i18n('conf_effect_bgeff_intro'), "editor_container_backgroundEffect");
}
function updateEffectlist(){
var newEffects = window.serverInfo.effects;
if (newEffects.length != oldEffects.length)
{
$('#root_foregroundEffect_effect').html('');
var usrEffArr = [];
var sysEffArr = [];
function updateEffectlist() {
var newEffects = window.serverInfo.effects;
if (newEffects.length != oldEffects.length) {
$('#root_foregroundEffect_effect').html('');
var usrEffArr = [];
var sysEffArr = [];
for(var i = 0; i < newEffects.length; i++)
{
var effectName = newEffects[i].name;
if(!/^\:/.test(newEffects[i].file))
usrEffArr.push(effectName);
else
sysEffArr.push(effectName);
}
$('#root_foregroundEffect_effect').append(createSel(usrEffArr, $.i18n('remote_optgroup_usreffets')));
$('#root_foregroundEffect_effect').append(createSel(sysEffArr, $.i18n('remote_optgroup_syseffets')));
$('#root_backgroundEffect_effect').html($('#root_foregroundEffect_effect').html());
oldEffects = newEffects;
for (var i = 0; i < newEffects.length; i++) {
var effectName = newEffects[i].name;
if (!/^\:/.test(newEffects[i].file))
usrEffArr.push(effectName);
else
sysEffArr.push(effectName);
}
$('#root_foregroundEffect_effect').append(createSel(usrEffArr, $.i18n('remote_optgroup_usreffets')));
$('#root_foregroundEffect_effect').append(createSel(sysEffArr, $.i18n('remote_optgroup_syseffets')));
$('#root_backgroundEffect_effect').html($('#root_foregroundEffect_effect').html());
oldEffects = newEffects;
$('#root_foregroundEffect_effect').val(confFgEff);
$('#root_backgroundEffect_effect').val(confBgEff);
}
}
$('#root_foregroundEffect_effect').val(confFgEff);
$('#root_backgroundEffect_effect').val(confBgEff);
}
}
//interval update
$(window.hyperion).on("cmd-effects-update", function(event){
window.serverInfo.effects = event.response.data.effects
updateEffectlist();
});
//interval update
$(window.hyperion).on("cmd-effects-update", function (event) {
window.serverInfo.effects = event.response.data.effects
updateEffectlist();
});
removeOverlay();
removeOverlay();
});

View File

@ -228,6 +228,11 @@ $(document).ready(function () {
$("#MenuItemGrabber").attr('style', 'display:none')
$("#MenuItemInstCapture").attr('style', 'display:none')
}
//Hide effectsconfigurator menu entry, if effectengine is not available
if (jQuery.inArray("effectengine", window.serverInfo.services) === -1) {
$("#MenuItemEffectsConfig").attr('style', 'display:none')
}
});
$(window.hyperion).on("cmd-adjustment-update", function (event) {
@ -312,14 +317,14 @@ $(document).ready(function () {
window.scrollTo(0, 0);
});
$(window).scroll(function() {
$(window).scroll(function () {
if ($(window).scrollTop() > 65)
$("#navbar_brand_logo").css("display", "none");
else
$("#navbar_brand_logo").css("display", "");
});
$('#side-menu li a, #side-menu li ul li a').click(function() {
$('#side-menu li a, #side-menu li ul li a').click(function () {
$('#side-menu').find('.active').toggleClass('inactive'); // find all active classes and set inactive;
$(this).addClass('active');
});
@ -370,8 +375,8 @@ function SwitchToMenuItem(target, item) {
cl_object.addClass('in'); // Add class "in" to expand header in sidebar menu;
if (item) { // Jump to div "item" if available. Time limit 3 seconds
function scrollTo(counter) {
if(counter < 30) {
setTimeout(function() {
if (counter < 30) {
setTimeout(function () {
counter++;
if ($('#' + item).length)
$('#' + item)[0].scrollIntoView();

View File

@ -1,6 +1,8 @@
$(document).ready(function () {
performTranslation();
var EFFECTENGINE_ENABLED = (jQuery.inArray("effectengine", window.serverInfo.services) !== -1);
// update instance listing
updateHyperionInstanceListing();
@ -337,10 +339,13 @@ $(document).ready(function () {
});
$("#remote_input_reseff, #remote_input_rescol").off().on("click", function () {
if (this.id == "remote_input_rescol")
if (this.id == "remote_input_rescol") {
sendColor();
else
sendEffect();
} else {
if (EFFECTENGINE_ENABLED) {
sendEffect();
}
}
});
$("#remote_input_repimg").off().on("click", function () {
@ -365,7 +370,12 @@ $(document).ready(function () {
updateInputSelect();
updateLedMapping();
updateVideoMode();
updateEffectlist();
if (EFFECTENGINE_ENABLED) {
updateEffectlist();
} else {
$('#effect_row').hide();
}
// interval updates

View File

@ -1232,7 +1232,9 @@ function getSystemInfo() {
info += '- Kernel: ' + sys.kernelType + ' (' + sys.kernelVersion + ' (WS: ' + sys.wordSize + '))\n';
info += '- Root/Admin: ' + sys.isUserAdmin + '\n';
info += '- Qt Version: ' + sys.qtVersion + '\n';
info += '- Python Version: ' + sys.pyVersion + '\n';
if (jQuery.inArray("effectengine", window.serverInfo.services) !== -1) {
info += '- Python Version: ' + sys.pyVersion + '\n';
}
info += '- Browser: ' + navigator.userAgent;
return info;
}
@ -1349,3 +1351,4 @@ function isValidHostnameOrIP4(value) {
function isValidHostnameOrIP(value) {
return (isValidHostnameOrIP4(value) || isValidIPv6(value));
}

View File

@ -17,8 +17,8 @@ make_release()
cd build-${RELEASE}
cmake -DCMAKE_INSTALL_PREFIX=/usr -DPLATFORM=${PLATFORM} $@ -DCMAKE_BUILD_TYPE=Release -Wno-dev .. || exit 1
#cmake -DCMAKE_INSTALL_PREFIX=/usr -DPLATFORM=${PLATFORM} $@ -DCMAKE_BUILD_TYPE=Debug .. || exit 1
cmake -DCMAKE_INSTALL_PREFIX=/usr -DPLATFORM=${PLATFORM} -DCMAKE_BUILD_TYPE=Release -Wno-dev $@ .. || exit 1
#cmake -DCMAKE_INSTALL_PREFIX=/usr -DPLATFORM=${PLATFORM} -DCMAKE_BUILD_TYPE=Debug $@ .. || exit 1
make -j $(nproc) || exit 1
strip bin/*
make package -j $(nproc)
@ -27,16 +27,14 @@ make_release()
bin/create_release.sh . ${RELEASE}
}
#export QTDIR="/opt/Qt/6.2.0/gcc_64"
#export QTDIR=="/opt/Qt/5.15.2/gcc_64"
#export QTDIR="/opt/Qt/6.2.2/gcc_64"
#export QTDIR="/opt/Qt/5.15.2/gcc_64"
CMAKE_PROTOC_FLAG="-DIMPORT_PROTOC=../build-x86x64/protoc_export.cmake"
CMAKE_FLATC_FLAG="-DIMPORT_FLATC=../build-x86x64/flatc_export.cmake"
make_release x86x64 x11
#make_release x32 x11 -DCMAKE_TOOLCHAIN_FILE="../cmake/Toolchain-x32.cmake" ${CMAKE_PROTOC_FLAG} ${CMAKE_FLATC_FLAG}
#make_release rpi rpi -DCMAKE_TOOLCHAIN_FILE="../cmake/Toolchain-rpi.cmake" ${CMAKE_PROTOC_FLAG} ${CMAKE_FLATC_FLAG}
#make_release wetek wetek -DCMAKE_TOOLCHAIN_FILE="../cmake/Toolchain-rpi.cmake" ${CMAKE_PROTOC_FLAG} ${CMAKE_FLATC_FLAG}
#make_release imx6 imx6 -DCMAKE_TOOLCHAIN_FILE="../cmake/Toolchain-imx6.cmake" ${CMAKE_PROTOC_FLAG} ${CMAKE_FLATC_FLAG}
make_release x86x64 x11 $@
#make_release x32 x11 $@ -DCMAKE_TOOLCHAIN_FILE="../cmake/Toolchain-x32.cmake" ${CMAKE_PROTOC_FLAG} ${CMAKE_FLATC_FLAG}
#make_release rpi rpi $@ -DCMAKE_TOOLCHAIN_FILE="../cmake/Toolchain-rpi.cmake" ${CMAKE_PROTOC_FLAG} ${CMAKE_FLATC_FLAG}
#make_release wetek wetek $@ -DCMAKE_TOOLCHAIN_FILE="../cmake/Toolchain-rpi.cmake" ${CMAKE_PROTOC_FLAG} ${CMAKE_FLATC_FLAG}
#make_release imx6 imx6 $@ -DCMAKE_TOOLCHAIN_FILE="../cmake/Toolchain-imx6.cmake" ${CMAKE_PROTOC_FLAG} ${CMAKE_FLATC_FLAG}

View File

@ -23,6 +23,8 @@ BUILD_LOCAL=0
BUILD_INCREMENTAL=0
#Verbose output
_VERBOSE=0
#Additional args
BUILD_ARGS=""
# get current path to this script, independent of calling
pushd . > /dev/null
@ -62,20 +64,23 @@ echo "########################################################
## Requires installed Docker: https://www.docker.com/
## Without arguments it will compile Hyperion for Debian Buster (x86_64) and uses Hyperion code from GitHub repository.
## Supports Raspberry Pi (armv6l, armv7l) cross compilation (Debian Stretch/Buster) and native compilation (Raspbian Stretch/Buster)
## For all images and tags currently available, see https://github.com/orgs/hyperion-project/packages
##
## Homepage: https://www.hyperion-project.org
## Forum: https://hyperion-project.org/forum/
########################################################
# These are possible arguments to modify the script behaviour with their default values
#
# docker-compile.sh -h # Show this help message
# docker-compile.sh -i x86_64 # The docker image, one of x86_64 | armv6l | armv7l | rpi-raspbian
# docker-compile.sh -t buster # The docker tag, stretch, buster or bullseye
# docker-compile.sh -b Release # cmake Release or Debug build
# docker-compile.sh -p true # If true, build packages with CPack
# docker-compile.sh -l # Run build using local code files
# docker-compile.sh -c # Run incremental build, i.e. do not delete files created during previous build
# docker-compile.sh -f x11 # cmake PLATFORM parameter
# docker-compile.sh -h, --help # Show this help message
# docker-compile.sh -i, --image # The docker image, e.g., x86_64, armv6l, armv7l, aarch64, rpi-raspbian
# docker-compile.sh -t, --tag # The docker tag, e.g., stretch, buster, bullseye, bookworm
# docker-compile.sh -b, --type # Release or Debug build
# docker-compile.sh -p, --packages # If true, build packages with CPack
# docker-compile.sh -l, --local # Run build using local code files
# docker-compile.sh -c, --incremental # Run incremental build, i.e. do not delete files created during previous build
# docker-compile.sh -f, --platform # cmake PLATFORM parameter, e.g. x11, amlogic-dev
# docker-compile.sh -v, --verbose # Run the script in verbose mode
# docker-compile.sh -- args # Additonal cmake arguments, e.g., -DHYPERION_LIGHT=ON
# More informations to docker tags at: https://github.com/Hyperion-Project/hyperion.docker-ci"
}
@ -86,23 +91,54 @@ function log () {
}
echo "Compile Hyperion using a Docker container"
options=$(getopt -l "image:,tag:,type:,packages:,platform:,local,incremental,verbose,help" -o "i:t:b:p:f:lcvh" -a -- "$@")
while getopts i:t:b:p:f:lcvh option
eval set -- "$options"
while true
do
case "${option}"
in
i) BUILD_IMAGE=${OPTARG};;
t) BUILD_TAG=${OPTARG};;
b) BUILD_TYPE=${OPTARG};;
p) BUILD_PACKAGES=${OPTARG};;
f) BUILD_PLATFORM=${OPTARG,,};;
l) BUILD_LOCAL=1;;
c) BUILD_INCREMENTAL=1;;
v) _VERBOSE=1;;
h) printHelp; exit 0;;
esac
case $1 in
-i|--image)
shift
BUILD_IMAGE=$1
;;
-t|--tag)
shift
BUILD_TAG=$1
;;
-b|--type)
shift
BUILD_TYPE=$1
;;
-p|--packages)
shift
BUILD_PACKAGES=$1
;;
-f|--platform)
shift
BUILD_PLATFORM=$1
;;
-l|--local)
BUILD_LOCAL=1
;;
-c|--incremental)
BUILD_INCREMENTAL=1
;;
-v|--verbose)
_VERBOSE=1
;;
-h|--help)
printHelp
exit 0
;;
--)
shift
break;;
esac
shift
done
BUILD_ARGS=$@
# determine package creation
if [ ${BUILD_PACKAGES} == "true" ]; then
PACKAGES="package"
@ -164,7 +200,7 @@ $DOCKER run --rm \
-v "${CODE_PATH}/:/source:rw" \
${REGISTRY_URL}/${BUILD_IMAGE}:${BUILD_TAG} \
/bin/bash -c "mkdir -p /source/${BUILD_DIR} && cd /source/${BUILD_DIR} &&
cmake -DCMAKE_BUILD_TYPE=${BUILD_TYPE} ${PLATFORM} .. || exit 2 &&
cmake -DCMAKE_BUILD_TYPE=${BUILD_TYPE} ${PLATFORM} ${BUILD_ARGS} .. || exit 2 &&
make -j $(nproc) ${PACKAGES} || exit 3 || : &&
exit 0;
exit 1 " || { echo "---> Hyperion compilation failed! Abort"; exit 4; }

View File

@ -47,34 +47,36 @@ macro(DeployMacOS TARGET)
endif()
endforeach()
include(BundleUtilities)
fixup_bundle("${CMAKE_INSTALL_PREFIX}/${TARGET_BUNDLE_NAME}" "${QT_PLUGINS}" "" IGNORE_ITEM "python;python3;Python;Python3;.Python;.Python3")
if(ENABLE_EFFECTENGINE)
include(BundleUtilities)
fixup_bundle("${CMAKE_INSTALL_PREFIX}/${TARGET_BUNDLE_NAME}" "${QT_PLUGINS}" "" IGNORE_ITEM "python;python3;Python;Python3;.Python;.Python3")
# Detect the Python version and modules directory
find_package(Python3 3.5 REQUIRED)
execute_process(
COMMAND ${Python3_EXECUTABLE} -c "from distutils.sysconfig import get_python_lib; print(get_python_lib(standard_lib=True))"
OUTPUT_VARIABLE PYTHON_MODULES_DIR
OUTPUT_STRIP_TRAILING_WHITESPACE
)
# Copy Python modules to '/../Frameworks/Python.framework/Versions/Current/lib/PythonMAJOR.MINOR' and ignore the unnecessary stuff listed below
if (PYTHON_MODULES_DIR)
set(PYTHON_VERSION_MAJOR_MINOR "${Python3_VERSION_MAJOR}.${Python3_VERSION_MINOR}")
file(
COPY ${PYTHON_MODULES_DIR}/
DESTINATION "${CMAKE_INSTALL_PREFIX}/${TARGET_BUNDLE_NAME}/Contents/Frameworks/Python.framework/Versions/Current/lib/python${PYTHON_VERSION_MAJOR_MINOR}"
PATTERN "*.pyc" EXCLUDE # compiled bytecodes
PATTERN "__pycache__" EXCLUDE # any cache
PATTERN "config-${PYTHON_VERSION_MAJOR_MINOR}*" EXCLUDE # static libs
PATTERN "lib2to3" EXCLUDE # automated Python 2 to 3 code translation
PATTERN "tkinter" EXCLUDE # Tk interface
PATTERN "turtledemo" EXCLUDE # Tk demo folder
PATTERN "turtle.py" EXCLUDE # Tk demo file
PATTERN "test" EXCLUDE # unittest module
PATTERN "sitecustomize.py" EXCLUDE # site-specific configs
# Detect the Python version and modules directory
find_package(Python3 3.5 REQUIRED)
execute_process(
COMMAND ${Python3_EXECUTABLE} -c "from distutils.sysconfig import get_python_lib; print(get_python_lib(standard_lib=True))"
OUTPUT_VARIABLE PYTHON_MODULES_DIR
OUTPUT_STRIP_TRAILING_WHITESPACE
)
endif(PYTHON_MODULES_DIR)
# Copy Python modules to '/../Frameworks/Python.framework/Versions/Current/lib/PythonMAJOR.MINOR' and ignore the unnecessary stuff listed below
if (PYTHON_MODULES_DIR)
set(PYTHON_VERSION_MAJOR_MINOR "${Python3_VERSION_MAJOR}.${Python3_VERSION_MINOR}")
file(
COPY ${PYTHON_MODULES_DIR}/
DESTINATION "${CMAKE_INSTALL_PREFIX}/${TARGET_BUNDLE_NAME}/Contents/Frameworks/Python.framework/Versions/Current/lib/python${PYTHON_VERSION_MAJOR_MINOR}"
PATTERN "*.pyc" EXCLUDE # compiled bytecodes
PATTERN "__pycache__" EXCLUDE # any cache
PATTERN "config-${PYTHON_VERSION_MAJOR_MINOR}*" EXCLUDE # static libs
PATTERN "lib2to3" EXCLUDE # automated Python 2 to 3 code translation
PATTERN "tkinter" EXCLUDE # Tk interface
PATTERN "turtledemo" EXCLUDE # Tk demo folder
PATTERN "turtle.py" EXCLUDE # Tk demo file
PATTERN "test" EXCLUDE # unittest module
PATTERN "sitecustomize.py" EXCLUDE # site-specific configs
)
endif(PYTHON_MODULES_DIR)
endif(ENABLE_EFFECTENGINE)
]] COMPONENT "Hyperion")
else()
@ -225,36 +227,38 @@ macro(DeployLinux TARGET)
)
endforeach()
# Detect the Python version and modules directory
if (NOT CMAKE_VERSION VERSION_LESS "3.12")
set(PYTHON_VERSION_MAJOR_MINOR "${Python3_VERSION_MAJOR}.${Python3_VERSION_MINOR}")
set(PYTHON_MODULES_DIR "${Python3_STDLIB}")
else()
set(PYTHON_VERSION_MAJOR_MINOR "${PYTHON_VERSION_MAJOR}.${PYTHON_VERSION_MINOR}")
execute_process(
COMMAND ${PYTHON_EXECUTABLE} -c "from distutils.sysconfig import get_python_lib; print(get_python_lib(standard_lib=True))"
OUTPUT_VARIABLE PYTHON_MODULES_DIR
OUTPUT_STRIP_TRAILING_WHITESPACE
)
endif()
if(ENABLE_EFFECTENGINE)
# Detect the Python version and modules directory
if (NOT CMAKE_VERSION VERSION_LESS "3.12")
set(PYTHON_VERSION_MAJOR_MINOR "${Python3_VERSION_MAJOR}.${Python3_VERSION_MINOR}")
set(PYTHON_MODULES_DIR "${Python3_STDLIB}")
else()
set(PYTHON_VERSION_MAJOR_MINOR "${PYTHON_VERSION_MAJOR}.${PYTHON_VERSION_MINOR}")
execute_process(
COMMAND ${PYTHON_EXECUTABLE} -c "from distutils.sysconfig import get_python_lib; print(get_python_lib(standard_lib=True))"
OUTPUT_VARIABLE PYTHON_MODULES_DIR
OUTPUT_STRIP_TRAILING_WHITESPACE
)
endif()
# Copy Python modules to 'share/hyperion/lib/pythonMAJOR.MINOR' and ignore the unnecessary stuff listed below
if (PYTHON_MODULES_DIR)
# Copy Python modules to 'share/hyperion/lib/pythonMAJOR.MINOR' and ignore the unnecessary stuff listed below
if (PYTHON_MODULES_DIR)
install(
DIRECTORY ${PYTHON_MODULES_DIR}/
DESTINATION "share/hyperion/lib/python${PYTHON_VERSION_MAJOR_MINOR}"
COMPONENT "Hyperion"
PATTERN "*.pyc" EXCLUDE # compiled bytecodes
PATTERN "__pycache__" EXCLUDE # any cache
PATTERN "config-${PYTHON_VERSION_MAJOR_MINOR}*" EXCLUDE # static libs
PATTERN "lib2to3" EXCLUDE # automated Python 2 to 3 code translation
PATTERN "tkinter" EXCLUDE # Tk interface
PATTERN "turtle.py" EXCLUDE # Tk demo
PATTERN "test" EXCLUDE # unittest module
PATTERN "sitecustomize.py" EXCLUDE # site-specific configs
)
endif(PYTHON_MODULES_DIR)
install(
DIRECTORY ${PYTHON_MODULES_DIR}/
DESTINATION "share/hyperion/lib/python${PYTHON_VERSION_MAJOR_MINOR}"
COMPONENT "Hyperion"
PATTERN "*.pyc" EXCLUDE # compiled bytecodes
PATTERN "__pycache__" EXCLUDE # any cache
PATTERN "config-${PYTHON_VERSION_MAJOR_MINOR}*" EXCLUDE # static libs
PATTERN "lib2to3" EXCLUDE # automated Python 2 to 3 code translation
PATTERN "tkinter" EXCLUDE # Tk interface
PATTERN "turtle.py" EXCLUDE # Tk demo
PATTERN "test" EXCLUDE # unittest module
PATTERN "sitecustomize.py" EXCLUDE # site-specific configs
)
endif(PYTHON_MODULES_DIR)
endif(ENABLE_EFFECTENGINE)
else()
# Run CMake after target was built to run get_prerequisites on ${TARGET_FILE}
@ -388,44 +392,46 @@ macro(DeployWindows TARGET)
COMPONENT "Hyperion"
)
# Download embed python package (only release build package available)
# Currently only cmake version >= 3.12 implemented
set(url "https://www.python.org/ftp/python/${Python3_VERSION}/")
set(filename "python-${Python3_VERSION}-embed-amd64.zip")
if(ENABLE_EFFECTENGINE)
# Download embed python package (only release build package available)
# Currently only cmake version >= 3.12 implemented
set(url "https://www.python.org/ftp/python/${Python3_VERSION}/")
set(filename "python-${Python3_VERSION}-embed-amd64.zip")
if (NOT EXISTS "${CMAKE_CURRENT_BINARY_DIR}/${filename}" OR NOT EXISTS "${CMAKE_CURRENT_BINARY_DIR}/python")
file(DOWNLOAD "${url}${filename}" "${CMAKE_CURRENT_BINARY_DIR}/${filename}"
STATUS result
)
if (NOT EXISTS "${CMAKE_CURRENT_BINARY_DIR}/${filename}" OR NOT EXISTS "${CMAKE_CURRENT_BINARY_DIR}/python")
file(DOWNLOAD "${url}${filename}" "${CMAKE_CURRENT_BINARY_DIR}/${filename}"
STATUS result
)
# Check if the download is successful
list(GET result 0 result_code)
if(NOT result_code EQUAL 0)
list(GET result 1 reason)
message(FATAL_ERROR "Could not download file ${url}${filename}: ${reason}")
# Check if the download is successful
list(GET result 0 result_code)
if(NOT result_code EQUAL 0)
list(GET result 1 reason)
message(FATAL_ERROR "Could not download file ${url}${filename}: ${reason}")
endif()
# Unpack downloaded embed python
file(REMOVE_RECURSE ${CMAKE_CURRENT_BINARY_DIR}/python)
file(MAKE_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}/python)
execute_process(
COMMAND ${CMAKE_COMMAND} -E tar -xfz "${CMAKE_CURRENT_BINARY_DIR}/${filename}"
WORKING_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}/python
OUTPUT_QUIET
)
endif()
# Unpack downloaded embed python
file(REMOVE_RECURSE ${CMAKE_CURRENT_BINARY_DIR}/python)
file(MAKE_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}/python)
execute_process(
COMMAND ${CMAKE_COMMAND} -E tar -xfz "${CMAKE_CURRENT_BINARY_DIR}/${filename}"
WORKING_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}/python
OUTPUT_QUIET
# Copy pythonXX.dll and pythonXX.zip to 'hyperion'
foreach(PYTHON_FILE
"python${Python3_VERSION_MAJOR}${Python3_VERSION_MINOR}.dll"
"python${Python3_VERSION_MAJOR}${Python3_VERSION_MINOR}.zip"
)
endif()
# Copy pythonXX.dll and pythonXX.zip to 'hyperion'
foreach(PYTHON_FILE
"python${Python3_VERSION_MAJOR}${Python3_VERSION_MINOR}.dll"
"python${Python3_VERSION_MAJOR}${Python3_VERSION_MINOR}.zip"
)
install(
FILES ${CMAKE_CURRENT_BINARY_DIR}/python/${PYTHON_FILE}
DESTINATION "bin"
COMPONENT "Hyperion"
)
endforeach()
install(
FILES ${CMAKE_CURRENT_BINARY_DIR}/python/${PYTHON_FILE}
DESTINATION "bin"
COMPONENT "Hyperion"
)
endforeach()
endif(ENABLE_EFFECTENGINE)
if (ENABLE_DX)
# Download DirectX End-User Runtimes (June 2010)

View File

@ -1,10 +1,10 @@
add_subdirectory(build/hidapi)
if ( ENABLE_TINKERFORGE )
if (ENABLE_DEV_TINKERFORGE)
add_subdirectory(build/tinkerforge)
endif()
if(ENABLE_WS281XPWM)
if(ENABLE_DEV_WS281XPWM)
add_library(ws281x
external/rpi_ws281x/mailbox.c external/rpi_ws281x/ws2811.c
external/rpi_ws281x/pwm.c external/rpi_ws281x/dma.c
@ -194,135 +194,138 @@ endif()
# MBEDTLS
#=============================================================================
set(USE_SYSTEM_MBEDTLS_LIBS ${DEFAULT_USE_SYSTEM_MBEDTLS_LIBS} CACHE BOOL "use mbedtls library from system")
if(ENABLE_DEV_NETWORK)
set(USE_SYSTEM_MBEDTLS_LIBS ${DEFAULT_USE_SYSTEM_MBEDTLS_LIBS} CACHE BOOL "use mbedtls library from system")
if (USE_SYSTEM_MBEDTLS_LIBS)
find_package(mbedtls REQUIRED)
if (NOT MBEDTLS_FOUND)
message(STATUS "Could NOT find mbedtls system libraries, build static mbedtls libraries")
#Fallback: build mbedtls static libray inside project
set(DEFAULT_USE_SYSTEM_MBEDTLS_LIBS OFF PARENT_SCOPE)
set(USE_SYSTEM_MBEDTLS_LIBS OFF)
endif (NOT MBEDTLS_FOUND)
endif (USE_SYSTEM_MBEDTLS_LIBS)
if (USE_SYSTEM_MBEDTLS_LIBS)
find_package(mbedtls REQUIRED)
if (NOT MBEDTLS_FOUND)
message(STATUS "Could NOT find mbedtls system libraries, build static mbedtls libraries")
#Fallback: build mbedtls static libray inside project
set(DEFAULT_USE_SYSTEM_MBEDTLS_LIBS OFF PARENT_SCOPE)
set(USE_SYSTEM_MBEDTLS_LIBS OFF)
endif (NOT MBEDTLS_FOUND)
endif (USE_SYSTEM_MBEDTLS_LIBS)
if (NOT USE_SYSTEM_MBEDTLS_LIBS)
set(DEFAULT_USE_SYSTEM_MBEDTLS_LIBS OFF CACHE BOOL "system mbedtls libraries not found, disable use system mbedtls libraries")
set(BUILD_SHARED_LIBS OFF CACHE BOOL "Build shared mbedtls libraries")
if (NOT USE_SYSTEM_MBEDTLS_LIBS)
set(DEFAULT_USE_SYSTEM_MBEDTLS_LIBS OFF CACHE BOOL "system mbedtls libraries not found, disable use system mbedtls libraries")
set(BUILD_SHARED_LIBS OFF CACHE BOOL "Build shared mbedtls libraries")
set(ENABLE_TESTING OFF CACHE BOOL "Disable mbedTLS tests")
set(ENABLE_PROGRAMS OFF CACHE BOOL "Disable mbedTLS programs")
set(USE_SHARED_MBEDTLS_LIBRARY OFF CACHE BOOL "Disable mbedTLS shared libraries")
set(USE_STATIC_MBEDTLS_LIBRARY ON CACHE BOOL "Enable mbedTLS static libraries")
set(ENABLE_TESTING OFF CACHE BOOL "Disable mbedTLS tests")
set(ENABLE_PROGRAMS OFF CACHE BOOL "Disable mbedTLS programs")
set(USE_SHARED_MBEDTLS_LIBRARY OFF CACHE BOOL "Disable mbedTLS shared libraries")
set(USE_STATIC_MBEDTLS_LIBRARY ON CACHE BOOL "Enable mbedTLS static libraries")
set(MBEDTLS_DOWNLOAD_DIR "${CMAKE_BINARY_DIR}/dependencies/external/mbedtls/download")
set(MBEDTLS_SOURCE_DIR "${CMAKE_BINARY_DIR}/dependencies/external/mbedtls/src")
set(MBEDTLS_BINARY_DIR "${CMAKE_BINARY_DIR}/dependencies/external/mbedtls/build")
set(MBEDTLS_INSTALL_DIR "${CMAKE_BINARY_DIR}")
if(${CMAKE_BUILD_TYPE} AND ${CMAKE_BUILD_TYPE} EQUAL "Debug")
set(MBEDTLS_LOGGING 1)
else ()
set(MBEDTLS_LOGGING 0)
endif ()
set(MBEDTLS_CMAKE_ARGS
-DCMAKE_INSTALL_PREFIX:PATH=${MBEDTLS_INSTALL_DIR}
-DCMAKE_BUILD_TYPE:STRING=${CMAKE_BUILD_TYPE}
-DUSE_SHARED_MBEDTLS_LIBRARY:BOOL=OFF
-DUSE_STATIC_MBEDTLS_LIBRARY:BOOL=ON
-DENABLE_TESTING:BOOL=OFF
-DENABLE_PROGRAMS:BOOL=OFF
-DLINK_WITH_PTHREAD:BOOL=ON
-Wno-dev
#-DCMAKE_POSITION_INDEPENDENT_CODE:BOOL=TRUE
)
set(ENABLE_MBEDTLS_FETCH_CONTENT ON)
if (ENABLE_MBEDTLS_FETCH_CONTENT AND CMAKE_VERSION VERSION_GREATER_EQUAL 3.11)
include(FetchContent)
FetchContent_Declare(
mbedtls
GIT_REPOSITORY https://github.com/ARMmbed/mbedtls.git
GIT_TAG origin/master
BUILD_ALWAYS OFF
GIT_PROGRESS 1
DOWNLOAD_DIR "${MBEDTLS_DOWNLOAD_DIR}"
SOURCE_DIR "${MBEDTLS_SOURCE_DIR}"
BINARY_DIR "${MBEDTLS_BINARY_DIR}"
INSTALL_DIR "${MBEDTLS_INSTALL_DIR}"
CMAKE_ARGS ${MBEDTLS_CMAKE_ARGS}
BUILD_COMMAND ""
INSTALL_COMMAND ""
LOG_DOWNLOAD ${MBEDTLS_LOGGING}
LOG_UPDATE ${MBEDTLS_LOGGING}
LOG_PATCH ${MBEDTLS_LOGGING}
LOG_CONFIGURE ${MBEDTLS_LOGGING}
LOG_BUILD ${MBEDTLS_LOGGING}
LOG_INSTALL ${MBEDTLS_LOGGING}
LOG_TEST ${MBEDTLS_LOGGING}
LOG_MERGED_STDOUTERR ${MBEDTLS_LOGGING}
LOG_OUTPUT_ON_FAILURE ${MBEDTLS_LOGGING}
)
if (CMAKE_VERSION VERSION_LESS 3.14)
macro (FetchContent_MakeAvailable NAME)
FetchContent_GetProperties(${NAME})
if (NOT ${NAME}_POPULATED)
FetchContent_Populate(${NAME})
add_subdirectory(${${NAME}_SOURCE_DIR} ${${NAME}_BINARY_DIR})
endif ()
endmacro ()
set(MBEDTLS_DOWNLOAD_DIR "${CMAKE_BINARY_DIR}/dependencies/external/mbedtls/download")
set(MBEDTLS_SOURCE_DIR "${CMAKE_BINARY_DIR}/dependencies/external/mbedtls/src")
set(MBEDTLS_BINARY_DIR "${CMAKE_BINARY_DIR}/dependencies/external/mbedtls/build")
set(MBEDTLS_INSTALL_DIR "${CMAKE_BINARY_DIR}")
if(${CMAKE_BUILD_TYPE} AND ${CMAKE_BUILD_TYPE} EQUAL "Debug")
set(MBEDTLS_LOGGING 1)
else ()
set(MBEDTLS_LOGGING 0)
endif ()
FetchContent_MakeAvailable(mbedtls)
else ()
set(ENABLE_MBEDTLS_FETCH_CONTENT OFF PARENT_SCOPE)
if(NOT DEFINED BUILD_MBEDTLS_ONCE)
set(BUILD_MBEDTLS_ONCE CACHE INTERNAL "Done")
configure_file(${CMAKE_SOURCE_DIR}/dependencies/CMakeLists-mbedtls.txt.in ${MBEDTLS_DOWNLOAD_DIR}/CMakeLists.txt @ONLY)
execute_process(COMMAND ${CMAKE_COMMAND} -DCMAKE_INSTALL_PREFIX:PATH=${MBEDTLS_INSTALL_DIR} -DCMAKE_BUILD_TYPE:STRING=${CMAKE_BUILD_TYPE} -G "${CMAKE_GENERATOR}" . WORKING_DIRECTORY ${MBEDTLS_DOWNLOAD_DIR})
execute_process(COMMAND ${CMAKE_COMMAND} --build . WORKING_DIRECTORY ${MBEDTLS_DOWNLOAD_DIR})
add_subdirectory(${MBEDTLS_SOURCE_DIR} ${MBEDTLS_BINARY_DIR})
endif()
endif ()
set(MBEDTLS_CMAKE_ARGS
-DCMAKE_INSTALL_PREFIX:PATH=${MBEDTLS_INSTALL_DIR}
-DCMAKE_BUILD_TYPE:STRING=${CMAKE_BUILD_TYPE}
-DUSE_SHARED_MBEDTLS_LIBRARY:BOOL=OFF
-DUSE_STATIC_MBEDTLS_LIBRARY:BOOL=ON
-DENABLE_TESTING:BOOL=OFF
-DENABLE_PROGRAMS:BOOL=OFF
-DLINK_WITH_PTHREAD:BOOL=ON
-Wno-dev
#-DCMAKE_POSITION_INDEPENDENT_CODE:BOOL=TRUE
)
set (MBEDTLS_INCLUDE_DIR "${MBEDTLS_SOURCE_DIR}/include")
set (MBEDTLS_INCLUDE_DIR ${MBEDTLS_INCLUDE_DIR} PARENT_SCOPE)
if (MBEDTLS_INCLUDE_DIR)
if (EXISTS "${MBEDTLS_INCLUDE_DIR}/mbedtls/build_info.h")
file(STRINGS ${MBEDTLS_INCLUDE_DIR}/mbedtls/build_info.h _MBEDTLS_VERSION_LINE REGEX "^#define[ \t]+MBEDTLS_VERSION_STRING[\t ].*")
string(REGEX REPLACE ".*MBEDTLS_VERSION_STRING[\t ]+\"(.*)\"" "\\1" MBEDTLS_VERSION ${_MBEDTLS_VERSION_LINE})
set (MBEDTLS_VERSION ${MBEDTLS_VERSION} PARENT_SCOPE)
message(STATUS "Using static mbedtls libraries (build version \"${MBEDTLS_VERSION}\")")
elseif(EXISTS "${MBEDTLS_INCLUDE_DIR}/mbedtls/version.h")
file(STRINGS "${MBEDTLS_INCLUDE_DIR}/mbedtls/version.h" _MBEDTLS_VERSION_STRING REGEX "^#[\t ]*define[\t ]+MBEDTLS_VERSION_STRING[\t ]+\"[0-9]+.[0-9]+.[0-9]+\"")
string(REGEX REPLACE "^.*MBEDTLS_VERSION_STRING.*([0-9]+.[0-9]+.[0-9]+).*" "\\1" MBEDTLS_VERSION "${_MBEDTLS_VERSION_STRING}")
set (MBEDTLS_VERSION ${MBEDTLS_VERSION} PARENT_SCOPE)
message(STATUS "Using static mbedtls libraries (build version \"${MBEDTLS_VERSION}\")")
endif()
endif ()
set(ENABLE_MBEDTLS_FETCH_CONTENT ON)
include_directories(${MBEDTLS_INCLUDE_DIR})
if (ENABLE_MBEDTLS_FETCH_CONTENT AND CMAKE_VERSION VERSION_GREATER_EQUAL 3.11)
if(WIN32)
set (MBEDTLS_LIB_INSTALL_DIR_WITH_LIB_PREFIX "${MBEDTLS_INSTALL_DIR}/lib/${CMAKE_CFG_INTDIR}/")
else()
set (MBEDTLS_LIB_INSTALL_DIR_WITH_LIB_PREFIX "${MBEDTLS_INSTALL_DIR}/lib/${CMAKE_STATIC_LIBRARY_PREFIX}")
endif ()
include(FetchContent)
set (MBEDTLS_SSL_LIBRARY "${MBEDTLS_LIB_INSTALL_DIR_WITH_LIB_PREFIX}mbedtls${CMAKE_STATIC_LIBRARY_SUFFIX}")
set (MBEDTLS_X509_LIBRARY "${MBEDTLS_LIB_INSTALL_DIR_WITH_LIB_PREFIX}mbedx509${CMAKE_STATIC_LIBRARY_SUFFIX}")
set (MBEDTLS_CRYPTO_LIBRARY "${MBEDTLS_LIB_INSTALL_DIR_WITH_LIB_PREFIX}mbedcrypto${CMAKE_STATIC_LIBRARY_SUFFIX}")
set (MBEDTLS_LIBRARIES ${MBEDTLS_SSL_LIBRARY} ${MBEDTLS_X509_LIBRARY} ${MBEDTLS_CRYPTO_LIBRARY})
set (MBEDTLS_LIBRARIES ${MBEDTLS_LIBRARIES} PARENT_SCOPE)
FetchContent_Declare(
mbedtls
GIT_REPOSITORY https://github.com/ARMmbed/mbedtls.git
GIT_TAG origin/master
BUILD_ALWAYS OFF
GIT_PROGRESS 1
DOWNLOAD_DIR "${MBEDTLS_DOWNLOAD_DIR}"
SOURCE_DIR "${MBEDTLS_SOURCE_DIR}"
BINARY_DIR "${MBEDTLS_BINARY_DIR}"
INSTALL_DIR "${MBEDTLS_INSTALL_DIR}"
CMAKE_ARGS ${MBEDTLS_CMAKE_ARGS}
BUILD_COMMAND ""
INSTALL_COMMAND ""
LOG_DOWNLOAD ${MBEDTLS_LOGGING}
LOG_UPDATE ${MBEDTLS_LOGGING}
LOG_PATCH ${MBEDTLS_LOGGING}
LOG_CONFIGURE ${MBEDTLS_LOGGING}
LOG_BUILD ${MBEDTLS_LOGGING}
LOG_INSTALL ${MBEDTLS_LOGGING}
LOG_TEST ${MBEDTLS_LOGGING}
LOG_MERGED_STDOUTERR ${MBEDTLS_LOGGING}
LOG_OUTPUT_ON_FAILURE ${MBEDTLS_LOGGING}
)
if(${CMAKE_BUILD_TYPE} AND ${CMAKE_BUILD_TYPE} EQUAL "Debug")
message(STATUS "mbedtls libraries: ${MBEDTLS_LIBRARIES}")
endif ()
if (CMAKE_VERSION VERSION_LESS 3.14)
macro (FetchContent_MakeAvailable NAME)
FetchContent_GetProperties(${NAME})
if (NOT ${NAME}_POPULATED)
FetchContent_Populate(${NAME})
add_subdirectory(${${NAME}_SOURCE_DIR} ${${NAME}_BINARY_DIR})
endif ()
endmacro ()
endif ()
mark_as_advanced (MBEDTLS_INCLUDE_DIR MBEDTLS_LIBRARIES MBEDTLS_SSL_LIBRARY MBEDTLS_X509_LIBRARY MBEDTLS_CRYPTO_LIBRARY)
FetchContent_MakeAvailable(mbedtls)
else ()
set(ENABLE_MBEDTLS_FETCH_CONTENT OFF PARENT_SCOPE)
if(NOT DEFINED BUILD_MBEDTLS_ONCE)
set(BUILD_MBEDTLS_ONCE CACHE INTERNAL "Done")
configure_file(${CMAKE_SOURCE_DIR}/dependencies/CMakeLists-mbedtls.txt.in ${MBEDTLS_DOWNLOAD_DIR}/CMakeLists.txt @ONLY)
execute_process(COMMAND ${CMAKE_COMMAND} -DCMAKE_INSTALL_PREFIX:PATH=${MBEDTLS_INSTALL_DIR} -DCMAKE_BUILD_TYPE:STRING=${CMAKE_BUILD_TYPE} -G "${CMAKE_GENERATOR}" . WORKING_DIRECTORY ${MBEDTLS_DOWNLOAD_DIR})
execute_process(COMMAND ${CMAKE_COMMAND} --build . WORKING_DIRECTORY ${MBEDTLS_DOWNLOAD_DIR})
add_subdirectory(${MBEDTLS_SOURCE_DIR} ${MBEDTLS_BINARY_DIR})
endif()
endif ()
set (MBEDTLS_INCLUDE_DIR "${MBEDTLS_SOURCE_DIR}/include")
set (MBEDTLS_INCLUDE_DIR ${MBEDTLS_INCLUDE_DIR} PARENT_SCOPE)
if (MBEDTLS_INCLUDE_DIR)
if (EXISTS "${MBEDTLS_INCLUDE_DIR}/mbedtls/build_info.h")
file(STRINGS ${MBEDTLS_INCLUDE_DIR}/mbedtls/build_info.h _MBEDTLS_VERSION_LINE REGEX "^#define[ \t]+MBEDTLS_VERSION_STRING[\t ].*")
string(REGEX REPLACE ".*MBEDTLS_VERSION_STRING[\t ]+\"(.*)\"" "\\1" MBEDTLS_VERSION ${_MBEDTLS_VERSION_LINE})
set (MBEDTLS_VERSION ${MBEDTLS_VERSION} PARENT_SCOPE)
message(STATUS "Using static mbedtls libraries (build version \"${MBEDTLS_VERSION}\")")
elseif(EXISTS "${MBEDTLS_INCLUDE_DIR}/mbedtls/version.h")
file(STRINGS "${MBEDTLS_INCLUDE_DIR}/mbedtls/version.h" _MBEDTLS_VERSION_STRING REGEX "^#[\t ]*define[\t ]+MBEDTLS_VERSION_STRING[\t ]+\"[0-9]+.[0-9]+.[0-9]+\"")
string(REGEX REPLACE "^.*MBEDTLS_VERSION_STRING.*([0-9]+.[0-9]+.[0-9]+).*" "\\1" MBEDTLS_VERSION "${_MBEDTLS_VERSION_STRING}")
set (MBEDTLS_VERSION ${MBEDTLS_VERSION} PARENT_SCOPE)
message(STATUS "Using static mbedtls libraries (build version \"${MBEDTLS_VERSION}\")")
endif()
endif ()
include_directories(${MBEDTLS_INCLUDE_DIR})
if(WIN32)
set (MBEDTLS_LIB_INSTALL_DIR_WITH_LIB_PREFIX "${MBEDTLS_INSTALL_DIR}/lib/${CMAKE_CFG_INTDIR}/")
else()
set (MBEDTLS_LIB_INSTALL_DIR_WITH_LIB_PREFIX "${MBEDTLS_INSTALL_DIR}/lib/${CMAKE_STATIC_LIBRARY_PREFIX}")
endif ()
set (MBEDTLS_SSL_LIBRARY "${MBEDTLS_LIB_INSTALL_DIR_WITH_LIB_PREFIX}mbedtls${CMAKE_STATIC_LIBRARY_SUFFIX}")
set (MBEDTLS_X509_LIBRARY "${MBEDTLS_LIB_INSTALL_DIR_WITH_LIB_PREFIX}mbedx509${CMAKE_STATIC_LIBRARY_SUFFIX}")
set (MBEDTLS_CRYPTO_LIBRARY "${MBEDTLS_LIB_INSTALL_DIR_WITH_LIB_PREFIX}mbedcrypto${CMAKE_STATIC_LIBRARY_SUFFIX}")
set (MBEDTLS_LIBRARIES ${MBEDTLS_SSL_LIBRARY} ${MBEDTLS_X509_LIBRARY} ${MBEDTLS_CRYPTO_LIBRARY})
set (MBEDTLS_LIBRARIES ${MBEDTLS_LIBRARIES} PARENT_SCOPE)
if(${CMAKE_BUILD_TYPE} AND ${CMAKE_BUILD_TYPE} EQUAL "Debug")
message(STATUS "mbedtls libraries: ${MBEDTLS_LIBRARIES}")
endif ()
mark_as_advanced (MBEDTLS_INCLUDE_DIR MBEDTLS_LIBRARIES MBEDTLS_SSL_LIBRARY MBEDTLS_X509_LIBRARY MBEDTLS_CRYPTO_LIBRARY)
endif (NOT USE_SYSTEM_MBEDTLS_LIBS)
endif(ENABLE_DEV_NETWORK)
endif (NOT USE_SYSTEM_MBEDTLS_LIBS)

View File

@ -107,6 +107,7 @@ protected:
///
void setVideoMode(VideoMode mode, hyperion::Components callerComp = hyperion::COMP_INVALID);
#if defined(ENABLE_EFFECTENGINE)
///
/// @brief Set an effect
/// @param dat The effect data
@ -115,6 +116,7 @@ protected:
/// @return True on success else false
///
bool setEffect(const EffectCmdData &dat, hyperion::Components callerComp = hyperion::COMP_INVALID);
#endif
///
/// @brief Set source auto select enabled or disabled
@ -213,6 +215,7 @@ protected:
///
QString setInstanceName(quint8 index, const QString &name);
#if defined(ENABLE_EFFECTENGINE)
///
/// @brief Delete an effect. Requires ADMIN ACCESS
/// @param name The effect name
@ -226,6 +229,7 @@ protected:
/// @return True on success else false
///
QString saveEffect(const QJsonObject &data);
#endif
///
/// @brief Save settings object. Requires ADMIN ACCESS

View File

@ -148,6 +148,7 @@ private:
///
void handleImageCommand(const QJsonObject &message, const QString &command, int tan);
#if defined(ENABLE_EFFECTENGINE)
///
/// Handle an incoming JSON Effect message
///
@ -168,6 +169,7 @@ private:
/// @param message the incoming message
///
void handleDeleteEffectCommand(const QJsonObject &message, const QString &command, int tan);
#endif
///
/// Handle an incoming JSON System info message

View File

@ -99,10 +99,12 @@ private slots:
///
void handleVideoModeChange(VideoMode mode);
#if defined(ENABLE_EFFECTENGINE)
///
/// @brief Handle effect list change
///
void handleEffectListChange();
#endif
///
/// @brief Handle a config part change. This does NOT include (global) changes from other hyperion instances

View File

@ -22,8 +22,6 @@ class Effect : public QThread
public:
static const int ENDLESS;
friend class EffectModule;
Effect(Hyperion *hyperion

View File

@ -70,13 +70,13 @@ signals:
public slots:
/// Run the specified effect on the given priority channel and optionally specify a timeout
int runEffect(const QString &effectName, int priority, int timeout = Effect::ENDLESS, const QString &origin="System");
int runEffect(const QString &effectName, int priority, int timeout = PriorityMuxer::ENDLESS, 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 = Effect::ENDLESS
, int timeout = PriorityMuxer::ENDLESS
, const QString &pythonScript = ""
, const QString &origin = "System"
, unsigned smoothCfg=0
@ -103,7 +103,7 @@ private:
,const QString &name
, const QJsonObject &args
, int priority
, int timeout = Effect::ENDLESS
, int timeout = PriorityMuxer::ENDLESS
, const QString &origin="System"
, unsigned smoothCfg=0
, const QString &imageData = ""

View File

@ -55,8 +55,12 @@ private slots:
{
_isBgEffectConfigured = true;
#if defined(ENABLE_EFFECTENGINE)
const QString bgTypeConfig = BGEffectConfig["type"].toString("effect");
const QString bgEffectConfig = BGEffectConfig["effect"].toString("Warm mood blobs");
#else
const QString bgTypeConfig = "color";
#endif
const QJsonValue bgColorConfig = BGEffectConfig["color"];
if (bgTypeConfig.contains("color"))
{
@ -70,11 +74,13 @@ private slots:
_hyperion->setColor(PriorityMuxer::BG_PRIORITY, bg_color);
Info(Logger::getInstance("HYPERION"),"Initial background color set (%d %d %d)",bg_color.at(0).red, bg_color.at(0).green, bg_color.at(0).blue);
}
#if defined(ENABLE_EFFECTENGINE)
else
{
int result = _hyperion->setEffect(bgEffectConfig, PriorityMuxer::BG_PRIORITY, Effect::ENDLESS);
int result = _hyperion->setEffect(bgEffectConfig, PriorityMuxer::BG_PRIORITY, PriorityMuxer::ENDLESS);
Info(Logger::getInstance("HYPERION"),"Initial background effect '%s' %s", QSTRING_CSTR(bgEffectConfig), ((result == 0) ? "started" : "failed"));
}
#endif
}
#undef BGCONFIG_ARRAY
}

View File

@ -24,11 +24,13 @@
#include <hyperion/ColorAdjustment.h>
#include <hyperion/ComponentRegister.h>
#if defined(ENABLE_EFFECTENGINE)
// Effect engine includes
#include <effectengine/EffectDefinition.h>
#include <effectengine/Effect.h>
#include <effectengine/ActiveEffectDefinition.h>
#include <effectengine/EffectSchema.h>
#endif
#include <leddevice/LedDevice.h>
@ -42,7 +44,9 @@ class ImageProcessor;
class MessageForwarder;
#endif
class LinearColorSmoothing;
#if defined(ENABLE_EFFECTENGINE)
class EffectEngine;
#endif
class MultiColorAdjustment;
class ColorAdjustment;
class SettingsManager;
@ -138,7 +142,7 @@ public slots:
/// @param clearEffect Should be true when NOT called from an effect
/// @return True on success, false when priority is not found
///
bool setInput(int priority, const std::vector<ColorRgb>& ledColors, int timeout_ms = -1, bool clearEffect = true);
bool setInput(int priority, const std::vector<ColorRgb>& ledColors, int timeout_ms = PriorityMuxer::ENDLESS, bool clearEffect = true);
///
/// @brief Update the current image of a priority (prev registered with registerInput())
@ -149,7 +153,7 @@ public slots:
/// @param clearEffect Should be true when NOT called from an effect
/// @return True on success, false when priority is not found
///
bool setInputImage(int priority, const Image<ColorRgb>& image, int64_t timeout_ms = -1, bool clearEffect = true);
bool setInputImage(int priority, const Image<ColorRgb>& image, int64_t timeout_ms = PriorityMuxer::ENDLESS, bool clearEffect = true);
///
/// Writes a single color to all the leds for the given time and priority
@ -162,7 +166,7 @@ public slots:
/// @param[in] origin The setter
/// @param clearEffect Should be true when NOT called from an effect
///
void setColor(int priority, const std::vector<ColorRgb> &ledColors, int timeout_ms = -1, const QString& origin = "System" ,bool clearEffects = true);
void setColor(int priority, const std::vector<ColorRgb> &ledColors, int timeout_ms = PriorityMuxer::ENDLESS, const QString& origin = "System" ,bool clearEffects = true);
///
/// @brief Set the given priority to inactive
@ -196,14 +200,15 @@ public slots:
///
bool clear(int priority, bool forceClearAll=false);
#if defined(ENABLE_EFFECTENGINE)
/// #############
/// EFFECTENGINE
///
/// @brief Get a pointer to the effect engine
/// @return EffectEngine instance pointer
///
EffectEngine* getEffectEngineInstance() const { return _effectEngine; }
///
/// @brief Save an effect
/// @param obj The effect args
@ -222,7 +227,7 @@ public slots:
/// @param effectName Name of the effec to run
/// @param priority The priority channel of the effect
/// @param timeout The timeout of the effect (after the timout, the effect will be cleared)
int setEffect(const QString & effectName, int priority, int timeout = Effect::ENDLESS, const QString & origin="System");
int setEffect(const QString & effectName, int priority, int timeout = PriorityMuxer::ENDLESS, const QString & origin="System");
/// Run the specified effect on the given priority channel and optionally specify a timeout
/// @param effectName Name of the effec to run
@ -232,7 +237,7 @@ public slots:
int setEffect(const QString &effectName
, const QJsonObject &args
, int priority
, int timeout = Effect::ENDLESS
, int timeout = PriorityMuxer::ENDLESS
, const QString &pythonScript = ""
, const QString &origin="System"
, const QString &imageData = ""
@ -249,6 +254,7 @@ public slots:
/// Get the list of available effect schema files
/// @return The list of available effect schema files
std::list<EffectSchema> getEffectSchemas() const;
#endif
/// #############
/// PRIORITYMUXER
@ -444,10 +450,12 @@ signals:
///
void adjustmentChanged();
#if defined(ENABLE_EFFECTENGINE)
///
/// @brief Signal pipe from EffectEngine to external, emits when effect list has been updated
///
void effectListUpdated();
#endif
///
/// @brief Emits whenever new data should be pushed to the LedDeviceWrapper which forwards it to the threaded LedDevice
@ -533,8 +541,10 @@ private:
/// The smoothing LedDevice
LinearColorSmoothing * _deviceSmooth;
#if defined(ENABLE_EFFECTENGINE)
/// Effect engine
EffectEngine * _effectEngine;
#endif
#if defined(ENABLE_FORWARDER)
// Message forwarder

View File

@ -63,6 +63,8 @@ public:
/// Timeout used to identify a non active priority
const static int TIMEOUT_NOT_ACTIVE_PRIO;
const static int ENDLESS;
///
/// Constructs the PriorityMuxer for the given number of LEDs (used to switch to black when
/// there are no priority channels
@ -164,7 +166,7 @@ public:
/// @param timeout_ms The new timeout (defaults to -1 endless)
/// @return True on success, false when priority is not found
///
bool setInput(int priority, const std::vector<ColorRgb>& ledColors, int64_t timeout_ms = -1);
bool setInput(int priority, const std::vector<ColorRgb>& ledColors, int64_t timeout_ms = ENDLESS);
///
/// @brief Update the current image of a priority (prev registered with registerInput())
@ -173,7 +175,7 @@ public:
/// @param timeout_ms The new timeout (defaults to -1 endless)
/// @return True on success, false when priority is not found
///
bool setInputImage(int priority, const Image<ColorRgb>& image, int64_t timeout_ms = -1);
bool setInputImage(int priority, const Image<ColorRgb>& image, int64_t timeout_ms = ENDLESS);
///
/// @brief Set the given priority to inactive
@ -220,7 +222,7 @@ signals:
///
/// @brief Emits whenever something changes which influences the priorities listing
/// Emits also in 1s interval when a COLOR or EFFECT is running with a timeout > -1
/// Emits also in 1s interval when a COLOR or EFFECT is running with a timeout > -1 (endless)
///
void prioritiesChanged();

View File

@ -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();

View File

@ -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
}

View File

@ -26,18 +26,21 @@ endif()
add_subdirectory(leddevice)
add_subdirectory(utils)
add_subdirectory(effectengine)
add_subdirectory(grabber)
add_subdirectory(webserver)
add_subdirectory(db)
add_subdirectory(api)
add_subdirectory(python)
add_subdirectory(ssdp)
if(ENABLE_AVAHI)
add_subdirectory(bonjour)
endif()
if(ENABLE_EFFECTENGINE)
add_subdirectory(effectengine)
add_subdirectory(python)
endif()
if(ENABLE_CEC)
add_subdirectory(cec)
endif()

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)
{

View File

@ -8,18 +8,17 @@
#include <effectengine/EffectModule.h>
#include <utils/Logger.h>
#include <hyperion/Hyperion.h>
#include <hyperion/PriorityMuxer.h>
// python utils
#include <python/PythonProgram.h>
const int Effect::ENDLESS = -1;
Effect::Effect(Hyperion *hyperion, int priority, int timeout, const QString &script, const QString &name, const QJsonObject &args, const QString &imageData)
: QThread()
, _hyperion(hyperion)
, _priority(priority)
, _timeout(timeout)
, _isEndless(timeout <= ENDLESS)
, _isEndless(timeout <= PriorityMuxer::ENDLESS)
, _script(script)
, _name(name)
, _args(args)

View File

@ -22,7 +22,6 @@ target_link_libraries(hyperion
blackborder
hyperion-utils
leddevice
effectengine
database
${QT_LIBRARIES}
)
@ -31,6 +30,10 @@ if(ENABLE_BOBLIGHT_SERVER)
target_link_libraries(hyperion boblightserver)
endif()
if(ENABLE_EFFECTENGINE)
target_link_libraries(hyperion effectengine)
endif()
if(ENABLE_FLATBUF_SERVER)
target_link_libraries(hyperion flatbufserver)
endif()

View File

@ -28,8 +28,10 @@
#include <hyperion/MultiColorAdjustment.h>
#include "LinearColorSmoothing.h"
#if defined(ENABLE_EFFECTENGINE)
// effect engine includes
#include <effectengine/EffectEngine.h>
#endif
// settingsManagaer
#include <hyperion/SettingsManager.h>
@ -56,7 +58,9 @@ Hyperion::Hyperion(quint8 instance, bool readonlyMode)
, _raw2ledAdjustment(hyperion::createLedColorsAdjustment(static_cast<int>(_ledString.leds().size()), getSetting(settings::COLOR).object()))
, _ledDeviceWrapper(nullptr)
, _deviceSmooth(nullptr)
#if defined(ENABLE_EFFECTENGINE)
, _effectEngine(nullptr)
#endif
#if defined(ENABLE_FORWARDER)
, _messageForwarder(nullptr)
#endif
@ -148,10 +152,11 @@ void Hyperion::start()
}
#endif
#if defined(ENABLE_EFFECTENGINE)
// create the effect engine; needs to be initialized after smoothing!
_effectEngine = new EffectEngine(this);
connect(_effectEngine, &EffectEngine::effectListUpdated, this, &Hyperion::effectListUpdated);
#endif
// initial startup effect
hyperion::handleInitialEffect(this, getSetting(settings::FGEFFECT).object());
@ -197,7 +202,11 @@ void Hyperion::freeObjects()
#endif
delete _captureCont;
#if defined(ENABLE_EFFECTENGINE)
delete _effectEngine;
#endif
delete _raw2ledAdjustment;
#if defined(ENABLE_FORWARDER)
@ -233,8 +242,10 @@ void Hyperion::handleSettingsUpdate(settings::type type, const QJsonDocument& co
{
const QJsonArray leds = config.array();
#if defined(ENABLE_EFFECTENGINE)
// stop and cache all running effects, as effects depend heavily on LED-layout
_effectEngine->cacheRunningEffects();
#endif
// ledstring, img processor, muxer, ledGridSize (effect-engine image based effects), _ledBuffer and ByteOrder of ledstring
_ledString = hyperion::createLedString(leds, hyperion::createColorOrder(getSetting(settings::DEVICE).object()));
@ -258,8 +269,10 @@ void Hyperion::handleSettingsUpdate(settings::type type, const QJsonDocument& co
delete _raw2ledAdjustment;
_raw2ledAdjustment = hyperion::createLedColorsAdjustment(static_cast<int>(_ledString.leds().size()), getSetting(settings::COLOR).object());
#if defined(ENABLE_EFFECTENGINE)
// start cached effects
_effectEngine->startCachedEffects();
#endif
}
else if(type == settings::DEVICE)
{
@ -370,11 +383,13 @@ bool Hyperion::setInput(int priority, const std::vector<ColorRgb>& ledColors, in
{
if(_muxer->setInput(priority, ledColors, timeout_ms))
{
#if defined(ENABLE_EFFECTENGINE)
// clear effect if this call does not come from an effect
if(clearEffect)
{
_effectEngine->channelCleared(priority);
}
#endif
// if this priority is visible, update immediately
if(priority == _muxer->getCurrentPriority())
@ -397,11 +412,13 @@ bool Hyperion::setInputImage(int priority, const Image<ColorRgb>& image, int64_t
if(_muxer->setInputImage(priority, image, timeout_ms))
{
#if defined(ENABLE_EFFECTENGINE)
// clear effect if this call does not come from an effect
if(clearEffect)
{
_effectEngine->channelCleared(priority);
}
#endif
// if this priority is visible, update immediately
if(priority == _muxer->getCurrentPriority())
@ -421,11 +438,13 @@ bool Hyperion::setInputInactive(quint8 priority)
void Hyperion::setColor(int priority, const std::vector<ColorRgb> &ledColors, int timeout_ms, const QString &origin, bool clearEffects)
{
#if defined(ENABLE_EFFECTENGINE)
// clear effect if this call does not come from an effect
if (clearEffects)
{
_effectEngine->channelCleared(priority);
}
#endif
// create full led vector from single/multiple colors
size_t size = _ledString.leds().size();
@ -478,15 +497,20 @@ bool Hyperion::clear(int priority, bool forceClearAll)
{
_muxer->clearAll(forceClearAll);
#if defined(ENABLE_EFFECTENGINE)
// send clearall signal to the effect engine
_effectEngine->allChannelsCleared();
#endif
isCleared = true;
}
else
{
#if defined(ENABLE_EFFECTENGINE)
// send clear signal to the effect engine
// (outside the check so the effect gets cleared even when the effect is not sending colors)
_effectEngine->channelCleared(priority);
#endif
if (_muxer->clearInput(priority))
{
@ -516,6 +540,7 @@ Hyperion::InputInfo Hyperion::getPriorityInfo(int priority) const
return _muxer->getInputInfo(priority);
}
#if defined(ENABLE_EFFECTENGINE)
QString Hyperion::saveEffect(const QJsonObject& obj)
{
return _effectEngine->saveEffect(obj);
@ -541,11 +566,6 @@ std::list<EffectSchema> Hyperion::getEffectSchemas() const
return _effectEngine->getEffectSchemas();
}
QJsonObject Hyperion::getQJsonConfig() const
{
return _settingsManager->getSettings();
}
int Hyperion::setEffect(const QString &effectName, int priority, int timeout, const QString & origin)
{
return _effectEngine->runEffect(effectName, priority, timeout, origin);
@ -555,6 +575,12 @@ int Hyperion::setEffect(const QString &effectName, const QJsonObject &args, int
{
return _effectEngine->runEffect(effectName, args, priority, timeout, pythonScript, origin, 0, imageData);
}
#endif
QJsonObject Hyperion::getQJsonConfig() const
{
return _settingsManager->getSettings();
}
void Hyperion::setLedMappingType(int mappingType)
{

View File

@ -17,6 +17,7 @@ const int PriorityMuxer::BG_PRIORITY = 254;
const int PriorityMuxer::MANUAL_SELECTED_PRIORITY = 256;
const int PriorityMuxer::LOWEST_PRIORITY = std::numeric_limits<uint8_t>::max();
const int PriorityMuxer::TIMEOUT_NOT_ACTIVE_PRIO = -100;
const int PriorityMuxer::ENDLESS = -1;
PriorityMuxer::PriorityMuxer(int ledCount, QObject * parent)
: QObject(parent)
@ -37,7 +38,7 @@ PriorityMuxer::PriorityMuxer(int ledCount, QObject * parent)
// init lowest priority info
_lowestPriorityInfo.priority = PriorityMuxer::LOWEST_PRIORITY;
_lowestPriorityInfo.timeoutTime_ms = -1;
_lowestPriorityInfo.timeoutTime_ms = PriorityMuxer::ENDLESS;
_lowestPriorityInfo.ledColors = std::vector<ColorRgb>(ledCount, {0, 0, 0});
_lowestPriorityInfo.componentId = hyperion::COMP_COLOR;
_lowestPriorityInfo.origin = "System";
@ -45,7 +46,7 @@ PriorityMuxer::PriorityMuxer(int ledCount, QObject * parent)
_activeInputs[PriorityMuxer::LOWEST_PRIORITY] = _lowestPriorityInfo;
// adapt to 1s interval for COLOR and EFFECT timeouts > -1
// adapt to 1s interval for COLOR and EFFECT timeouts > -1 (endless)
connect(_timer, &QTimer::timeout, this, &PriorityMuxer::timeTrigger);
_timer->setSingleShot(true);
_blockTimer->setSingleShot(true);

View File

@ -3,7 +3,13 @@
SET(CURRENT_HEADER_DIR ${CMAKE_SOURCE_DIR}/include/leddevice)
SET(CURRENT_SOURCE_DIR ${CMAKE_SOURCE_DIR}/libsrc/leddevice)
find_package(Qt${QT_VERSION_MAJOR} COMPONENTS Network SerialPort REQUIRED)
if ( ENABLE_DEV_NETWORK )
find_package(Qt${QT_VERSION_MAJOR} COMPONENTS Network REQUIRED)
endif()
if ( ENABLE_DEV_SERIAL )
find_package(Qt${QT_VERSION_MAJOR} COMPONENTS SerialPort REQUIRED)
endif()
include_directories(
dev_hid
@ -19,10 +25,6 @@ FILE ( GLOB Leddevice_SOURCES
"${CURRENT_HEADER_DIR}/*.h"
"${CURRENT_SOURCE_DIR}/*.h"
"${CURRENT_SOURCE_DIR}/*.cpp"
"${CURRENT_SOURCE_DIR}/dev_serial/*.h"
"${CURRENT_SOURCE_DIR}/dev_serial/*.cpp"
"${CURRENT_SOURCE_DIR}/dev_net/*.h"
"${CURRENT_SOURCE_DIR}/dev_net/*.cpp"
"${CURRENT_SOURCE_DIR}/dev_other/*.h"
"${CURRENT_SOURCE_DIR}/dev_other/*.cpp"
)
@ -32,7 +34,23 @@ if ( ENABLE_OSX OR WIN32 )
list(REMOVE_ITEM Leddevice_SOURCES "${CURRENT_SOURCE_DIR}/dev_other/LedDevicePiBlaster.cpp")
endif()
if ( ENABLE_USB_HID )
if ( ENABLE_DEV_NETWORK )
FILE ( GLOB Leddevice_NETWORK_SOURCES "${CURRENT_SOURCE_DIR}/dev_net/*.h" "${CURRENT_SOURCE_DIR}/dev_net/*.cpp")
endif()
if ( ENABLE_DEV_SERIAL )
FILE ( GLOB Leddevice_SERIAL_SOURCES "${CURRENT_SOURCE_DIR}/dev_serial/*.h" "${CURRENT_SOURCE_DIR}/dev_serial/*.cpp")
endif()
if ( ENABLE_DEV_SPI )
FILE ( GLOB Leddevice_SPI_SOURCES "${CURRENT_SOURCE_DIR}/dev_spi/*.h" "${CURRENT_SOURCE_DIR}/dev_spi/*.cpp")
endif()
if ( ENABLE_DEV_TINKERFORGE )
FILE ( GLOB Leddevice_TINKER_SOURCES "${CURRENT_SOURCE_DIR}/dev_tinker/*.h" "${CURRENT_SOURCE_DIR}/dev_tinker/*.cpp")
endif()
if ( ENABLE_DEV_USB_HID )
find_package(libusb-1.0 REQUIRED)
include_directories(
${CMAKE_SOURCE_DIR}/include/hidapi
@ -41,15 +59,7 @@ if ( ENABLE_USB_HID )
FILE ( GLOB Leddevice_USB_HID_SOURCES "${CURRENT_SOURCE_DIR}/dev_hid/*.h" "${CURRENT_SOURCE_DIR}/dev_hid/*.cpp")
endif()
if ( ENABLE_SPIDEV )
FILE ( GLOB Leddevice_SPI_SOURCES "${CURRENT_SOURCE_DIR}/dev_spi/*.h" "${CURRENT_SOURCE_DIR}/dev_spi/*.cpp")
endif()
if ( ENABLE_TINKERFORGE )
FILE ( GLOB Leddevice_TINKER_SOURCES "${CURRENT_SOURCE_DIR}/dev_tinker/*.h" "${CURRENT_SOURCE_DIR}/dev_tinker/*.cpp")
endif()
if ( ENABLE_WS281XPWM )
if ( ENABLE_DEV_WS281XPWM )
include_directories(../../dependencies/external/rpi_ws281x)
FILE ( GLOB Leddevice_PWM_SOURCES "${CURRENT_SOURCE_DIR}/dev_rpi_pwm/*.h" "${CURRENT_SOURCE_DIR}/dev_rpi_pwm/*.cpp")
endif()
@ -59,10 +69,12 @@ set(LedDevice_RESOURCES ${CURRENT_SOURCE_DIR}/LedDeviceSchemas.qrc )
SET( Leddevice_SOURCES
${Leddevice_SOURCES}
${LedDevice_RESOURCES}
${Leddevice_USB_HID_SOURCES}
${Leddevice_TINKER_SOURCES}
${Leddevice_SPI_SOURCES}
${Leddevice_NETWORK_SOURCES}
${Leddevice_PWM_SOURCES}
${Leddevice_SERIAL_SOURCES}
${Leddevice_SPI_SOURCES}
${Leddevice_TINKER_SOURCES}
${Leddevice_USB_HID_SOURCES}
)
# auto generate header file that include all available leddevice headers
@ -86,24 +98,42 @@ target_link_libraries(leddevice
hyperion
hyperion-utils
${CMAKE_THREAD_LIBS_INIT}
Qt${QT_VERSION_MAJOR}::Network
Qt${QT_VERSION_MAJOR}::SerialPort
ssdp
)
if(WIN32)
target_link_libraries(leddevice ws2_32)
endif()
if(ENABLE_TINKERFORGE)
if(ENABLE_DEV_NETWORK)
target_link_libraries(leddevice Qt${QT_VERSION_MAJOR}::Network ssdp)
if (NOT DEFAULT_USE_SYSTEM_MBEDTLS_LIBS)
if (MBEDTLS_LIBRARIES)
include_directories(${MBEDTLS_INCLUDE_DIR})
target_link_libraries(leddevice ${MBEDTLS_LIBRARIES})
target_include_directories(leddevice PRIVATE ${MBEDTLS_INCLUDE_DIR})
endif (MBEDTLS_LIBRARIES)
endif ()
string(REGEX MATCH "[0-9]+|-([A-Za-z0-9_.]+)" MBEDTLS_MAJOR ${MBEDTLS_VERSION})
if (MBEDTLS_MAJOR EQUAL "3")
target_compile_definitions(leddevice PRIVATE USE_MBEDTLS3)
endif()
endif()
if(ENABLE_DEV_SERIAL)
target_link_libraries(leddevice Qt${QT_VERSION_MAJOR}::SerialPort)
endif()
if(ENABLE_DEV_TINKERFORGE)
target_link_libraries(leddevice tinkerforge)
endif()
if(ENABLE_WS281XPWM)
if(ENABLE_DEV_WS281XPWM)
target_link_libraries(leddevice ws281x)
endif()
if (ENABLE_USB_HID)
if (ENABLE_DEV_USB_HID)
if(APPLE)
target_link_libraries(leddevice ${LIBUSB_1_LIBRARIES} hidapi-mac)
else()
@ -111,15 +141,3 @@ if (ENABLE_USB_HID)
endif()
endif()
if (NOT DEFAULT_USE_SYSTEM_MBEDTLS_LIBS)
if (MBEDTLS_LIBRARIES)
include_directories(${MBEDTLS_INCLUDE_DIR})
target_link_libraries(leddevice ${MBEDTLS_LIBRARIES})
target_include_directories(leddevice PRIVATE ${MBEDTLS_INCLUDE_DIR})
endif (MBEDTLS_LIBRARIES)
endif ()
string(REGEX MATCH "[0-9]+|-([A-Za-z0-9_.]+)" MBEDTLS_MAJOR ${MBEDTLS_VERSION})
if (MBEDTLS_MAJOR EQUAL "3")
target_compile_definitions(leddevice PRIVATE USE_MBEDTLS3)
endif()

View File

@ -1,15 +1,17 @@
# Define the current source locations
# Include the python directory. Also include the parent (which is for example /usr/include)
# which may be required when it is not includes by the (cross-) compiler by default.
if (NOT CMAKE_VERSION VERSION_LESS "3.12")
find_package(Python3 COMPONENTS Interpreter Development REQUIRED)
include_directories(${Python3_INCLUDE_DIRS} ${Python3_INCLUDE_DIRS}/..)
add_compile_definitions(PYTHON_VERSION_MAJOR_MINOR=${Python3_VERSION_MAJOR}${Python3_VERSION_MINOR})
else()
find_package (PythonLibs ${PYTHON_VERSION_STRING} EXACT) # Maps PythonLibs to the PythonInterp version of the main cmake
include_directories(${PYTHON_INCLUDE_DIRS} ${PYTHON_INCLUDE_DIRS}/..)
add_definitions(-DPYTHON_VERSION_MAJOR_MINOR=${PYTHON_VERSION_MAJOR}${PYTHON_VERSION_MINOR})
if(ENABLE_EFFECTENGINE)
# Include the python directory. Also include the parent (which is for example /usr/include)
# which may be required when it is not includes by the (cross-) compiler by default.
if (NOT CMAKE_VERSION VERSION_LESS "3.12")
find_package(Python3 COMPONENTS Interpreter Development REQUIRED)
include_directories(${Python3_INCLUDE_DIRS} ${Python3_INCLUDE_DIRS}/..)
add_compile_definitions(PYTHON_VERSION_MAJOR_MINOR=${Python3_VERSION_MAJOR}${Python3_VERSION_MINOR})
else()
find_package (PythonLibs ${PYTHON_VERSION_STRING} EXACT) # Maps PythonLibs to the PythonInterp version of the main cmake
include_directories(${PYTHON_INCLUDE_DIRS} ${PYTHON_INCLUDE_DIRS}/..)
add_definitions(-DPYTHON_VERSION_MAJOR_MINOR=${PYTHON_VERSION_MAJOR}${PYTHON_VERSION_MINOR})
endif()
endif()
SET(CURRENT_HEADER_DIR ${CMAKE_SOURCE_DIR}/include/utils)
@ -27,8 +29,11 @@ add_library(hyperion-utils
target_link_libraries(hyperion-utils
hyperion
python
Qt${QT_VERSION_MAJOR}::Core
Qt${QT_VERSION_MAJOR}::Gui
Qt${QT_VERSION_MAJOR}::Network
)
if(ENABLE_EFFECTENGINE)
target_link_libraries(hyperion-utils python)
endif()

View File

@ -1,5 +1,9 @@
#include "HyperionConfig.h"
#if defined(ENABLE_EFFECTENGINE)
// Python includes
#include <Python.h>
#endif
#include "utils/SysInfo.h"
#include "utils/FileUtils.h"
@ -10,6 +14,9 @@
#include <QRegularExpressionMatch>
#include <iostream>
#ifndef _WIN32
#include <unistd.h>
#endif
#ifdef _WIN32
#include <shlobj_core.h>
@ -32,7 +39,9 @@ SysInfo::SysInfo()
_sysinfo.isUserAdmin = isUserAdmin();
getCPUInfo();
_sysinfo.qtVersion = QT_VERSION_STR;
#if defined(ENABLE_EFFECTENGINE)
_sysinfo.pyVersion = PY_VERSION;
#endif
}
SysInfo::HyperionSysInfo SysInfo::get()

View File

@ -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)

View File

@ -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()
{

View File

@ -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

View File

@ -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;

View File

@ -4,13 +4,15 @@ else()
project(hyperiond)
endif()
if (NOT CMAKE_VERSION VERSION_LESS "3.12")
find_package(Python3 COMPONENTS Interpreter Development REQUIRED)
include_directories(${Python3_INCLUDE_DIRS} ${Python3_INCLUDE_DIRS}/..)
else()
find_package (PythonLibs ${PYTHON_VERSION_STRING} EXACT) # Maps PythonLibs to the PythonInterp version of the main cmake
include_directories(${PYTHON_INCLUDE_DIRS} ${PYTHON_INCLUDE_DIRS}/..)
endif()
if(ENABLE_EFFECTENGINE)
if (NOT CMAKE_VERSION VERSION_LESS "3.12")
find_package(Python3 COMPONENTS Interpreter Development REQUIRED)
include_directories(${Python3_INCLUDE_DIRS} ${Python3_INCLUDE_DIRS}/..)
else()
find_package (PythonLibs ${PYTHON_VERSION_STRING} EXACT) # Maps PythonLibs to the PythonInterp version of the main cmake
include_directories(${PYTHON_INCLUDE_DIRS} ${PYTHON_INCLUDE_DIRS}/..)
endif()
endif ()
find_package(Qt${QT_VERSION_MAJOR} COMPONENTS Core Network Gui Widgets REQUIRED)
@ -47,12 +49,10 @@ endif(WIN32)
target_link_libraries(${PROJECT_NAME}
commandline
hyperion
effectengine
jsonserver
webserver
ssdp
database
python
resources
Qt${QT_VERSION_MAJOR}::Core
Qt${QT_VERSION_MAJOR}::Gui
@ -60,12 +60,15 @@ target_link_libraries(${PROJECT_NAME}
Qt${QT_VERSION_MAJOR}::Widgets
)
if (NOT CMAKE_VERSION VERSION_LESS "3.12")
target_link_libraries( ${PROJECT_NAME} ${Python3_LIBRARIES} )
else()
target_link_libraries( ${PROJECT_NAME} ${PYTHON_LIBRARIES} )
endif()
if(ENABLE_EFFECTENGINE)
target_link_libraries(${PROJECT_NAME} effectengine python)
if (NOT CMAKE_VERSION VERSION_LESS "3.12")
target_link_libraries( ${PROJECT_NAME} ${Python3_LIBRARIES} )
else()
target_link_libraries( ${PROJECT_NAME} ${PYTHON_LIBRARIES} )
endif()
endif ()
if(ENABLE_FLATBUF_SERVER)
target_link_libraries(${PROJECT_NAME} flatbufserver)

View File

@ -53,11 +53,13 @@
// NetOrigin checks
#include <utils/NetOrigin.h>
#if defined(ENABLE_EFFECTENGINE)
// Init Python
#include <python/PythonInit.h>
// EffectFileHandler
#include <effectengine/EffectFileHandler.h>
#endif
#ifdef ENABLE_CEC
#include <cec/CECHandler.h>
@ -73,7 +75,9 @@ HyperionDaemon::HyperionDaemon(const QString& rootPath, QObject* parent, bool lo
, _bonjourBrowserWrapper(new BonjourBrowserWrapper())
#endif
, _netOrigin(new NetOrigin(this))
#if defined(ENABLE_EFFECTENGINE)
, _pyInit(new PythonInit())
#endif
, _webserver(nullptr)
, _sslWebserver(nullptr)
, _jsonServer(nullptr)
@ -113,9 +117,11 @@ HyperionDaemon::HyperionDaemon(const QString& rootPath, QObject* parent, bool lo
createCecHandler();
#if defined(ENABLE_EFFECTENGINE)
// init EffectFileHandler
EffectFileHandler* efh = new EffectFileHandler(rootPath, getSetting(settings::EFFECTS), this);
connect(this, &HyperionDaemon::settingsChanged, efh, &EffectFileHandler::handleSettingsUpdate);
#endif
// connect and apply settings for AuthManager
connect(this, &HyperionDaemon::settingsChanged, _authManager, &AuthManager::handleSettingsUpdate);
@ -160,7 +166,9 @@ HyperionDaemon::HyperionDaemon(const QString& rootPath, QObject* parent, bool lo
HyperionDaemon::~HyperionDaemon()
{
delete _settingsManager;
#if defined(ENABLE_EFFECTENGINE)
delete _pyInit;
#endif
}
void HyperionDaemon::setVideoMode(VideoMode mode)

View File

@ -73,7 +73,9 @@ class JsonServer;
class BonjourBrowserWrapper;
class WebServer;
class SettingsManager;
#if defined(ENABLE_EFFECTENGINE)
class PythonInit;
#endif
class SSDPHandler;
class FlatBufferServer;
class ProtoServer;
@ -168,7 +170,9 @@ private:
AuthManager* _authManager;
BonjourBrowserWrapper* _bonjourBrowserWrapper;
NetOrigin* _netOrigin;
#if defined(ENABLE_EFFECTENGINE)
PythonInit* _pyInit;
#endif
WebServer* _webserver;
WebServer* _sslWebserver;
JsonServer* _jsonServer;

View File

@ -192,7 +192,9 @@ int main(int argc, char** argv)
#endif
parser.add<BooleanOption> (0x0, "desktop", "Show systray on desktop");
parser.add<BooleanOption> (0x0, "service", "Force hyperion to start as console service");
#if defined(ENABLE_EFFECTENGINE)
Option & exportEfxOption = parser.add<Option> (0x0, "export-effects", "Export effects to given path");
#endif
/* Internal options, invisible to help */
BooleanOption & waitOption = parser.addHidden<BooleanOption> (0x0, "wait-hyperion", "Do not exit if other Hyperion instances are running, wait them to finish");
@ -275,6 +277,7 @@ int main(int argc, char** argv)
return 0;
}
#if defined(ENABLE_EFFECTENGINE)
if (parser.isSet(exportEfxOption))
{
Q_INIT_RESOURCE(EffectEngine);
@ -311,6 +314,7 @@ int main(int argc, char** argv)
Error(log, "Can not export to %s",exportEfxOption.getCString(parser));
return 1;
}
#endif
int rc = 1;
bool readonlyMode = false;

View File

@ -15,8 +15,10 @@
#include <utils/ColorRgb.h>
#include <utils/Process.h>
#if defined(ENABLE_EFFECTENGINE)
#include <effectengine/EffectDefinition.h>
#include <effectengine/Effect.h>
#endif
#include <webserver/WebServer.h>
#include <hyperion/PriorityMuxer.h>
@ -91,8 +93,10 @@ void SysTray::createTrayIcon()
clearAction->setIcon(QPixmap(":/clear.svg"));
connect(clearAction, &QAction::triggered, this, &SysTray::clearEfxColor);
const std::list<EffectDefinition> efxs = _hyperion->getEffects();
_trayIconMenu = new QMenu(this);
#if defined(ENABLE_EFFECTENGINE)
const std::list<EffectDefinition> efxs = _hyperion->getEffects();
_trayIconEfxMenu = new QMenu(_trayIconMenu);
_trayIconEfxMenu->setTitle(tr("Effects"));
_trayIconEfxMenu->setIcon(QPixmap(":/effects.svg"));
@ -122,6 +126,7 @@ void SysTray::createTrayIcon()
_trayIconEfxMenu->addAction(efxAction);
}
}
#endif
#ifdef _WIN32
autorunAction = new QAction(tr("&Disable autostart"), this);
@ -135,7 +140,9 @@ void SysTray::createTrayIcon()
_trayIconMenu->addAction(settingsAction);
_trayIconMenu->addSeparator();
_trayIconMenu->addAction(colorAction);
#if defined(ENABLE_EFFECTENGINE)
_trayIconMenu->addMenu(_trayIconEfxMenu);
#endif
_trayIconMenu->addAction(clearAction);
_trayIconMenu->addSeparator();
_trayIconMenu->addAction(restartAction);
@ -175,7 +182,7 @@ void SysTray::setColor(const QColor & color)
{
std::vector<ColorRgb> rgbColor{ ColorRgb{ (uint8_t)color.red(), (uint8_t)color.green(), (uint8_t)color.blue() } };
_hyperion->setColor(PriorityMuxer::FG_PRIORITY,rgbColor, Effect::ENDLESS);
_hyperion->setColor(PriorityMuxer::FG_PRIORITY,rgbColor, PriorityMuxer::ENDLESS);
}
void SysTray::showColorDialog()
@ -228,11 +235,13 @@ void SysTray::settings() const
#endif
}
#if defined(ENABLE_EFFECTENGINE)
void SysTray::setEffect()
{
QString efxName = qobject_cast<QAction*>(sender())->text();
_hyperion->setEffect(efxName, PriorityMuxer::FG_PRIORITY, Effect::ENDLESS);
_hyperion->setEffect(efxName, PriorityMuxer::FG_PRIORITY, PriorityMuxer::ENDLESS);
}
#endif
void SysTray::clearEfxColor()
{

View File

@ -25,7 +25,9 @@ public slots:
void setColor(const QColor & color);
void closeEvent(QCloseEvent *event);
void settings() const;
#if defined(ENABLE_EFFECTENGINE)
void setEffect();
#endif
void clearEfxColor();
void setAutorunState();
@ -66,7 +68,9 @@ private:
QSystemTrayIcon *_trayIcon;
QMenu *_trayIconMenu;
#if defined(ENABLE_EFFECTENGINE)
QMenu *_trayIconEfxMenu;
#endif
QColorDialog _colorDlg;
HyperionDaemon *_hyperiond;
Hyperion *_hyperion;

View File

@ -4,16 +4,19 @@ include_directories(../libsrc)
find_package(Qt${QT_VERSION_MAJOR} COMPONENTS Widgets REQUIRED)
MACRO (link_to_hyperion TARGET)
target_link_libraries( ${TARGET} blackborder leddevice jsonserver hyperion-utils hyperion effectengine )
target_link_libraries( ${TARGET} blackborder leddevice jsonserver hyperion-utils hyperion )
if(ENABLE_EFFECTENGINE)
target_link_libraries( ${TARGET} effectengine )
endif()
ENDMACRO()
if(ENABLE_SPIDEV)
if(ENABLE_DEV_SPI)
# Add the simple test executable 'TestSpi'
add_executable(test_spi TestSpi.cpp)
target_link_libraries( test_spi leddevice hyperion-utils hyperion )
add_executable(spidev_test spidev_test.c)
add_executable(gpio2spi switchPinCtrl.c)
endif(ENABLE_SPIDEV)
endif(ENABLE_DEV_SPI)
add_executable(test_configfile TestConfigFile.cpp)
link_to_hyperion(test_configfile)

View File

@ -1,4 +1,4 @@
Copyright (c) 2011 Julian Berman
Copyright (c) 2013 Julian Berman
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal

View File

@ -3,6 +3,12 @@ import json, sys
from os import path
from jsonschema import Draft3Validator, RefResolver
from urllib.parse import urljoin
from urllib.request import pathname2url
def path2url(path):
return urljoin('file:', pathname2url(path))
print('-- validate json file')
jsonFileName = sys.argv[1]
@ -11,8 +17,11 @@ schemaFileName = sys.argv[2]
try:
with open(schemaFileName) as schemaFile:
with open(jsonFileName) as jsonFile:
resolver = RefResolver('file://%s/schema/' % path.abspath(path.dirname(schemaFileName)), None)
Draft3Validator(json.loads(schemaFile.read()), resolver=resolver).validate(json.loads(jsonFile.read()))
schema = json.load(schemaFile)
uri = path2url('%s/schema/' % path.abspath(path.dirname(schemaFileName)))
resolver = RefResolver(uri, referrer = schema)
instance = json.load(jsonFile)
Draft3Validator(schema, resolver=resolver).validate(instance)
except Exception as e:
print('validation error: '+jsonFileName + ' '+schemaFileName+' ('+str(e)+')')
sys.exit(1)

File diff suppressed because it is too large Load Diff