This commit is contained in:
b1rdhous3 2019-07-10 22:40:13 +02:00
commit b9ef03acac
186 changed files with 4966 additions and 3509 deletions

153
.azure.yml Normal file
View File

@ -0,0 +1,153 @@
jobs:
######################
###### Linux #########
######################
- job: Linux
timeoutInMinutes: 120
pool:
vmImage: 'ubuntu-16.04'
strategy:
matrix:
AMD64 (x64):
dockerTag: 'amd64'
dockerName: 'Debian Stretch (AMD64)'
platform: 'x11'
i386 (x86):
dockerTag: 'i386'
dockerName: 'Debian Stretch (i386)'
platform: 'x11'
ARMv6hf (Raspberry Pi v1 & ZERO):
dockerTag: 'armv6hf'
dockerName: 'Debian Stretch (Raspberry Pi v1 & ZERO)'
platform: 'rpi'
ARMv7hf (Raspberry Pi 2 & 3):
dockerTag: 'armv7hf'
dockerName: 'Debian Stretch (Raspberry Pi 2 & 3)'
platform: 'rpi'
ARMv8 (Generic AARCH64):
dockerTag: 'aarch64'
dockerName: 'ARMv8 (Generic AARCH64)'
platform: 'amlogic'
steps:
- checkout: self # represents the repo where the initial Pipelines YAML file was found
submodules: recursive # set to 'recursive' to get submodules of submodules
# read channel tag in version.json
- task: oneLuckiDevJson2Variable@1
inputs:
jsonFile: 'version.json'
shouldPrefixVariables: true
variablePrefix: 'json'
displayName: 'Read and generate pipeline variables'
# build process
- bash: ./.ci/ci_build.sh
displayName: 'Build $(dockerName) packages'
env:
DOCKER_TAG: $(dockerTag)
DOCKER_NAME: $(dockerName)
PLATFORM: $(platform)
# copy files
- bash: 'cp -v deploy/Hyperion.NG-* $(Build.ArtifactStagingDirectory)'
workingDirectory: '$(Build.SourcesDirectory)'
condition: and(succeeded(), ne(variables['system.pullrequest.isfork'], true), startsWith(variables['Build.SourceBranch'], 'refs/tags/'))
displayName: 'Collecting deployable artifacts'
# publish artifacts
- task: PublishBuildArtifacts@1
inputs:
pathtoPublish: '$(Build.ArtifactStagingDirectory)'
ArtifactName: $(dockerTag)
condition: and(succeeded(), ne(variables['system.pullrequest.isfork'], true), startsWith(variables['Build.SourceBranch'], 'refs/tags/'))
displayName: 'Publish deployables artifacts'
# set release to pre-release
- bash: echo '##vso[task.setvariable variable=preRelease;]true'
condition: and(succeeded(), contains(variables['json.channel'], 'beta'), ne(variables['system.pullrequest.isfork'], true), startsWith(variables['Build.SourceBranch'], 'refs/tags/'))
displayName: 'Mark beta as pre-release'
# create or update github release
- task: GithubRelease@0
inputs:
gitHubConnection: Hyperion.NG
repositoryName: $(Build.Repository.Name)
action: edit
target: $(Build.SourceVersion)
tagSource: manual
tag: $(Build.SourceBranchName)
assets: '$(Build.ArtifactStagingDirectory)/*'
assetUploadMode: 'replace'
addChangeLog: false
isPreRelease: $(preRelease)
condition: and(succeeded(), ne(variables['system.pullrequest.isfork'], true), startsWith(variables['Build.SourceBranch'], 'refs/tags/'))
displayName: Create/Update GitHub release
######################
###### macOS #########
######################
- job: macOS
timeoutInMinutes: 120
pool:
vmImage: 'macOS-10.13'
steps:
- checkout: self # represents the repo where the initial Pipelines YAML file was found
submodules: recursive # set to 'recursive' to get submodules of submodules
# read channel tag in version.json
- task: oneLuckiDevJson2Variable@1
inputs:
jsonFile: 'version.json'
shouldPrefixVariables: true
variablePrefix: 'json'
displayName: 'Read and generate pipeline variables'
# install dependencies
- bash: ./.ci/ci_install.sh
displayName: 'Install dependencies'
# build process
- bash: ./.ci/ci_build.sh
displayName: 'Build macOS 10.13 packages'
env:
PLATFORM: 'osx'
# copy files
- bash: 'cp -v build/Hyperion.NG-* $(Build.ArtifactStagingDirectory)'
workingDirectory: '$(Build.SourcesDirectory)'
condition: and(succeeded(), ne(variables['system.pullrequest.isfork'], true), startsWith(variables['Build.SourceBranch'], 'refs/tags/'))
displayName: 'Collecting deployable artifacts'
# publish artifacts
- task: PublishBuildArtifacts@1
inputs:
pathtoPublish: '$(Build.ArtifactStagingDirectory)'
ArtifactName: 'macos'
condition: and(succeeded(), ne(variables['system.pullrequest.isfork'], true), startsWith(variables['Build.SourceBranch'], 'refs/tags/'))
displayName: 'Publish deployables artifacts'
# set release to pre-release
- bash: echo '##vso[task.setvariable variable=preRelease;]true'
condition: and(succeeded(), contains(variables['json.channel'], 'beta'), ne(variables['system.pullrequest.isfork'], true), startsWith(variables['Build.SourceBranch'], 'refs/tags/'))
displayName: 'Mark beta as pre-release'
# create or update github release
- task: GithubRelease@0
inputs:
gitHubConnection: Hyperion.NG
repositoryName: $(Build.Repository.Name)
action: edit
target: $(Build.SourceVersion)
tagSource: manual
tag: '$(Build.SourceBranchName)'
assets: '$(Build.ArtifactStagingDirectory)/*'
assetUploadMode: 'replace'
addChangeLog: false
isPreRelease: $(preRelease)
condition: and(succeeded(), ne(variables['system.pullrequest.isfork'], true), startsWith(variables['Build.SourceBranch'], 'refs/tags/'))
displayName: Create/Update GitHub release

59
.ci/ci_build.sh Executable file
View File

@ -0,0 +1,59 @@
#!/bin/bash
# detect CI
if [ -n "${TRAVIS-}" ]; then
# Travis-CI
CI_NAME="$(echo "$TRAVIS_OS_NAME" | tr '[:upper:]' '[:lower:]')"
CI_BUILD_DIR="$TRAVIS_BUILD_DIR"
elif [ "$SYSTEM_COLLECTIONID" != "" ]; then
# Azure Pipelines
CI_NAME="$(echo "$AGENT_OS" | tr '[:upper:]' '[:lower:]')"
CI_BUILD_DIR="$BUILD_SOURCESDIRECTORY"
else
# for executing in non ci environment
CI_NAME="$(uname -s | tr '[:upper:]' '[:lower:]')"
fi
# set environment variables if not exists
[ -z "${BUILD_TYPE}" ] && BUILD_TYPE="Debug"
# Determine cmake build type; tag builds are Release, else Debug (-dev appends to platform)
if [[ $BUILD_SOURCEBRANCH == *"refs/tags"* ]]; then
BUILD_TYPE=Release
else
PLATFORM=${PLATFORM}-dev
fi
# Build the package on osx or linux
if [[ "$CI_NAME" == 'osx' || "$CI_NAME" == 'darwin' ]]; then
# compile prepare
mkdir build || exit 1
cd build
cmake -DPLATFORM=${PLATFORM} -DCMAKE_BUILD_TYPE=${BUILD_TYPE} -DCMAKE_INSTALL_PREFIX:PATH=/usr/local ../ || exit 2
make -j $(sysctl -n hw.ncpu) package || exit 3
cd ${CI_BUILD_DIR} && source /${CI_BUILD_DIR}/test/testrunner.sh || exit 4
exit 0;
exit 1 || { echo "---> Hyperion compilation failed! Abort"; exit 5; }
elif [[ "$CI_NAME" == 'linux' ]]; then
echo "Compile Hyperion with DOCKER_TAG = ${DOCKER_TAG} and friendly name DOCKER_NAME = ${DOCKER_NAME}"
# take ownership of deploy dir
mkdir ${CI_BUILD_DIR}/deploy
# run docker
docker run --rm \
-v "${CI_BUILD_DIR}/deploy:/deploy" \
-v "${CI_BUILD_DIR}:/source:ro" \
hyperionproject/hyperion-ci:$DOCKER_TAG \
/bin/bash -c "mkdir hyperion.ng && cp -r source/. /hyperion.ng &&
cd /hyperion.ng && mkdir build && cd build &&
cmake -DPLATFORM=${PLATFORM} -DCMAKE_BUILD_TYPE=${BUILD_TYPE} -DDOCKER_PLATFORM=${DOCKER_TAG} ../ || exit 2 &&
make -j $(nproc) package || exit 3 &&
cp /hyperion.ng/build/bin/h* /deploy/ 2>/dev/null || : &&
cp /hyperion.ng/build/Hyperion.NG-* /deploy/ 2>/dev/null || : &&
cd /hyperion.ng && source /hyperion.ng/test/testrunner.sh || exit 4 &&
exit 0;
exit 1 " || { echo "---> Hyperion compilation failed! Abort"; exit 5; }
# overwrite file owner to current user
sudo chown -fR $(stat -c "%U:%G" ${CI_BUILD_DIR}/deploy) ${CI_BUILD_DIR}/deploy
fi

42
.ci/ci_install.sh Executable file
View File

@ -0,0 +1,42 @@
#!/bin/bash
# detect CI
if [ -n "${TRAVIS-}" ]; then
# Travis-CI
CI_NAME="$(echo "$TRAVIS_OS_NAME" | tr '[:upper:]' '[:lower:]')"
elif [ "$SYSTEM_COLLECTIONID" != "" ]; then
# Azure Pipelines
CI_NAME="$(echo "$AGENT_OS" | tr '[:upper:]' '[:lower:]')"
else
# for executing in non ci environment
CI_NAME="$(uname -s | tr '[:upper:]' '[:lower:]')"
fi
function installAndUpgrade()
{
arr=("$@")
for i in "${arr[@]}";
do
list_output=`brew list | grep $i`
outdated_output=`brew outdated | grep $i`
if [[ ! -z "$list_output" ]]; then
if [[ ! -z "$outdated_output" ]]; then
brew upgrade $i
fi
else
brew install $i
fi
done
}
# install osx deps for hyperion compile
if [[ $CI_NAME == 'osx' || $CI_NAME == 'darwin' ]]; then
echo "Install dependencies"
brew update
dependencies=("qt5" "python" "libusb" "cmake" "doxygen")
installAndUpgrade "${dependencies[@]}"
elif [[ $CI_NAME != 'linux' ]]; then
echo "Unsupported platform: $CI_NAME"
exit 5
fi

5
.gitmodules vendored
View File

@ -5,3 +5,8 @@
[submodule "dependencies/external/flatbuffers"]
path = dependencies/external/flatbuffers
url = https://github.com/google/flatbuffers
branch = master
[submodule "dependencies/external/protobuf"]
path = dependencies/external/protobuf
url = https://github.com/hyperion-project/protobuf.git
branch = master

View File

@ -1,3 +1,11 @@
linux: &linux
os: linux
dist: xenial
services:
- docker
osx: &osx
os: osx
cache:
- ccache
- directories:
@ -5,27 +13,54 @@ cache:
notifications:
email: false
language: cpp
services:
- docker
matrix:
before_install:
- ./.ci/ci_install.sh
jobs:
include:
- os: linux
dist: trusty
- <<: *linux
name: "AMD64 (x64)"
env:
- DOCKER_TAG=ubuntu1604
- DOCKER_NAME="Ubuntu 16.04"
- os: linux
dist: trusty
- DOCKER_TAG=amd64
- DOCKER_NAME="Debian Stretch (AMD64)"
- PLATFORM="x11"
- <<: *linux
name: "i386 (x86)"
env:
- DOCKER_TAG=cross-qemu-rpistretch
- DOCKER_NAME="Raspberry Pi"
- os: osx
- DOCKER_TAG=i386
- DOCKER_NAME="Debian Stretch (i386)"
- PLATFORM="x11"
# ////////////////////////////////////////////////////////////////
# NOTE: Temporary disabled because travis timeouts
# ////////////////////////////////////////////////////////////////
# - <<: *linux
# name: "ARMv6hf (Raspberry Pi v1 & ZERO)"
# env:
# - DOCKER_TAG=armv6hf
# - DOCKER_NAME="Debian Stretch (Raspberry Pi v1 & ZERO)"
# - PLATFORM="rpi"
# - <<: *linux
# name: "ARMv7hf (Raspberry Pi 2 & 3)"
# env:
# - DOCKER_TAG=armv7hf
# - DOCKER_NAME="Debian Stretch (Raspberry Pi 2 & 3)"
# - PLATFORM="rpi"
# - <<: *linux
# name: "ARMv8 (Generic AARCH64)"
# env:
# - DOCKER_TAG=aarch64
# - DOCKER_NAME="ARMv8 (Generic AARCH64)"
# - PLATFORM="amlogic"
#
# ////////////////////////////////////////////////////////////////
- <<: *osx
osx_image: xcode8.3
name: "macOS 10.12 (Xcode 8.3.3)"
env:
- HOMEBREW_CACHE=$HOME/brew-cache
before_install:
- ./.travis/travis_install.sh
- PLATFORM="osx"
script:
- ./.travis/travis_build.sh
after_success:
- ./.travis/travis_deploy.sh
- ./.ci/ci_build.sh

View File

@ -1,64 +0,0 @@
#!/bin/bash
# for executing in non travis environment
[ -z "$TRAVIS_OS_NAME" ] && TRAVIS_OS_NAME="$(uname -s | tr '[:upper:]' '[:lower:]')"
PLATFORM=x86
BUILD_TYPE=Debug
PACKAGES=""
# Detect number of processor cores
# default is 4 jobs
if [[ "$TRAVIS_OS_NAME" == 'osx' || "$TRAVIS_OS_NAME" == 'darwin' ]]
then
JOBS=$(sysctl -n hw.ncpu)
PLATFORM=osx
elif [[ "$TRAVIS_OS_NAME" == 'linux' ]]
then
JOBS=$(nproc)
fi
echo "compile jobs: ${JOBS:=4}"
# Determine cmake build type; tag builds are Release, else Debug
[ -n "${TRAVIS_TAG:-}" ] && BUILD_TYPE=Release
# Determine package creation; True for cron and tag builds
[ "${TRAVIS_EVENT_TYPE:-}" == 'cron' ] || [ -n "${TRAVIS_TAG:-}" ] && PACKAGES=package
# Determie -dev appends to platform;
[ "${TRAVIS_EVENT_TYPE:-}" != 'cron' -a -z "${TRAVIS_TAG:-}" ] && PLATFORM=${PLATFORM}-dev
# Build the package on osx
if [[ "$TRAVIS_OS_NAME" == 'osx' || "$TRAVIS_OS_NAME" == 'darwin' ]]
then
# compile prepare
mkdir build || exit 1
cd build
cmake -DPLATFORM=$PLATFORM -DCMAKE_BUILD_TYPE=$BUILD_TYPE -DCMAKE_INSTALL_PREFIX=/usr .. || exit 2
make -j ${JOBS} || exit 3
fi
# Build the package with docker
if [[ $TRAVIS_OS_NAME == 'linux' ]]
then
echo "Compile Hyperion with DOCKER_TAG = ${DOCKER_TAG} and friendly name DOCKER_NAME = ${DOCKER_NAME}"
# take ownership of deploy dir
mkdir $TRAVIS_BUILD_DIR/deploy
# run docker
docker run --rm \
-v "${TRAVIS_BUILD_DIR}/deploy:/deploy" \
-v "${TRAVIS_BUILD_DIR}:/source:ro" \
hyperionorg/hyperion-ci:$DOCKER_TAG \
/bin/bash -c "mkdir build && cp -r /source/. /build &&
cd /build && mkdir build && cd build &&
cmake -DCMAKE_BUILD_TYPE=${BUILD_TYPE} .. || exit 2 &&
make -j $(nproc) ${PACKAGES} || exit 3 &&
echo '---> Copy binaries and packages to host folder: ${TRAVIS_BUILD_DIR}/deploy' &&
cp -v /build/build/bin/h* /deploy/ 2>/dev/null || : &&
cp -v /build/build/Hyperion-* /deploy/ 2>/dev/null || : &&
exit 0;
exit 1 " || { echo "---> Hyperion compilation failed! Abort"; exit 4; }
# overwrite file owner to current user
sudo chown -fR $(stat -c "%U:%G" $TRAVIS_BUILD_DIR/deploy) $TRAVIS_BUILD_DIR/deploy
fi

View File

@ -1,64 +0,0 @@
#!/bin/bash
# sf_upload <FILES> <sf_dir>
sf_upload()
{
echo "Uploading following files: ${1}
to dir /hyperion-project/${2}"
/usr/bin/expect <<-EOD
spawn scp $1hyperionsf37@frs.sourceforge.net:/home/frs/project/hyperion-project/$2
expect "*(yes/no)*"
send "yes\r"
expect "*password:*"
send "$SFPW\r"
expect eof
EOD
}
# append current Date to filename (just packages no binaries)
appendDate()
{
D=$(date +%Y-%m-%d)
for F in $TRAVIS_BUILD_DIR/deploy/Hy*
do
mv "$F" "${F%.*}-$D.${F##*.}"
done
}
# append friendly name (just packages no binaries)
appendName()
{
for F in $TRAVIS_BUILD_DIR/deploy/Hy*
do
mv "$F" "${F%.*}-($DOCKER_NAME).${F##*.}"
done
}
# get all files to deploy (just packages no binaries)
getFiles()
{
FILES=""
for f in $TRAVIS_BUILD_DIR/deploy/Hy*;
do FILES+="${f} ";
done;
}
if [[ $TRAVIS_OS_NAME == 'linux' ]]; then
if [[ -n $TRAVIS_TAG ]]; then
echo "tag upload"
appendName
appendDate
getFiles
sf_upload $FILES release
elif [[ $TRAVIS_EVENT_TYPE == 'cron' ]]; then
echo "cron upload"
appendName
appendDate
getFiles
sf_upload $FILES dev/alpha
else
echo "Direct pushed no upload, PRs not possible"
#sf_upload $FILES pr
fi
fi

View File

@ -1,26 +0,0 @@
#!/bin/bash
# for executing in non travis environment
[ -z "$TRAVIS_OS_NAME" ] && TRAVIS_OS_NAME="$( uname -s | tr '[:upper:]' '[:lower:]' )"
# install osx deps for hyperion compile
if [[ $TRAVIS_OS_NAME == 'osx' || $TRAVIS_OS_NAME == 'darwin' ]]
then
echo "Install OSX deps"
brew update
brew install qt5 || true
brew upgrade python3 || true
brew upgrade libusb || true
brew upgrade cmake || true
brew install doxygen || true
# install linux deps for hyperion compile
elif [[ $TRAVIS_OS_NAME == 'linux' ]]
then
echo "Install linux deps"
#sudo apt-get -qq update
#sudo apt-get install -qq -y qtbase5-dev libqt5serialport5-dev libusb-1.0-0-dev python3-dev libxrender-dev libavahi-core-dev libavahi-compat-libdnssd-dev doxygen expect
else
echo "Unsupported platform: $TRAVIS_OS_NAME"
exit 5
fi

View File

@ -7,15 +7,56 @@ set(CMAKE_AUTOMOC ON)
# auto prepare .qrc files
set(CMAKE_AUTORCC ON)
IF ( POLICY CMP0026 )
if ( POLICY CMP0026 )
CMAKE_POLICY( SET CMP0026 OLD )
ENDIF()
endif()
SET ( HYPERION_VERSION_STABLE OFF )
SET ( HYPERION_VERSION_MAJOR 2 )
SET ( HYPERION_VERSION_MINOR 0 )
SET ( HYPERION_VERSION_PATCH 0 )
# Configure CCache if available
find_program(CCACHE_FOUND ccache)
if ( CCACHE_FOUND )
set_property(GLOBAL PROPERTY RULE_LAUNCH_COMPILE ccache)
set_property(GLOBAL PROPERTY RULE_LAUNCH_LINK ccache)
endif(CCACHE_FOUND)
find_package( PythonInterp 3.5 REQUIRED )
# Read version from version.json
EXECUTE_PROCESS (
COMMAND ${PYTHON_EXECUTABLE} test/jsonchecks/version.py version.json
WORKING_DIRECTORY ${CMAKE_SOURCE_DIR}
RESULT_VARIABLE error_code
OUTPUT_VARIABLE RETURN_VERSION
)
SET( VERSION_REGEX "[0-9]+\\.[0-9]+\\.[0-9]+(-[a-zA-Z0-9_]+)?" )
if ( ${RETURN_VERSION} MATCHES ${VERSION_REGEX} )
STRING(REGEX MATCHALL "[0-9]+|-([A-Za-z0-9_]+)" VERSION_PARTS ${RETURN_VERSION} )
LIST( GET VERSION_PARTS 0 VERSION_MAJOR )
LIST( GET VERSION_PARTS 1 VERSION_MINOR )
LIST( GET VERSION_PARTS 2 VERSION_PATCH )
else ( ${RETURN_VERSION} MATCHES ${VERSION_REGEX} )
message( FATAL_ERROR "Failed to parse version.json string properly. ${error_code}" )
endif()
SET( HYPERION_VERSION_MAJOR ${VERSION_MAJOR} )
SET( HYPERION_VERSION_MINOR ${VERSION_MINOR} )
SET( HYPERION_VERSION_PATCH ${VERSION_PATCH} )
# Read channel from version.json
EXECUTE_PROCESS (
COMMAND ${PYTHON_EXECUTABLE} test/jsonchecks/version.py version.json "channel"
WORKING_DIRECTORY ${CMAKE_SOURCE_DIR}
RESULT_VARIABLE error_code
OUTPUT_VARIABLE RETURN_CHANNEL
)
if ( error_code )
message( FATAL_ERROR "Failed to parse version.json string properly. ${error_code}" )
endif()
SET ( HYPERION_VERSION_CHANNEL ${RETURN_CHANNEL} )
# Set build variables
SET ( DEFAULT_AMLOGIC OFF )
SET ( DEFAULT_DISPMANX OFF )
SET ( DEFAULT_OSX OFF )
@ -24,6 +65,7 @@ SET ( DEFAULT_QT ON )
SET ( DEFAULT_WS281XPWM OFF )
SET ( DEFAULT_USE_SHARED_AVAHI_LIBS ON )
SET ( DEFAULT_USE_SYSTEM_FLATBUFFERS_LIBS OFF )
SET ( DEFAULT_USE_SYSTEM_PROTO_LIBS OFF )
SET ( DEFAULT_TESTS OFF )
IF ( ${CMAKE_SYSTEM} MATCHES "Linux" )
@ -38,14 +80,6 @@ ELSE()
SET ( DEFAULT_USB_HID OFF )
ENDIF()
if (APPLE)
SET( PLATFORM "osx")
endif()
if (WIN32)
SET( PLATFORM "windows")
endif()
if ( NOT DEFINED PLATFORM )
if ( "${CMAKE_SYSTEM_PROCESSOR}" MATCHES "x86" )
SET( PLATFORM "x11")
@ -58,6 +92,10 @@ if ( NOT DEFINED PLATFORM )
elseif ( ("${SYSTEM_CPUINFO}" MATCHES "amlogic" OR "${SYSTEM_CPUINFO}" MATCHES "odroid-c2" OR "${SYSTEM_CPUINFO}" MATCHES "vero4k") AND ${CMAKE_SIZEOF_VOID_P} EQUAL 8 )
SET( PLATFORM "amlogic64" )
endif()
elseif ( APPLE )
SET( PLATFORM "osx")
elseif ( WIN32 )
SET( PLATFORM "windows")
endif()
if ( PLATFORM )
message( STATUS "PLATFORM is not defined, evaluated platform: ${PLATFORM}")
@ -164,6 +202,9 @@ message(STATUS "ENABLE_PROFILER = ${ENABLE_PROFILER}")
SET ( FLATBUFFERS_INSTALL_BIN_DIR ${CMAKE_BINARY_DIR}/flatbuf )
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
@ -171,7 +212,7 @@ SET( JSON_FILES
${HYPERION_SCHEMAS}
)
EXECUTE_PROCESS (
COMMAND python test/jsonchecks/checkjson.py ${JSON_FILES}
COMMAND ${PYTHON_EXECUTABLE} test/jsonchecks/checkjson.py ${JSON_FILES}
WORKING_DIRECTORY ${CMAKE_SOURCE_DIR}
RESULT_VARIABLE CHECK_JSON_FAILED
)
@ -180,7 +221,7 @@ IF ( ${CHECK_JSON_FAILED} )
ENDIF ()
EXECUTE_PROCESS (
COMMAND python test/jsonchecks/checkeffects.py effects effects/schema
COMMAND ${PYTHON_EXECUTABLE} test/jsonchecks/checkeffects.py effects effects/schema
WORKING_DIRECTORY ${CMAKE_SOURCE_DIR}
RESULT_VARIABLE CHECK_EFFECTS_FAILED
)
@ -188,6 +229,7 @@ IF ( ${CHECK_EFFECTS_FAILED} )
MESSAGE (FATAL_ERROR "check of json effect files failed" )
ENDIF ()
# for python 3 the checkschema.py file must be rewritten
EXECUTE_PROCESS (
COMMAND python test/jsonchecks/checkschema.py config/hyperion.config.json.default libsrc/hyperion/hyperion.schema.json
WORKING_DIRECTORY ${CMAKE_SOURCE_DIR}
@ -197,9 +239,6 @@ IF ( ${CHECK_CONFIG_FAILED} )
MESSAGE (FATAL_ERROR "check of json default config failed" )
ENDIF ()
# Createt the configuration file
# Add project specific cmake modules (find, etc)
set(CMAKE_MODULE_PATH ${CMAKE_MODULE_PATH} ${CMAKE_CURRENT_SOURCE_DIR}/cmake)
@ -210,7 +249,6 @@ find_package(GitVersion)
configure_file("${PROJECT_SOURCE_DIR}/HyperionConfig.h.in" "${PROJECT_BINARY_DIR}/HyperionConfig.h")
include_directories("${PROJECT_BINARY_DIR}")
# Define the global output path of binaries
SET(LIBRARY_OUTPUT_PATH ${PROJECT_BINARY_DIR}/lib)
SET(EXECUTABLE_OUTPUT_PATH ${PROJECT_BINARY_DIR}/bin)
@ -233,6 +271,7 @@ CHECK_CXX_COMPILER_FLAG("-std=c++0x" COMPILER_SUPPORTS_CXX0X)
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wall")
if (CMAKE_COMPILER_IS_GNUCXX)
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wno-psabi")
set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -Wno-psabi")
endif()
if(COMPILER_SUPPORTS_CXX11)
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=c++11")
@ -242,6 +281,9 @@ else()
message(STATUS "No support for C++11 detected. Compilation will most likely fail on your compiler")
endif()
# Use GNU gold linker if available
include (${CMAKE_CURRENT_SOURCE_DIR}/cmake/LDGold.cmake)
# setup -rpath to search for shared libs in BINARY/../libs folder
if (UNIX AND NOT APPLE)
SET(CMAKE_SKIP_BUILD_RPATH FALSE)
@ -250,6 +292,24 @@ if (UNIX AND NOT APPLE)
endif ()
# add QT5 dependency
IF ( CMAKE_CROSSCOMPILING )
file(GLOB QT_BIN ${QT_BIN_PATH})
set(QT_MOC_EXECUTABLE ${QT_BIN}/moc)
add_executable(Qt5::moc IMPORTED)
set_property(TARGET Qt5::moc PROPERTY IMPORTED_LOCATION ${QT_MOC_EXECUTABLE})
set(QT_RCC_EXECUTABLE ${QT_BIN}/rcc)
add_executable(Qt5::rcc IMPORTED)
set_property(TARGET Qt5::rcc PROPERTY IMPORTED_LOCATION ${QT_RCC_EXECUTABLE})
message(STATUS "QT_BIN_PATH = ${QT_BIN}")
message(STATUS "QT_MOC_EXECUTABLE = ${QT_MOC_EXECUTABLE}")
message(STATUS "QT_RCC_EXECUTABLE = ${QT_RCC_EXECUTABLE}")
ENDIF()
SET(QT_MIN_VERSION "5.5.0")
find_package(Qt5 COMPONENTS Core Gui Network SerialPort REQUIRED)
message( STATUS "Found Qt Version: ${Qt5Core_VERSION}" )
@ -257,12 +317,23 @@ IF ( "${Qt5Core_VERSION}" VERSION_LESS "${QT_MIN_VERSION}" )
message( FATAL_ERROR "Your Qt version is to old! Minimum required ${QT_MIN_VERSION}" )
ENDIF()
# Add libusb and pthreads
find_package(libusb-1.0 REQUIRED)
find_package(Threads REQUIRED)
add_definitions(${QT_DEFINITIONS})
# Add jpeg library
if (ENABLE_V4L2)
find_package(JPEG)
if (JPEG_FOUND)
add_definitions(-DHAVE_JPEG)
message( STATUS "Using JPEG library: ${JPEG_LIBRARIES}")
include_directories(${JPEG_INCLUDE_DIR})
else()
message( STATUS "JPEG library not found, MJPEG camera format won't work in V4L2 grabber.")
endif()
endif()
# TODO[TvdZ]: This linking directory should only be added if we are cross compiling
#if(NOT APPLE)
# link_directories(${CMAKE_FIND_ROOT_PATH}/lib/arm-linux-gnueabihf)
@ -300,3 +371,4 @@ add_custom_target(uninstall COMMAND ${CMAKE_COMMAND} -P ${CMAKE_CURRENT_BINARY_D
# enable make package - no code after this line !
include (${CMAKE_CURRENT_SOURCE_DIR}/cmake/packages.cmake)

View File

@ -1,16 +1,33 @@
# With Docker
If you are using [Docker](https://www.docker.com/), you can compile Hyperion inside a docker container. This keeps your system clean and with a simple script it's easy to use. Supported is also cross compilation for Raspberry Pi (Raspbian stretch)
If you are using [Docker](https://www.docker.com/), you can compile Hyperion inside a docker container. This keeps your system clean and with a simple script it's easy to use. Supported is also cross compiling for Raspberry Pi (Debian Stretch or higher). To compile Hyperion just execute one of the following commands.
To compile Hyperion for Ubuntu 16.04 (x64) or higher just execute the following command
The compiled binaries and packages will be available at the deploy folder next to the script
Note: call the script with `./docker-compile.sh -h` for more options
## Native compiling on Raspberry Pi
```
wget -qN https://raw.github.com/hyperion-project/hyperion.ng/master/bin/scripts/docker-compile.sh && chmod +x *.sh && ./docker-compile.sh -t rpi-raspbian
```
## Cross compiling on X64_86 for:
**X64:**
```
wget -qN https://raw.github.com/hyperion-project/hyperion.ng/master/bin/scripts/docker-compile.sh && chmod +x *.sh && ./docker-compile.sh
```
To compile Hyperion for Raspberry Pi
**i386:**
```
wget -qN https://raw.github.com/hyperion-project/hyperion.ng/master/bin/scripts/docker-compile.sh && chmod +x *.sh && ./docker-compile.sh -t cross-qemu-rpistretch
wget -qN https://raw.github.com/hyperion-project/hyperion.ng/master/bin/scripts/docker-compile.sh && chmod +x *.sh && ./docker-compile.sh -t i386
```
**Raspberry Pi v1 & ZERO**
```
wget -qN https://raw.github.com/hyperion-project/hyperion.ng/master/bin/scripts/docker-compile.sh && chmod +x *.sh && ./docker-compile.sh -t armv6hf
```
**Raspberry Pi 2 & 3**
```
wget -qN https://raw.github.com/hyperion-project/hyperion.ng/master/bin/scripts/docker-compile.sh && chmod +x *.sh && ./docker-compile.sh -t armv7hf
```
The compiled binaries and packages will be available at the deploy folder next to the script
Note: call the script with `./docker-compile.sh -h` for more options
# The usual way
@ -18,7 +35,7 @@ Note: call the script with `./docker-compile.sh -h` for more options
```
sudo apt-get update
sudo apt-get install git cmake build-essential qtbase5-dev libqt5serialport5-dev libusb-1.0-0-dev python3-dev libxrender-dev libavahi-core-dev libavahi-compat-libdnssd-dev
sudo apt-get install git cmake build-essential qtbase5-dev libqt5serialport5-dev libusb-1.0-0-dev python3-dev libxrender-dev libavahi-core-dev libavahi-compat-libdnssd-dev libjpeg-dev
```
**on RPI you need the videocore IV headers**
@ -27,6 +44,10 @@ sudo apt-get install git cmake build-essential qtbase5-dev libqt5serialport5-dev
sudo apt-get install libraspberrypi-dev
```
**OSMC on Raspberry Pi**
```
sudo apt-get install rbp-userland-dev-osmc
```
**ATTENTION Win10LinuxSubsystem** we do not (/we can't) support using hyperion in linux subsystem of MS Windows 10, albeit some users tested it with success. Keep in mind to disable
all linux specific led and grabber hardware via cmake. Because we use QT as framework in hyperion, serialport leds and network driven devices could work.
@ -68,6 +89,8 @@ mkdir build
cd build
cmake -DCMAKE_BUILD_TYPE=Release ..
make -j $(nproc)
if this get stucked and dmseg says out of memory try:
make -j 2
# optional: install into your system
sudo make install/strip
# to uninstall (not very well tested, please keep that in mind)

View File

@ -1,38 +1,36 @@
#!/bin/bash
#Updated: 18 August 2016, by brindosch
#Just use a clean Ubunut 14.04 and run this script
#Use a clean Raspbian Stretch Lite and Ubunut 18/19 and run this script
##############
#ON TARGET
#--------------
#sudo apt-get install qtbase5-dev libqt5serialport5-dev libusb-1.0-0-dev python-dev libxrender-dev libavahi-core-dev libavahi-compat-libdnssd-dev python-dev rsync
#sudo apt-get install qtbase5-dev libqt5serialport5-dev libusb-1.0-0-dev python3-dev libxrender-dev libavahi-core-dev libavahi-compat-libdnssd-dev aptitude show qt5-default rsync
#############
#ON HOST
#---------
sudo apt-get update
sudo apt-get upgrade
#TO-DO verify what is really required
#blacklist: lib32z1 lib32ncurses5 lib32bz2-1.0 zlib1g-dev
sudo apt-get -qq -y install git rsync cmake build-essential qtbase5-dev libqt5serialport5-dev libusb-1.0-0-dev python-dev libxrender-dev libavahi-core-dev libavahi-compat-libdnssd-dev
# !!! TO-DO verify aptitude gcc-multilib
echo 'PATH=$PATH:$HOME/raspberrypi/tools/arm-bcm2708/gcc-linaro-arm-linux-gnueabihf-raspbian/bin' >> .bashrc
sudo apt-get -qq -y install git rsync cmake build-essential qtbase5-dev libqt5serialport5-dev libusb-1.0-0-dev python3-dev libxrender-dev libavahi-core-dev libavahi-compat-libdnssd-dev
#---------
export TARGET_IP=192.168.0.103
export TARGET_IP=x.x.x.x
export TARGET_USER=pi
export RASCROSS_DIR="$HOME/raspberrypi"
export CROSSROOT="$HOME/crosscompile"
export RASCROSS_DIR="$CROSSROOT/raspberrypi"
export ROOTFS_DIR="$RASCROSS_DIR/rootfs"
export HYPERION_DIR="$HOME/hyperion"
#export IMX6_DIR="$HOME/hummingboard"
export TOOLCHAIN_FILE="$HYPERION_DIR/Toolchain-RaspberryPi.cmake"
export TOOLCHAIN_DIR="$RASCROSS_DIR/tools"
export QT5_DIR="$CROSSROOT/Qt5"
export NATIVE_BUILD_DIR="$HYPERION_DIR/build"
export TARGET_BUILD_DIR="$HYPERION_DIR/build-rpi"
export HYPERION_DIR="$HOME/hyperion.ng"
mkdir -p "$ROOTFS_DIR"
rsync -rl --delete-after --copy-unsafe-links $TARGET_USER@$TARGET_IP:/{lib,usr} "$ROOTFS_DIR"
mkdir -p "$ROOTFS_DIR/lib"
mkdir -p "$ROOTFS_DIR/usr"
rsync -rl --delete-after --copy-unsafe-links $TARGET_USER@$TARGET_IP:/lib "$ROOTFS_DIR"
rsync -rl --delete-after --copy-unsafe-links $TARGET_USER@$TARGET_IP:/usr/include "$ROOTFS_DIR/usr"
rsync -rl --delete-after --copy-unsafe-links $TARGET_USER@$TARGET_IP:/usr/lib "$ROOTFS_DIR/usr"
######## RPi specific #########
@ -40,41 +38,40 @@ mkdir -p "$RASCROSS_DIR/firmware"
git clone --depth 1 https://github.com/raspberrypi/firmware.git "$RASCROSS_DIR/firmware"
ln -s "$RASCROSS_DIR/firmware/hardfp/opt" "$ROOTFS_DIR/opt"
git clone --depth 1 git://github.com/raspberrypi/tools.git "$RASCROSS_DIR/tools"
mkdir -p "$TOOLCHAIN_DIR"
cd $TOOLCHAIN_DIR
wget -c https://releases.linaro.org/components/toolchain/binaries/latest-7/arm-linux-gnueabihf/gcc-linaro-7.4.1-2019.02-x86_64_arm-linux-gnueabihf.tar.xz --no-check-certificate
tar -xvf gcc-linaro-7.4.1-2019.02-x86_64_arm-linux-gnueabihf.tar.xz
##### End of RPi specific ######
######## NOT TESTED ONLY INFOs #########
######## IMX6 specific #########
#export IMX6_DIR="$HOME/hummingboard"
#mkdir -p "$IMX6_Dir"
#cd "$IMX6_Dir"
#wget https://launchpad.net/linaro-toolchain-binaries/trunk/2013.10/+download/gcc-linaro-arm-linux-gnueabihf-4.8-2013.10_linux.tar.bz2
#tar -xvjf gcc-linaro-arm-linux-gnueabihf-4.8-2013.10_linux.tar.bz2
#cd
##### End of IMX6 specific ######
######## NOT TESTED #########
######## Qt5 specific #########
mkdir -p "$QT5_DIR"
cd "$QT5_DIR"
wget -c http://download.qt.io/archive/qt/5.7/5.7.1/qt-opensource-linux-x64-5.7.1.run
chmod +x $QT5_DIR/*.run
#Display absolute installation directory to be used in Qt5 installer
echo $HOME/crosscompile/Qt5
./qt-opensource-linux-x64-5.7.1.run
#Follow the dialogs and install in absolute directory of $HOME/crosscompile/Qt5 (copy from above)
##### End of Qt5 specific ######
# get the Hyperion sources
git clone --recursive https://github.com/hyperion-project/hyperion.ng.git "$HYPERION_DIR"
# do a native build (to build the flatbuffers compiler for the native platform)
mkdir -p "$NATIVE_BUILD_DIR"
cmake -DENABLE_DISPMANX=OFF --build "$NATIVE_BUILD_DIR" "$HYPERION_DIR"
# do the cross build
# specify the protoc export file to import the flatbuffers compiler from the native build
mkdir -p "$TARGET_BUILD_DIR"
cmake -DCMAKE_TOOLCHAIN_FILE="$TOOLCHAIN_FILE" -DIMPORT_PROTOC=$NATIVE_BUILD_DIR/protoc_export.cmake --build "$TARGET_BUILD_DIR" "$HYPERION_DIR"
# get requried submodules
cd "$HYPERION_DIR"
git fetch --recurse-submodules -j2
#compile
cd "$HYPERION_DIR/bin"
chmod +x *
cp "$HYPERION_DIR/bin/create_all_releases.sh" "$HYPERION_DIR"
cd "$HYPERION_DIR"
./create_all_releases.sh
chmod +x "$HYPERION_DIR/bin/"*.sh
./bin/create_all_releases.sh
######END
#------------------------------------------------------------------------------
#These instructions are based on tvdzwan and on the guide given by:
#http://airwiki.ws.dei.polimi.it/index.php/Cross-compiling_for_the_RaspberryPi

View File

@ -43,5 +43,6 @@
#define HYPERION_VERSION_MINOR "${HYPERION_VERSION_MINOR}"
#define HYPERION_VERSION_PATCH "${HYPERION_VERSION_PATCH}"
#define HYPERION_VERSION "${HYPERION_VERSION_MAJOR}.${HYPERION_VERSION_MINOR}.${HYPERION_VERSION_PATCH}"
#define HYPERION_VERSION_CHANNEL "${HYPERION_VERSION_CHANNEL}"
#define HYPERION_JSON_VERSION "1.0.0"

View File

@ -1,46 +1,47 @@
HYPERION
========
![Hyperion.NG](https://raw.githubusercontent.com/hyperion-project/hyperion.ng/master/assets/webconfig/img/hyperion/hyperionlogo.png)
[![Build Status](https://travis-ci.org/hyperion-project/hyperion.ng.svg?branch=master)](https://travis-ci.org/hyperion-project/hyperion.ng)
[![Dependencies](https://img.shields.io/librariesio/github/hyperion-project/hyperion.ng.svg)](https://github.com/hyperion-project/hyperion.ng/tree/master/dependencies/external)
[![Azure-Pipeline](https://dev.azure.com/Hyperion-Project/Hyperion.NG/_apis/build/status/Hyperion.NG?branchName=master)](https://dev.azure.com/Hyperion-Project/Hyperion.NG/_build/latest?definitionId=7&branchName=master)
[![Travis-CI](https://travis-ci.org/hyperion-project/hyperion.ng.svg?branch=master)](https://travis-ci.org/hyperion-project/hyperion.ng)
[![LGTM](https://img.shields.io/lgtm/alerts/g/hyperion-project/hyperion.ng.svg)](https://lgtm.com/projects/g/hyperion-project/hyperion.ng/alerts/)
This is a pre alpha development repository for the next major version of hyperion
## About Hyperion
--------
## **Important notice!**
[Hyperion.NG](https://github.com/hyperion-project/hyperion.ng) is an opensource '[AmbiLight](https://de.wikipedia.org/wiki/Ambilight)' implementation with support for many LED devices and video grabbers. The project is still in a beta development stage (no stable release available).
Hyperion.NG is under heavy development. This version is currently _only for development_ purpose.
Please do not use it for your 'productiv' setup!
![Screenshot](doc/screenshot.png)
If you want to use hyperion as 'normal user', please use [current stable version](https://github.com/hyperion-project/hyperion)
### Features:
Besides of that .... Feel free to join us! We are looking always for people who wants to participate.
--------
Hyperion is an opensource 'AmbiLight' implementation with support for many LED devices and video grabbers.
The main features of Hyperion are:
* Low CPU load makes it perfect for SoCs like Raspberry Pi
* Json interface which allows easy integration into scripts
* A command line utility to for testing and integration in automated environment
* Priority channels are not coupled to a specific led data provider which means that a provider can post led data and leave without the need to maintain a connection to Hyperion. This is ideal for a remote application (like our Android app).
* Black border detector.
* Priority channels are not coupled to a specific led data provider which means that a provider can post led data and leave without the need to maintain a connection to Hyperion. This is ideal for a remote application (like our [Android app](https://play.google.com/store/apps/details?id=nl.hyperion.hyperionpro)).
* Black border detector and processor
* A scriptable (Python) effect engine
* A web ui to configure and remote control hyperion
* A multi language web interface to configure and remote control hyperion
More information can be found on the official Hyperion [Wiki](https://wiki.hyperion-project.org)
If you need further support please open a topic at the forum!
[![Hyperion webpage/forum](https://img.shields.io/website/https/hyperion-project.org.svg?down_color=red&down_message=offline&up_color=green&up_message=online)](https://www.hyperion-project.org)
If you need further support please open a topic at the our new forum!
[Hyperion webpage/forum](https://www.hyperion-project.org).
## Contributing
Contributions are welcome! Feel free to join us! We are looking always for people who wants to participate.
[![Contributors](https://img.shields.io/github/contributors/hyperion-project/hyperion.ng.svg)](https://github.com/hyperion-project/hyperion.ng/graphs/contributors)
For an example, you can participate in the translation.
[![Join Translation](https://img.shields.io/badge/POEditor-translate-green.svg)](https://poeditor.com/join/project/Y4F6vHRFjA)
## Requirements
* Debian 9, Ubuntu 16.04 or higher. Windows is not supported currently.
Debian 9, Ubuntu 16.04 or higher. Windows is not supported currently.
## Building
See [Compilehowto](CompileHowto.md) and [CrossCompileHowto](CrossCompileHowto.txt).
See [CompileHowto](CompileHowto.md) and [CrossCompileHowto](CrossCompileHowto.txt).
## Download
A download isn't available, you need to compile your own version see "Building"
**Please be patient. The first release is coming soon.**
## License
The source is released under MIT-License (see http://opensource.org/licenses/MIT).
[![GitHub license](https://img.shields.io/badge/License-MIT-yellow.svg)](https://raw.githubusercontent.com/hyperion-project/hyperion.ng/master/LICENSE)

View File

@ -20,7 +20,6 @@ import sys
import socket
import serial
import serial.threaded
import time
class SerialToNet(serial.threaded.Protocol):

View File

@ -30,11 +30,11 @@
lang = lang.toString().replace(/,/g,", ");
var fc = ['<span id="danger_trig">'+$.i18n("about_version")+'<span>',$.i18n("about_build"),$.i18n("about_builddate"),$.i18n("about_translations"),$.i18n("about_resources", $.i18n("general_webui_title"))];
var sc = [currentVersion,si.build,si.time,'('+availLang.length+')<p>'+lang+'</p><p><a href="https://hyperion-project.org/contribute/?pk_campaign=WebUI&pk_kwd=about_contribute" target="_blank">'+$.i18n("about_contribute")+'</a></p>',libh];
var sc = [currentVersion,si.build,si.time,'('+availLang.length+')<p>'+lang+'</p><p><a href="https://github.com/hyperion-project/hyperion.ng" target="_blank">'+$.i18n("about_contribute")+'</a></p>',libh];
createTable("","atb","about_cont");
for(var i = 0; i<fc.length; i++)
$('.atb').append(createTableRow([fc[i],sc[i]], "atb", false, true));
$('.atb').append(createTableRow([fc[i],sc[i]], "atb", false));
$('#danger_trig').off().on('click',function(){
dcount++;

View File

@ -7,6 +7,7 @@
<hr />
<div id="log_content"><span style="font-weight:bold;font-size:17px" data-i18n="conf_logging_nomessage"></span></div>
<hr>
<div style="display:none">
<h4 style="font-weight:bold"><i class="fa fa-reorder fa-fw"></i><span data-i18n="conf_logging_report">Bericht</span></h4>
<button class="btn btn-primary" id="btn_logupload"><i class="fa fa-upload fa-fw"></i><span data-i18n="conf_logging_btn_pbupload"></span></button>
<div id="log_upl_pol"></div>
@ -15,5 +16,6 @@
</div>
</div>
</div>
</div>
<script src="/js/content_logging.js"></script>

View File

@ -37,6 +37,10 @@
<td data-i18n="dashboard_infobox_label_currenthyp">Hyperion version:</td>
<td id="dash_currv">unknown</td>
</tr>
<tr>
<td data-i18n="dashboard_infobox_label_versionbranch">Version Branch:</td>
<td id="dash_versionbranch">unknown</td>
</tr>
<tr>
<td data-i18n="dashboard_infobox_label_latesthyp">Latest version:</td>
<td id="dash_latev">unknown</td>
@ -71,7 +75,7 @@
</div>
</div>
</div>
<div class="col-md-12 col-xxl-5">
<div class="col-md-12 col-xxl-5" style="display:none">
<div class="panel panel-default">
<div class="panel-heading">
<i class="fa fa-newspaper-o fa-fw"></i>

View File

@ -3,6 +3,7 @@
<div class="col-xs-12">
<h3 class="page-header"><i class="fa fa-info fa-fw"></i><span data-i18n="support_label_title">Support Hyperion</span></h3>
<div id="supp_intro"></div>
<div style="display:none">
<h4 style="font-weight: bold" data-i18n="support_label_spreadtheword">Spread the word</h4>
<a href="https://www.facebook.com/Hyperion-1415088231896140/" target="_blank" class="unlink">
<div class="col-xs-12 col-sm-6 col-lg-3 support-container">
@ -40,7 +41,8 @@
</div>
</a>
</div>
<div class="col-xs-12">
</div>
<div class="col-xs-12" style="display:none">
<hr>
<h4 style="font-weight: bold" data-i18n="support_label_donate">Donate or use our affiliate links</h4>
<ol>
@ -125,4 +127,5 @@
<script type="text/javascript">
performTranslation();
createHintH("intro", $.i18n('support_label_intro'), "supp_intro");
removeOverlay();
</script>

View File

@ -4,6 +4,7 @@
<h3 class="page-header"><i class="fa fa-download fa-fw"></i><span data-i18n="main_menu_update_token">Update</span></h3>
<div class="introd">
<h4 data-i18n="update_label_intro">Overview about all available Hyperion versions. On top you could update or downgrade your version of Hyperion whenever you want. Sorted from newest to oldest</h4>
<h4> At the moment the install buttons are not working. Development is still ongoing here. </h4>
<hr />
</div>
<h4 id="update_currver"></h4>
@ -15,11 +16,29 @@
</div>
<script>
performTranslation('trans_update');
$(document).ready( function(error) {
performTranslation();
getReleases(function (callback){
for (key in parsedUpdateJSON)
if(callback)
{
$('#versionlist').append('<div class="col-lg-6"><div class="panel panel-default"><div class="panel-heading"><i class="fa fa-television fa-fw"></i>Hyperion V'+parsedUpdateJSON[key].versionnr+'</div><div class="panel-body"><p><span style="font-weight:bold;">'+$.i18n('update_label_type')+'</span> '+ parsedUpdateJSON[key].channel +'</p><p><span style="font-weight:bold;">'+$.i18n('update_label_description')+'</span> '+parsedUpdateJSON[key].versiondesc+'</p><hr><a class="btn btn-primary" href="'+ parsedUpdateJSON[key].versionchangelog +'" target="_blank"><i class="fa fa-list fa-fw"></i><span style="font-weight:bold;">'+$.i18n('update_button_changelog')+'</span></a><button type="button" class="btn btn-warning pull-right"><i class="fa fa-download fa-fw"></i>'+$.i18n('update_button_install')+'</button></div></div></div>');
for (var key in window.gitHubVersionList)
{
if(window.gitHubVersionList[key].name == null || (window.serverConfig.general.versionBranch == "Stable" && window.gitHubVersionList[key].prerelease == true))
{
continue;
}
$('#versionlist').append('<div class="col-lg-6"><div class="panel panel-'+ (window.gitHubVersionList[key].prerelease == true ? "danger" : "default") +'"><div class="panel-heading"><i class="fa fa-television fa-fw"></i>Hyperion V'+window.gitHubVersionList[key].tag_name+'</div><div class="panel-body"><p><span style="font-weight:bold;">'+$.i18n('update_label_type') + '</span> ' + (window.gitHubVersionList[key].prerelease == true ? "Beta" : "Stable") + '</p><p><span style="font-weight:bold;">'+$.i18n('update_label_description')+'</span> '+window.gitHubVersionList[key].body+'</p><hr><a class="btn btn-primary" href="'+ window.gitHubVersionList[key].html_url +'" target="_blank"><i class="fa fa-list fa-fw"></i><span style="font-weight:bold;">'+$.i18n('update_button_changelog')+'</span></a><button type="button" class="btn btn-warning pull-right" ' + (window.gitHubVersionList[key].tag_name == window.currentVersion ? "disabled":"") + '><i class="fa fa-download fa-fw"></i>'+$.i18n('update_button_install')+'</button></div></div></div>');
}
$('#update_currver').append($.i18n('update_versreminder', currentVersion));
}
else
{
$('#versionlist').append($.i18n('update_error_getting_versions'));
}
});
removeOverlay();
});
</script>

View File

@ -21,6 +21,7 @@
"general_comp_UDPLISTENER": "UDP Listener",
"general_comp_BOBLIGHTSERVER": "Boblight Server",
"general_comp_FLATBUFSERVER": "Flatbuffers Server",
"general_comp_PROTOSERVER": "Protocol Buffers Server",
"general_comp_GRABBER": "Plattform Aufnahme",
"general_comp_V4L": "USB Aufnahme",
"general_comp_LEDDEVICE": "LED Hardware",
@ -48,7 +49,8 @@
"dashboard_infobox_label_latesthyp": "Aktuellste Hyperion Version:",
"dashboard_infobox_label_platform": "Plattform:",
"dashboard_infobox_label_instance": "Instanz:",
"dashboard_infobox_label_ports" : "Port flatbuf:",
"dashboard_infobox_label_ports": "Ports (flat|proto):",
"dashboard_infobox_label_versionbranch": "Versionszweig:",
"dashboard_infobox_message_updatewarning": "Eine aktuellere Version von Hyperion ist verfügbar! (V$1)",
"dashboard_infobox_message_updatesuccess": "Du nutzt die aktuellste Version von Hyperion.",
"dashboard_infobox_label_statush": "Hyperion Status:",
@ -169,6 +171,7 @@
"conf_network_bobl_intro": "Boblight Empfänger",
"conf_network_udpl_intro": "UDP Empfänger",
"conf_network_fbs_intro": "Google Flatbuffers Empfänger. Wird genutzt für schnellen Bildempfang.",
"conf_network_proto_intro": "Der PROTO-Port dieser Hyperion-Instanz, wird genutzt für \"Bildstreams\" (HyperionScreenCap, Kodi Addon, ...)",
"conf_network_forw_intro": "Leite alles an eine zweite Hyperion Instanz weiter, diese kann dann mit einer anderen LED Steuerung genutzt werden",
"conf_logging_label_intro": "Überprüfe die Meldungen im Prokotoll um zu erfahren was Hyperion gerade beschäftigt. Je nach eingestellter Protokoll-Stufe siehst du mehr oder weniger Informationen.",
"conf_logging_btn_pbupload": "Bericht für Supportanfrage hochladen",
@ -253,12 +256,13 @@
"update_button_changelog": "Zeige Änderungsprotokoll",
"update_label_type": "Art:",
"update_versreminder": "Deine Version: $1",
"update_error_getting_versions": "Wir hatten Probleme die verfügbaren Versionen zu ermitteln.",
"about_version": "Version",
"about_build": "Build",
"about_builddate": "Build Datum",
"about_translations": "Übersetzungen",
"about_resources": "$1 Bibliotheken",
"about_contribute" : "Übersetze Hyperion in weitere Sprachen!",
"about_contribute": "Entwickel Hyperion mit uns weiter!",
"about_credits": "Einen Dank an alle Entwickler!",
"info_conlost_label_title": "Verbindung zum Hyperion Service unterbrochen!",
"info_conlost_label_reason": "Mögliche Ursachen:",
@ -346,12 +350,13 @@
"wiz_cc_morethanone": "Du hast mehr als 1 Profil, bitte wähle das zu kalibrierende Profil",
"wiz_cc_btn_stop": "Stoppe Video",
"wiz_cc_summary": "Im folgenden eine Zusammenfassung deiner Einstellungen. Während du ein Video abspielst, kannst du hier weiter ausprobieren. Wenn du fertig bist, klicke auf speichern.",
"edt_dev_auth_key_title" : "Aurora API Schlüssel",
"edt_dev_auth_key_title": "Authentisierungstoken",
"edt_dev_enum_subtract_minimum": "Subtrahiere minimum",
"edt_dev_enum_sub_min_cool_adjust": "Minimale Anpassung: cool",
"edt_dev_enum_sub_min_warm_adjust": "Minimale Anpassung: warm",
"edt_dev_enum_white_off": "Weiß ist aus",
"edt_dev_general_heading_title": "Allgemeine Einstellungen",
"edt_dev_general_name_title": "Name der Konfiguration",
"edt_dev_general_hardwareLedCount_title": "Anzahl Hardware LEDs",
"edt_dev_general_colorOrder_title": "RGB Byte Reihenfolge",
"edt_dev_general_rewriteTime_title": "Aktualisierungszeit",
@ -381,6 +386,7 @@
"edt_dev_spec_transistionTime_title": "Übergangszeit",
"edt_dev_spec_switchOffOnBlack_title": "Aus bei schwarz",
"edt_dev_spec_brightnessFactor_title": "Helligkeitsfaktor",
"edt_dev_spec_ledType_title": "LED typ",
"edt_dev_spec_uid_title": "UID",
"edt_dev_spec_intervall_title": "Intervall",
"edt_dev_spec_latchtime_title": "Sperrzeit",
@ -395,13 +401,12 @@
"edt_dev_spec_useRgbwProtocol_title": "Nutze RGBW Protokoll",
"edt_dev_spec_maximumLedCount_title": "Maximale Anzahl LEDs",
"edt_dev_spec_gpioNumber_title": "GPIO Nummer",
"edt_dev_spec_dmaNumber_title": "DMA Kanal",
"edt_dev_spec_gpioMap_title": "GPIO Zuweisung",
"edt_dev_spec_PBFiFo_title": "Pi-Blaster FiFo",
"edt_dev_spec_gpioBcm_title": "GPIO Pin",
"edt_dev_spec_ledIndex_title": "LED index",
"edt_dev_spec_colorComponent_title": "Farbkomponente",
"edt_dev_spec_ledType_title" : "LED typ",
"edt_dev_spec_dmaNumber_title" : "DMA Kanal",
"edt_conf_general_enable_title": "Aktiviert",
"edt_conf_general_enable_expl": "Wenn aktiviert, ist die Komponente aktiv.",
"edt_conf_general_priority_title": "Priorität",
@ -430,14 +435,17 @@
"edt_conf_enum_bbdefault": "Standard",
"edt_conf_enum_bbclassic": "Klassisch",
"edt_conf_enum_bbosd": "OSD",
"edt_conf_enum_automatic": "Automatisch",
"edt_conf_gen_heading_title": "Allgemeine Einstellungen",
"edt_conf_gen_name_title": "Name der Konfiguration",
"edt_conf_gen_name_expl": "Der Name wird verwendet, um Hyperion besser zu identifizieren. (Hilfreich bei mehreren Instanzen)",
"edt_conf_gen_showOptHelp_title": "Zeige Erklärungen",
"edt_conf_gen_showOptHelp_expl": "Zeige alle verfügbaren Options-Erklärungen. Empfohlen für Anfänger",
"edt_conf_gen_versionBranch_title": "Versionszweig",
"edt_conf_gen_versionBranch_expl": "Gibt an, welcher Versionszweig für die Suche von neuen Hyperion Versionen genutzt werden soll.",
"edt_conf_color_heading_title": "Farbkalibrierung",
"edt_conf_color_channelAdjustment_header_title" : "Anpassung Farbkanäle",
"edt_conf_color_channelAdjustment_header_itemtitle": "Profil",
"edt_conf_color_channelAdjustment_header_title": "Anpassung Farbkanäle",
"edt_conf_color_channelAdjustment_header_expl": "Passe die Farbkanäle deinen LEDs an",
"edt_conf_color_imageToLedMappingType_title": "LED-Bereich Zuordnungstyp",
"edt_conf_color_imageToLedMappingType_expl": "Sofern nicht \"Mehrfarbig\", wird dein LED Layout mit einer anderen Bildzuweisung überschrieben",
@ -535,8 +543,6 @@
"edt_conf_fg_pixelDecimation_expl": "Bildverkleinerung (Faktor) ausgehend von der original Größe. 1 für unveränderte/originale Größe.",
"edt_conf_fg_device_title": "Device",
"edt_conf_fg_display_title": "Display",
"edt_conf_fg_amlogic_grabber_title" : "Amlogic Grabber Device",
"edt_conf_fg_ge2d_mode_title" : "Amlogic ge2d Grabber Modus",
"edt_conf_fg_display_expl": "Gebe an von welchem Desktop aufgenommen werden soll. (Multi Monitor Setup)",
"edt_conf_bb_heading_title": "Schwarze Balken Erkennung",
"edt_conf_bb_threshold_title": "Schwelle",
@ -572,6 +578,9 @@
"edt_conf_fbs_heading_title": "Flatbuffers Server",
"edt_conf_fbs_timeout_title": "Zeitüberschreitung",
"edt_conf_fbs_timeout_expl": "Wenn für die angegebene Zeit keine Daten empfangen werden, wird die Komponente (vorübergehend) deaktiviert",
"edt_conf_pbs_heading_title": "Protocol Buffers Server",
"edt_conf_pbs_timeout_title": "Zeitüberschreitung",
"edt_conf_pbs_timeout_expl": "Wenn für die angegebene Zeit keine Daten empfangen werden, wird die Komponente (vorübergehend) deaktiviert",
"edt_conf_bobls_heading_title": "Boblight Server",
"edt_conf_udpl_heading_title": "UDP Listener",
"edt_conf_udpl_address_title": "Adresse",
@ -596,12 +605,12 @@
"edt_eff_smooth_custom": "Aktivere Glättung",
"edt_eff_smooth_time_ms": "Glättung: Zeit",
"edt_eff_smooth_updateFrequency": "Glättung: Aktualisierungsfrequenz",
"edt_eff_candle_header" : "Kerze",
"edt_eff_candle_header_desc" : "Flackerndes Kerzenlicht",
"edt_eff_waves_header": "Wellen",
"edt_eff_waves_header_desc": "Gestalte Wellen aus Farbe! Mische dazu deine lieblings Farben und wähle einen Mittelpunkt.",
"edt_eff_gif_header": "GIF's",
"edt_eff_gif_header_desc": "Dieser Effekt spielt .gif Dateien ab. Bietet die Möglichkeit kleine GIF-Videos abzuspielen.",
"edt_eff_candle_header": "Kerze",
"edt_eff_candle_header_desc": "Flackerndes Kerzenlicht",
"edt_eff_police_header": "Polizei",
"edt_eff_police_header_desc": "Lights like a police car in action",
"edt_eff_fade_header": "Farbübergang",
@ -627,6 +636,7 @@
"edt_eff_sparks_header": "Funken",
"edt_eff_sparks_header_desc": "Ein Sternenfunkeln, wahlweise in festgelegter Farbe oder zufällig. Passe Helligkeit, Sättigung und Geschwindigkeit an.",
"edt_eff_traces_header": "Farbspuren",
"edt_eff_traces_header_desc": "Erfordert eine Neugestaltung",
"edt_eff_x-mas_header": "Weihnachten",
"edt_eff_x-mas_header_desc": "Ein Hauch von Weihnachten",
"edt_eff_trails_header": "Sternschnuppen",
@ -644,15 +654,17 @@
"edt_eff_colorcount": "Farblänge",
"edt_eff_rotationtime": "Rotationszeit",
"edt_eff_sleeptime": "Schlafzeit",
"edt_eff_image": "Bilddatei",
"edt_eff_fps": "Bilder pro Sekunde",
"edt_eff_reversedirection": "Richtung umkehren",
"edt_eff_fadeintime": "Zeit für Einblendung",
"edt_eff_fadeouttime": "Zeit für Ausblendung",
"edt_eff_repeat": "Wiederholung",
"edt_eff_repeatcount": "Anzahl Wiederholung",
"edt_eff_colorendtime": "Zeit für Start-Farbe",
"edt_eff_colorstarttime": "Zeit für End-Farbe",
"edt_eff_colorstart": "Farbe Start",
"edt_eff_colorend": "Farbe Ende",
"edt_eff_repeatcount" : "Anzahl Wiederholung",
"edt_eff_maintain_end_color": "Behalte Endfarbe",
"edt_eff_colorshift": "Farbverschiebung",
"edt_eff_whichleds": "Welche LEDs",
@ -685,8 +697,8 @@
"edt_eff_colorMinute": "Farbe Minute",
"edt_eff_colorSecond": "Farbe Sekunde",
"edt_eff_colorMarker": "Marker Farbe",
"edt_eff_markerDepth" : "Marker Tiefe",
"edt_eff_markerWidth": "Marker Breite",
"edt_eff_markerDepth": "Marker Tiefe",
"edt_eff_markerEnable": "Zeige Marker",
"edt_eff_backgroundColor": "Hintergrundfarbe",
"edt_eff_countries": "Länder",

View File

@ -21,6 +21,7 @@
"general_comp_UDPLISTENER" : "UDP Listener",
"general_comp_BOBLIGHTSERVER" : "Boblight Server",
"general_comp_FLATBUFSERVER" : "Flatbuffers Server",
"general_comp_PROTOSERVER" : "Protocol Buffers Server",
"general_comp_GRABBER" : "Platform Capture",
"general_comp_V4L" : "USB Capture",
"general_comp_LEDDEVICE" : "LED device",
@ -48,7 +49,8 @@
"dashboard_infobox_label_latesthyp" : "Latest Hyperion version:",
"dashboard_infobox_label_platform" : "Platform:",
"dashboard_infobox_label_instance" : "Instance:",
"dashboard_infobox_label_ports" : "Port flatbuf:",
"dashboard_infobox_label_ports" : "Ports (flat|proto):",
"dashboard_infobox_label_versionbranch" : "Version Branch:",
"dashboard_infobox_message_updatewarning" : "A newer version of Hyperion is available! ($1)",
"dashboard_infobox_message_updatesuccess" : "You run the latest version of Hyperion.",
"dashboard_infobox_label_statush" : "Hyperion status:",
@ -169,6 +171,7 @@
"conf_network_bobl_intro" : "Receiver for Boblight",
"conf_network_udpl_intro" : "Receiver for UDP",
"conf_network_fbs_intro" : "Google Flatbuffers Receiver. Used for fast image transmission.",
"conf_network_proto_intro" : "The PROTO-Port of this Hyperion instance, used for picture streams (HyperionScreenCap, Kodi Addon, ...)",
"conf_network_forw_intro" : "Forward all input to a second Hyperion instance which could be driven with another led controller",
"conf_logging_label_intro" : "Area to check log messages, depending on loglevel setting you see more or less information.",
"conf_logging_btn_pbupload" : "Upload report for support request",
@ -253,12 +256,13 @@
"update_button_changelog" : "Full changelog",
"update_label_type" : "Type:",
"update_versreminder" : "Your version: $1",
"update_error_getting_versions" : "We had trouble to determinate the available Versions.",
"about_version" : "Version",
"about_build" : "Build",
"about_builddate" : "Build date",
"about_translations" : "Translations",
"about_resources" : "$1 libraries",
"about_contribute" : "Add more languages to Hyperion!",
"about_contribute" : "Develop Hyperion further with us!",
"about_credits" : "Credits to all these developers!",
"info_conlost_label_title" : "Lost connection to Hyperion service!",
"info_conlost_label_reason" : "Possible reasons:",
@ -346,7 +350,7 @@
"wiz_cc_morethanone" : "You have more than one profile, please choose the profile you want to calibrate.",
"wiz_cc_btn_stop" : "Stop video",
"wiz_cc_summary" : "A conclusion of your settings. During video playback, you could change or test values again. If you are done, click on save.",
"edt_dev_auth_key_title" : "Aurora API Key",
"edt_dev_auth_key_title" : "Authentication Token",
"edt_dev_enum_subtract_minimum" : "Substract minimum",
"edt_dev_enum_sub_min_cool_adjust" : "Subtract cool white",
"edt_dev_enum_sub_min_warm_adjust" : "Subtract warm white",
@ -431,11 +435,14 @@
"edt_conf_enum_bbdefault" : "Default",
"edt_conf_enum_bbclassic" : "Classic",
"edt_conf_enum_bbosd" : "OSD",
"edt_conf_enum_automatic" : "Automatic",
"edt_conf_gen_heading_title" : "General Settings",
"edt_conf_gen_name_title" : "Configuration name",
"edt_conf_gen_name_expl" : "A user defined name which is used to detect Hyperion. (Helpful with more than one Hyperion instance)",
"edt_conf_gen_showOptHelp_title" : "Show explanations",
"edt_conf_gen_showOptHelp_expl" : "Show all available explanations in each section. Highly recommended for beginners!",
"edt_conf_gen_versionBranch_title" : "Version Branch",
"edt_conf_gen_versionBranch_expl" : "Selects which version branch should be used for searching new Hyperion versions.",
"edt_conf_color_heading_title" : "Color Calibration",
"edt_conf_color_channelAdjustment_header_itemtitle" : "Profile",
"edt_conf_color_channelAdjustment_header_title" : "Color channel adjustments",
@ -536,8 +543,6 @@
"edt_conf_fg_pixelDecimation_expl" : "Reduce picture size (factor) based on original size. A factor of 1 means no change",
"edt_conf_fg_device_title" : "Device",
"edt_conf_fg_display_title" : "Display",
"edt_conf_fg_amlogic_grabber_title" : "Amlogic Grabber Device",
"edt_conf_fg_ge2d_mode_title" : "Amlogic ge2d Grabber Modus",
"edt_conf_fg_display_expl" : "Select which desktop should be captured (multi monitor setup)",
"edt_conf_bb_heading_title" : "Blackbar detector",
"edt_conf_bb_threshold_title" : "Threshold",
@ -573,6 +578,9 @@
"edt_conf_fbs_heading_title" : "Flatbuffers Server",
"edt_conf_fbs_timeout_title" : "Timeout",
"edt_conf_fbs_timeout_expl" : "If no data are received for the given period, the component will be (soft) disabled.",
"edt_conf_pbs_heading_title" : "Protocol Buffers Server",
"edt_conf_pbs_timeout_title" : "Timeout",
"edt_conf_pbs_timeout_expl" : "If no data are received for the given period, the component will be (soft) disabled.",
"edt_conf_bobls_heading_title" : "Boblight Server",
"edt_conf_udpl_heading_title" : "UDP Listener",
"edt_conf_udpl_address_title" : "Address",

View File

@ -179,11 +179,8 @@
<ul class="nav nav-second-level">
<li> <a class="inactive mnava" href="#conf_webconfig" id="load_webconfig"><i class="fa fa-wrench fa-fw"></i><span data-i18n="main_menu_webconfig_token">Webconfiguration</span></a> </li>
<li> <a class="inactive mnava" href="#conf_logging"><i class="fa fa-reorder fa-fw"></i><span data-i18n="main_menu_logging_token">Log</span></a> </li>
<!-- Update is disabled
<li> <a class="inactive mnava" href="#update"><i class="fa fa-download fa-fw"></i><span data-i18n="main_menu_update_token">Update</span></a> </li>
-->
<li> <a class="inactive mnava" href="#about"><i class="fa fa-info-circle fa-fw"></i><span data-i18n="main_menu_about_token">Update</span></a> </li>
<li> <a class="inactive mnava" href="#about"><i class="fa fa-info-circle fa-fw"></i><span data-i18n="main_menu_about_token">About</span></a> </li>
</ul>
</li>
</ul>

View File

@ -4,22 +4,22 @@ $(document).ready( function() {
var editor_smoothing = null;
var editor_blackborder = null;
if(showOptHelp)
if(window.showOptHelp)
{
//color
$('#conf_cont').append(createRow('conf_cont_color'))
$('#conf_cont').append(createRow('conf_cont_color'));
$('#conf_cont_color').append(createOptPanel('fa-photo', $.i18n("edt_conf_color_heading_title"), 'editor_container_color', 'btn_submit_color'));
$('#conf_cont_color').append(createHelpTable(schema.color.properties, $.i18n("edt_conf_color_heading_title")));
$('#conf_cont_color').append(createHelpTable(window.schema.color.properties, $.i18n("edt_conf_color_heading_title")));
//smoothing
$('#conf_cont').append(createRow('conf_cont_smoothing'))
$('#conf_cont').append(createRow('conf_cont_smoothing'));
$('#conf_cont_smoothing').append(createOptPanel('fa-photo', $.i18n("edt_conf_smooth_heading_title"), 'editor_container_smoothing', 'btn_submit_smoothing'));
$('#conf_cont_smoothing').append(createHelpTable(schema.smoothing.properties, $.i18n("edt_conf_smooth_heading_title")));
$('#conf_cont_smoothing').append(createHelpTable(window.schema.smoothing.properties, $.i18n("edt_conf_smooth_heading_title")));
//blackborder
$('#conf_cont').append(createRow('conf_cont_blackborder'))
$('#conf_cont').append(createRow('conf_cont_blackborder'));
$('#conf_cont_blackborder').append(createOptPanel('fa-photo', $.i18n("edt_conf_bb_heading_title"), 'editor_container_blackborder', 'btn_submit_blackborder'));
$('#conf_cont_blackborder').append(createHelpTable(schema.blackborderdetector.properties, $.i18n("edt_conf_bb_heading_title")));
$('#conf_cont_blackborder').append(createHelpTable(window.schema.blackborderdetector.properties, $.i18n("edt_conf_bb_heading_title")));
}
else
{
@ -31,7 +31,7 @@ $(document).ready( function() {
//color
editor_color = createJsonEditor('editor_container_color', {
color : schema.color
color : window.schema.color
}, true, true);
editor_color.on('change',function() {
@ -44,7 +44,7 @@ $(document).ready( function() {
//smoothing
editor_smoothing = createJsonEditor('editor_container_smoothing', {
smoothing : schema.smoothing
smoothing : window.schema.smoothing
}, true, true);
editor_smoothing.on('change',function() {
@ -57,7 +57,7 @@ $(document).ready( function() {
//blackborder
editor_blackborder = createJsonEditor('editor_container_blackborder', {
blackborderdetector: schema.blackborderdetector
blackborderdetector: window.schema.blackborderdetector
}, true, true);
editor_blackborder.on('change',function() {
@ -72,7 +72,7 @@ $(document).ready( function() {
$('#editor_container_blackborder').append(buildWL("user/moretopics/bbmode","edt_conf_bb_mode_title",true));
//create introduction
if(showOptHelp)
if(window.showOptHelp)
{
createHint("intro", $.i18n('conf_colors_color_intro'), "editor_container_color");
createHint("intro", $.i18n('conf_colors_smoothing_intro'), "editor_container_smoothing");

View File

@ -1,58 +1,58 @@
$(document).ready( function() {
performTranslation();
function newsCont(t,e,l)
{
var h = '<div style="padding-left:9px;border-left:6px solid #0088cc;">';
h += '<h4 style="font-weight:bold;font-size:17px">'+t+'</h4>';
h += e;
h += '<a href="'+l+'" class="" target="_blank"><i class="fa fa-fw fa-newspaper-o"></i>'+$.i18n('dashboard_newsbox_readmore')+'</a>';
h += '</div><hr/>';
$('#dash_news').append(h);
}
// function newsCont(t,e,l)
// {
// var h = '<div style="padding-left:9px;border-left:6px solid #0088cc;">';
// h += '<h4 style="font-weight:bold;font-size:17px">'+t+'</h4>';
// h += e;
// h += '<a href="'+l+'" class="" target="_blank"><i class="fa fa-fw fa-newspaper-o"></i>'+$.i18n('dashboard_newsbox_readmore')+'</a>';
// h += '</div><hr/>';
// $('#dash_news').append(h);
// }
function createNews(d)
{
for(var i = 0; i<d.length; i++)
{
if(i > 5)
break;
// function createNews(d)
// {
// for(var i = 0; i<d.length; i++)
// {
// if(i > 5)
// break;
//
// var title = d[i].title.rendered;
// var excerpt = d[i].excerpt.rendered;
// var link = d[i].link+'?pk_campaign=WebUI&pk_kwd=news_'+d[i].slug;
//
// newsCont(title,excerpt,link);
// }
// }
title = d[i].title.rendered;
excerpt = d[i].excerpt.rendered;
link = d[i].link+'?pk_campaign=WebUI&pk_kwd=news_'+d[i].slug;
newsCont(title,excerpt,link);
}
}
function getNews()
{
var h = '<span style="color:red;font-weight:bold">'+$.i18n('dashboard_newsbox_noconn')+'</span>';
$.ajax({
url: 'https://hyperion-project.org/wp-json/wp/v2/posts?_embed',
dataType: 'json',
type: 'GET',
timeout: 2000
})
.done( function( data, textStatus, jqXHR ) {
if(jqXHR.status == 200)
createNews(data);
else
$('#dash_news').html(h);
})
.fail( function( jqXHR, textStatus ) {
$('#dash_news').html(h);
});
}
// function getNews()
// {
// var h = '<span style="color:red;font-weight:bold">'+$.i18n('dashboard_newsbox_noconn')+'</span>';
// $.ajax({
// url: 'https://hyperion-project.org/wp-json/wp/v2/posts?_embed',
// dataType: 'json',
// type: 'GET',
// timeout: 2000
// })
// .done( function( data, textStatus, jqXHR ) {
// if(jqXHR.status == 200)
// createNews(data);
// else
// $('#dash_news').html(h);
// })
// .fail( function( jqXHR, textStatus ) {
// $('#dash_news').html(h);
// });
// }
// getNews();
function updateComponents()
{
var components = comps;
components_html = "";
for ( idx=0; idx<components.length;idx++)
var components = window.comps;
var components_html = "";
for (var idx=0; idx<components.length;idx++)
{
if(components[idx].name != "ALL")
components_html += '<tr><td>'+$.i18n('general_comp_'+components[idx].name)+'</td><td><i class="fa fa-circle component-'+(components[idx].enabled?"on":"off")+'"></i></td></tr>';
@ -60,7 +60,7 @@ $(document).ready( function() {
$("#tab_components").html(components_html);
//info
hyperion_enabled = true;
var hyperion_enabled = true;
components.forEach( function(obj) {
if (obj.name == "ALL")
@ -74,27 +74,32 @@ $(document).ready( function() {
}
// add more info
$('#dash_leddevice').html(serverInfo.ledDevices.active);
$('#dash_currv').html(currentVersion);
$('#dash_instance').html(serverConfig.general.name);
$('#dash_ports').html(serverConfig.flatbufServer.port);
$('#dash_leddevice').html(window.serverInfo.ledDevices.active);
$('#dash_currv').html(window.currentChannel+' '+window.currentVersion);
$('#dash_instance').html(window.serverConfig.general.name);
$('#dash_ports').html(window.serverConfig.flatbufServer.port+' | '+window.serverConfig.protoServer.port);
$('#dash_versionbranch').html(window.serverConfig.general.versionBranch);
$.get( "https://raw.githubusercontent.com/hyperion-project/hyperion.ng/master/version.json", function( data ) {
parsedUpdateJSON = JSON.parse(data);
latestVersion = parsedUpdateJSON[0].versionnr;
var cleanLatestVersion = latestVersion.replace(/\./g, '');
var cleanCurrentVersion = currentVersion.replace(/\./g, '');
getReleases(function(callback){
if(callback)
{
var cleanLatestVersion = window.latestVersion.tag_name.replace(/\./g, '');
var cleanCurrentVersion = window.currentVersion.replace(/\./g, '');
// $('#dash_latev').html(latestVersion);
$('#dash_latev').html(window.currentVersion);
$('#dash_latev').html(window.latestVersion.tag_name + ' (' + (window.latestVersion.prerelease == true ? "Beta" : "Stable") + ')');
// if ( cleanCurrentVersion < cleanLatestVersion )
// $('#versioninforesult').html('<div class="bs-callout bs-callout-warning" style="margin:0px">'+$.i18n('dashboard_infobox_message_updatewarning', latestVersion)+'</div>');
// else
if ( cleanCurrentVersion < cleanLatestVersion )
$('#versioninforesult').html('<div class="bs-callout bs-callout-warning" style="margin:0px">'+$.i18n('dashboard_infobox_message_updatewarning', window.latestVersion.tag_name) + ' (' + (window.latestVersion.prerelease == true ? "Beta" : "Stable") + ')</div>');
else
$('#versioninforesult').html('<div class="bs-callout bs-callout-success" style="margin:0px">'+$.i18n('dashboard_infobox_message_updatesuccess')+'</div>');
}
});
//determine platform
var grabbers = serverInfo.grabbers.available;
var grabbers = window.serverInfo.grabbers.available;
var html = "";
if(grabbers.indexOf('dispmanx') > -1)
@ -113,9 +118,9 @@ $(document).ready( function() {
//interval update
updateComponents();
$(hyperion).on("components-updated",updateComponents);
$(window.hyperion).on("components-updated",updateComponents);
if(showOptHelp)
if(window.showOptHelp)
createHintH("intro", $.i18n('dashboard_label_intro'), "dash_intro");
removeOverlay();

View File

@ -2,29 +2,29 @@ $(document).ready( function() {
performTranslation();
var oldEffects = [];
var effects_editor = null;
var confFgEff = serverConfig.foregroundEffect.effect;
var confBgEff = serverConfig.backgroundEffect.effect;
var confFgEff = window.serverConfig.foregroundEffect.effect;
var confBgEff = window.serverConfig.backgroundEffect.effect;
var foregroundEffect_editor = null;
var backgroundEffect_editor = null;
if(showOptHelp)
if(window.showOptHelp)
{
//foreground effect
$('#conf_cont').append(createRow('conf_cont_fge'))
$('#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(schema.foregroundEffect.properties, $.i18n("edt_conf_fge_heading_title")));
$('#conf_cont_fge').append(createHelpTable(window.schema.foregroundEffect.properties, $.i18n("edt_conf_fge_heading_title")));
//background effect
$('#conf_cont').append(createRow('conf_cont_bge'))
$('#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(schema.backgroundEffect.properties, $.i18n("edt_conf_bge_heading_title")));
$('#conf_cont_bge').append(createHelpTable(window.schema.backgroundEffect.properties, $.i18n("edt_conf_bge_heading_title")));
//effect path
if(storedAccess != 'default')
{
$('#conf_cont').append(createRow('conf_cont_ef'))
$('#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(schema.effects.properties, $.i18n("edt_conf_effp_heading_title")));
$('#conf_cont_ef').append(createHelpTable(window.schema.effects.properties, $.i18n("edt_conf_effp_heading_title")));
}
}
else
@ -39,7 +39,7 @@ $(document).ready( function() {
if(storedAccess != 'default')
{
effects_editor = createJsonEditor('editor_container_effects', {
effects : schema.effects
effects : window.schema.effects
}, true, true);
effects_editor.on('change',function() {
@ -52,11 +52,11 @@ $(document).ready( function() {
}
foregroundEffect_editor = createJsonEditor('editor_container_foregroundEffect', {
foregroundEffect : schema.foregroundEffect
foregroundEffect : window.schema.foregroundEffect
}, true, true);
backgroundEffect_editor = createJsonEditor('editor_container_backgroundEffect', {
backgroundEffect : schema.backgroundEffect
backgroundEffect : window.schema.backgroundEffect
}, true, true);
@ -75,19 +75,19 @@ $(document).ready( function() {
$('#btn_submit_foregroundEffect').off().on('click',function() {
var value = foregroundEffect_editor.getValue();
if(typeof value.foregroundEffect.effect == 'undefined')
value.foregroundEffect.effect = serverConfig.foregroundEffect.effect;
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 = serverConfig.backgroundEffect.effect;
value.backgroundEffect.effect = window.serverConfig.backgroundEffect.effect;
requestWriteConfig(value);
});
//create introduction
if(showOptHelp)
if(window.showOptHelp)
{
createHint("intro", $.i18n('conf_effect_path_intro'), "editor_container_effects");
createHint("intro", $.i18n('conf_effect_fgeff_intro'), "editor_container_foregroundEffect");
@ -95,14 +95,14 @@ $(document).ready( function() {
}
function updateEffectlist(){
var newEffects = serverInfo.effects;
var newEffects = window.serverInfo.effects;
if (newEffects.length != oldEffects.length)
{
$('#root_foregroundEffect_effect').html('');
var usrEffArr = [];
var sysEffArr = [];
for(i = 0; i < newEffects.length; i++)
for(var i = 0; i < newEffects.length; i++)
{
var effectName = newEffects[i].name;
if(!/^\:/.test(newEffects[i].file))
@ -121,8 +121,8 @@ $(document).ready( function() {
}
//interval update
$(hyperion).on("cmd-effects-update", function(event){
serverInfo.effects = event.response.data.effects
$(window.hyperion).on("cmd-effects-update", function(event){
window.serverInfo.effects = event.response.data.effects
updateEffectlist();
});

View File

@ -7,11 +7,11 @@ $(document).ready( function() {
var effectPy = "";
var testrun;
if(showOptHelp)
if(window.showOptHelp)
createHintH("intro", $.i18n('effectsconfigurator_label_intro'), "intro_effc");
function updateDelEffectlist(){
var newDelList = serverInfo.effects;
var newDelList = window.serverInfo.effects;
if(newDelList.length != oldDelList.length)
{
$('#effectsdellist').html("");
@ -107,7 +107,7 @@ $(document).ready( function() {
// Save Effect
$('#btn_write').off().on('click',function() {
requestWriteEffect(effectName,effectPy,JSON.stringify(effects_editor.getValue()),imageData);
$(hyperion).one("cmd-create-effect", function(event) {
$(window.hyperion).one("cmd-create-effect", function(event) {
if (event.response.success)
showInfoDialog('success', "", $.i18n('infoDialog_effconf_created_text', effectName));
});
@ -137,7 +137,7 @@ $(document).ready( function() {
$('#btn_delete').off().on('click',function() {
var name = $("#effectsdellist").val().split("_")[1];
requestDeleteEffect(name);
$(hyperion).one("cmd-delete-effect", function(event) {
$(window.hyperion).one("cmd-delete-effect", function(event) {
if (event.response.success)
showInfoDialog('success', "", $.i18n('infoDialog_effconf_deleted_text', name));
});
@ -163,15 +163,15 @@ $(document).ready( function() {
$("#name-input").val(name);
}
var efx = serverInfo.effects;
var efx = window.serverInfo.effects;
for(var i = 0; i<efx.length; i++)
{
if(efx[i].name == name)
{
var py = efx[i].script.split("/").pop()
var py = efx[i].script.split("/").pop();
$("#effectslist").val(py).trigger("change");
for(key in efx[i].args)
for(var key in efx[i].args)
{
var ed = effects_editor.getEditor('root.args.'+[key]);
if(ed)
@ -183,7 +183,7 @@ $(document).ready( function() {
});
//create basic effect list
var effects = serverSchema.properties.effectSchemas.internal
var effects = window.serverSchema.properties.effectSchemas.internal;
for(var idx=0; idx<effects.length; idx++)
{
$("#effectslist").append(createSelOpt(effects[idx].schemaContent.script, $.i18n(effects[idx].schemaContent.title)));
@ -193,8 +193,8 @@ $(document).ready( function() {
updateDelEffectlist();
//interval update
$(hyperion).on("cmd-effects-update", function(event){
serverInfo.effects = event.response.data.effects
$(window.hyperion).on("cmd-effects-update", function(event){
window.serverInfo.effects = event.response.data.effects
updateDelEffectlist();
});

View File

@ -6,15 +6,15 @@ $(document).ready( function() {
var conf_editor = null;
$('#conf_cont').append(createOptPanel('fa-wrench', $.i18n("edt_conf_gen_heading_title"), 'editor_container', 'btn_submit'));
if(showOptHelp)
if(window.showOptHelp)
{
$('#conf_cont').append(createHelpTable(schema.general.properties, $.i18n("edt_conf_gen_heading_title")));
$('#conf_cont').append(createHelpTable(window.schema.general.properties, $.i18n("edt_conf_gen_heading_title")));
}
else
$('#conf_imp').appendTo('#conf_cont');
conf_editor = createJsonEditor('editor_container', {
general: schema.general
general: window.schema.general
}, true, true);
conf_editor.on('change',function() {
@ -88,7 +88,7 @@ $(document).ready( function() {
//export
$('#btn_export_conf').off().on('click', function(){
var name = serverConfig.general.name;
var name = window.serverConfig.general.name;
var d = new Date();
var month = d.getMonth()+1;
@ -98,11 +98,11 @@ $(document).ready( function() {
(month<10 ? '0' : '') + month + '.' +
(day<10 ? '0' : '') + day;
download(JSON.stringify(serverConfig, null, "\t"), 'Hyperion-'+currentVersion+'-Backup ('+name+') '+timestamp+'.json', "application/json");
download(JSON.stringify(window.serverConfig, null, "\t"), 'Hyperion-'+window.currentVersion+'-Backup ('+name+') '+timestamp+'.json', "application/json");
});
//create introduction
if(showOptHelp)
if(window.showOptHelp)
createHint("intro", $.i18n('conf_general_intro'), "editor_container");
removeOverlay();

View File

@ -12,22 +12,22 @@ $(document).ready( function() {
}
}
if(showOptHelp)
if(window.showOptHelp)
{
//fg
$('#conf_cont').append(createRow('conf_cont_instCapt'))
$('#conf_cont').append(createRow('conf_cont_instCapt'));
$('#conf_cont_instCapt').append(createOptPanel('fa-camera', $.i18n("edt_conf_instCapture_heading_title"), 'editor_container_instCapt', 'btn_submit_instCapt'));
$('#conf_cont_instCapt').append(createHelpTable(schema.instCapture.properties, $.i18n("edt_conf_instCapture_heading_title")));
$('#conf_cont_instCapt').append(createHelpTable(window.schema.instCapture.properties, $.i18n("edt_conf_instCapture_heading_title")));
//fg
$('#conf_cont').append(createRow('conf_cont_fg'))
$('#conf_cont').append(createRow('conf_cont_fg'));
$('#conf_cont_fg').append(createOptPanel('fa-camera', $.i18n("edt_conf_fg_heading_title"), 'editor_container_fg', 'btn_submit_fg'));
$('#conf_cont_fg').append(createHelpTable(schema.framegrabber.properties, $.i18n("edt_conf_fg_heading_title")));
$('#conf_cont_fg').append(createHelpTable(window.schema.framegrabber.properties, $.i18n("edt_conf_fg_heading_title")));
//v4l
$('#conf_cont').append(createRow('conf_cont_v4l'))
$('#conf_cont').append(createRow('conf_cont_v4l'));
$('#conf_cont_v4l').append(createOptPanel('fa-camera', $.i18n("edt_conf_v4l2_heading_title"), 'editor_container_v4l2', 'btn_submit_v4l2'));
$('#conf_cont_v4l').append(createHelpTable(schema.grabberV4L2.items.properties, $.i18n("edt_conf_v4l2_heading_title")));
$('#conf_cont_v4l').append(createHelpTable(window.schema.grabberV4L2.properties, $.i18n("edt_conf_v4l2_heading_title")));
}
else
{
@ -38,7 +38,7 @@ $(document).ready( function() {
}
//instCapt
conf_editor_instCapt = createJsonEditor('editor_container_instCapt', {
instCapture: schema.instCapture
instCapture: window.schema.instCapture
}, true, true);
conf_editor_instCapt.on('change',function() {
@ -52,7 +52,7 @@ $(document).ready( function() {
//fg
conf_editor_fg = createJsonEditor('editor_container_fg', {
framegrabber: schema.framegrabber
framegrabber: window.schema.framegrabber
}, true, true);
conf_editor_fg.on('change',function() {
@ -65,7 +65,7 @@ $(document).ready( function() {
//vl4
conf_editor_v4l2 = createJsonEditor('editor_container_v4l2', {
grabberV4L2 : schema.grabberV4L2
grabberV4L2 : window.schema.grabberV4L2
}, true, true);
conf_editor_v4l2.on('change',function() {
@ -77,7 +77,7 @@ $(document).ready( function() {
});
//create introduction
if(showOptHelp)
if(window.showOptHelp)
{
createHint("intro", $.i18n('conf_grabber_fg_intro'), "editor_container_fg");
createHint("intro", $.i18n('conf_grabber_v4l_intro'), "editor_container_v4l2");
@ -85,7 +85,7 @@ $(document).ready( function() {
//hide specific options
conf_editor_fg.on('ready',function() {
var grabbers = serverInfo.grabbers.available;
var grabbers = window.serverInfo.grabbers.available;
if(grabbers.indexOf('dispmanx') > -1)
hideEl(["device","pixelDecimation"]);

View File

@ -4,14 +4,14 @@ $(document).ready( function() {
loadContentTo("#container_restart","restart");
initWebSocket();
$(hyperion).on("cmd-serverinfo",function(event){
serverInfo = event.response.info;
$(window.hyperion).on("cmd-serverinfo",function(event){
window.serverInfo = event.response.info;
// comps
comps = event.response.info.components
window.comps = event.response.info.components
$(hyperion).trigger("ready");
$(window.hyperion).trigger("ready");
comps.forEach( function(obj) {
window.comps.forEach( function(obj) {
if (obj.name == "ALL")
{
if(obj.enabled)
@ -21,7 +21,7 @@ $(document).ready( function() {
}
});
if (serverInfo.hyperion.enabled)
if (window.serverInfo.hyperion.enabled)
$("#hyperion_disabled_notify").fadeOut("fast");
else
$("#hyperion_disabled_notify").fadeIn("fast");
@ -29,59 +29,60 @@ $(document).ready( function() {
updateSessions();
}); // end cmd-serverinfo
$(hyperion).on("cmd-sessions-update", function(event) {
serverInfo.sessions = event.response.data;
$(window.hyperion).on("cmd-sessions-update", function(event) {
window.serverInfo.sessions = event.response.data;
updateSessions();
});
$(hyperion).on("cmd-sysinfo", function(event) {
$(window.hyperion).on("cmd-sysinfo", function(event) {
requestServerInfo();
sysInfo = event.response.info;
window.sysInfo = event.response.info;
currentVersion = sysInfo.hyperion.version;
window.currentVersion = window.sysInfo.hyperion.version;
window.currentChannel = window.sysInfo.hyperion.channel;
});
$(hyperion).one("cmd-config-getschema", function(event) {
serverSchema = event.response.info;
$(window.hyperion).one("cmd-config-getschema", function(event) {
window.serverSchema = event.response.info;
requestServerConfig();
schema = serverSchema.properties;
window.schema = window.serverSchema.properties;
});
$(hyperion).on("cmd-config-getconfig", function(event) {
serverConfig = event.response.info;
$(window.hyperion).on("cmd-config-getconfig", function(event) {
window.serverConfig = event.response.info;
requestSysInfo();
showOptHelp = serverConfig.general.showOptHelp;
window.showOptHelp = window.serverConfig.general.showOptHelp;
});
$(hyperion).on("cmd-config-setconfig", function(event) {
$(window.hyperion).on("cmd-config-setconfig", function(event) {
if (event.response.success === true) {
$('#hyperion_config_write_success_notify').fadeIn().delay(5000).fadeOut();
}
});
$(hyperion).on("error",function(event){
$(window.hyperion).on("error",function(event){
showInfoDialog("error","Error", event.reason);
});
$(hyperion).on("open",function(event){
$(window.hyperion).on("open",function(event){
requestServerConfigSchema();
});
$(hyperion).one("ready", function(event) {
$(window.hyperion).one("ready", function(event) {
loadContent();
});
$(hyperion).on("cmd-adjustment-update", function(event) {
serverInfo.adjustment = event.response.data
$(window.hyperion).on("cmd-adjustment-update", function(event) {
window.serverInfo.adjustment = event.response.data
});
$(hyperion).on("cmd-videomode-update", function(event) {
serverInfo.videomode = event.response.data.videomode
$(window.hyperion).on("cmd-videomode-update", function(event) {
window.serverInfo.videomode = event.response.data.videomode
});
$(hyperion).on("cmd-components-update", function(event) {
$(window.hyperion).on("cmd-components-update", function(event) {
let obj = event.response.data
// notfication in index
@ -93,17 +94,17 @@ $(document).ready( function() {
$("#hyperion_disabled_notify").fadeIn("fast");
}
comps.forEach((entry, index) => {
window.comps.forEach((entry, index) => {
if (entry.name === obj.name){
comps[index] = obj;
window.comps[index] = obj;
}
});
// notify the update
$(hyperion).trigger("components-updated");
$(window.hyperion).trigger("components-updated");
});
$(hyperion).on("cmd-effects-update", function(event){
serverInfo.effects = event.response.data.effects
$(window.hyperion).on("cmd-effects-update", function(event){
window.serverInfo.effects = event.response.data.effects
});
$(".mnava").bind('click.menu', function(e){

View File

@ -30,19 +30,19 @@ function createLedPreview(leds, origin){
$('.st_helper').css("border", "8px solid grey");
canvas_height = $('#leds_preview').innerHeight();
canvas_width = $('#leds_preview').innerWidth();
var canvas_height = $('#leds_preview').innerHeight();
var canvas_width = $('#leds_preview').innerWidth();
leds_html = "";
var leds_html = "";
for(var idx=0; idx<leds.length; idx++)
{
led = leds[idx];
led_id='ledc_'+[idx];
bgcolor = "background-color:hsl("+(idx*360/leds.length)+",100%,50%);";
pos = "left:"+(led.hscan.minimum * canvas_width)+"px;"+
var led = leds[idx];
var led_id='ledc_'+[idx];
var bgcolor = "background-color:hsl("+(idx*360/leds.length)+",100%,50%);";
var pos = "left:"+(led.hscan.minimum * canvas_width)+"px;"+
"top:"+(led.vscan.minimum * canvas_height)+"px;"+
"width:"+((led.hscan.maximum-led.hscan.minimum) * canvas_width-1)+"px;"+
"height:"+((led.vscan.maximum-led.vscan.minimum) * canvas_height-1)+"px;";
"width:"+((led.hscan.maximum-led.hscan.minimum) * (canvas_width-1))+"px;"+
"height:"+((led.vscan.maximum-led.vscan.minimum) * (canvas_height-1))+"px;";
leds_html += '<div id="'+led_id+'" class="led" style="'+bgcolor+pos+'" title="'+led.index+'"><span id="'+led_id+'_num" class="led_prev_num">'+led.index+'</span></div>';
}
$('#leds_preview').html(leds_html);
@ -87,10 +87,10 @@ function createClassicLeds(){
function createFinalArray(array){
finalLedArray = [];
for(var i = 0; i<array.length; i++){
hmin = array[i].hscan.minimum;
hmax = array[i].hscan.maximum;
vmin = array[i].vscan.minimum;
vmax = array[i].vscan.maximum;
var hmin = array[i].hscan.minimum;
var hmax = array[i].hscan.maximum;
var vmin = array[i].vscan.minimum;
var vmax = array[i].vscan.maximum;
finalLedArray[i] = { "index" : i, "hscan": { "maximum" : hmax, "minimum" : hmin }, "vscan": { "maximum": vmax, "minimum": vmin}}
}
createLedPreview(finalLedArray, 'classic');
@ -115,9 +115,9 @@ function createClassicLeds(){
function valScan(val)
{
if(val > 1)
return val = 1;
return 1;
if(val < 0)
return val = 0;
return 0;
return val;
}
@ -138,62 +138,65 @@ function createClassicLeds(){
}
function createTopLeds(){
step=(Hmax-Hmin)/ledstop;
var step=(Hmax-Hmin)/ledstop;
//if(cornerVGap != '0')
// step=(Hmax-Hmin-(cornerHGap*2))/ledstop;
vmin=Vmin;
vmax=vmin+ledsHDepth;
var vmin=Vmin;
var vmax=vmin+ledsHDepth;
for (var i = 0; i<ledstop; i++){
hmin = ovl("-",(Hdiff/ledstop*[i])+edgeHGap);
hmax = ovl("+",(Hdiff/ledstop*[i])+step+edgeHGap);
var hmin = ovl("-",(Hdiff/ledstop*Number([i]))+edgeHGap);
var hmax = ovl("+",(Hdiff/ledstop*Number([i]))+step+edgeHGap);
createLedArray(hmin, hmax, vmin, vmax);
}
}
function createLeftLeds(){
step=(Vmax-Vmin)/ledsleft;
var step=(Vmax-Vmin)/ledsleft;
//if(cornerVGap != '0')
// step=(Vmax-Vmin-(cornerVGap*2))/ledsleft;
hmin=Hmin;
hmax=hmin+ledsVDepth;
var hmin=Hmin;
var hmax=hmin+ledsVDepth;
for (var i = ledsleft-1; i>-1; --i){
vmin = ovl("-",(Vdiff/ledsleft*[i])+edgeVGap);
vmax = ovl("+",(Vdiff/ledsleft*[i])+step+edgeVGap);
var vmin = ovl("-",(Vdiff/ledsleft*Number([i]))+edgeVGap);
var vmax = ovl("+",(Vdiff/ledsleft*Number([i]))+step+edgeVGap);
createLedArray(hmin, hmax, vmin, vmax);
}
}
function createRightLeds(){
step=(Vmax-Vmin)/ledsright;
var step=(Vmax-Vmin)/ledsright;
//if(cornerVGap != '0')
// step=(Vmax-Vmin-(cornerVGap*2))/ledsright;
hmax=Hmax;
hmin=hmax-ledsVDepth;
var hmax=Hmax;
var hmin=hmax-ledsVDepth;
for (var i = 0; i<ledsright; i++){
vmin = ovl("-",(Vdiff/ledsright*[i])+edgeVGap);
vmax = ovl("+",(Vdiff/ledsright*[i])+step+edgeVGap);
var vmin = ovl("-",(Vdiff/ledsright*Number([i]))+edgeVGap);
var vmax = ovl("+",(Vdiff/ledsright*Number([i]))+step+edgeVGap);
createLedArray(hmin, hmax, vmin, vmax);
}
}
function createBottomLeds(){
step=(Hmax-Hmin)/ledsbottom;
var step=(Hmax-Hmin)/ledsbottom;
//if(cornerVGap != '0')
// step=(Hmax-Hmin-(cornerHGap*2))/ledsbottom;
vmax=Vmax;
vmin=vmax-ledsHDepth;
var vmax=Vmax;
var vmin=vmax-ledsHDepth;
for (var i = ledsbottom-1; i>-1; i--){
hmin = ovl("-",(Hdiff/ledsbottom*[i])+edgeHGap);
hmax = ovl("+",(Hdiff/ledsbottom*[i])+step+edgeHGap);
var hmin = ovl("-",(Hdiff/ledsbottom*Number([i]))+edgeHGap);
var hmax = ovl("+",(Hdiff/ledsbottom*Number([i]))+step+edgeHGap);
createLedArray(hmin, hmax, vmin, vmax);
}
}
createLeftLeds(createBottomLeds(createRightLeds(createTopLeds())));
createTopLeds();
createRightLeds();
createBottomLeds();
createLeftLeds();
//check led gap pos
if (ledsgpos+ledsglength > ledArray.length)
@ -308,17 +311,17 @@ $(document).ready(function() {
performTranslation();
//add intros
if(showOptHelp)
if(window.showOptHelp)
{
createHintH("intro", $.i18n('conf_leds_device_intro'), "leddevice_intro");
createHintH("intro", $.i18n('conf_leds_layout_intro'), "layout_intro");
$('#led_vis_help').html('<div><div class="led_ex" style="background-color:black;margin-right:5px;margin-top:3px"></div><div style="display:inline-block;vertical-align:top">'+$.i18n('conf_leds_layout_preview_l1')+'</div></div><div class="led_ex" style="background-color:grey;margin-top:3px;margin-right:2px"></div><div class="led_ex" style="background-color: rgb(169, 169, 169);margin-right:5px;margin-top:3px;"></div><div style="display:inline-block;vertical-align:top">'+$.i18n('conf_leds_layout_preview_l2')+'</div>');
}
var slConfig = serverConfig.ledConfig;
var slConfig = window.serverConfig.ledConfig;
//restore ledConfig
for(key in slConfig)
for(var key in slConfig)
{
if(typeof(slConfig[key]) === "boolean")
$('#ip_cl_'+key).prop('checked', slConfig[key]);
@ -329,7 +332,7 @@ $(document).ready(function() {
function saveValues()
{
var ledConfig = {};
for(key in slConfig)
for(var key in slConfig)
{
if(typeof(slConfig[key]) === "boolean")
ledConfig[key] = $('#ip_cl_'+key).is(':checked');
@ -370,7 +373,7 @@ $(document).ready(function() {
});
// v4 of json schema with diff required assignment - remove when hyperion schema moved to v4
var ledschema = {"items":{"additionalProperties":false,"required":["hscan","vscan","index"],"properties":{"clone":{"type":"integer"},"colorOrder":{"enum":["rgb","bgr","rbg","brg","gbr","grb"],"type":"string"},"hscan":{"additionalProperties":false,"properties":{"maximum":{"maximum":1,"minimum":0,"type":"number"},"minimum":{"maximum":1,"minimum":0,"type":"number"}},"type":"object"},"index":{"type":"integer"},"vscan":{"additionalProperties":false,"properties":{"maximum":{"maximum":1,"minimum":0,"type":"number"},"minimum":{"maximum":1,"minimum":0,"type":"number"}},"type":"object"}},"type":"object"},"type":"array"}
var ledschema = {"items":{"additionalProperties":false,"required":["hscan","vscan","index"],"properties":{"clone":{"type":"integer"},"colorOrder":{"enum":["rgb","bgr","rbg","brg","gbr","grb"],"type":"string"},"hscan":{"additionalProperties":false,"properties":{"maximum":{"maximum":1,"minimum":0,"type":"number"},"minimum":{"maximum":1,"minimum":0,"type":"number"}},"type":"object"},"index":{"type":"integer"},"vscan":{"additionalProperties":false,"properties":{"maximum":{"maximum":1,"minimum":0,"type":"number"},"minimum":{"maximum":1,"minimum":0,"type":"number"}},"type":"object"}},"type":"object"},"type":"array"};
//create jsonace editor
var aceEdt = new JSONACEEditor(document.getElementById("aceedit"),{
mode: 'code',
@ -396,7 +399,7 @@ $(document).ready(function() {
$('#leds_custom_save').attr("disabled", true);
}
}
}, serverConfig.leds);
}, window.serverConfig.leds);
//TODO: HACK! No callback for schema validation - Add it!
setInterval(function(){
@ -405,12 +408,12 @@ $(document).ready(function() {
$('#leds_custom_updsim').attr("disabled", true);
$('#leds_custom_save').attr("disabled", true);
}
},1000)
},1000);
$('.jsoneditor-menu').toggle();
// leds to finalLedArray
finalLedArray = serverConfig.leds;
finalLedArray = window.serverConfig.leds;
// cl/ma leds push to textfield
$('#btn_cl_generate, #btn_ma_generate').off().on("click", function(e) {
@ -425,28 +428,31 @@ $(document).ready(function() {
// create and update editor
$("#leddevices").off().on("change", function() {
generalOptions = serverSchema.properties.device;
specificOptions = serverSchema.properties.alldevices[$(this).val()];
var generalOptions = window.serverSchema.properties.device;
// Modified schema enty "hardwareLedCount" in generalOptions to minimum LedCount
var specificOptions = window.serverSchema.properties.alldevices[$(this).val()];
conf_editor = createJsonEditor('editor_container', {
generalOptions : generalOptions,
specificOptions : specificOptions,
});
values_general = {};
values_specific = {};
isCurrentDevice = (serverInfo.ledDevices.active == $(this).val());
var values_general = {};
var values_specific = {};
var isCurrentDevice = (window.serverInfo.ledDevices.active == $(this).val());
for(var key in serverConfig.device){
for(var key in window.serverConfig.device){
if (key != "type" && key in generalOptions.properties)
values_general[key] = serverConfig.device[key];
values_general[key] = window.serverConfig.device[key];
};
conf_editor.getEditor("root.generalOptions").setValue( values_general );
if (isCurrentDevice)
{
specificOptions_val = conf_editor.getEditor("root.specificOptions").getValue()
var specificOptions_val = conf_editor.getEditor("root.specificOptions").getValue()
for(var key in specificOptions_val){
values_specific[key] = (key in serverConfig.device) ? serverConfig.device[key] : specificOptions_val[key];
values_specific[key] = (key in window.serverConfig.device) ? window.serverConfig.device[key] : specificOptions_val[key];
};
conf_editor.getEditor("root.specificOptions").setValue( values_specific );
@ -469,12 +475,12 @@ $(document).ready(function() {
});
// create led device selection
ledDevices = serverInfo.ledDevices.available
devRPiSPI = ['apa102', 'apa104', 'ws2801', 'lpd6803', 'lpd8806', 'p9813', 'sk6812spi', 'sk6822spi', 'ws2812spi'];
devRPiPWM = ['ws281x'];
devRPiGPIO = ['piblaster'];
devNET = ['atmoorb', 'fadecandy', 'philipshue', 'aurora', 'tinkerforge', 'tpm2net', 'udpe131', 'udpartnet', 'udph801', 'udpraw'];
devUSB = ['adalight', 'dmx', 'atmo', 'hyperionusbasp', 'lightpack', 'multilightpack', 'paintpack', 'rawhid', 'sedu', 'tpm2', 'karate'];
var ledDevices = window.serverInfo.ledDevices.available;
var devRPiSPI = ['apa102', 'apa104', 'ws2801', 'lpd6803', 'lpd8806', 'p9813', 'sk6812spi', 'sk6822spi', 'ws2812spi'];
var devRPiPWM = ['ws281x'];
var devRPiGPIO = ['piblaster'];
var devNET = ['atmoorb', 'fadecandy', 'philipshue', 'aurora', 'tinkerforge', 'tpm2net', 'udpe131', 'udpartnet', 'udph801', 'udpraw'];
var devUSB = ['adalight', 'dmx', 'atmo', 'hyperionusbasp', 'lightpack', 'multilightpack', 'paintpack', 'rawhid', 'sedu', 'tpm2', 'karate'];
var optArr = [[]];
optArr[1]=[];
@ -483,7 +489,7 @@ $(document).ready(function() {
optArr[4]=[];
optArr[5]=[];
for (idx=0; idx<ledDevices.length; idx++)
for (var idx=0; idx<ledDevices.length; idx++)
{
if($.inArray(ledDevices[idx], devRPiSPI) != -1)
optArr[0].push(ledDevices[idx]);
@ -505,7 +511,7 @@ $(document).ready(function() {
$("#leddevices").append(createSel(optArr[3], $.i18n('conf_leds_optgroup_network')));
$("#leddevices").append(createSel(optArr[4], $.i18n('conf_leds_optgroup_usb')));
$("#leddevices").append(createSel(optArr[5], $.i18n('conf_leds_optgroup_debug')));
$("#leddevices").val(serverInfo.ledDevices.active);
$("#leddevices").val(window.serverInfo.ledDevices.active);
$("#leddevices").trigger("change");
// validate textfield and update preview
@ -559,11 +565,11 @@ $(document).ready(function() {
// save led device config
$("#btn_submit_controller").off().on("click", function(event) {
ledDevice = $("#leddevices").val();
result = {device:{}};
var ledDevice = $("#leddevices").val();
var result = {device:{}};
general = conf_editor.getEditor("root.generalOptions").getValue();
specific = conf_editor.getEditor("root.specificOptions").getValue();
var general = conf_editor.getEditor("root.generalOptions").getValue();
var specific = conf_editor.getEditor("root.specificOptions").getValue();
for(var key in general){
result.device[key] = general[key];
}
@ -577,6 +583,3 @@ $(document).ready(function() {
removeOverlay();
});

View File

@ -10,15 +10,15 @@ $(document).ready(function() {
var reportUrl = 'https://report.hyperion-project.org/#';
$('#conf_cont').append(createOptPanel('fa-reorder', $.i18n("edt_conf_log_heading_title"), 'editor_container', 'btn_submit'));
if(showOptHelp)
if(window.showOptHelp)
{
$('#conf_cont').append(createHelpTable(schema.logger.properties, $.i18n("edt_conf_log_heading_title")));
$('#conf_cont').append(createHelpTable(window.schema.logger.properties, $.i18n("edt_conf_log_heading_title")));
createHintH("intro", $.i18n('conf_logging_label_intro'), "log_head");
}
$("#log_upl_pol").append('<span style="color:grey;font-size:80%">'+$.i18n("conf_logging_uplpolicy")+' '+buildWL("user/support#report_privacy_policy",$.i18n("conf_logging_contpolicy")));
conf_editor = createJsonEditor('editor_container', {
logger : schema.logger
logger : window.schema.logger
}, true, true);
conf_editor.on('change',function() {
@ -61,11 +61,11 @@ $(document).ready(function() {
function uploadLog()
{
var log = "";
var config = JSON.stringify(serverConfig, null).replace(/"/g, '\"');
var prios = serverInfo.priorities;
var comps = serverInfo.components;
var sys = sysInfo.system;
var shy = sysInfo.hyperion;
var config = JSON.stringify(window.serverConfig, null).replace(/"/g, '\\"');
var prios = window.serverInfo.priorities;
var comps = window.serverInfo.components;
var sys = window.sysInfo.system;
var shy = window.sysInfo.hyperion;
var info;
//create log
@ -78,8 +78,8 @@ $(document).ready(function() {
info += 'Version: '+shy.version+'\n';
info += 'UI Lang: '+storedLang+' (BrowserL: '+navigator.language+')\n';
info += 'UI Access: '+storedAccess+'\n';
info += 'Log lvl: '+serverConfig.logger.level+'\n';
info += 'Avail Capt: '+serverInfo.grabbers.available+'\n\n';
info += 'Log lvl: '+window.serverConfig.logger.level+'\n';
info += 'Avail Capt: '+window.serverInfo.grabbers.available+'\n\n';
info += 'Distribution:'+sys.prettyName+'\n';
info += 'Arch: '+sys.architecture+'\n';
info += 'Kernel: '+sys.kernelType+' ('+sys.kernelVersion+' (WS: '+sys.wordSize+'))\n';
@ -96,10 +96,10 @@ $(document).ready(function() {
info += ' ';
info += ' ('+prios[i].component+') Owner: '+prios[i].owner+'\n';
}
info += '\npriorities_autoselect: '+serverInfo.priorities_autoselect+'\n\n';
info += '\npriorities_autoselect: '+window.serverInfo.priorities_autoselect+'\n\n';
//create comps
info += '### COMPONENTS ### \n'
info += '### COMPONENTS ### \n';
for(var i = 0; i<comps.length; i++)
{
info += comps[i].enabled+' - '+comps[i].name+'\n';
@ -109,7 +109,7 @@ $(document).ready(function() {
info = JSON.stringify(info);
log = JSON.stringify(log);
config = JSON.stringify(config);
var title = 'Hyperion '+currentVersion+' Report ('+serverConfig.general.name+' ('+serverInfo.ledDevices.active+'))';
var title = 'Hyperion '+window.currentVersion+' Report ('+window.serverConfig.general.name+' ('+window.serverInfo.ledDevices.active+'))';
$.ajax({
url: 'https://api.hyperion-project.org/report.php',
@ -140,15 +140,15 @@ $(document).ready(function() {
});
}
if (!loggingHandlerInstalled)
if (!window.loggingHandlerInstalled)
{
loggingHandlerInstalled = true;
$(hyperion).on("cmd-logging-update",function(event){
window.loggingHandlerInstalled = true;
$(window.hyperion).on("cmd-logging-update",function(event){
if ($("#logmessages").length == 0 && loggingStreamActive)
if ($("#logmessages").length == 0 && window.loggingStreamActive)
{
requestLoggingStop();
loggingStreamActive = false;
window.loggingStreamActive = false;
}
messages = (event.response.result.messages);
@ -163,13 +163,13 @@ $(document).ready(function() {
}
for(var idx=0; idx<messages.length; idx++)
{
app_name = messages[idx].appName;
logger_name = messages[idx].loggerName;
function_ = messages[idx].function;
line = messages[idx].line;
file_name = messages[idx].fileName;
msg = messages[idx].message;
level_string = messages[idx].levelString;
var app_name = messages[idx].appName;
var logger_name = messages[idx].loggerName;
var function_ = messages[idx].function;
var line = messages[idx].line;
var file_name = messages[idx].fileName;
var msg = messages[idx].message;
var level_string = messages[idx].levelString;
var debug = "";

View File

@ -1,7 +1,6 @@
$(document).ready( function() {
performTranslation();
var conf_editor_net = null;
var conf_editor_json = null;
var conf_editor_proto = null;
var conf_editor_fbs = null;
@ -9,34 +8,39 @@ $(document).ready( function() {
var conf_editor_udpl = null;
var conf_editor_forw = null;
if(showOptHelp)
if(window.showOptHelp)
{
//jsonserver
$('#conf_cont').append(createRow('conf_cont_json'))
$('#conf_cont_json').append(createOptPanel('fa-sitemap', $.i18n("edt_conf_js_heading_title"), 'editor_container_jsonserver', 'btn_submit_jsonserver'));
$('#conf_cont_json').append(createHelpTable(schema.jsonServer.properties, $.i18n("edt_conf_js_heading_title")));
$('#conf_cont_json').append(createHelpTable(window.schema.jsonServer.properties, $.i18n("edt_conf_js_heading_title")));
//flatbufserver
$('#conf_cont').append(createRow('conf_cont_flatbuf'))
$('#conf_cont_flatbuf').append(createOptPanel('fa-sitemap', $.i18n("edt_conf_fbs_heading_title"), 'editor_container_fbserver', 'btn_submit_fbserver'));
$('#conf_cont_flatbuf').append(createHelpTable(schema.flatbufServer.properties, $.i18n("edt_conf_fbs_heading_title")));
$('#conf_cont_flatbuf').append(createHelpTable(window.schema.flatbufServer.properties, $.i18n("edt_conf_fbs_heading_title")));
//protoserver
$('#conf_cont').append(createRow('conf_cont_proto'))
$('#conf_cont_proto').append(createOptPanel('fa-sitemap', $.i18n("edt_conf_pbs_heading_title"), 'editor_container_protoserver', 'btn_submit_protoserver'));
$('#conf_cont_proto').append(createHelpTable(window.schema.protoServer.properties, $.i18n("edt_conf_pbs_heading_title")));
//boblight
$('#conf_cont').append(createRow('conf_cont_bobl'))
$('#conf_cont_bobl').append(createOptPanel('fa-sitemap', $.i18n("edt_conf_bobls_heading_title"), 'editor_container_boblightserver', 'btn_submit_boblightserver'));
$('#conf_cont_bobl').append(createHelpTable(schema.boblightServer.properties, $.i18n("edt_conf_bobls_heading_title")));
$('#conf_cont_bobl').append(createHelpTable(window.schema.boblightServer.properties, $.i18n("edt_conf_bobls_heading_title")));
//udplistener
$('#conf_cont').append(createRow('conf_cont_udpl'))
$('#conf_cont_udpl').append(createOptPanel('fa-sitemap', $.i18n("edt_conf_udpl_heading_title"), 'editor_container_udplistener', 'btn_submit_udplistener'));
$('#conf_cont_udpl').append(createHelpTable(schema.udpListener.properties, $.i18n("edt_conf_udpl_heading_title")));
$('#conf_cont_udpl').append(createHelpTable(window.schema.udpListener.properties, $.i18n("edt_conf_udpl_heading_title")));
//forwarder
if(storedAccess != 'default')
{
$('#conf_cont').append(createRow('conf_cont_fw'))
$('#conf_cont_fw').append(createOptPanel('fa-sitemap', $.i18n("edt_conf_fw_heading_title"), 'editor_container_forwarder', 'btn_submit_forwarder'));
$('#conf_cont_fw').append(createHelpTable(schema.forwarder.properties, $.i18n("edt_conf_fw_heading_title")));
$('#conf_cont_fw').append(createHelpTable(window.schema.forwarder.properties, $.i18n("edt_conf_fw_heading_title")));
}
}
else
@ -44,6 +48,7 @@ $(document).ready( function() {
$('#conf_cont').addClass('row');
$('#conf_cont').append(createOptPanel('fa-sitemap', $.i18n("edt_conf_js_heading_title"), 'editor_container_jsonserver', 'btn_submit_jsonserver'));
$('#conf_cont').append(createOptPanel('fa-sitemap', $.i18n("edt_conf_fbs_heading_title"), 'editor_container_fbserver', 'btn_submit_fbserver'));
$('#conf_cont').append(createOptPanel('fa-sitemap', $.i18n("edt_conf_pbs_heading_title"), 'editor_container_protoserver', 'btn_submit_protoserver'));
$('#conf_cont').append(createOptPanel('fa-sitemap', $.i18n("edt_conf_bobls_heading_title"), 'editor_container_boblightserver', 'btn_submit_boblightserver'));
$('#conf_cont').append(createOptPanel('fa-sitemap', $.i18n("edt_conf_udpl_heading_title"), 'editor_container_udplistener', 'btn_submit_udplistener'));
if(storedAccess != 'default')
@ -52,7 +57,7 @@ $(document).ready( function() {
//json
conf_editor_json = createJsonEditor('editor_container_jsonserver', {
jsonServer : schema.jsonServer
jsonServer : window.schema.jsonServer
}, true, true);
conf_editor_json.on('change',function() {
@ -65,7 +70,7 @@ $(document).ready( function() {
//flatbuffer
conf_editor_fbs = createJsonEditor('editor_container_fbserver', {
flatbufServer : schema.flatbufServer
flatbufServer : window.schema.flatbufServer
}, true, true);
conf_editor_fbs.on('change',function() {
@ -76,9 +81,22 @@ $(document).ready( function() {
requestWriteConfig(conf_editor_fbs.getValue());
});
//protobuffer
conf_editor_proto = createJsonEditor('editor_container_protoserver', {
protoServer : window.schema.protoServer
}, true, true);
conf_editor_proto.on('change',function() {
conf_editor_proto.validate().length ? $('#btn_submit_protoserver').attr('disabled', true) : $('#btn_submit_protoserver').attr('disabled', false);
});
$('#btn_submit_protoserver').off().on('click',function() {
requestWriteConfig(conf_editor_proto.getValue());
});
//boblight
conf_editor_bobl = createJsonEditor('editor_container_boblightserver', {
boblightServer : schema.boblightServer
boblightServer : window.schema.boblightServer
}, true, true);
conf_editor_bobl.on('change',function() {
@ -91,7 +109,7 @@ $(document).ready( function() {
//udplistener
conf_editor_udpl = createJsonEditor('editor_container_udplistener', {
udpListener : schema.udpListener
udpListener : window.schema.udpListener
}, true, true);
conf_editor_udpl.on('change',function() {
@ -106,7 +124,7 @@ $(document).ready( function() {
{
//forwarder
conf_editor_forw = createJsonEditor('editor_container_forwarder', {
forwarder : schema.forwarder
forwarder : window.schema.forwarder
}, true, true);
conf_editor_forw.on('change',function() {
@ -119,10 +137,11 @@ $(document).ready( function() {
}
//create introduction
if(showOptHelp)
if(window.showOptHelp)
{
createHint("intro", $.i18n('conf_network_json_intro'), "editor_container_jsonserver");
createHint("intro", $.i18n('conf_network_fbs_intro'), "editor_container_fbserver");
createHint("intro", $.i18n('conf_network_proto_intro'), "editor_container_protoserver");
createHint("intro", $.i18n('conf_network_bobl_intro'), "editor_container_boblightserver");
createHint("intro", $.i18n('conf_network_udpl_intro'), "editor_container_udplistener");
createHint("intro", $.i18n('conf_network_forw_intro'), "editor_container_forwarder");

View File

@ -3,7 +3,7 @@ $(document).ready(function() {
var oldEffects = [];
var cpcolor = '#B500FF';
var mappingList = serverSchema.properties.color.properties.imageToLedMappingType.enum;
var mappingList = window.serverSchema.properties.color.properties.imageToLedMappingType.enum;
var duration = 0;
var rgb = {r:255,g:0,b:0};
@ -14,7 +14,7 @@ $(document).ready(function() {
//create introduction
if(showOptHelp)
if(window.showOptHelp)
{
createHint("intro", $.i18n('remote_color_intro', $.i18n('remote_losthint')), "color_intro");
createHint("intro", $.i18n('remote_input_intro', $.i18n('remote_losthint')), "sstcont");
@ -25,16 +25,16 @@ $(document).ready(function() {
}
//color adjustment
var sColor = sortProperties(serverSchema.properties.color.properties.channelAdjustment.items.properties)
var values = serverInfo.adjustment[0]
var sColor = sortProperties(window.serverSchema.properties.color.properties.channelAdjustment.items.properties);
var values = window.serverInfo.adjustment[0];
for(key in sColor)
for(var key in sColor)
{
if(sColor[key].key != "id" && sColor[key].key != "leds")
{
var title = '<label for="cr_'+sColor[key].key+'">'+$.i18n(sColor[key].title)+'</label>';
var property;
var value = values[sColor[key].key]
var value = values[sColor[key].key];
if(sColor[key].type == "array")
{
@ -71,11 +71,11 @@ $(document).ready(function() {
function sendEffect()
{
efx = $("#effect_select").val();
var efx = $("#effect_select").val();
if(efx != "__none__")
{
requestPriorityClear();
$(hyperion).one("cmd-clear", function(event) {
$(window.hyperion).one("cmd-clear", function(event) {
setTimeout(function() {requestPlayEffect(efx,duration)}, 100);
});
}
@ -89,8 +89,7 @@ $(document).ready(function() {
function updateInputSelect()
{
$('.sstbody').html("");
var data = "";
var prios = serverInfo.priorities
var prios = window.serverInfo.priorities;
var i;
var clearAll = false;
@ -156,9 +155,12 @@ $(document).ready(function() {
case "FLATBUFSERVER":
owner = $.i18n('general_comp_FLATBUFSERVER');
break;
case "PROTOSERVER":
owner = $.i18n('general_comp_PROTOSERVER');
break;
}
if(duration && compId != "GRABBER" && compId != "PROTOSERVER")
if(duration && compId != "GRABBER" && compId != "FLATBUFSERVER" && compId != "PROTOSERVER")
owner += '<br/><span style="font-size:80%; color:grey;">'+$.i18n('remote_input_duration')+' '+duration.toFixed(0)+$.i18n('edt_append_s')+'</span>';
var btn = '<button id="srcBtn'+i+'" type="button" '+btn_state+' class="btn btn-'+btn_type+' btn_input_selection" onclick="requestSetSource('+priority+');">'+btn_text+'</button>';
@ -169,9 +171,9 @@ $(document).ready(function() {
if(btn_type != 'default')
$('.sstbody').append(createTableRow([origin, owner, priority, btn], false, true));
}
var btn_auto_color = (serverInfo.priorities_autoselect? "btn-success" : "btn-danger");
var btn_auto_state = (serverInfo.priorities_autoselect? "disabled" : "enabled");
var btn_auto_text = (serverInfo.priorities_autoselect? $.i18n('general_btn_on') : $.i18n('general_btn_off'));
var btn_auto_color = (window.serverInfo.priorities_autoselect? "btn-success" : "btn-danger");
var btn_auto_state = (window.serverInfo.priorities_autoselect? "disabled" : "enabled");
var btn_auto_text = (window.serverInfo.priorities_autoselect? $.i18n('general_btn_on') : $.i18n('general_btn_off'));
var btn_call_state = (clearAll? "enabled" : "disabled");
$('#auto_btn').html('<button id="srcBtn'+i+'" type="button" '+btn_auto_state+' class="btn '+btn_auto_color+'" style="margin-right:5px;display:inline-block;" onclick="requestSetSource(\'auto\');">'+$.i18n('remote_input_label_autoselect')+' ('+btn_auto_text+')</button>');
$('#auto_btn').append('<button type="button" '+btn_call_state+' class="btn btn-danger" style="display:inline-block;" onclick="requestClearAll();">'+$.i18n('remote_input_clearall')+'</button>');
@ -186,15 +188,15 @@ $(document).ready(function() {
function updateLedMapping()
{
mapping = serverInfo.imageToLedMappingType;
var mapping = window.serverInfo.imageToLedMappingType;
$('#mappingsbutton').html("");
for(var ix = 0; ix < mappingList.length; ix++)
{
if(mapping == mappingList[ix])
btn_style = 'btn-success';
var btn_style = 'btn-success';
else
btn_style = 'btn-primary';
var btn_style = 'btn-primary';
$('#mappingsbutton').append('<button type="button" id="lmBtn_'+mappingList[ix]+'" class="btn '+btn_style+'" style="margin:3px;min-width:200px" onclick="requestMappingType(\''+mappingList[ix]+'\');">'+$.i18n('remote_maptype_label_'+mappingList[ix])+'</button><br/>');
}
@ -202,7 +204,7 @@ $(document).ready(function() {
function updateComponents()
{
components = comps;
var components = window.comps;
var hyperionEnabled = true;
components.forEach( function(obj) {
if (obj.name == "ALL")
@ -213,21 +215,21 @@ $(document).ready(function() {
// create buttons
$('#componentsbutton').html("");
for ( idx=0; idx<components.length;idx++)
for (var idx=0; idx<components.length;idx++)
{
if(components[idx].name == "ALL")
continue
continue;
enable_style = (components[idx].enabled? "btn-success" : "btn-danger");
enable_icon = (components[idx].enabled? "fa-play" : "fa-stop");
comp_name = components[idx].name;
comp_btn_id = "comp_btn_"+comp_name;
comp_goff = hyperionEnabled? "enabled" : "disabled";
var enable_style = (components[idx].enabled? "btn-success" : "btn-danger");
var enable_icon = (components[idx].enabled? "fa-play" : "fa-stop");
var comp_name = components[idx].name;
var comp_btn_id = "comp_btn_"+comp_name;
var comp_goff = hyperionEnabled? "enabled" : "disabled";
// create btn if not there
if ($("#"+comp_btn_id).length == 0)
{
d='<span style="display:block;margin:3px"><button type="button" '+comp_goff+' id="'+comp_btn_id+'" class="btn '+enable_style
var d='<span style="display:block;margin:3px"><button type="button" '+comp_goff+' id="'+comp_btn_id+'" class="btn '+enable_style
+'" onclick="requestSetComponentState(\''+comp_name+'\','+(!components[idx].enabled)
+')"><i id="'+comp_btn_id+'_icon" class="fa '+enable_icon+'"></i></button> '+$.i18n('general_comp_'+components[idx].name)+'</span>';
$('#componentsbutton').append(d);
@ -243,14 +245,14 @@ $(document).ready(function() {
function updateEffectlist()
{
var newEffects = serverInfo.effects;
var newEffects = window.serverInfo.effects;
if (newEffects.length != oldEffects.length)
{
$('#effect_select').html('<option value="__none__"></option>');
var usrEffArr = [];
var sysEffArr = [];
for(i = 0; i < newEffects.length; i++) {
for(var i = 0; i < newEffects.length; i++) {
var effectName = newEffects[i].name;
if(!/^\:/.test(newEffects[i].file)){
usrEffArr.push(effectName);
@ -267,16 +269,16 @@ $(document).ready(function() {
function updateVideoMode()
{
videoModes = ["2D","3DSBS","3DTAB"];
currVideoMode = serverInfo.videomode;
var videoModes = ["2D","3DSBS","3DTAB"];
var currVideoMode = window.serverInfo.videomode;
$('#videomodebtns').html("");
for(var ix = 0; ix < videoModes.length; ix++)
{
if(currVideoMode == videoModes[ix])
btn_style = 'btn-success';
var btn_style = 'btn-success';
else
btn_style = 'btn-primary';
var btn_style = 'btn-primary';
$('#videomodebtns').append('<button type="button" id="vModeBtn_'+videoModes[ix]+'" class="btn '+btn_style+'" style="margin:3px;min-width:200px" onclick="requestVideoMode(\''+videoModes[ix]+'\');">'+$.i18n('remote_videoMode_'+videoModes[ix])+'</button><br/>');
}
}
@ -336,25 +338,25 @@ $(document).ready(function() {
updateEffectlist();
// interval updates
$(hyperion).on("components-updated",updateComponents);
$(window.hyperion).on("components-updated",updateComponents);
$(hyperion).on("cmd-priorities-update", function(event){
serverInfo.priorities = event.response.data.priorities
serverInfo.priorities_autoselect = event.response.data.priorities_autoselect
$(window.hyperion).on("cmd-priorities-update", function(event){
window.serverInfo.priorities = event.response.data.priorities
window.serverInfo.priorities_autoselect = event.response.data.priorities_autoselect
updateInputSelect()
});
$(hyperion).on("cmd-imageToLedMapping-update", function(event){
serverInfo.imageToLedMappingType = event.response.data.imageToLedMappingType
$(window.hyperion).on("cmd-imageToLedMapping-update", function(event){
window.serverInfo.imageToLedMappingType = event.response.data.imageToLedMappingType
updateLedMapping()
});
$(hyperion).on("cmd-videomode-update", function(event){
serverInfo.videomode = event.response.data.videomode
$(window.hyperion).on("cmd-videomode-update", function(event){
window.serverInfo.videomode = event.response.data.videomode
updateVideoMode()
});
$(hyperion).on("cmd-effects-update", function(event){
serverInfo.effects = event.response.data.effects
$(window.hyperion).on("cmd-effects-update", function(event){
window.serverInfo.effects = event.response.data.effects
updateEffectlist();
});

View File

@ -4,13 +4,13 @@
var conf_editor = null;
$('#conf_cont').append(createOptPanel('fa-wrench', $.i18n("edt_conf_webc_heading_title"), 'editor_container', 'btn_submit'));
if(showOptHelp)
if(window.showOptHelp)
{
$('#conf_cont').append(createHelpTable(schema.webConfig.properties, $.i18n("edt_conf_webc_heading_title")));
$('#conf_cont').append(createHelpTable(window.schema.webConfig.properties, $.i18n("edt_conf_webc_heading_title")));
}
conf_editor = createJsonEditor('editor_container', {
webConfig : schema.webConfig
webConfig : window.schema.webConfig
}, true, true);
conf_editor.on('change',function() {
@ -21,7 +21,7 @@
requestWriteConfig(conf_editor.getValue());
});
if(showOptHelp)
if(window.showOptHelp)
createHint("intro", $.i18n('conf_webconfig_label_intro'), "editor_container");
removeOverlay();

View File

@ -1,44 +1,43 @@
// global vars
var webPrio = 1;
var webOrigin = "Web Configuration";
var showOptHelp;
var currentVersion;
var latestVersion;
var serverInfo = {};
var parsedUpdateJSON = {};
var serverSchema = {};
var serverConfig = {};
var schema;
var sysInfo = {};
var jsonPort = 19444;
var websocket = null;
var hyperion = {};
var wsTan = 1;
var ledStreamActive = false;
var imageStreamActive = false;
var loggingStreamActive = false;
var loggingHandlerInstalled = false;
var watchdog = 0;
var debugMessagesActive = true;
var wSess = [];
var plugins_installed = {};
var plugins_available = {};
//comps serverinfo
comps = [];
// global vars (read and write in window object)
window.webPrio = 1;
window.webOrigin = "Web Configuration";
window.showOptHelp = true;
window.gitHubReleaseApiUrl = "https://api.github.com/repos/hyperion-project/hyperion.ng/releases";
window.currentChannel = null;
window.currentVersion = null;
window.latestVersion = null;
window.latestStableVersion = null;
window.latestBetaVersion = null;
window.gitHubVersionList = null;
window.serverInfo = {};
window.serverSchema = {};
window.serverConfig = {};
window.schema = {};
window.sysInfo = {};
window.jsonPort = 19444;
window.websocket = null;
window.hyperion = {};
window.wsTan = 1;
window.ledStreamActive = false;
window.imageStreamActive = false;
window.loggingStreamActive = false;
window.loggingHandlerInstalled = false;
window.watchdog = 0;
window.debugMessagesActive = true;
window.wSess = [];
window.comps = [];
function initRestart()
{
$(hyperion).off();
$(window.hyperion).off();
requestServerConfigReload();
watchdog = 10;
window.watchdog = 10;
connectionLostDetection('restart');
}
function connectionLostDetection(type)
{
if ( watchdog > 2 )
if ( window.watchdog > 2 )
{
var interval_id = window.setInterval("", 9999); // Get a reference to the last
for (var i = 1; i < interval_id; i++)
@ -57,7 +56,7 @@ function connectionLostDetection(type)
}
else
{
$.get( "/cgi/cfg_jsonserver", function() {watchdog=0}).fail(function() {watchdog++;});
$.get( "/cgi/cfg_jsonserver", function() {window.watchdog=0}).fail(function() {window.watchdog++;});
}
}
@ -69,20 +68,20 @@ function initWebSocket()
{
if ("WebSocket" in window)
{
if (websocket == null)
if (window.websocket == null)
{
jsonPort = (document.location.port == '') ? '80' : document.location.port;
websocket = new WebSocket('ws://'+document.location.hostname+":"+jsonPort);
window.jsonPort = (document.location.port == '') ? '80' : document.location.port;
window.websocket = new WebSocket('ws://'+document.location.hostname+":"+window.jsonPort);
websocket.onopen = function (event) {
$(hyperion).trigger({type:"open"});
window.websocket.onopen = function (event) {
$(window.hyperion).trigger({type:"open"});
$(hyperion).on("cmd-serverinfo", function(event) {
watchdog = 0;
$(window.hyperion).on("cmd-serverinfo", function(event) {
window.watchdog = 0;
});
};
websocket.onclose = function (event) {
window.websocket.onclose = function (event) {
// See http://tools.ietf.org/html/rfc6455#section-7.4.1
var reason;
switch(event.code)
@ -102,45 +101,44 @@ function initWebSocket()
case 1015: reason = "The connection was closed due to a failure to perform a TLS handshake (e.g., the server certificate can't be verified)."; break;
default: reason = "Unknown reason";
}
console.log("[websocket::onclose] "+reason)
$(hyperion).trigger({type:"close", reason:reason});
watchdog = 10;
$(window.hyperion).trigger({type:"close", reason:reason});
window.watchdog = 10;
connectionLostDetection();
};
websocket.onmessage = function (event) {
window.websocket.onmessage = function (event) {
try
{
response = JSON.parse(event.data);
success = response.success;
cmd = response.command;
var response = JSON.parse(event.data);
var success = response.success;
var cmd = response.command;
if (success || typeof(success) == "undefined")
{
$(hyperion).trigger({type:"cmd-"+cmd, response:response});
$(window.hyperion).trigger({type:"cmd-"+cmd, response:response});
}
else
{
error = response.hasOwnProperty("error")? response.error : "unknown";
$(hyperion).trigger({type:"error",reason:error});
console.log("[websocket::onmessage] "+error)
var error = response.hasOwnProperty("error")? response.error : "unknown";
$(window.hyperion).trigger({type:"error",reason:error});
console.log("[window.websocket::onmessage] "+error)
}
}
catch(exception_error)
{
$(hyperion).trigger({type:"error",reason:exception_error});
console.log("[websocket::onmessage] "+exception_error)
$(window.hyperion).trigger({type:"error",reason:exception_error});
console.log("[window.websocket::onmessage] "+exception_error)
}
};
websocket.onerror = function (error) {
$(hyperion).trigger({type:"error",reason:error});
console.log("[websocket::onerror] "+error)
window.websocket.onerror = function (error) {
$(window.hyperion).trigger({type:"error",reason:error});
console.log("[window.websocket::onerror] "+error)
};
}
}
else
{
$(hyperion).trigger("error");
$(window.hyperion).trigger("error");
alert("Websocket is not supported by your browser");
return;
}
@ -158,7 +156,7 @@ function sendToHyperion(command, subcommand, msg)
else
msg = "";
websocket.send(encode_utf8('{"command":"'+command+'", "tan":'+wsTan+subcommand+msg+'}'));
window.websocket.send(encode_utf8('{"command":"'+command+'", "tan":'+window.wsTan+subcommand+msg+'}'));
}
// -----------------------------------------------------------
@ -192,32 +190,32 @@ function requestServerConfigReload()
function requestLedColorsStart()
{
ledStreamActive=true;
window.ledStreamActive=true;
sendToHyperion("ledcolors", "ledstream-start");
}
function requestLedColorsStop()
{
ledStreamActive=false;
window.ledStreamActive=false;
sendToHyperion("ledcolors", "ledstream-stop");
}
function requestLedImageStart()
{
imageStreamActive=true;
window.imageStreamActive=true;
sendToHyperion("ledcolors", "imagestream-start");
}
function requestLedImageStop()
{
imageStreamActive=false;
window.imageStreamActive=false;
sendToHyperion("ledcolors", "imagestream-stop");
}
function requestPriorityClear(prio)
{
if(typeof prio !== 'number')
prio = webPrio;
prio = window.webPrio;
sendToHyperion("clear", "", '"priority":'+prio+'');
}
@ -229,22 +227,22 @@ function requestClearAll()
function requestPlayEffect(effectName, duration)
{
sendToHyperion("effect", "", '"effect":{"name":"'+effectName+'"},"priority":'+webPrio+',"duration":'+validateDuration(duration)+',"origin":"'+webOrigin+'"');
sendToHyperion("effect", "", '"effect":{"name":"'+effectName+'"},"priority":'+window.webPrio+',"duration":'+validateDuration(duration)+',"origin":"'+window.webOrigin+'"');
}
function requestSetColor(r,g,b,duration)
{
sendToHyperion("color", "", '"color":['+r+','+g+','+b+'], "priority":'+webPrio+',"duration":'+validateDuration(duration)+',"origin":"'+webOrigin+'"');
sendToHyperion("color", "", '"color":['+r+','+g+','+b+'], "priority":'+window.webPrio+',"duration":'+validateDuration(duration)+',"origin":"'+window.webOrigin+'"');
}
function requestSetImage(data,width,height,duration)
{
sendToHyperion("image", "", '"imagedata":"'+data+'", "imagewidth":'+width+',"imageheight":'+height+', "priority":'+webPrio+',"duration":'+validateDuration(duration)+'');
sendToHyperion("image", "", '"imagedata":"'+data+'", "imagewidth":'+width+',"imageheight":'+height+', "priority":'+window.webPrio+',"duration":'+validateDuration(duration)+'');
}
function requestSetComponentState(comp, state)
{
state_str = state ? "true" : "false";
var state_str = state ? "true" : "false";
sendToHyperion("componentstate", "", '"componentstate":{"component":"'+comp+'","state":'+state_str+'}');
}
@ -259,15 +257,15 @@ function requestSetSource(prio)
function requestWriteConfig(config, full)
{
if(full === true)
serverConfig = config;
window.serverConfig = config;
else
{
jQuery.each(config, function(i, val) {
serverConfig[i] = val;
window.serverConfig[i] = val;
});
}
sendToHyperion("config","setconfig", '"config":'+JSON.stringify(serverConfig));
sendToHyperion("config","setconfig", '"config":'+JSON.stringify(window.serverConfig));
}
function requestWriteEffect(effectName,effectPy,effectArgs,data)
@ -278,7 +276,7 @@ function requestWriteEffect(effectName,effectPy,effectArgs,data)
function requestTestEffect(effectName,effectPy,effectArgs,data)
{
sendToHyperion("effect", "", '"effect":{"name":"'+effectName+'", "args":'+effectArgs+'}, "priority":'+webPrio+', "origin":"'+webOrigin+'", "pythonScript":"'+effectPy+'", "imageData":"'+data+'"');
sendToHyperion("effect", "", '"effect":{"name":"'+effectName+'", "args":'+effectArgs+'}, "priority":'+window.webPrio+', "origin":"'+window.webOrigin+'", "pythonScript":"'+effectPy+'", "imageData":"'+data+'"');
}
function requestDeleteEffect(effectName)
@ -288,13 +286,13 @@ function requestDeleteEffect(effectName)
function requestLoggingStart()
{
loggingStreamActive=true;
window.loggingStreamActive=true;
sendToHyperion("logging", "start");
}
function requestLoggingStop()
{
loggingStreamActive=false;
window.loggingStreamActive=false;
sendToHyperion("logging", "stop");
}

View File

@ -43,14 +43,7 @@ $(document).ready(function() {
* @return {Path2D} The final path
*/
function build2DPath(x, y, width, height, radius) {
var useColor = false
if (typeof stroke == 'undefined') {
stroke = true;
}
if (typeof radius === 'undefined') {
radius = 5;
}
if (typeof radius === 'number') {
if (typeof radius == 'number') {
radius = {tl: radius, tr: radius, br: radius, bl: radius};
} else {
var defaultRadius = {tl: 0, tr: 0, br: 0, bl: 0};
@ -59,7 +52,7 @@ $(document).ready(function() {
}
}
var path = new Path2D()
var path = new Path2D();
path.moveTo(x + radius.tl, y);
path.lineTo(x + width - radius.tr, y);
@ -74,10 +67,10 @@ $(document).ready(function() {
return path;
}
$(hyperion).one("ready",function(){
leds = serverConfig.leds;
$(window.hyperion).one("ready",function(){
leds = window.serverConfig.leds;
if(showOptHelp)
if(window.showOptHelp)
{
createHint('intro', $.i18n('main_ledsim_text'), 'ledsim_text');
$('#ledsim_text').css({'margin':'10px 15px 0px 15px'});
@ -125,7 +118,7 @@ $(document).ready(function() {
}
});
// apply new serverinfos
$(hyperion).on("cmd-config-getconfig",function(event){
$(window.hyperion).on("cmd-config-getconfig",function(event){
leds = event.response.info.leds;
updateLedLayout();
});
@ -135,7 +128,7 @@ $(document).ready(function() {
{
// toggle leds, do not print
if(toggleLeds)
return
return;
var useColor = false;
ledsCanvasNodeCtx.clear();
@ -169,7 +162,7 @@ $(document).ready(function() {
canvas_width = $('#ledsim_dialog').outerWidth()-30;
$('#leds_canvas').html("");
leds_html = '<canvas id="image_preview_canv" width="'+canvas_width+'" height="'+canvas_height+'" style="position: absolute; left: 0; top: 0; z-index: 99998;"></canvas>';
var leds_html = '<canvas id="image_preview_canv" width="'+canvas_width+'" height="'+canvas_height+'" style="position: absolute; left: 0; top: 0; z-index: 99998;"></canvas>';
leds_html += '<canvas id="leds_preview_canv" width="'+canvas_width+'" height="'+canvas_height+'" style="position: absolute; left: 0; top: 0; z-index: 99999;"></canvas>';
$('#leds_canvas').html(leds_html);
@ -178,7 +171,7 @@ $(document).ready(function() {
ledsCanvasNodeCtx = document.getElementById("leds_preview_canv").getContext("2d");
create2dPaths();
printLedsToCanvas();
resetImage()
resetImage();
}
// ------------------------------------------------------------------
@ -196,8 +189,8 @@ $(document).ready(function() {
// ------------------------------------------------------------------
$('#leds_toggle_live_video').off().on("click", function() {
setClassByBool('#leds_toggle_live_video',imageStreamActive,"btn-success","btn-danger");
if ( imageStreamActive )
setClassByBool('#leds_toggle_live_video',window.imageStreamActive,"btn-success","btn-danger");
if ( window.imageStreamActive )
{
requestLedImageStop();
resetImage();
@ -209,7 +202,7 @@ $(document).ready(function() {
});
// ------------------------------------------------------------------
$(hyperion).on("cmd-ledcolors-ledstream-update",function(event){
$(window.hyperion).on("cmd-ledcolors-ledstream-update",function(event){
if (!modalOpened)
{
requestLedColorsStop();
@ -221,14 +214,14 @@ $(document).ready(function() {
});
// ------------------------------------------------------------------
$(hyperion).on("cmd-ledcolors-imagestream-update",function(event){
$(window.hyperion).on("cmd-ledcolors-imagestream-update",function(event){
if (!modalOpened)
{
requestLedImageStop();
}
else
{
imageData = (event.response.result.image);
var imageData = (event.response.result.image);
var image = new Image();
image.onload = function() {
@ -243,12 +236,12 @@ $(document).ready(function() {
});
// ------------------------------------------------------------------
$(hyperion).on("cmd-settings-update",function(event){
$(window.hyperion).on("cmd-settings-update",function(event){
var obj = event.response.data
Object.getOwnPropertyNames(obj).forEach(function(val, idx, array) {
serverInfo[val] = obj[val];
window.serverInfo[val] = obj[val];
});
leds = serverConfig.leds
leds = window.serverConfig.leds
updateLedLayout();
});

View File

@ -1,4 +1,4 @@
var storedAccess;
var storedAccess;
var storedLang;
var availLang = ['en','de','es','it','cs'];
var availAccess = ['default','advanced','expert'];
@ -30,7 +30,7 @@ $(document).ready( function() {
storedLang = getStorage("langcode");
if (storedLang == null)
{
setStorage("langcode", 'auto')
setStorage("langcode", 'auto');
storedLang = 'auto';
initTrans(storedLang);
}
@ -119,14 +119,20 @@ $(document).ready( function() {
// instance switcher
$('#btn_instanceswitch').off().on('click',function() {
var lsys = sysInfo.system.hostName+':'+serverConfig.webConfig.port;
var lsys = window.sysInfo.system.hostName+':'+window.serverConfig.webConfig.port;
showInfoDialog('iswitch', $.i18n('InfoDialog_iswitch_title'), $.i18n('InfoDialog_iswitch_text'));
for (var i = 0; i<wSess.length; i++)
for (var i = 0; i<window.wSess.length; i++)
{
if(lsys != window.wSess[i].host+':'+window.wSess[i].port)
var hyperionAddress
if(lsys != wSess[i].host+':'+wSess[i].port)
$('#id_select').append(createSelOpt('http://'+wSess[i].address+':'+wSess[i].port, wSess[i].name))
if (window.wSess[i].address.indexOf(':') > -1 && window.wSess[i].address.length == 36)
hyperionAddress = 'http://['+window.wSess[i].address+']:'+window.wSess[i].port
else
hyperionAddress = 'http://'+window.wSess[i].address+':'+window.wSess[i].port
$('#id_select').append(createSelOpt(hyperionAddress, window.wSess[i].host))
}
$('#id_btn_saveset').off().on('click',function() {

View File

@ -42,7 +42,7 @@ function setStorage(item, value, session)
function debugMessage(msg)
{
if (debugMessagesActive)
if (window.debugMessagesActive)
{
console.log(msg);
}
@ -50,19 +50,19 @@ function debugMessage(msg)
function updateSessions()
{
var sess = serverInfo.sessions;
var sess = window.serverInfo.sessions;
if (sess.length)
{
wSess = [];
window.wSess = [];
for(var i = 0; i<sess.length; i++)
{
if(sess[i].type == "_hyperiond-http._tcp.")
{
wSess.push(sess[i]);
window.wSess.push(sess[i]);
}
}
if (wSess.length > 1)
if (window.wSess.length > 1)
$('#btn_instanceswitch').toggle(true);
else
$('#btn_instanceswitch').toggle(false);
@ -72,7 +72,7 @@ function updateSessions()
function validateDuration(d)
{
if(typeof d === "undefined" || d < 0)
return d = 0;
return 0;
else
return d *= 1000;
}
@ -110,8 +110,10 @@ function loadContent(event, forceRefresh)
$("#page-content").off();
$("#page-content").load("/content/"+tag+".html", function(response,status,xhr){
if(status == "error")
{
$("#page-content").html('<h3>'+$.i18n('info_404')+'</h3>');
removeOverlay();
}
});
}
}
@ -212,7 +214,8 @@ function showInfoDialog(type,header,message)
function createHintH(type, text, container)
{
if(type = "intro")
type = String(type);
if(type == "intro")
tclass = "introd";
$('#'+container).prepend('<div class="'+tclass+'"><h4 style="font-size:16px">'+text+'</h4><hr/></div>');
@ -349,7 +352,7 @@ function createJsonEditor(container,schema,setconfig,usePanel,arrayre)
{
for(var key in editor.root.editors)
{
editor.getEditor("root."+key).setValue( serverConfig[key] );
editor.getEditor("root."+key).setValue( window.serverConfig[key] );
}
}
@ -476,8 +479,8 @@ function createCP(id, color, cb)
}
});
$('#'+id).colorpicker().on('changeColor', function(e) {
rgb = e.color.toRGB();
hex = e.color.toHex();
var rgb = e.color.toRGB();
var hex = e.color.toHex();
cb(rgb,hex,e);
});
}
@ -549,7 +552,7 @@ function createRow(id)
function createOptPanel(phicon, phead, bodyid, footerid)
{
phead = '<i class="fa '+phicon+' fa-fw"></i>'+phead;
pfooter = document.createElement('button');
var pfooter = document.createElement('button');
pfooter.className = "btn btn-primary";
pfooter.setAttribute("id", footerid);
pfooter.innerHTML = '<i class="fa fa-fw fa-save"></i>'+$.i18n('general_button_savesettings');
@ -559,7 +562,7 @@ function createOptPanel(phicon, phead, bodyid, footerid)
function sortProperties(list)
{
for(key in list)
for(var key in list)
{
list[key].key = key;
}
@ -583,7 +586,7 @@ function createHelpTable(list, phead){
thead.appendChild(createTableRow([$.i18n('conf_helptable_option'), $.i18n('conf_helptable_expl')], true, false));
for (key in list)
for (var key in list)
{
if(list[key].access != 'system')
{
@ -596,7 +599,7 @@ function createHelpTable(list, phead){
if(list[key].items && list[key].items.properties)
{
var ilist = sortProperties(list[key].items.properties);
for (ikey in ilist)
for (var ikey in ilist)
{
// break one iteration (in the loop), if the schema has the entry hidden=true
if ("options" in ilist[ikey] && "hidden" in ilist[ikey].options && (ilist[ikey].options.hidden))
@ -635,7 +638,7 @@ function createPanel(head, body, footer, type, bodyid){
if(typeof bodyid != 'undefined')
{
pfooter.style.textAlign = 'right';
pbody.setAttribute("id", bodyid)
pbody.setAttribute("id", bodyid);
}
if(typeof body != 'undefined' && body != "")
@ -706,3 +709,51 @@ function encode_utf8(s)
{
return unescape(encodeURIComponent(s));
}
function getReleases(callback)
{
$.ajax({
url: window.gitHubReleaseApiUrl,
method: 'get',
error: function(XMLHttpRequest, textStatus, errorThrown)
{
callback(false);
},
success: function(releases)
{
window.gitHubVersionList = releases;
for(var i in releases)
{
if(releases[i].prerelease == true)
{
window.latestBetaVersion = releases[i];
break;
}
}
$.ajax({
url: window.gitHubReleaseApiUrl + "/latest",
method: 'get',
error: function(XMLHttpRequest, textStatus, errorThrown)
{
callback(false);
},
success: function(latest)
{
window.latestStableVersion = latest;
if(window.serverConfig.general.versionBranch == "Beta" && window.latestStableVersion.tag_name.replace(/\./g, '') <= window.latestBetaVersion.tag_name.replace(/\./g, ''))
{
window.latestVersion = window.latestBetaVersion;
}
else
{
window.latestVersion = window.latestStableVersion;
}
callback(true);
}
});
}
})
}

View File

@ -1,11 +1,11 @@
//clear priority and other tasks if people reload the page or lost connection while a wizard was active
$(hyperion).one("ready", function(event) {
$(window.hyperion).one("ready", function(event) {
if(getStorage("wizardactive") === 'true')
{
requestPriorityClear();
setStorage("wizardactive", false);
if(getStorage("kodiAddress" != null))
if(getStorage("kodiAddress") != null)
{
kodiAddress = getStorage("kodiAddress");
sendToKodi("stop");
@ -58,7 +58,7 @@
$('#wizp2_body').append('<div class="form-group"><label>'+$.i18n('wiz_rgb_switchevery')+'</label><div class="input-group" style="width:100px"><select id="wiz_switchtime_select" class="form-control"></select><div class="input-group-addon">'+$.i18n('edt_append_s')+'</div></div></div>');
$('#wizp2_body').append('<canvas id="wiz_canv_color" width="100" height="100" style="border-radius:60px;background-color:red; display:block; margin: 10px 0;border:4px solid grey;"></canvas><label>'+$.i18n('wiz_rgb_q')+'</label>');
$('#wizp2_body').append('<table class="table borderless" style="width:200px"><tbody><tr><td class="ltd"><label>'+$.i18n('wiz_rgb_qrend')+'</label></td><td class="itd"><select id="wiz_r_select" class="form-control wselect"></select></td></tr><tr><td class="ltd"><label>'+$.i18n('wiz_rgb_qgend')+'</label></td><td class="itd"><select id="wiz_g_select" class="form-control wselect"></select></td></tr></tbody></table>');
$('#wizp2_footer').html('<button type="button" class="btn btn-primary" id="btn_wiz_save"><i class="fa fa-fw fa-save"></i>'+$.i18n('general_btn_save')+'</button><button type="button" class="btn btn-primary" id="btn_wiz_checkok" style="display:none" data-dismiss="modal"><i class="fa fa-fw fa-check"></i>'+$.i18n('general_btn_ok')+'</button><button type="button" class="btn btn-danger" id="btn_wiz_abort"><i class="fa fa-fw fa-close"></i>'+$.i18n('general_btn_cancel')+'</button>')
$('#wizp2_footer').html('<button type="button" class="btn btn-primary" id="btn_wiz_save"><i class="fa fa-fw fa-save"></i>'+$.i18n('general_btn_save')+'</button><button type="button" class="btn btn-primary" id="btn_wiz_checkok" style="display:none" data-dismiss="modal"><i class="fa fa-fw fa-check"></i>'+$.i18n('general_btn_ok')+'</button><button type="button" class="btn btn-danger" id="btn_wiz_abort"><i class="fa fa-fw fa-close"></i>'+$.i18n('general_btn_cancel')+'</button>');
//open modal
$("#wizard_modal").modal({
@ -84,7 +84,7 @@
});
$('.wselect').change(function () {
var rgb_order = serverConfig.device.colorOrder.split("");
var rgb_order = window.serverConfig.device.colorOrder.split("");
var redS = $("#wiz_r_select").val();
var greenS = $("#wiz_g_select").val();
var blueS = rgb_order.toString().replace(/,/g,"").replace(redS, "").replace(greenS,"");
@ -127,7 +127,7 @@
$('#btn_wiz_save').toggle(true);
$('#btn_wiz_checkok').toggle(false);
}
new_rgb_order = rgb_order
new_rgb_order = rgb_order;
}
else
$('#btn_wiz_save').attr('disabled',true);
@ -153,8 +153,8 @@
$('#btn_wiz_save').off().on('click',function() {
resetWizard();
serverConfig.device.colorOrder = new_rgb_order;
requestWriteConfig({"device" : serverConfig.device});
window.serverConfig.device.colorOrder = new_rgb_order;
requestWriteConfig({"device" : window.serverConfig.device});
});
}
@ -232,10 +232,10 @@
{
$('#wiz_cc_desc').html($.i18n('wiz_cc_chooseid'));
updateWEditor(["id"]);
$('#btn_wiz_back').attr("disabled", true)
$('#btn_wiz_back').attr("disabled", true);
}
else
$('#btn_wiz_back').attr("disabled", false)
$('#btn_wiz_back').attr("disabled", false);
if(step == 2)
{
@ -415,7 +415,7 @@
$('#wizp1_body').html('<h4 style="font-weight:bold;text-transform:uppercase;">'+$.i18n('wiz_cc_title')+'</h4><p>'+$.i18n('wiz_cc_intro1')+'</p><label>'+$.i18n('wiz_cc_kwebs')+'</label><input class="form-control" style="width:170px;margin:auto" id="wiz_cc_kodiip" type="text" placeholder="'+kodiAddress+'" value="'+kodiAddress+'" /><span id="kodi_status"></span><span id="multi_cali"></span>');
$('#wizp1_footer').html('<button type="button" class="btn btn-primary" id="btn_wiz_cont" disabled="disabled"><i class="fa fa-fw fa-check"></i>'+$.i18n('general_btn_continue')+'</button><button type="button" class="btn btn-danger" data-dismiss="modal"><i class="fa fa-fw fa-close"></i>'+$.i18n('general_btn_cancel')+'</button>');
$('#wizp2_body').html('<div id="wiz_cc_desc" style="font-weight:bold"></div><div id="editor_container_wiz"></div>');
$('#wizp2_footer').html('<button type="button" class="btn btn-primary" id="btn_wiz_back"><i class="fa fa-fw fa-chevron-left"></i>'+$.i18n('general_btn_back')+'</button><button type="button" class="btn btn-primary" id="btn_wiz_next">'+$.i18n('general_btn_next')+'<i style="margin-left:4px;"class="fa fa-fw fa-chevron-right"></i></button><button type="button" class="btn btn-warning" id="btn_wiz_save" style="display:none"><i class="fa fa-fw fa-save"></i>'+$.i18n('general_btn_save')+'</button><button type="button" class="btn btn-danger" id="btn_wiz_abort"><i class="fa fa-fw fa-close"></i>'+$.i18n('general_btn_cancel')+'</button>')
$('#wizp2_footer').html('<button type="button" class="btn btn-primary" id="btn_wiz_back"><i class="fa fa-fw fa-chevron-left"></i>'+$.i18n('general_btn_back')+'</button><button type="button" class="btn btn-primary" id="btn_wiz_next">'+$.i18n('general_btn_next')+'<i style="margin-left:4px;"class="fa fa-fw fa-chevron-right"></i></button><button type="button" class="btn btn-warning" id="btn_wiz_save" style="display:none"><i class="fa fa-fw fa-save"></i>'+$.i18n('general_btn_save')+'</button><button type="button" class="btn btn-danger" id="btn_wiz_abort"><i class="fa fa-fw fa-close"></i>'+$.i18n('general_btn_cancel')+'</button>');
//open modal
$("#wizard_modal").modal({
@ -450,10 +450,10 @@
$('#wizp2').toggle(true);
});
$('#wiz_cc_kodiip').trigger("change")
colorLength = serverConfig.color.channelAdjustment;
cobj = schema.color.properties.channelAdjustment.items.properties;
websAddress = document.location.hostname+':'+serverConfig.webConfig.port;
$('#wiz_cc_kodiip').trigger("change");
colorLength = window.serverConfig.color.channelAdjustment;
cobj = window.schema.color.properties.channelAdjustment.items.properties;
websAddress = document.location.hostname+':'+window.serverConfig.webConfig.port;
imgAddress = 'http://'+websAddress+'/img/cc/';
setStorage("wizardactive", true);
@ -471,7 +471,7 @@
//prepare editor
wiz_editor = createJsonEditor('editor_container_wiz', {
color : schema.color
color : window.schema.color
}, true, true);
$('#editor_container_wiz h4').toggle(false);
@ -716,7 +716,7 @@
//create hue led config
var incC = 0;
for(key in lightIDs)
for(var key in lightIDs)
{
if($('#hue_'+key).val() != "disabled")
{
@ -726,10 +726,10 @@
}
}
serverConfig.leds = hueLedConfig;
window.serverConfig.leds = hueLedConfig;
//Adjust gamma, brightness and compensation
var c = serverConfig.color.channelAdjustment[0];
var c = window.serverConfig.color.channelAdjustment[0];
c.gammaBlue = 1.0;
c.gammaRed = 1.0;
c.gammaGreen = 1.0;
@ -737,7 +737,7 @@
c.brightnessCompensation = 0;
//device config
var d = serverConfig.device;
var d = window.serverConfig.device;
d.output = $('#ip').val();
d.lightIds = finalLightIds;
d.username = $('#user').val();
@ -746,9 +746,9 @@
d.switchOffOnBlack = true;
//smoothing off
serverConfig.smoothing.enable = false;
window.serverConfig.smoothing.enable = false;
requestWriteConfig(serverConfig, true);
requestWriteConfig(window.serverConfig, true);
resetWizard();
});
@ -822,7 +822,7 @@
$('.hue_sel_watch').bind("change", function(){
var cC = 0;
for(key in lightIDs)
for(var key in lightIDs)
{
if($('#hue_'+key).val() != "disabled")
{

15
bin/create_all_releases.sh Normal file → Executable file
View File

@ -10,25 +10,28 @@ make_release()
PLATFORM=$2
shift 2
rm -r build-${RELEASE}
mkdir -p build-${RELEASE}
rm -r deploy/${RELEASE}
mkdir -p deploy/${RELEASE}
cd build-${RELEASE}
cmake -DCMAKE_INSTALL_PREFIX=/usr -DPLATFORM=${PLATFORM} $@ -DCMAKE_BUILD_TYPE=Release -Wno-dev .. || exit 1
make -j $(nproc) || exit 1
#strip bin/*
make package -j $(nproc)
mv hyperion-*-ambilight.* ../deploy/${RELEASE}
mv Hyperion-*.* ../deploy/${RELEASE}
cd ..
bin/create_release.sh . ${RELEASE}
}
export PATH="$PATH:$HOME/raspberrypi/tools/arm-bcm2708/gcc-linaro-arm-linux-gnueabihf-raspbian/bin"
CMAKE_PROTOC_FLAG="-DIMPORT_PROTOC=../build-x86x64/protoc_export.cmake"
CMAKE_FLATC_FLAG="-DIMPORT_FLATC=../build-x86x64/flatc_export.cmake"
make_release x86x64 x86
#make_release x32 x86 ${CMAKE_PROTOC_FLAG}
make_release rpi rpi -DCMAKE_TOOLCHAIN_FILE="../cmake/Toolchain-rpi.cmake" ${CMAKE_PROTOC_FLAG}
make_release wetek wetek -DCMAKE_TOOLCHAIN_FILE="../cmake/Toolchain-rpi.cmake" ${CMAKE_PROTOC_FLAG}
#make_release imx6 imx6 -DCMAKE_TOOLCHAIN_FILE="../cmake/Toolchain-imx6.cmake" ${CMAKE_PROTOC_FLAG}
#make_release x32 x86 -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}

8
bin/create_release.sh Normal file → Executable file
View File

@ -27,8 +27,8 @@ tar --create --gzip --absolute-names --show-transformed-names --ignore-failed-re
--transform "s:$repodir/bin/service/hyperion.initctl.sh:hyperion/services/hyperion.initctl.sh:" \
--transform "s://:/:g" \
"$builddir/bin/hyperion"* \
"$repodir/bin/service/hyperion.init.sh" \
"$repodir/bin/service/hyperion.systemd.sh" \
"$repodir/bin/service/hyperion.initctl.sh" \
"$repodir/config/hyperion.config.json.example"
"$repodir/bin/service/hyperion.init" \
"$repodir/bin/service/hyperion.systemd" \
"$repodir/bin/service/hyperion.initctl" \
"$repodir/config/hyperion.config.json.default"

View File

@ -5,8 +5,8 @@ DOCKER="docker"
GIT_REPO_URL="https://github.com/hyperion-project/hyperion.ng.git"
# cmake build type
BUILD_TYPE="Release"
# the image tag at hyperionorg/hyperion-ci
BUILD_TARGET="ubuntu1604"
# the image tag at hyperionproject/hyperion-ci
BUILD_TARGET="amd64"
# build packages (.deb .zip ...)
BUILD_PACKAGES=true
# packages string inserted to cmake cmd
@ -42,8 +42,8 @@ function printHelp {
echo "########################################################
## A script to compile Hyperion inside a docker container
## Requires installed Docker: https://www.docker.com/
## Without arguments it will compile Hyperion for Ubuntu 16.04 (x64) or higher.
## Supports Raspberry Pi (armv6) cross compilation (Raspbian Stretch)
## Without arguments it will compile Hyperion for Debain Stretch (x64) or higher.
## Supports Raspberry Pi (armv6hf, armv7hf) cross compilation (Debian Stretch)
##
## Homepage: https://www.hyperion-project.org
## Forum: https://forum.hyperion-project.org
@ -51,10 +51,10 @@ echo "########################################################
# These are possible arguments to modify the script behaviour with their default values
#
# docker-compile.sh -h # Show this help message
# docker-compile.sh -t ubuntu1604 # The docker tag, one of ubuntu1604 | cross-qemu-rpistretch
# docker-compile.sh -t amd64 # The docker tag, one of amd64 | i386 | armv6hf | armv7hf
# docker-compile.sh -b Release # cmake Release or Debug build
# docker-compile.sh -p true # If true build packages with CPack
# More informations to docker tags at: https://hub.docker.com/r/hyperionorg/hyperion-ci/"
# More informations to docker tags at: https://hub.docker.com/r/hyperionproject/hyperion-ci/"
}
while getopts t:b:p:h option
@ -81,8 +81,8 @@ mkdir $SCRIPT_PATH/deploy >/dev/null 2>&1
# get Hyperion source, cleanup previous folder
echo "---> Downloading Hyperion source code from ${GIT_REPO_URL}"
sudo rm -fr $SCRIPT_PATH/hyperion >/dev/null 2>&1
git clone --recursive --depth 1 -q $GIT_REPO_URL $SCRIPT_PATH/hyperion || { echo "---> Failed to download Hyperion source code! Abort"; exit 1; }
sudo rm -fr $SCRIPT_PATH/hyperion.ng >/dev/null 2>&1
git clone --recursive --depth 1 -q $GIT_REPO_URL $SCRIPT_PATH/hyperion.ng || { echo "---> Failed to download Hyperion source code! Abort"; exit 1; }
# start compilation
# Remove container after stop
@ -93,15 +93,15 @@ git clone --recursive --depth 1 -q $GIT_REPO_URL $SCRIPT_PATH/hyperion || { echo
echo "---> Startup docker..."
$DOCKER run --rm \
-v "${SCRIPT_PATH}/deploy:/deploy" \
-v "${SCRIPT_PATH}/hyperion:/source:ro" \
hyperionorg/hyperion-ci:$BUILD_TARGET \
/bin/bash -c "mkdir build && cp -r /source/. /build &&
cd /build && mkdir build && cd build &&
-v "${SCRIPT_PATH}/hyperion.ng:/source:ro" \
hyperionproject/hyperion-ci:$BUILD_TARGET \
/bin/bash -c "mkdir hyperion.ng && cp -r /source/. /hyperion.ng &&
cd /hyperion.ng && mkdir build && cd build &&
cmake -DCMAKE_BUILD_TYPE=${BUILD_TYPE} .. || exit 2 &&
make -j $(nproc) ${PACKAGES} || exit 3 &&
echo '---> Copy binaries and packages to host folder: ${SCRIPT_PATH}/deploy' &&
cp -v /build/build/bin/h* /deploy/ 2>/dev/null || : &&
cp -v /build/build/Hyperion-* /deploy/ 2>/dev/null || : &&
cp -v /hyperion.ng/build/bin/h* /deploy/ 2>/dev/null || : &&
cp -v /hyperion.ng/build/Hyperion.NG-* /deploy/ 2>/dev/null || : &&
exit 0;
exit 1 " || { echo "---> Hyperion compilation failed! Abort"; exit 4; }

View File

@ -7,4 +7,5 @@ STRING ( STRIP "${BUILD_ID}" BUILD_ID )
STRING ( STRIP "${VERSION_ID}" VERSION_ID )
STRING ( STRIP "${GIT_REMOTE_PATH}" GIT_REMOTE_PATH )
SET ( HYPERION_BUILD_ID "${VERSION_ID} (${BUILD_ID}) Git Remote: ${GIT_REMOTE_PATH}" )
message ( STATUS "Current Version: ${HYPERION_BUILD_ID}" )
SET ( HYPERION_VERSION "${HYPERION_VERSION_CHANNEL}.${HYPERION_VERSION_MAJOR}.${HYPERION_VERSION_MINOR}.${HYPERION_VERSION_PATCH}" )
message ( STATUS "Current Version: ${HYPERION_VERSION} (${HYPERION_BUILD_ID})" )

17
cmake/LDGold.cmake Normal file
View File

@ -0,0 +1,17 @@
option(ENABLE_LDGOLD "Use GNU gold linker" ON)
set(LDGOLD_FOUND FALSE)
if(ENABLE_LDGOLD)
execute_process(COMMAND ${CMAKE_C_COMPILER} -fuse-ld=gold -Wl,--version ERROR_QUIET OUTPUT_VARIABLE LD_VERSION)
if(LD_VERSION MATCHES "GNU gold")
set(CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} -fuse-ld=gold")
set(CMAKE_SHARED_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} -fuse-ld=gold")
set(CMAKE_MODULE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} -fuse-ld=gold")
set(LDGOLD_FOUND TRUE)
message(STATUS "Linker: GNU gold")
else()
message(STATUS "GNU gold linker is not available, falling back to default system linker")
endif()
else()
message(STATUS "Linker: Default system linker")
endif()

View File

@ -1,16 +1,21 @@
SET(CUBIXCROSS_DIR $ENV{HOME}/hummingboard)
SET(CMAKE_SYSTEM_NAME Linux)
SET(CMAKE_SYSTEM_VERSION 1)
# specify the cross compiler
SET(CMAKE_C_COMPILER ${CUBIXCROSS_DIR}/gcc-linaro-arm-linux-gnueabihf-4.8-2013.10_linux/bin/arm-linux-gnueabihf-gcc)
SET(CMAKE_CXX_COMPILER ${CUBIXCROSS_DIR}/gcc-linaro-arm-linux-gnueabihf-4.8-2013.10_linux/bin/arm-linux-gnueabihf-g++)
SET(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -march=armv7-a -mcpu=cortex-a9 -mtune=cortex-a9 -mfpu=vfpv3 -mfloat-abi=hard")
SET(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -march=armv7-a -mcpu=cortex-a9 -mtune=cortex-a9 -mfpu=vfpv3 -mfloat-abi=hard")
SET(CROSSROOT $ENV{HOME}/crosscompile)
SET(DEVROOT ${CROSSROOT}/hummingboard)
SET(CUBIXROOT ${DEVROOT}/rootfs)
SET(CUBIXCROSS_DIR ${DEVROOT}/tools)
# where is the target environment
SET(CMAKE_FIND_ROOT_PATH ${CUBIXCROSS_DIR}/rootfs)
SET(TOOLROOT ${CUBIXCROSS_DIR}/gcc-linaro-arm-linux-gnueabihf-4.8-2013.10_linux/ )
# specify the cross compiler
SET(CMAKE_C_COMPILER ${TOOLROOT}/bin/arm-linux-gnueabihf-gcc)
SET(CMAKE_CXX_COMPILER ${TOOLROOT}/bin/arm-linux-gnueabihf-g++)
SET(CUBIX_FLAGS "-march=armv7-a -mcpu=cortex-a9 -mtune=cortex-a9 -mfpu=vfpv3 -mfloat-abi=hard")
SET(CPACK_DEBIAN_PACKAGE_ARCHITECTURE "armhf" )
SET(CMAKE_SYSROOT ${CUBIXROOT})
SET(CMAKE_FIND_ROOT_PATH ${CUBIXROOT})
# search for programs in the build host directories
SET(CMAKE_FIND_ROOT_PATH_MODE_PROGRAM NEVER)
@ -18,5 +23,17 @@ SET(CMAKE_FIND_ROOT_PATH_MODE_PROGRAM NEVER)
# for libraries and headers in the target directories
SET(CMAKE_FIND_ROOT_PATH_MODE_LIBRARY ONLY)
SET(CMAKE_FIND_ROOT_PATH_MODE_INCLUDE ONLY)
#SET(CMAKE_FIND_ROOT_PATH_MODE_PACKAGES ONLY)
include_directories(${CMAKE_FIND_ROOT_PATH}/usr/include)
#SET Flags for linking as dynamic linker config file is not being properly parsed by the toolchain
# see https://solderspot.wordpress.com/2016/02/04/cross-compiling-for-raspberry-pi-part-ii/
SET(FLAGS "${CUBIX_FLAGS} -Wl,-rpath-link,${CUBIXROOT}/opt/vc/lib -Wl,-rpath-link,${CUBIXROOT}/lib/arm-linux-gnueabihf -Wl,-rpath-link,${CUBIXROOT}/usr/lib/arm-linux-gnueabihf -Wl,-rpath-link,${CUBIXROOT}/usr/local/lib")
UNSET(CMAKE_C_FLAGS CACHE)
UNSET(CMAKE_CXX_FLAGS CACHE)
SET(CMAKE_CXX_FLAGS ${FLAGS} CACHE STRING "" FORCE)
SET(CMAKE_C_FLAGS ${FLAGS} CACHE STRING "" FORCE)
link_directories(${CUBIXROOT}/lib/arm-linux-gnueabihf)

View File

@ -1,14 +1,21 @@
SET(RASPCROSS_DIR $ENV{HOME}/raspberrypi)
SET(CMAKE_SYSTEM_NAME Linux)
SET(CMAKE_SYSTEM_VERSION 1)
# specify the cross compiler
SET(CMAKE_C_COMPILER ${RASPCROSS_DIR}/tools/arm-bcm2708/gcc-linaro-arm-linux-gnueabihf-raspbian-x64/bin/arm-linux-gnueabihf-gcc)
SET(CMAKE_CXX_COMPILER ${RASPCROSS_DIR}/tools/arm-bcm2708/gcc-linaro-arm-linux-gnueabihf-raspbian-x64/bin/arm-linux-gnueabihf-g++)
SET(CROSSROOT $ENV{HOME}/crosscompile)
SET(DEVROOT ${CROSSROOT}/raspberrypi)
SET(PIROOT ${DEVROOT}/rootfs)
SET(PITOOLCHAIN ${DEVROOT}/tools)
# where is the target environment
SET(CMAKE_FIND_ROOT_PATH ${RASPCROSS_DIR}/rootfs)
SET(TOOLROOT ${PITOOLCHAIN}/gcc-linaro-7.4.1-2019.02-x86_64_arm-linux-gnueabihf )
SET(QT_BIN_PATH ${CROSSROOT}/Qt5/5.7/gcc_64/bin)
# specify the cross compiler
SET(CMAKE_C_COMPILER ${TOOLROOT}/bin/arm-linux-gnueabihf-gcc)
SET(CMAKE_CXX_COMPILER ${TOOLROOT}/bin/arm-linux-gnueabihf-g++)
SET(CPACK_DEBIAN_PACKAGE_ARCHITECTURE "armhf" )
SET(CMAKE_SYSROOT ${PIROOT})
SET(CMAKE_FIND_ROOT_PATH ${PIROOT})
# search for programs in the build host directories
SET(CMAKE_FIND_ROOT_PATH_MODE_PROGRAM NEVER)
@ -16,4 +23,19 @@ SET(CMAKE_FIND_ROOT_PATH_MODE_PROGRAM NEVER)
# for libraries and headers in the target directories
SET(CMAKE_FIND_ROOT_PATH_MODE_LIBRARY ONLY)
SET(CMAKE_FIND_ROOT_PATH_MODE_INCLUDE ONLY)
#SET(CMAKE_FIND_ROOT_PATH_MODE_PACKAGES ONLY)
#SET Flags for linking as dynamic linker config file is not being properly parsed by the toolchain
# see https://solderspot.wordpress.com/2016/02/04/cross-compiling-for-raspberry-pi-part-ii/
SET(FLAGS "-Wl,-rpath-link,${PIROOT}/opt/vc/lib -Wl,-rpath-link,${PIROOT}/lib/arm-linux-gnueabihf -Wl,-rpath-link,${PIROOT}/usr/lib/arm-linux-gnueabihf -Wl,-rpath-link,${PIROOT}/usr/local/lib")
UNSET(CMAKE_C_FLAGS CACHE)
UNSET(CMAKE_CXX_FLAGS CACHE)
SET(CMAKE_CXX_FLAGS ${FLAGS} CACHE STRING "" FORCE)
SET(CMAKE_C_FLAGS ${FLAGS} CACHE STRING "" FORCE)
link_directories(${PIROOT}/lib/arm-linux-gnueabihf)

View File

@ -1,7 +1,13 @@
# toolchain file for building a 32bit version on a 64bit host
# use it like this:
# cmake -DCMAKE_TOOLCHAIN_FILE=Toolchain-x32.cmake <sourcedir>
# Add additional 32-bit libraries
# sudo apt-get install g++-multilib libc6-dev-i386
#TO-DO
# Install QT5 32bit
SET(CROSSROOT $ENV{HOME}/crosscompile)
SET(QT_BIN_PATH ${CROSSROOT}/x86_32-linux-gnu/qt5/bin)
set(CMAKE_SYSTEM_NAME Linux)
set(CMAKE_SYSTEM_VERSION 1)
@ -10,3 +16,6 @@ set(CMAKE_SYSTEM_PROCESSOR "i686")
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -m32" CACHE STRING "c++ flags")
set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -m32" CACHE STRING "c flags")

View File

@ -24,10 +24,16 @@ ENDIF()
# Apply to all packages, some of these can be overwritten with generator specific content
# https://cmake.org/cmake/help/v3.5/module/CPack.html
SET ( CPACK_PACKAGE_NAME "Hyperion" )
SET ( CPACK_PACKAGE_NAME "Hyperion.NG" )
SET ( CPACK_PACKAGE_DESCRIPTION_SUMMARY "Hyperion is an open source ambient light implementation" )
SET ( CPACK_PACKAGE_DESCRIPTION_FILE "${CMAKE_SOURCE_DIR}/README.md" )
SET ( CPACK_PACKAGE_FILE_NAME "Hyperion-${HYPERION_VERSION_MAJOR}.${HYPERION_VERSION_MINOR}.${HYPERION_VERSION_PATCH}-${CMAKE_SYSTEM_NAME}")
if ( NOT DEFINED DOCKER_PLATFORM )
SET ( CPACK_PACKAGE_FILE_NAME "Hyperion.NG-${HYPERION_VERSION_CHANNEL}.${HYPERION_VERSION_MAJOR}.${HYPERION_VERSION_MINOR}.${HYPERION_VERSION_PATCH}-${CMAKE_SYSTEM_NAME}")
else()
SET ( CPACK_PACKAGE_FILE_NAME "Hyperion.NG-${HYPERION_VERSION_CHANNEL}.${HYPERION_VERSION_MAJOR}.${HYPERION_VERSION_MINOR}.${HYPERION_VERSION_PATCH}-${CMAKE_SYSTEM_NAME}-${DOCKER_PLATFORM}")
endif()
SET ( CPACK_PACKAGE_CONTACT "packages@hyperion-project.org")
SET ( CPACK_PACKAGE_EXECUTABLES "hyperiond;Hyperion" )
SET ( CPACK_PACKAGE_ICON "${CMAKE_SOURCE_DIR}/resources/icons/hyperion-icon-32px.png")

View File

@ -6,10 +6,12 @@
{
/// general Settings
/// * 'name' : The user friendly name of the hyperion instance (used for network things)
/// * 'versionBranch' : Which branch should be used for hyperion version
/// * 'showOptHelp' : Show option expanations at the webui. Highly recommended for beginners.
"general" :
{
"name" : "MyHyperionConfig",
"versionBranch" : "Stable",
"showOptHelp" : true
},
/// set log level: silent warn verbose debug
@ -31,7 +33,7 @@
"output" : "/dev/null",
"rate" : 1000000,
"colorOrder" : "rgb",
"rewriteTime": 0
"rewriteTime": 5000
},
/// Color manipulation configuration used to tune the output colors to specific surroundings.
@ -114,7 +116,6 @@
/// * sDHOffsetMax : area for signal detection - horizontal maximum offset value. Values between 0.0 and 1.0
/// * sDVOffsetMax : area for signal detection - vertical maximum offset value. Values between 0.0 and 1.0
"grabberV4L2" :
[
{
"device" : "auto",
"standard" : "NO_CHANGE",
@ -132,8 +133,7 @@
"sDHOffsetMin" : 0.25,
"sDVOffsetMax" : 0.75,
"sDHOffsetMax" : 0.75
}
],
},
/// The configuration for the frame-grabber, contains the following items:
/// * type : type of grabber. (auto|osx|dispmanx|amlogic|x11|framebuffer|qt) [auto]
@ -162,11 +162,7 @@
"display" 0,
// valid for framebuffer
"device" : "/dev/fb0",
// valid for amlogic
"amlogic_grabber" : "amvideocap0",
"ge2d_mode" : 1
"device" : "/dev/fb0"
},
/// The black border configuration, contains the following items:
@ -247,15 +243,24 @@
"timeout" : 5
},
/// The configuration of the Protobuffer server which enables the Protobuffer remote interface
/// * port : Port at which the protobuffer server is started
"protoServer" :
{
"enable" : true,
"port" : 19445,
"timeout" : 5
},
/// The configuration of the boblight server which enables the boblight remote interface
/// * enable : Enable or disable the boblight server (true/false)
/// * port : Port at which the boblight server is started
/// * priority : Priority of the boblight server (Default=201) HINT: lower value result in HIGHER priority!
/// * priority : Priority of the boblight server (Default=128) HINT: lower value result in HIGHER priority!
"boblightServer" :
{
"enable" : false,
"port" : 19333,
"priority" : 201
"priority" : 128
},
/// The configuration of the udp listener

View File

@ -2,6 +2,7 @@
"general" :
{
"name" : "My Hyperion Config",
"versionBranch" : "Stable",
"showOptHelp" : true
},
"logger" :
@ -57,7 +58,6 @@
},
"grabberV4L2" :
[
{
"device" : "auto",
"standard" : "NO_CHANGE",
@ -74,8 +74,7 @@
"sDHOffsetMin" : 0.25,
"sDVOffsetMax" : 0.75,
"sDHOffsetMax" : 0.75
}
],
},
"framegrabber" :
{
@ -88,9 +87,7 @@
"cropRight" : 0,
"cropTop" : 0,
"cropBottom" : 0,
"device" : "/dev/fb0",
"amlogic_grabber" : "amvideocap0",
"ge2d_mode" : 1
"device" : "/dev/fb0"
},
"blackborderdetector" :
@ -140,11 +137,18 @@
"timeout" : 5
},
"protoServer" :
{
"enable" : true,
"port" : 19445,
"timeout" : 5
},
"boblightServer" :
{
"enable" : false,
"port" : 19333,
"priority" : 201
"priority" : 128
},
"udpListener" :

View File

@ -9,6 +9,10 @@ if(ENABLE_WS281XPWM)
external/rpi_ws281x/rpihw.c)
endif()
#=============================================================================
# FLATBUFFER
#=============================================================================
set(USE_SYSTEM_FLATBUFFERS_LIBS ${DEFAULT_USE_SYSTEM_FLATBUFFERS_LIBS} CACHE BOOL "use flatbuffers library from system")
if (USE_SYSTEM_FLATBUFFERS_LIBS)
@ -36,9 +40,17 @@ else ()
set(FLATBUFFERS_INCLUDE_DIRS "${CMAKE_CURRENT_SOURCE_DIR}/external/flatbuffers/include")
set(FLATBUFFERS_INCLUDE_DIRS ${FLATBUFFERS_INCLUDE_DIRS} PARENT_SCOPE)
IF (NOT CMAKE_CROSSCOMPILING)
# define the flatc executable at the parent scope
get_property(FLATBUFFERS_FLATC_EXECUTABLE TARGET flatc PROPERTY LOCATION)
else()
#Workaround, set flatc comiplier directory hard, as cmake definitions of flatc do not cater for crosscompile correctly.
#Includ of flatc_export.cmake detects that flatc target is defined aand returns before using the definitions written by export
set ( FLATBUFFERS_FLATC_EXECUTABLE "${CMAKE_BINARY_DIR}/../build-x86x64/bin/flatc")
endif()
set(FLATBUFFERS_FLATC_EXECUTABLE ${FLATBUFFERS_FLATC_EXECUTABLE} PARENT_SCOPE)
endif()
message(STATUS "Using flatbuffers compiler: " ${FLATBUFFERS_FLATC_EXECUTABLE})
@ -63,3 +75,115 @@ function(compile_flattbuffer_schema SRC_FBS OUTPUT_DIR)
DEPENDS flatc)
endif()
endfunction()
#=============================================================================
# PROTOBUFFER
#=============================================================================
set(USE_SYSTEM_PROTO_LIBS ${DEFAULT_USE_SYSTEM_PROTO_LIBS} CACHE BOOL "use protobuf library from system")
if (USE_SYSTEM_PROTO_LIBS)
find_package(Protobuf REQUIRED)
if (ENABLE_AMLOGIC)
set(PROTOBUF_INCLUDE_DIRS "${Protobuf_INCLUDE_DIRS}" PARENT_SCOPE)
set(PROTOBUF_PROTOC_EXECUTABLE "${Protobuf_PROTOC_EXECUTABLE}" PARENT_SCOPE)
endif()
include_directories(${PROTOBUF_INCLUDE_DIRS})
else ()
set(BUILD_SHARED_LIBS OFF CACHE BOOL "Build shared protobuf library")
add_subdirectory(external/protobuf)
if(CMAKE_CROSSCOMPILING)
# when crosscompiling import the protoc executable targets from a file generated by a native build
option(IMPORT_PROTOC "Protoc export file (protoc_export.cmake) from a native build" "IMPORT_PROTOC-FILE_NOT_FOUND")
include(${IMPORT_PROTOC})
else()
# export the protoc compiler so it can be used when cross compiling
export(TARGETS protoc_compiler FILE "${CMAKE_BINARY_DIR}/protoc_export.cmake")
endif()
# define the include for the protobuf library at the parent scope
set(PROTOBUF_INCLUDE_DIRS "${CMAKE_CURRENT_SOURCE_DIR}/external/protobuf/src")
set(PROTOBUF_INCLUDE_DIRS ${PROTOBUF_INCLUDE_DIRS} PARENT_SCOPE)
# define the protoc executable at the parent scope
get_property(PROTOBUF_PROTOC_EXECUTABLE TARGET protoc_compiler PROPERTY LOCATION)
set(PROTOBUF_PROTOC_EXECUTABLE ${PROTOBUF_PROTOC_EXECUTABLE} PARENT_SCOPE)
endif()
message(STATUS "Using protobuf compiler: " ${PROTOBUF_PROTOC_EXECUTABLE})
#=============================================================================
# Copyright 2009 Kitware, Inc.
# Copyright 2009-2011 Philip Lowman <philip@yhbt.com>
# Copyright 2008 Esben Mose Hansen, Ange Optimization ApS
#
# Distributed under the OSI-approved BSD License (the "License");
# see accompanying file Copyright.txt for details.
#
# This software is distributed WITHOUT ANY WARRANTY; without even the
# implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
# See the License for more information.
#=============================================================================
# (To distribute this file outside of CMake, substitute the full
# License text for the above reference.)
function(PROTOBUF_GENERATE_CPP SRCS HDRS)
if(NOT ARGN)
message(SEND_ERROR "Error: PROTOBUF_GENERATE_CPP() called without any proto files")
return()
endif()
if(PROTOBUF_GENERATE_CPP_APPEND_PATH)
# Create an include path for each file specified
foreach(FIL ${ARGN})
get_filename_component(ABS_FIL ${FIL} ABSOLUTE)
get_filename_component(ABS_PATH ${ABS_FIL} PATH)
list(FIND _protobuf_include_path ${ABS_PATH} _contains_already)
if(${_contains_already} EQUAL -1)
list(APPEND _protobuf_include_path -I ${ABS_PATH})
endif()
endforeach()
else()
set(_protobuf_include_path -I ${CMAKE_CURRENT_SOURCE_DIR})
endif()
if(DEFINED PROTOBUF_IMPORT_DIRS)
foreach(DIR ${PROTOBUF_IMPORT_DIRS})
get_filename_component(ABS_PATH ${DIR} ABSOLUTE)
list(FIND _protobuf_include_path ${ABS_PATH} _contains_already)
if(${_contains_already} EQUAL -1)
list(APPEND _protobuf_include_path -I ${ABS_PATH})
endif()
endforeach()
endif()
if(CMAKE_CROSSCOMPILING OR USE_SYSTEM_PROTO_LIBS)
set(PROTOC_DEPENDENCY ${PROTOBUF_PROTOC_EXECUTABLE})
else()
set(PROTOC_DEPENDENCY protoc_compiler)
endif()
set(${SRCS})
set(${HDRS})
foreach(FIL ${ARGN})
get_filename_component(ABS_FIL ${FIL} ABSOLUTE)
get_filename_component(FIL_WE ${FIL} NAME_WE)
list(APPEND ${SRCS} "${CMAKE_CURRENT_BINARY_DIR}/${FIL_WE}.pb.cc")
list(APPEND ${HDRS} "${CMAKE_CURRENT_BINARY_DIR}/${FIL_WE}.pb.h")
add_custom_command(
OUTPUT "${CMAKE_CURRENT_BINARY_DIR}/${FIL_WE}.pb.cc"
"${CMAKE_CURRENT_BINARY_DIR}/${FIL_WE}.pb.h"
COMMAND ${PROTOBUF_PROTOC_EXECUTABLE}
ARGS --cpp_out ${CMAKE_CURRENT_BINARY_DIR} ${_protobuf_include_path} ${ABS_FIL}
DEPENDS ${ABS_FIL} ${PROTOC_DEPENDENCY}
COMMENT "Running C++ protocol buffer compiler on ${FIL}"
VERBATIM
)
endforeach()
set_source_files_properties(${${SRCS}} ${${HDRS}} PROPERTIES GENERATED TRUE)
set(${SRCS} ${${SRCS}} PARENT_SCOPE)
set(${HDRS} ${${HDRS}} PARENT_SCOPE)
endfunction()

View File

@ -1055,7 +1055,7 @@ static void ipcon_dispatch_meta(IPConnectionPrivate *ipcon_p, Meta *meta) {
mutex_unlock(&ipcon_p->socket_mutex);
}
// FIXME: wait a moment here, otherwise the next connect
// NOTE: wait a moment here, otherwise the next connect
// attempt will succeed, even if there is no open server
// socket. the first receive will then fail directly
thread_sleep(100);
@ -1146,11 +1146,11 @@ static void ipcon_callback_loop(void *opaque) {
while (true) {
if (queue_get(&callback->queue, &kind, &data, &length) < 0) {
// FIXME: what to do here? try again? exit?
// NOTE: what to do here? try again? exit?
break;
}
// FIXME: cannot lock callback mutex here because this can
// NOTE: cannot lock callback mutex here because this can
// deadlock due to an ordering problem with the socket mutex
//mutex_lock(&callback->mutex);
@ -1219,7 +1219,7 @@ static void ipcon_disconnect_probe_loop(void *opaque) {
while (event_wait(&ipcon_p->disconnect_probe_event,
IPCON_DISCONNECT_PROBE_INTERVAL) < 0) {
if (ipcon_p->disconnect_probe_flag) {
// FIXME: this might block
// TODO: this might block
if (socket_send(ipcon_p->socket, &disconnect_probe,
disconnect_probe.length) < 0) {
ipcon_handle_disconnect_by_peer(ipcon_p, IPCON_DISCONNECT_REASON_ERROR,
@ -1509,7 +1509,7 @@ static void ipcon_disconnect_unlocked(IPConnectionPrivate *ipcon_p) {
// thread to avoid timeout exceptions due to callback functions
// trying to call getters
if (!thread_is_current(&ipcon_p->callback->thread)) {
// FIXME: cannot lock callback mutex here because this can
// NOTE: cannot lock callback mutex here because this can
// deadlock due to an ordering problem with the socket mutex
//mutex_lock(&ipcon->callback->mutex);
@ -1608,7 +1608,7 @@ void ipcon_create(IPConnection *ipcon) {
void ipcon_destroy(IPConnection *ipcon) {
IPConnectionPrivate *ipcon_p = ipcon->p;
ipcon_disconnect(ipcon); // FIXME: disable disconnected callback before?
ipcon_disconnect(ipcon); // NOTE: disable disconnected callback before?
mutex_destroy(&ipcon_p->sequence_number_mutex);

1
dependencies/external/protobuf vendored Submodule

@ -0,0 +1 @@
Subproject commit adce8a99fdab90f290d659b6b3bf2d09b721e24a

@ -1 +1 @@
Subproject commit f580777219062568d2e43e998ecb0950deff9e99
Subproject commit 6c5ade93d1af78cd19e60ee5ecc34adfd111b186

BIN
doc/screenshot.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 226 KiB

View File

@ -1,4 +1,4 @@
import os, hyperion, time
import hyperion, time
# Get the parameters
imageFile = hyperion.args.get('image')

View File

@ -1,4 +1,4 @@
import hyperion, time, colorsys
import hyperion, time
# Get the parameters
speed = float(hyperion.args.get('speed', 1.0))

View File

@ -1,4 +1,4 @@
import hyperion, time, colorsys
import hyperion, time
from random import randint
#get args

View File

@ -1,4 +1,4 @@
import hyperion, time, colorsys, random
import hyperion, time
# get options from args
sleepTime = float(hyperion.args.get('speed', 1.5)) * 0.005

View File

@ -1,4 +1,4 @@
import hyperion, time, math, random
import hyperion, time, random
# Convert x/y (0.0 - 1.0) point to proper int values based on Hyperion image width/height
# Or get a random value

View File

@ -39,7 +39,7 @@ diag = int(diag*1.3)
# calc positions
pos = 0
step = int(255/len(colors))
for entry in colors:
for _ in colors:
positions.append(pos)
pos += step

View File

@ -1,4 +1,4 @@
import hyperion, time, colorsys
import hyperion, time
# Get the parameters
sleepTime = float(hyperion.args.get('sleepTime', 1000))/1000.0

View File

@ -6,7 +6,7 @@
#include <utils/Components.h>
#include <hyperion/Hyperion.h>
// qt includess
// qt includes
#include <QJsonObject>
#include <QMutex>
#include <QString>
@ -46,7 +46,7 @@ public slots:
void setImage(const Image<ColorRgb> & image);
/// process and push new log messages from logger (if enabled)
void incommingLogMessage(Logger::T_LOG_MESSAGE);
void incommingLogMessage(const Logger::T_LOG_MESSAGE&);
signals:
///
@ -86,7 +86,7 @@ private:
/// mutex to determine state of image streaming
QMutex _image_stream_mutex;
/// mutex to determine state of image streaming
/// mutex to determine state of led streaming
QMutex _led_stream_mutex;
/// timeout for live video refresh

0
include/bonjour/bonjourrecord.h Executable file → Normal file
View File

0
include/bonjour/bonjourserviceregister.h Executable file → Normal file
View File

View File

@ -15,13 +15,13 @@ class Option: public QCommandLineOption
public:
Option(const QString &name,
const QString &description = QString(),
const QString &valueName = QString::null,
const QString &valueName = QString(),
const QString &defaultValue = QString()
);
Option(const QStringList &names,
const QString &description = QString(),
const QString &valueName = QString::null,
const QString &valueName = QString(),
const QString &defaultValue = QString()
);

View File

@ -45,7 +45,7 @@ public:
/// @param[out] resultMsg The feedback message
/// @return True on success else false
///
const bool saveEffect(const QJsonObject& obj, QString& resultMsg);
bool saveEffect(const QJsonObject& obj, QString& resultMsg);
///
/// @brief Delete an effect by name.
@ -53,7 +53,7 @@ public:
/// @param[out] resultMsg The message on error
/// @return True on success else false
///
const bool deleteEffect(const QString& effectName, QString& resultMsg);
bool deleteEffect(const QString& effectName, QString& resultMsg);
///
/// @brief Get all init data of the running effects and stop them

View File

@ -33,7 +33,7 @@ public:
/// @param[out] resultMsg The feedback message
/// @return True on success else false
///
const bool saveEffect(const QJsonObject& obj, QString& resultMsg);
bool saveEffect(const QJsonObject& obj, QString& resultMsg);
///
/// @brief Delete an effect by name.
@ -41,7 +41,7 @@ public:
/// @param[out] resultMsg The message on error
/// @return True on success else false
///
const bool deleteEffect(const QString& effectName, QString& resultMsg);
bool deleteEffect(const QString& effectName, QString& resultMsg);
public slots:
///

118
include/grabber/AmlogicGrabber.h Executable file → Normal file
View File

@ -6,113 +6,6 @@
#include <hyperion/Grabber.h>
#include <grabber/FramebufferFrameGrabber.h>
class IonBuffer;
struct rectangle_s {
int x; /* X coordinate of its top-left point */
int y; /* Y coordinate of its top-left point */
int w; /* width of it */
int h; /* height of it */
};
struct ge2d_para_s {
unsigned int color;
struct rectangle_s src1_rect;
struct rectangle_s src2_rect;
struct rectangle_s dst_rect;
int op;
};
struct config_planes_s {
unsigned long addr;
unsigned int w;
unsigned int h;
};
struct src_key_ctrl_s {
int key_enable;
int key_color;
int key_mask;
int key_mode;
};
struct config_para_s {
int src_dst_type;
int alu_const_color;
unsigned int src_format;
unsigned int dst_format; /* add for src&dst all in user space. */
struct config_planes_s src_planes[4];
struct config_planes_s dst_planes[4];
struct src_key_ctrl_s src_key;
};
struct src_dst_para_ex_s {
int canvas_index;
int top;
int left;
int width;
int height;
int format;
int mem_type;
int color;
unsigned char x_rev;
unsigned char y_rev;
unsigned char fill_color_en;
unsigned char fill_mode;
};
struct config_para_ex_s {
struct src_dst_para_ex_s src_para;
struct src_dst_para_ex_s src2_para;
struct src_dst_para_ex_s dst_para;
/* key mask */
struct src_key_ctrl_s src_key;
struct src_key_ctrl_s src2_key;
int alu_const_color;
unsigned src1_gb_alpha;
unsigned op_mode;
unsigned char bitmask_en;
unsigned char bytemask_only;
unsigned int bitmask;
unsigned char dst_xy_swap;
/* scaler and phase releated */
unsigned hf_init_phase;
int hf_rpt_num;
unsigned hsc_start_phase_step;
int hsc_phase_slope;
unsigned vf_init_phase;
int vf_rpt_num;
unsigned vsc_start_phase_step;
int vsc_phase_slope;
unsigned char src1_vsc_phase0_always_en;
unsigned char src1_hsc_phase0_always_en;
/* 1bit, 0: using minus, 1: using repeat data */
unsigned char src1_hsc_rpt_ctrl;
/* 1bit, 0: using minus 1: using repeat data */
unsigned char src1_vsc_rpt_ctrl;
/* canvas info */
struct config_planes_s src_planes[4];
struct config_planes_s src2_planes[4];
struct config_planes_s dst_planes[4];
};
struct amvideo_grabber_data {
int canvas_index;
uint32_t canvas0Addr;
uint32_t ge2dformat;
uint64_t size;
};
enum ge2d_mode {
ge2d_single = 0,
ge2d_combined = 1
};
///
///
class AmlogicGrabber : public Grabber
@ -123,9 +16,8 @@ public:
///
/// @param[in] width The width of the captured screenshot
/// @param[in] height The heigth of the captured screenshot
/// @param[in] ge2d_mode The ge2d mode, 0: single icotl calls, 1: combined data ioctl call
///
AmlogicGrabber(const unsigned width, const unsigned height, const unsigned ge2d_mode, const QString device);
AmlogicGrabber(const unsigned width, const unsigned height);
~AmlogicGrabber();
///
@ -149,12 +41,10 @@ private:
bool openDev(int &fd, const char* dev);
int grabFrame_amvideocap(Image<ColorRgb> & image);
int grabFrame_ge2d(Image<ColorRgb> & image);
/** The snapshot/capture device of the amlogic video chip */
int _captureDev;
int _videoDev;
int _ge2dDev;
Image<ColorBgr> _image_bgr;
void* _image_ptr;
@ -164,10 +54,4 @@ private:
bool _videoPlaying;
FramebufferFrameGrabber _fbGrabber;
int _grabbingModeNotification;
void* _ge2dVideoBufferPtr;
IonBuffer* _ge2dIonBuffer;
struct config_para_ex_s _configex;
ge2d_para_s _blitRect;
int _ge2d_mode;
QString _device;
};

View File

@ -17,11 +17,8 @@ public:
///
/// @param[in] grabWidth The width of the grabbed image [pixels]
/// @param[in] grabHeight The height of the grabbed images [pixels]
/// @param[in] updateRate_Hz The image grab rate [Hz]
/// @param[in] ge2d_mode use single or combine ge2d ioctl call
/// @param[in] device amlogic grabber device
///
AmlogicWrapper(const unsigned grabWidth, const unsigned grabHeight, const unsigned updateRate_Hz, const unsigned ge2d_mode, const QString device);
AmlogicWrapper(const unsigned grabWidth, const unsigned grabHeight);
///
/// Destructor of this dispmanx frame grabber. Releases any claimed resources.

View File

@ -70,7 +70,7 @@ private:
/// @brief Setup a new capture display, will free the previous one
/// @return True on success, false if no display is found
///
const bool setupDisplay();
bool setupDisplay();
///
/// @brief Is called whenever we need new screen dimension calculations based on window geometry

View File

@ -13,6 +13,14 @@
#include <utils/PixelFormat.h>
#include <hyperion/Grabber.h>
#include <grabber/VideoStandard.h>
#include <utils/Components.h>
#ifdef HAVE_JPEG
#include <QImage>
#include <QColor>
#include <jpeglib.h>
#include <csetjmp>
#endif
/// Capture class for V4L2 devices
///
@ -29,8 +37,12 @@ public:
);
virtual ~V4L2Grabber();
QRectF getSignalDetectionOffset();
bool getSignalDetectionEnabled();
QRectF getSignalDetectionOffset()
{
return QRectF(_x_frac_min, _y_frac_min, _x_frac_max, _y_frac_max);
}
bool getSignalDetectionEnabled() { return _signalDetectionEnabled; }
int grabFrame(Image<ColorRgb> &);
@ -78,6 +90,8 @@ public slots:
void stop();
void componentStateChanged(const hyperion::Components component, bool enable);
signals:
void newFrame(const Image<ColorRgb> & image);
void readError(const char* err);
@ -91,7 +105,7 @@ private:
bool init();
void uninit();
void open_device();
bool open_device();
void close_device();
@ -111,26 +125,56 @@ private:
bool process_image(const void *p, int size);
void process_image(const uint8_t *p);
void process_image(const uint8_t *p, int size);
int xioctl(int request, void *arg);
void throw_exception(const QString &error);
void throw_exception(const QString & error)
{
Error(_log, "Throws error: %s", QSTRING_CSTR(error));
}
void throw_errno_exception(const QString &error);
void throw_errno_exception(const QString & error)
{
Error(_log, "Throws error nr: %s", QSTRING_CSTR(QString(error + " error code " + QString::number(errno) + ", " + strerror(errno))));
}
private:
enum io_method {
enum io_method
{
IO_METHOD_READ,
IO_METHOD_MMAP,
IO_METHOD_USERPTR
};
struct buffer {
struct buffer
{
void *start;
size_t length;
};
#ifdef HAVE_JPEG
struct errorManager
{
jpeg_error_mgr pub;
jmp_buf setjmp_buffer;
};
static void errorHandler(j_common_ptr cInfo)
{
errorManager* mgr = reinterpret_cast<errorManager*>(cInfo->err);
longjmp(mgr->setjmp_buffer, 1);
}
static void outputHandler(j_common_ptr cInfo)
{
// Suppress fprintf warnings.
}
jpeg_decompress_struct* _decompress;
errorManager* _error;
#endif
private:
QString _deviceName;
std::map<QString,QString> _v4lDevices;

0
include/grabber/X11Grabber.h Executable file → Normal file
View File

View File

@ -41,13 +41,13 @@ private slots:
/// @brief forward system image
/// @param image The image
///
void handleSystemImage(const Image<ColorRgb>& image);
void handleSystemImage(const QString& name, const Image<ColorRgb>& image);
///
/// @brief forward v4l image
/// @param image The image
///
void handleV4lImage(const Image<ColorRgb> & image);
void handleV4lImage(const QString& name, const Image<ColorRgb> & image);
///
/// @brief Is called from _v4lInactiveTimer to set source after specific time to inactive
@ -66,10 +66,12 @@ private:
/// Reflect state of System capture and prio
bool _systemCaptEnabled;
quint8 _systemCaptPrio;
QString _systemCaptName;
QTimer* _systemInactiveTimer;
/// Reflect state of v4l capture and prio
bool _v4lCaptEnabled;
quint8 _v4lCaptPrio;
QString _v4lCaptName;
QTimer* _v4lInactiveTimer;
};

View File

@ -84,12 +84,12 @@ public:
///
/// @brief get current resulting height of image (after crop)
///
virtual const int getImageWidth() { return _width; };
virtual int getImageWidth() { return _width; };
///
/// @brief get current resulting width of image (after crop)
///
virtual const int getImageHeight() { return _height; };
virtual int getImageHeight() { return _height; };
///
/// @brief Prevent the real capture implementation from capturing if disabled

View File

@ -24,7 +24,7 @@ class GrabberWrapper : public QObject
{
Q_OBJECT
public:
GrabberWrapper(QString grabberName, Grabber * ggrabber, unsigned width, unsigned height, const unsigned updateRate_Hz);
GrabberWrapper(QString grabberName, Grabber * ggrabber, unsigned width, unsigned height, const unsigned updateRate_Hz = 0);
virtual ~GrabberWrapper();
@ -54,7 +54,7 @@ public:
int ret = grabber.grabFrame(_image);
if (ret >= 0)
{
emit systemImage(_image);
emit systemImage(_grabberName, _image);
return true;
}
return false;
@ -92,7 +92,7 @@ signals:
///
/// @brief Emit the final processed image
///
void systemImage(const Image<ColorRgb>& image);
void systemImage(const QString& name, const Image<ColorRgb>& image);
protected:

View File

@ -5,7 +5,6 @@
#include <QMap>
// QT includes
//#include <QObject>
#include <QString>
#include <QStringList>
#include <QSize>
@ -13,6 +12,7 @@
#include <QJsonValue>
#include <QJsonArray>
#include <QFileSystemWatcher>
#include <QMutex>
// hyperion-utils includes
#include <utils/Image.h>
@ -168,7 +168,7 @@ public:
/// @param[out] resultMsg The feedback message
/// @return True on success else false
///
const bool saveEffect(const QJsonObject& obj, QString& resultMsg);
bool saveEffect(const QJsonObject& obj, QString& resultMsg);
///
/// @brief Delete an effect by name.
@ -176,7 +176,7 @@ public:
/// @param[out] resultMsg The message on error
/// @return True on success else false
///
const bool deleteEffect(const QString& effectName, QString& resultMsg);
bool deleteEffect(const QString& effectName, QString& resultMsg);
/// Get the list of available effects
/// @return The list of available effects
@ -282,7 +282,7 @@ public slots:
/// @param clearEffect Should be true when NOT called from an effect
/// @return True on success, false when priority is not found
///
const bool setInput(const int priority, const std::vector<ColorRgb>& ledColors, const int timeout_ms = -1, const bool& clearEffect = true);
bool setInput(const int priority, const std::vector<ColorRgb>& ledColors, const int timeout_ms = -1, const bool& clearEffect = true);
///
/// @brief Update the current image of a priority (prev registered with registerInput())
@ -293,14 +293,14 @@ public slots:
/// @param clearEffect Should be true when NOT called from an effect
/// @return True on success, false when priority is not found
///
const bool setInputImage(const int priority, const Image<ColorRgb>& image, int64_t timeout_ms = -1, const bool& clearEffect = true);
bool setInputImage(const int priority, const Image<ColorRgb>& image, int64_t timeout_ms = -1, const bool& clearEffect = true);
///
/// @brief Set the given priority to inactive
/// @param priority The priority
/// @return True on success false if not found
///
const bool setInputInactive(const quint8& priority);
bool setInputInactive(const quint8& priority);
///
/// Writes a single color to all the leds for the given time and priority
@ -336,7 +336,7 @@ public slots:
/// @param[in] priority The priority channel
/// @return True on success else false (not found)
///
const bool clear(int priority);
bool clear(int priority);
///
/// @brief Clears all priority channels. This will switch the leds off until a new priority is written.
@ -410,8 +410,11 @@ signals:
/// Signal which is emitted, when a new json message should be forwarded
void forwardJsonMessage(QJsonObject);
/// Signal which is emitted, when a new proto image should be forwarded
void forwardProtoMessage(Image<ColorRgb>);
/// Signal which is emitted, when a new system proto image should be forwarded
void forwardSystemProtoMessage(const QString, const Image<ColorRgb>);
/// Signal which is emitted, when a new V4l proto image should be forwarded
void forwardV4lProtoMessage(const QString, const Image<ColorRgb>);
///
/// @brief Is emitted from clients who request a videoMode change
@ -560,12 +563,12 @@ private:
/// Capture control for Daemon native capture
CaptureCont* _captureCont;
// lock Hyperion::update() for exec
bool _lockUpdate = false;
/// buffer for leds (with adjustment)
std::vector<ColorRgb> _ledBuffer;
/// Boblight instance
BoblightServer* _boblightServer;
/// mutex
QMutex _changes;
};

View File

@ -150,7 +150,7 @@ public:
// Check black border detection
verifyBorder(image);
// Determine the mean-colors of each led (using the existing mapping)
// Determine the mean or uni colors of each led (using the existing mapping)
switch (_mappingType)
{
case 1: _imageToLeds->getUniLedColor(image, ledColors); break;

View File

@ -57,11 +57,11 @@ namespace hyperion
///
unsigned height() const;
const unsigned horizontalBorder() const { return _horizontalBorder; };
const unsigned verticalBorder() const { return _verticalBorder; };
unsigned horizontalBorder() { return _horizontalBorder; };
unsigned verticalBorder() { return _verticalBorder; };
///
/// Determines the mean-color for each led using the mapping the image given
/// Determines the mean color for each led using the mapping the image given
/// at construction.
///
/// @param[in] image The image from which to extract the led colors
@ -96,15 +96,15 @@ namespace hyperion
// Iterate each led and compute the mean
auto led = ledColors.begin();
for (auto ledColors = _colorsMap.begin(); ledColors != _colorsMap.end(); ++ledColors, ++led)
for (auto colors = _colorsMap.begin(); colors != _colorsMap.end(); ++colors, ++led)
{
const ColorRgb color = calcMeanColor(image, *ledColors);
const ColorRgb color = calcMeanColor(image, *colors);
*led = color;
}
}
///
/// Determines the mean-color for each led using the mapping the image given
/// Determines the uni color for each led using the mapping the image given
/// at construction.
///
/// @param[in] image The image from which to extract the led colors
@ -120,7 +120,7 @@ namespace hyperion
}
///
/// Determines the mean color for each led using the mapping the image given
/// Determines the uni color for each led using the mapping the image given
/// at construction.
///
/// @param[in] image The image from which to extract the led colors

View File

@ -70,7 +70,7 @@ private slots:
/// @brief Forward image to all proto slaves
/// @param image The PROTO image to send
///
void forwardProtoMessage(const Image<ColorRgb> &image);
void forwardProtoMessage(const QString& name, const Image<ColorRgb> &image);
///
/// @brief Forward message to a single json slave

View File

@ -151,7 +151,7 @@ public:
/// @param timeout_ms The new timeout (defaults to -1 endless)
/// @return True on success, false when priority is not found
///
const bool setInput(const int priority, const std::vector<ColorRgb>& ledColors, int64_t timeout_ms = -1);
bool setInput(const int priority, const std::vector<ColorRgb>& ledColors, int64_t timeout_ms = -1);
///
/// @brief Update the current image of a priority (prev registered with registerInput())
@ -160,14 +160,14 @@ public:
/// @param timeout_ms The new timeout (defaults to -1 endless)
/// @return True on success, false when priority is not found
///
const bool setInputImage(const int priority, const Image<ColorRgb>& image, int64_t timeout_ms = -1);
bool setInputImage(const int priority, const Image<ColorRgb>& image, int64_t timeout_ms = -1);
///
/// @brief Set the given priority to inactive
/// @param priority The priority
/// @return True on success false if not found
///
const bool setInputInactive(const quint8& priority);
bool setInputInactive(const quint8& priority);
///
/// Clears the specified priority channel and update _currentPriority on success
@ -175,7 +175,7 @@ public:
/// @param[in] priority The priority of the channel to clear
/// @return True if priority has been cleared else false (not found)
///
const bool clearInput(const uint8_t priority);
bool clearInput(const uint8_t priority);
///
/// Clears all priority channels

View File

@ -34,7 +34,7 @@ public:
/// @param correct If true will correct json against schema before save
/// @return True on success else false
///
const bool saveSettings(QJsonObject config, const bool& correct = false);
bool saveSettings(QJsonObject config, const bool& correct = false);
///
/// @brief get a single setting json from config

View File

@ -58,7 +58,7 @@ public:
void setEnable(bool enable);
bool enabled() { return _enabled; };
const int getLatchTime() { return _latchTime_ms; };
int getLatchTime() { return _latchTime_ms; };
inline bool componentState() { return enabled(); };
@ -84,6 +84,14 @@ signals:
///
void enableStateChanged(bool newState);
///
/// PIPER signal for Priority Muxer -> LedDevice
///
/// @brief Handle priority updates from Priority Muxer
/// @param priority The new visible priority
///
void visiblePriorityChanged(const quint8 &priority);
protected:
virtual bool init(const QJsonObject &deviceConfig);

View File

@ -0,0 +1,67 @@
#pragma once
// util
#include <utils/Logger.h>
#include <utils/settings.h>
// qt
#include <QVector>
class QTcpServer;
class ProtoClientConnection;
///
/// @brief This class creates a TCP server which accepts connections wich can then send
/// in Protocol Buffer encoded commands. This interface to Hyperion is used by various
/// third-party applications
///
class ProtoServer : public QObject
{
Q_OBJECT
public:
ProtoServer(const QJsonDocument& config, QObject* parent = nullptr);
~ProtoServer();
public slots:
///
/// @brief Handle settings update
/// @param type The type from enum
/// @param config The configuration
///
void handleSettingsUpdate(const settings::type& type, const QJsonDocument& config);
void initServer();
private slots:
///
/// @brief Is called whenever a new socket wants to connect
///
void newConnection();
///
/// @brief is called whenever a client disconnected
///
void clientDisconnected();
private:
///
/// @brief Start the server with current _port
///
void startServer();
///
/// @brief Stop server
///
void stopServer();
private:
QTcpServer* _server;
Logger* _log;
int _timeout;
quint16 _port;
const QJsonDocument _config;
QVector<ProtoClientConnection*> _openConnections;
};

View File

@ -28,7 +28,7 @@ public:
/// @brief Start SSDP
/// @return false if already running or bind failure
///
const bool start();
bool start();
///
/// @brief Stop SSDP

View File

@ -84,7 +84,6 @@ private slots:
void processTheDatagram(const QByteArray * datagram, const QHostAddress * sender);
private:
/// The UDP server object
QUdpSocket * _server;

View File

@ -22,7 +22,8 @@ enum Components
COMP_IMAGE,
COMP_EFFECT,
COMP_LEDDEVICE,
COMP_FLATBUFSERVER
COMP_FLATBUFSERVER,
COMP_PROTOSERVER
};
inline const char* componentToString(Components c)
@ -42,6 +43,7 @@ inline const char* componentToString(Components c)
case COMP_IMAGE: return "Image";
case COMP_LEDDEVICE: return "LED device";
case COMP_FLATBUFSERVER: return "Image Receiver";
case COMP_PROTOSERVER: return "Proto Server";
default: return "";
}
}
@ -63,6 +65,7 @@ inline const char* componentToIdString(Components c)
case COMP_IMAGE: return "IMAGE";
case COMP_LEDDEVICE: return "LEDDEVICE";
case COMP_FLATBUFSERVER: return "FLATBUFSERVER";
case COMP_PROTOSERVER: return "PROTOSERVER";
default: return "";
}
}
@ -83,6 +86,7 @@ inline Components stringToComponent(QString component)
if (component == "IMAGE") return COMP_IMAGE;
if (component == "LEDDEVICE") return COMP_LEDDEVICE;
if (component == "FLATBUFSERVER") return COMP_FLATBUFSERVER;
if (component == "PROTOSERVER") return COMP_PROTOSERVER;
return COMP_INVALID;
}

View File

@ -29,13 +29,15 @@ public:
signals:
///
/// @brief PIPE SystemCapture images from GrabberWrapper to Hyperion class
/// @param name The name of the platform capture that is currently active
/// @param image The prepared image
///
void setSystemImage(const Image<ColorRgb>& image);
void setSystemImage(const QString& name, const Image<ColorRgb>& image);
///
/// @brief PIPE v4lCapture images from v4lCapture over HyperionDaemon to Hyperion class
/// @param name The name of the v4l capture (path) that is currently active
/// @param image The prepared image
///
void setV4lImage(const Image<ColorRgb> & image);
void setV4lImage(const QString& name, const Image<ColorRgb> & image);
};

View File

@ -68,7 +68,7 @@ public:
_pixels(new Pixel_T[other._width * other._height + 1]),
_endOfPixels(_pixels + other._width * other._height)
{
memcpy(_pixels, other._pixels, other._width * other._height * sizeof(Pixel_T));
memcpy(_pixels, other._pixels, (long) other._width * other._height * sizeof(Pixel_T));
}
// Define assignment operator in terms of the copy constructor
@ -242,7 +242,7 @@ public:
//
ssize_t size() const
{
return _width * _height * sizeof(Pixel_T);
return (ssize_t) _width * _height * sizeof(Pixel_T);
}
private:

View File

@ -86,7 +86,7 @@ public:
QVector<Logger::T_LOG_MESSAGE>* getLogMessageBuffer() { return &_logMessageBuffer; };
public slots:
void handleNewLogMessage(Logger::T_LOG_MESSAGE);
void handleNewLogMessage(const Logger::T_LOG_MESSAGE&);
signals:
void newLogMessage(Logger::T_LOG_MESSAGE);

View File

@ -11,7 +11,7 @@ namespace NetUtils {
/// @param log The logger of the caller to print
/// @return True on success else false
///
static const bool portAvailable(quint16& port, Logger* log)
static bool portAvailable(quint16& port, Logger* log)
{
const quint16 prevPort = port;
QTcpServer server;

View File

@ -12,6 +12,9 @@ enum PixelFormat {
PIXELFORMAT_BGR24,
PIXELFORMAT_RGB32,
PIXELFORMAT_BGR32,
#ifdef HAVE_JPEG
PIXELFORMAT_MJPEG,
#endif
PIXELFORMAT_NO_CHANGE
};
@ -44,6 +47,12 @@ inline PixelFormat parsePixelFormat(QString pixelFormat)
{
return PIXELFORMAT_BGR32;
}
#ifdef HAVE_JPEG
else if (pixelFormat == "mjpeg")
{
return PIXELFORMAT_MJPEG;
}
#endif
// return the default NO_CHANGE
return PIXELFORMAT_NO_CHANGE;

View File

@ -117,25 +117,25 @@ private:
void updateBrightnessComponents();
/// backlight variables
bool _backLightEnabled;
bool _backlightColored;
double _backlightThreshold;
double _sumBrightnessLow;
bool _backLightEnabled
, _backlightColored;
double _backlightThreshold
, _sumBrightnessLow;
/// gamma variables
double _gammaR;
double _gammaG;
double _gammaB;
double _gammaR
, _gammaG
, _gammaB;
/// The mapping from input color to output color
uint8_t _mappingR[256];
uint8_t _mappingG[256];
uint8_t _mappingB[256];
uint8_t _mappingR[256]
, _mappingG[256]
, _mappingB[256];
/// brightness variables
uint8_t _brightness;
uint8_t _brightnessCompensation;
uint8_t _brightness_rgb;
uint8_t _brightness_cmy;
uint8_t _brightness_w;
uint8_t _brightness
, _brightnessCompensation
, _brightness_rgb
, _brightness_cmy
, _brightness_w;
};

View File

@ -1,45 +0,0 @@
// qt includes
#include <QNetworkAccessManager>
#include <QNetworkRequest>
#include <QNetworkReply>
#include <QUrl>
#include <QUrlQuery>
#include <QTimer>
// hyperion includes
#include <utils/Logger.h>
#include <hyperion/Hyperion.h>
class Stats : public QObject
{
Q_OBJECT
public:
Stats();
static Stats* getInstance() { return instance; };
static Stats* instance;
void handleDataUpdate(const QJsonObject& config);
private:
friend class HyperionDaemon;
Stats(const QJsonObject& config);
~Stats();
private:
Logger* _log;
Hyperion* _hyperion;
QString _hash = "";
QByteArray _ba;
QNetworkRequest _req;
QNetworkAccessManager _mgr;
bool trigger(bool set = false);
private slots:
void initialExec();
void sendHTTP();
void sendHTTPp();
void resolveReply(QNetworkReply *reply);
};

View File

@ -40,12 +40,12 @@ namespace hyperion {
(uint8_t)FGCONFIG_ARRAY.at(2).toInt(0)
};
hyperion->setColor(FG_PRIORITY, fg_color, fg_duration_ms);
Info(Logger::getInstance("HYPERION"),"Inital foreground color set (%d %d %d)",fg_color.red,fg_color.green,fg_color.blue);
Info(Logger::getInstance("HYPERION"),"Initial foreground color set (%d %d %d)",fg_color.red,fg_color.green,fg_color.blue);
}
else
{
int result = hyperion->setEffect(fgEffectConfig, FG_PRIORITY, fg_duration_ms);
Info(Logger::getInstance("HYPERION"),"Inital foreground effect '%s' %s", QSTRING_CSTR(fgEffectConfig), ((result == 0) ? "started" : "failed"));
Info(Logger::getInstance("HYPERION"),"Initial foreground effect '%s' %s", QSTRING_CSTR(fgEffectConfig), ((result == 0) ? "started" : "failed"));
}
}
#undef FGCONFIG_ARRAY

View File

@ -29,6 +29,7 @@ enum type {
INSTCAPTURE,
NETWORK,
FLATBUFSERVER,
PROTOSERVER,
INVALID
};
@ -62,6 +63,7 @@ inline QString typeToString(const type& type)
case INSTCAPTURE: return "instCapture";
case NETWORK: return "network";
case FLATBUFSERVER: return "flatbufServer";
case PROTOSERVER: return "protoServer";
default: return "invalid";
}
}
@ -94,6 +96,7 @@ inline type stringToType(const QString& type)
else if (type == "instCapture") return INSTCAPTURE;
else if (type == "network") return NETWORK;
else if (type == "flatbufServer") return FLATBUFSERVER;
else if (type == "protoServer") return PROTOSERVER;
else return INVALID;
}
};

View File

@ -29,7 +29,7 @@ public:
quint16 getPort() { return _port; };
/// check if server has been inited
const bool isInited() { return _inited; };
bool isInited() { return _inited; };
///
/// @brief Set a new description, if empty the description is NotFound for clients

View File

@ -8,6 +8,7 @@ add_subdirectory(commandline)
add_subdirectory(blackborder)
add_subdirectory(jsonserver)
add_subdirectory(flatbufserver)
add_subdirectory(protoserver)
add_subdirectory(bonjour)
add_subdirectory(ssdp)
add_subdirectory(boblightserver)

View File

@ -25,7 +25,6 @@
#include <hyperion/GrabberWrapper.h>
#include <utils/Process.h>
#include <utils/JsonUtils.h>
#include <utils/Stats.h>
// bonjour wrapper
#include <bonjour/bonjourbrowserwrapper.h>
@ -249,6 +248,7 @@ void JsonAPI::handleSysInfoCommand(const QJsonObject&, const QString& command, c
QJsonObject hyperion;
hyperion["jsonrpc_version" ] = QString(HYPERION_JSON_VERSION);
hyperion["version" ] = QString(HYPERION_VERSION);
hyperion["channel" ] = QString(HYPERION_VERSION_CHANNEL);
hyperion["build" ] = QString(HYPERION_BUILD_ID);
hyperion["time" ] = QString(__DATE__ " " __TIME__);
hyperion["id" ] = _hyperion->getId();
@ -1052,7 +1052,7 @@ void JsonAPI::setImage(const Image<ColorRgb> & image)
}
}
void JsonAPI::incommingLogMessage(Logger::T_LOG_MESSAGE msg)
void JsonAPI::incommingLogMessage(const Logger::T_LOG_MESSAGE &msg)
{
QJsonObject result, message;
QJsonArray messageArray;

View File

@ -192,6 +192,9 @@ void BoblightClientConnection::handleMessage(const QString & message)
{
// clear the current channel
_hyperion->clear(_priority);
// register new priority
_hyperion->registerInput(prio, hyperion::COMP_BOBLIGHTSERVER, QString("Boblight@%1").arg(_socket->peerAddress().toString()));
}
_priority = prio;

Some files were not shown because too many files have changed in this diff Show More