From 0d53e9f486701acf532a8f754a2418055a9fc558 Mon Sep 17 00:00:00 2001 From: Awawa Date: Tue, 30 Nov 2021 17:31:37 +0100 Subject: [PATCH] Cumulative update: Wayland grabber (pipewire/portal) read more... * New: Portal version 4 protocol persistent authentication support for Pipewire grabber * New: Performance information panel in the overview tab * New: CPU performance and RAM usage (excluding Apple M1) * New: CPU temperature reading (Linux only, when sensor is present) * New: Under-voltage detection (Raspberry Pi OS only) * New: USB grabber performance * New: Instance input mages to LED colors performance * New: LED device output performance * New: Philips Hue automatic connection resumption when the UDP SSL stream is broken * Fix another LED on/off race condition (network devices that was turned off for a moment could not be turn on again) * Fix looped communication in the remote tab * Update MBEDTLS to v3.1.0 * Fix restart issue of X11 software screen grabber (fixes #167) * Fix memory leaks reported by Valgrind * Fix inter-thread communication * Fix LED devices state synchronization * Windows: switch project and documentation to Visual Studio 2022 * Refactoring: Remove unnecessary 'latch time' in LED devices configuration --- .ci/ci_build.sh | 2 +- .editorconfig | 4 +- .../{push-master-copy.bak => push-master.bak} | 64 +- .github/workflows/push-master.yml | 26 +- .gitignore | 4 +- 3RD_PARTY_LICENSES | 209 - CMakeLists.txt | 69 +- HyperhdrConfig.h.in | 3 + assets/webconfig/content/overview.html | 280 +- assets/webconfig/content/update.html | 14 +- assets/webconfig/i18n/en.json | 12 +- assets/webconfig/index.html | 3 - assets/webconfig/js/hyperhdr.js | 263 +- assets/webconfig/js/lib/semver.js | 350 -- assets/webconfig/js/overview.js | 309 +- assets/webconfig/js/remote.js | 43 +- assets/webconfig/js/settings.js | 76 + assets/webconfig/js/ui_utils.js | 55 +- assets/webconfig/js/wizard.js | 3907 +++++++++-------- bin/.gitignore | 1 - bin/compile.sh | 47 - bin/openelec/hyperhdr-remote.sh | 2 - bin/scripts/docker-compile.sh | 110 - bin/service/hyperhdr.systemd.RO | 16 - cmake/Dependencies.cmake | 45 +- {bin => cmake/debian}/service/hyperhdr.init | 0 .../debian}/service/hyperhdr.initctl | 0 .../debian}/service/hyperhdr.systemd | 0 cmake/osxbundle/autorun.scpt | 53 + cmake/osxbundle/background.png | Bin 0 -> 615319 bytes cmake/packages.cmake | 6 +- include/api/API.h | 761 ++-- include/api/JsonAPI.h | 82 +- include/api/JsonCB.h | 7 +- include/api/apiStructs.h | 37 - include/blackborder/BlackBorderDetector.h | 220 +- include/blackborder/BlackBorderProcessor.h | 41 +- include/boblightserver/BoblightServer.h | 10 +- include/commandline/BooleanOption.h | 39 +- include/commandline/ColorOption.h | 52 +- include/commandline/ColorsOption.h | 55 +- include/commandline/DoubleOption.h | 57 +- include/commandline/ImageOption.h | 54 +- include/commandline/IntOption.h | 60 +- include/commandline/Option.h | 70 +- include/commandline/Parser.h | 362 +- include/commandline/RegularExpressionOption.h | 122 +- include/commandline/SwitchOption.h | 45 - include/commandline/ValidatorOption.h | 60 +- include/db/AuthTable.h | 11 +- include/db/DBManager.h | 17 +- include/db/InstanceTable.h | 3 - include/db/MetaTable.h | 6 - include/db/SettingsTable.h | 4 - include/effectengine/ActiveEffectDefinition.h | 8 +- .../effectengine/Animation4Music_PulseBlue.h | 7 +- .../effectengine/Animation4Music_PulseGreen.h | 7 +- .../effectengine/Animation4Music_PulseMulti.h | 7 +- .../Animation4Music_PulseMultiFast.h | 7 +- .../Animation4Music_PulseMultiSlow.h | 7 +- .../effectengine/Animation4Music_PulseRed.h | 7 +- .../effectengine/Animation4Music_PulseWhite.h | 7 +- .../Animation4Music_PulseYellow.h | 7 +- .../effectengine/Animation4Music_QuatroBlue.h | 7 +- .../Animation4Music_QuatroGreen.h | 7 +- .../Animation4Music_QuatroMulti.h | 7 +- .../Animation4Music_QuatroMultiFast.h | 7 +- .../Animation4Music_QuatroMultiSlow.h | 7 +- .../effectengine/Animation4Music_QuatroRed.h | 7 +- .../Animation4Music_QuatroWhite.h | 7 +- .../Animation4Music_QuatroYellow.h | 7 +- .../effectengine/Animation4Music_StereoBlue.h | 7 +- .../Animation4Music_StereoGreen.h | 7 +- .../Animation4Music_StereoMulti.h | 7 +- .../Animation4Music_StereoMultiFast.h | 7 +- .../Animation4Music_StereoMultiSlow.h | 6 +- .../effectengine/Animation4Music_StereoRed.h | 7 +- .../Animation4Music_StereoWhite.h | 7 +- .../Animation4Music_StereoYellow.h | 7 +- include/effectengine/Animation4Music_TestEq.h | 6 +- .../effectengine/Animation4Music_WavesPulse.h | 3 - .../Animation4Music_WavesPulseFast.h | 7 +- .../Animation4Music_WavesPulseSlow.h | 8 +- include/effectengine/AnimationBase.h | 6 +- include/effectengine/AnimationBaseMusic.h | 26 +- include/effectengine/Animation_AtomicSwirl.h | 5 +- .../effectengine/Animation_BlueMoodBlobs.h | 5 +- include/effectengine/Animation_Breath.h | 5 +- include/effectengine/Animation_Candle.h | 4 +- include/effectengine/Animation_CandleLight.h | 11 +- .../Animation_CinemaBrightenLights.h | 5 +- .../effectengine/Animation_CinemaDimLights.h | 3 + .../effectengine/Animation_ColdMoodBlobs.h | 5 +- include/effectengine/Animation_DoubleSwirl.h | 3 + include/effectengine/Animation_Fade.h | 5 +- .../Animation_FullColorMoodBlobs.h | 4 +- .../effectengine/Animation_GreenMoodBlobs.h | 5 +- include/effectengine/Animation_KnightRider.h | 8 +- include/effectengine/Animation_MoodBlobs.h | 5 +- include/effectengine/Animation_NotifyBlue.h | 5 +- include/effectengine/Animation_Plasma.h | 12 +- include/effectengine/Animation_Police.h | 8 +- .../Animation_PoliceLightsSingle.h | 5 +- .../Animation_PoliceLightsSolid.h | 3 + include/effectengine/Animation_RainbowSwirl.h | 4 +- include/effectengine/Animation_RedMoodBlobs.h | 4 +- include/effectengine/Animation_SeaWaves.h | 5 +- include/effectengine/Animation_Sparks.h | 6 +- include/effectengine/Animation_StrobeRed.h | 4 +- include/effectengine/Animation_StrobeWhite.h | 4 +- include/effectengine/Animation_Swirl.h | 10 +- include/effectengine/Animation_SwirlFast.h | 5 +- .../effectengine/Animation_SystemShutdown.h | 8 +- .../effectengine/Animation_WarmMoodBlobs.h | 5 +- include/effectengine/Animation_Waves.h | 24 +- .../effectengine/Animation_WavesWithColor.h | 4 +- include/effectengine/Effect.h | 41 +- include/effectengine/EffectDBHandler.h | 14 +- include/effectengine/EffectEngine.h | 52 +- include/flatbufserver/FlatBufferConnection.h | 12 +- include/flatbufserver/FlatBufferServer.h | 2 +- include/grabber/AVFWorker.h | 110 +- include/grabber/DxGrabber.h | 26 +- include/grabber/MFCallback.h | 2 +- include/grabber/MFGrabber.h | 18 +- include/grabber/MFWorker.h | 116 +- include/grabber/MFWrapper.h | 2 +- include/grabber/PipewireGrabber.h | 86 + include/grabber/PipewireWrapper.h | 23 + include/grabber/SoundCapWindows.h | 26 +- include/grabber/V4L2Grabber.h | 24 +- include/grabber/V4L2Worker.h | 118 +- include/grabber/smartPipewire.h | 16 + include/hyperhdrbase/AuthManager.h | 61 +- include/hyperhdrbase/BGEffectHandler.h | 49 +- include/hyperhdrbase/ColorAdjustment.h | 23 + include/hyperhdrbase/ComponentRegister.h | 4 +- include/hyperhdrbase/DetectionAutomatic.h | 32 +- include/hyperhdrbase/DetectionManual.h | 6 +- include/hyperhdrbase/Grabber.h | 47 +- include/hyperhdrbase/GrabberWrapper.h | 32 +- include/hyperhdrbase/HyperHdrIManager.h | 12 +- include/hyperhdrbase/HyperHdrInstance.h | 87 +- include/hyperhdrbase/ImageProcessingUnit.h | 29 + include/hyperhdrbase/ImageProcessor.h | 58 +- include/hyperhdrbase/ImageToLedsMap.h | 20 +- include/hyperhdrbase/LedString.h | 16 +- ...nearColorSmoothing.h => LinearSmoothing.h} | 94 +- include/hyperhdrbase/MessageForwarder.h | 15 +- include/hyperhdrbase/MultiColorAdjustment.h | 7 +- include/hyperhdrbase/PriorityMuxer.h | 4 +- include/hyperhdrbase/SettingsManager.h | 3 +- include/hyperhdrbase/SoundCapture.h | 38 +- include/hyperhdrbase/SystemControl.h | 9 +- include/hyperhdrbase/SystemWrapper.h | 26 +- include/hyperhdrbase/VideoControl.h | 11 +- include/jsonserver/JsonServer.h | 8 +- include/leddevice/LedDevice.h | 56 +- include/leddevice/LedDeviceFactory.h | 2 +- include/leddevice/LedDeviceWrapper.h | 51 +- include/ssdp/SSDPDiscover.h | 30 +- include/ssdp/SSDPHandler.h | 21 +- include/ssdp/SSDPServer.h | 42 +- include/utils/ColorArgb.h | 53 - include/utils/ColorBgr.h | 76 - include/utils/ColorRgb.h | 52 +- include/utils/ColorRgba.h | 53 - include/utils/ColorRgbw.h | 38 +- include/utils/ColorSys.h | 16 +- include/utils/Components.h | 96 +- include/utils/FileUtils.h | 6 +- include/utils/FrameDecoder.h | 35 + include/utils/GlobalSignals.h | 22 +- include/utils/Image.h | 84 +- include/utils/ImageData.h | 49 +- include/utils/ImageResampler.h | 30 - include/utils/JsonUtils.h | 2 +- include/utils/Logger.h | 58 +- include/utils/NetOrigin.h | 4 +- include/utils/NetUtils.h | 32 - include/utils/PerformanceCounters.h | 71 + include/utils/PixelFormat.h | 16 +- include/utils/Process.h | 11 - include/utils/Profiler.h | 51 - include/utils/QStringUtils.h | 22 +- include/utils/RgbChannelAdjustment.h | 30 +- include/utils/RgbToRgbw.h | 19 - include/utils/RgbTransform.h | 46 +- include/utils/Sleep.h | 10 - include/utils/SysInfo.h | 2 + include/utils/SystemPerformanceCounters.h | 43 + include/utils/VideoMemoryManager.h | 21 +- include/utils/global_defines.h | 4 - include/utils/hyperhdr.h | 264 -- include/utils/jsonschema/QJsonFactory.h | 171 - include/utils/jsonschema/QJsonSchemaChecker.h | 36 +- include/utils/jsonschema/QJsonUtils.h | 223 +- include/utils/settings.h | 56 +- include/webserver/WebServer.h | 24 +- libsrc/api/API.cpp | 549 --- libsrc/api/JSONRPC_schema/schema.json | 11 - libsrc/blackborder/BlackBorderDetector.cpp | 29 - libsrc/commandline/BooleanOption.cpp | 3 - libsrc/commandline/ColorOption.cpp | 32 - libsrc/commandline/DoubleOption.cpp | 21 - libsrc/commandline/ImageOption.cpp | 19 - libsrc/commandline/IntOption.cpp | 20 - .../commandline/RegularExpressionOption.cpp | 4 - libsrc/commandline/SwitchOption.cpp | 5 - libsrc/commandline/ValidatorOption.cpp | 26 - .../Animation4Music_PulseBlue.cpp | 62 - .../Animation4Music_PulseGreen.cpp | 62 - .../Animation4Music_PulseMulti.cpp | 66 - .../Animation4Music_PulseMultiFast.cpp | 66 - .../Animation4Music_PulseMultiSlow.cpp | 66 - .../effectengine/Animation4Music_PulseRed.cpp | 62 - .../Animation4Music_PulseWhite.cpp | 62 - .../Animation4Music_PulseYellow.cpp | 62 - .../Animation4Music_StereoBlue.cpp | 78 - .../Animation4Music_StereoGreen.cpp | 78 - .../Animation4Music_StereoMulti.cpp | 81 - .../Animation4Music_StereoMultiFast.cpp | 81 - .../Animation4Music_StereoMultiSlow.cpp | 81 - .../Animation4Music_StereoRed.cpp | 78 - .../Animation4Music_StereoWhite.cpp | 78 - .../Animation4Music_StereoYellow.cpp | 78 - .../effectengine/Animation4Music_TestEq.cpp | 69 - .../Animation4Music_WavesPulse.cpp | 140 - .../Animation4Music_WavesPulseFast.cpp | 138 - .../Animation4Music_WavesPulseSlow.cpp | 139 - libsrc/effectengine/AnimationBase.cpp | 62 - libsrc/effectengine/Animation_AtomicSwirl.cpp | 41 - .../effectengine/Animation_BlueMoodBlobs.cpp | 25 - libsrc/effectengine/Animation_Breath.cpp | 28 - libsrc/effectengine/Animation_Candle.cpp | 24 - libsrc/effectengine/Animation_CandleLight.cpp | 68 - .../Animation_CinemaBrightenLights.cpp | 28 - .../Animation_CinemaDimLights.cpp | 28 - .../effectengine/Animation_ColdMoodBlobs.cpp | 29 - libsrc/effectengine/Animation_DoubleSwirl.cpp | 47 - .../Animation_FullColorMoodBlobs.cpp | 29 - .../effectengine/Animation_GreenMoodBlobs.cpp | 25 - libsrc/effectengine/Animation_KnightRider.cpp | 106 - libsrc/effectengine/Animation_NotifyBlue.cpp | 28 - libsrc/effectengine/Animation_Plasma.cpp | 97 - .../Animation_PoliceLightsSingle.cpp | 25 - .../Animation_PoliceLightsSolid.cpp | 24 - .../effectengine/Animation_RainbowSwirl.cpp | 31 - .../effectengine/Animation_RedMoodBlobs.cpp | 25 - libsrc/effectengine/Animation_SeaWaves.cpp | 43 - libsrc/effectengine/Animation_Sparks.cpp | 60 - libsrc/effectengine/Animation_StrobeRed.cpp | 28 - libsrc/effectengine/Animation_StrobeWhite.cpp | 28 - libsrc/effectengine/Animation_SwirlFast.cpp | 29 - .../effectengine/Animation_WarmMoodBlobs.cpp | 31 - .../effectengine/Animation_WavesWithColor.cpp | 21 - .../flatbufserver/hyperhdr_reply_generated.h | 192 - .../hyperhdr_request_generated.h | 1160 ----- libsrc/grabber/AVF/AVFWrapper.cpp | 14 - libsrc/grabber/MF/MFWrapper.cpp | 14 - .../SoundCapWindows/SoundCapWindows.cpp | 109 - libsrc/grabber/X11/X11Wrapper.cpp | 14 - libsrc/grabber/macOS/macOsWrapper.cpp | 14 - libsrc/hyperhdrbase/ImageProcessor.cpp | 311 -- libsrc/hyperhdrbase/ImageToLedsMap.cpp | 417 -- libsrc/hyperhdrbase/LedString.cpp | 15 - libsrc/hyperhdrbase/MultiColorAdjustment.cpp | 204 - .../leddevice/dev_net/LedDeviceUdpArtNet.cpp | 103 - libsrc/leddevice/dev_net/LedDeviceUdpRaw.cpp | 29 - .../leddevice/dev_net/LedDeviceYeelight.cpp | 1522 ------- libsrc/leddevice/dev_net/ProviderRestApi.cpp | 256 -- libsrc/leddevice/dev_other/LedDeviceFile.cpp | 123 - .../leddevice/dev_serial/LedDeviceKarate.cpp | 61 - libsrc/leddevice/dev_spi/LedDeviceWs2801.cpp | 25 - libsrc/utils/CMakeLists.txt | 21 - libsrc/utils/ColorArgb.cpp | 9 - libsrc/utils/ColorBgr.cpp | 10 - libsrc/utils/ColorRgba.cpp | 9 - libsrc/utils/ColorRgbw.cpp | 9 - libsrc/utils/ColorSys.cpp | 66 - libsrc/utils/DefaultSignalHandler.cpp | 186 - libsrc/utils/FileUtils.cpp | 151 - libsrc/utils/Process.cpp | 70 - libsrc/utils/Profiler.cpp | 87 - libsrc/utils/RgbToRgbw.cpp | 85 - libsrc/utils/VideoMemoryManager.cpp | 160 - libsrc/webserver/CgiHandler.cpp | 81 - libsrc/webserver/QtHttpClientWrapper.cpp | 376 -- libsrc/webserver/QtHttpClientWrapper.h | 63 - libsrc/webserver/QtHttpHeader.h | 44 - libsrc/webserver/QtHttpReply.cpp | 40 - libsrc/webserver/QtHttpReply.h | 65 - libsrc/webserver/QtHttpRequest.cpp | 34 - libsrc/webserver/QtHttpRequest.h | 64 - libsrc/webserver/QtHttpServer.cpp | 126 - libsrc/webserver/QtHttpServer.h | 91 - libsrc/webserver/StaticFileServing.cpp | 150 - {libsrc => sources}/CMakeLists.txt | 9 +- sources/api/API.cpp | 561 +++ {libsrc => sources}/api/CMakeLists.txt | 2 +- .../api/JSONRPC_schema/schema-adjustment.json | 0 .../api/JSONRPC_schema/schema-authorize.json | 0 .../api/JSONRPC_schema/schema-benchmark.json | 0 .../api/JSONRPC_schema/schema-classic.json | 0 .../api/JSONRPC_schema/schema-clear.json | 0 .../api/JSONRPC_schema/schema-clearall.json | 0 .../api/JSONRPC_schema/schema-color.json | 0 .../JSONRPC_schema/schema-componentstate.json | 0 .../api/JSONRPC_schema/schema-config.json | 2 +- .../JSONRPC_schema/schema-create-effect.json | 0 .../JSONRPC_schema/schema-delete-effect.json | 0 .../api/JSONRPC_schema/schema-effect.json | 0 .../api/JSONRPC_schema/schema-help.json | 0 .../api/JSONRPC_schema/schema-image.json | 0 .../api/JSONRPC_schema/schema-instance.json | 0 .../api/JSONRPC_schema/schema-ledcolors.json | 0 .../api/JSONRPC_schema/schema-leddevice.json | 0 .../api/JSONRPC_schema/schema-load-db.json | 0 .../api/JSONRPC_schema/schema-logging.json | 0 .../schema-performance-counters.json | 20 + .../api/JSONRPC_schema/schema-processing.json | 0 .../api/JSONRPC_schema/schema-save-db.json | 0 .../api/JSONRPC_schema/schema-serverinfo.json | 0 .../schema-signal-calibration.json | 0 .../JSONRPC_schema/schema-sourceselect.json | 0 .../api/JSONRPC_schema/schema-sysinfo.json | 0 .../JSONRPC_schema/schema-video-controls.json | 0 .../api/JSONRPC_schema/schema-video-crop.json | 0 .../api/JSONRPC_schema/schema-videomode.json | 0 .../JSONRPC_schema/schema-videomodehdr.json | 0 sources/api/JSONRPC_schema/schema.json | 11 + {libsrc => sources}/api/JSONRPC_schemas.qrc | 3 +- {libsrc => sources}/api/JsonAPI.cpp | 507 +-- {libsrc => sources}/api/JsonCB.cpp | 141 +- sources/blackborder/BlackBorderDetector.cpp | 255 ++ .../blackborder/BlackBorderProcessor.cpp | 87 +- .../blackborder/CMakeLists.txt | 2 +- .../BoblightClientConnection.cpp | 42 +- .../boblightserver/BoblightClientConnection.h | 24 +- .../boblightserver/BoblightServer.cpp | 20 +- .../boblightserver/CMakeLists.txt | 2 +- {libsrc => sources}/bonjour/CMakeLists.txt | 2 +- .../bonjour/bonjourbrowserwrapper.cpp | 0 .../bonjour/bonjourservicebrowser.cpp | 0 .../bonjour/bonjourserviceregister.cpp | 0 .../bonjour/bonjourserviceresolver.cpp | 0 {libsrc => sources}/cec/CMakeLists.txt | 2 +- {libsrc => sources}/cec/cecHandler.cpp | 0 sources/commandline/BooleanOption.cpp | 23 + .../commandline/CMakeLists.txt | 2 +- sources/commandline/ColorOption.cpp | 55 + .../commandline/ColorsOption.cpp | 36 +- sources/commandline/DoubleOption.cpp | 53 + sources/commandline/ImageOption.cpp | 45 + sources/commandline/IntOption.cpp | 50 + {libsrc => sources}/commandline/Option.cpp | 13 +- {libsrc => sources}/commandline/Parser.cpp | 12 +- .../commandline/RegularExpressionOption.cpp | 76 + sources/commandline/ValidatorOption.cpp | 46 + {libsrc => sources}/db/AuthTable.cpp | 81 +- {libsrc => sources}/db/CMakeLists.txt | 2 +- {libsrc => sources}/db/DBManager.cpp | 228 +- {libsrc => sources}/db/InstanceTable.cpp | 34 +- {libsrc => sources}/db/MetaTable.cpp | 10 +- {libsrc => sources}/db/SettingsTable.cpp | 36 +- .../Animation4Music_PulseBlue.cpp | 88 + .../Animation4Music_PulseGreen.cpp | 88 + .../Animation4Music_PulseMulti.cpp | 92 + .../Animation4Music_PulseMultiFast.cpp | 92 + .../Animation4Music_PulseMultiSlow.cpp | 92 + .../effectengine/Animation4Music_PulseRed.cpp | 88 + .../Animation4Music_PulseWhite.cpp | 88 + .../Animation4Music_PulseYellow.cpp | 88 + .../Animation4Music_QuatroBlue.cpp | 44 +- .../Animation4Music_QuatroGreen.cpp | 44 +- .../Animation4Music_QuatroMulti.cpp | 48 +- .../Animation4Music_QuatroMultiFast.cpp | 50 +- .../Animation4Music_QuatroMultiSlow.cpp | 52 +- .../Animation4Music_QuatroRed.cpp | 44 +- .../Animation4Music_QuatroWhite.cpp | 44 +- .../Animation4Music_QuatroYellow.cpp | 44 +- .../Animation4Music_StereoBlue.cpp | 102 + .../Animation4Music_StereoGreen.cpp | 102 + .../Animation4Music_StereoMulti.cpp | 105 + .../Animation4Music_StereoMultiFast.cpp | 105 + .../Animation4Music_StereoMultiSlow.cpp | 105 + .../Animation4Music_StereoRed.cpp | 103 + .../Animation4Music_StereoWhite.cpp | 102 + .../Animation4Music_StereoYellow.cpp | 102 + .../effectengine/Animation4Music_TestEq.cpp | 95 + .../Animation4Music_WavesPulse.cpp | 164 + .../Animation4Music_WavesPulseFast.cpp | 162 + .../Animation4Music_WavesPulseSlow.cpp | 163 + sources/effectengine/AnimationBase.cpp | 89 + .../effectengine/AnimationBaseMusic.cpp | 29 +- .../effectengine/Animation_AtomicSwirl.cpp | 68 + .../effectengine/Animation_BlueMoodBlobs.cpp | 52 + sources/effectengine/Animation_Breath.cpp | 55 + sources/effectengine/Animation_Candle.cpp | 51 + .../effectengine/Animation_CandleLight.cpp | 95 + .../Animation_CinemaBrightenLights.cpp | 55 + .../Animation_CinemaDimLights.cpp | 55 + .../effectengine/Animation_ColdMoodBlobs.cpp | 56 + .../effectengine/Animation_DoubleSwirl.cpp | 74 + .../effectengine/Animation_Fade.cpp | 97 +- .../Animation_FullColorMoodBlobs.cpp | 56 + .../effectengine/Animation_GreenMoodBlobs.cpp | 52 + .../effectengine/Animation_KnightRider.cpp | 131 + .../effectengine/Animation_MoodBlobs.cpp | 67 +- sources/effectengine/Animation_NotifyBlue.cpp | 55 + sources/effectengine/Animation_Plasma.cpp | 124 + .../effectengine/Animation_Police.cpp | 45 +- .../Animation_PoliceLightsSingle.cpp | 52 + .../Animation_PoliceLightsSolid.cpp | 51 + .../effectengine/Animation_RainbowSwirl.cpp | 58 + .../effectengine/Animation_RedMoodBlobs.cpp | 52 + sources/effectengine/Animation_SeaWaves.cpp | 70 + sources/effectengine/Animation_Sparks.cpp | 87 + sources/effectengine/Animation_StrobeRed.cpp | 55 + .../effectengine/Animation_StrobeWhite.cpp | 55 + .../effectengine/Animation_Swirl.cpp | 99 +- sources/effectengine/Animation_SwirlFast.cpp | 56 + .../effectengine/Animation_SystemShutdown.cpp | 43 +- .../effectengine/Animation_WarmMoodBlobs.cpp | 58 + .../effectengine/Animation_Waves.cpp | 79 +- .../effectengine/Animation_WavesWithColor.cpp | 48 + .../effectengine/CMakeLists.txt | 2 +- {libsrc => sources}/effectengine/Effect.cpp | 99 +- .../effectengine/EffectDBHandler.cpp | 37 +- .../effectengine/EffectDefinition.schema.json | 0 .../effectengine/EffectEngine.cpp | 129 +- .../flatbufserver/CMakeLists.txt | 2 +- .../flatbufserver/FlatBufferClient.cpp | 54 +- .../flatbufserver/FlatBufferClient.h | 26 +- .../flatbufserver/FlatBufferConnection.cpp | 76 +- .../flatbufserver/FlatBufferServer.cpp | 28 +- .../flatbufserver/hyperhdr_reply.fbs | 0 .../flatbufserver/hyperhdr_request.fbs | 0 {libsrc => sources}/grabber/AVF/AVFGrabber.mm | 105 +- {libsrc => sources}/grabber/AVF/AVFWorker.cpp | 97 +- sources/grabber/AVF/AVFWrapper.cpp | 41 + .../grabber/AVF/CMakeLists.txt | 2 +- {libsrc => sources}/grabber/CMakeLists.txt | 4 + {libsrc => sources}/grabber/DX/CMakeLists.txt | 2 +- {libsrc => sources}/grabber/DX/DxGrabber.cpp | 143 +- {libsrc => sources}/grabber/DX/DxWrapper.cpp | 8 +- {libsrc => sources}/grabber/MF/CMakeLists.txt | 2 +- {libsrc => sources}/grabber/MF/MFCallback.cpp | 30 +- {libsrc => sources}/grabber/MF/MFGrabber.cpp | 100 +- {libsrc => sources}/grabber/MF/MFWorker.cpp | 185 +- sources/grabber/MF/MFWrapper.cpp | 41 + .../grabber/SoundCapLinux/CMakeLists.txt | 2 +- .../grabber/SoundCapLinux/SoundCapLinux.cpp | 32 +- .../grabber/SoundCapMacOS/CMakeLists.txt | 2 +- .../grabber/SoundCapMacOS/SoundCapMacOS.mm | 27 + .../grabber/SoundCapWindows/CMakeLists.txt | 2 +- .../SoundCapWindows/SoundCapWindows.cpp | 136 + .../grabber/X11/CMakeLists.txt | 2 +- .../grabber/X11/X11Grabber.cpp | 27 + sources/grabber/X11/X11Wrapper.cpp | 41 + {libsrc => sources}/grabber/X11/smartX11.cpp | 27 + .../grabber/macOS/CMakeLists.txt | 2 +- .../grabber/macOS/macOsGrabber.mm | 27 + sources/grabber/macOS/macOsWrapper.cpp | 41 + sources/grabber/pipewire/CMakeLists.txt | 19 + sources/grabber/pipewire/PipewireGrabber.cpp | 392 ++ sources/grabber/pipewire/PipewireHandler.cpp | 726 +++ sources/grabber/pipewire/PipewireHandler.h | 90 + sources/grabber/pipewire/PipewireWrapper.cpp | 56 + sources/grabber/pipewire/smartPipewire.cpp | 147 + .../grabber/v4l2/CMakeLists.txt | 2 +- .../grabber/v4l2/V4L2Grabber.cpp | 409 +- .../grabber/v4l2/V4L2Worker.cpp | 235 +- .../grabber/v4l2/V4L2Wrapper.cpp | 0 .../hyperhdr-remote/CMakeLists.txt | 0 .../hyperhdr-remote/JsonConnection.cpp | 116 +- .../hyperhdr-remote/JsonConnection.h | 58 +- .../hyperhdr-remote/hyperhdr-remote.cpp | 134 +- {src => sources}/hyperhdr/CMakeLists.txt | 7 +- {src => sources}/hyperhdr/detectProcess.h | 0 {src => sources}/hyperhdr/hyperhdr.cpp | 140 +- {src => sources}/hyperhdr/hyperhdr.h | 89 +- {src => sources}/hyperhdr/main.cpp | 118 +- {src => sources}/hyperhdr/systray.cpp | 106 +- {src => sources}/hyperhdr/systray.h | 14 +- .../hyperhdrbase/AuthManager.cpp | 83 +- sources/hyperhdrbase/BGEffectHandler.cpp | 65 + .../hyperhdrbase/CMakeLists.txt | 4 +- .../hyperhdrbase/ComponentRegister.cpp | 26 +- .../hyperhdrbase/DetectionAutomatic.cpp | 106 +- .../hyperhdrbase/DetectionManual.cpp | 8 +- {libsrc => sources}/hyperhdrbase/Grabber.cpp | 239 +- .../hyperhdrbase/GrabberWrapper.cpp | 212 +- .../hyperhdrbase/HyperHdrIManager.cpp | 103 +- .../hyperhdrbase/HyperHdrInstance.cpp | 295 +- sources/hyperhdrbase/ImageProcessingUnit.cpp | 92 + sources/hyperhdrbase/ImageProcessor.cpp | 223 + sources/hyperhdrbase/ImageToLedsMap.cpp | 435 ++ sources/hyperhdrbase/LedString.cpp | 107 + .../hyperhdrbase/LinearSmoothing.cpp | 242 +- .../hyperhdrbase/MessageForwarder.cpp | 103 +- sources/hyperhdrbase/MultiColorAdjustment.cpp | 265 ++ .../hyperhdrbase/PriorityMuxer.cpp | 108 +- .../hyperhdrbase/SettingsManager.cpp | 72 +- .../hyperhdrbase/SoundCapture.cpp | 267 +- .../hyperhdrbase/SystemControl.cpp | 53 +- .../hyperhdrbase/SystemWrapper.cpp | 154 +- .../hyperhdrbase/VideoControl.cpp | 43 +- .../hyperhdrbase/hyperhdr.schema.json | 0 {libsrc => sources}/hyperhdrbase/resource.qrc | 0 .../schema/schema-backgroundEffect.json | 0 .../schema/schema-blackborderdetector.json | 0 .../schema/schema-boblightServer.json | 0 .../hyperhdrbase/schema/schema-color.json | 0 .../hyperhdrbase/schema/schema-device.json | 0 .../hyperhdrbase/schema/schema-effects.json | 0 .../schema/schema-flatbufServer.json | 0 .../schema/schema-foregroundEffect.json | 0 .../hyperhdrbase/schema/schema-forwarder.json | 0 .../hyperhdrbase/schema/schema-general.json | 15 +- .../schema/schema-jsonServer.json | 0 .../hyperhdrbase/schema/schema-ledConfig.json | 0 .../hyperhdrbase/schema/schema-leds.json | 0 .../hyperhdrbase/schema/schema-logger.json | 0 .../hyperhdrbase/schema/schema-network.json | 0 .../schema/schema-protoServer.json | 0 .../hyperhdrbase/schema/schema-smoothing.json | 0 .../schema/schema-soundEffect.json | 0 .../schema/schema-systemControl.json | 0 .../schema/schema-systemGrabber.json | 0 .../schema/schema-videoControl.json | 0 .../schema/schema-videoDetection.json | 0 .../schema/schema-videoGrabber.json | 0 .../hyperhdrbase/schema/schema-webConfig.json | 0 {libsrc => sources}/jsonserver/CMakeLists.txt | 2 +- .../jsonserver/JsonClientConnection.cpp | 8 +- .../jsonserver/JsonClientConnection.h | 6 +- {libsrc => sources}/jsonserver/JsonServer.cpp | 24 +- {libsrc => sources}/leddevice/CMakeLists.txt | 2 +- {libsrc => sources}/leddevice/LedDevice.cpp | 340 +- .../leddevice/LedDeviceFactory.cpp | 10 +- .../leddevice/LedDeviceSchemas.qrc | 0 .../leddevice/LedDeviceTemplate.cpp | 24 +- .../leddevice/LedDeviceTemplate.h | 8 +- .../leddevice/LedDeviceWrapper.cpp | 177 +- .../leddevice/dev_hid/LedDeviceLightpack.cpp | 0 .../leddevice/dev_hid/LedDeviceLightpack.h | 0 .../leddevice/dev_hid/LedDevicePaintpack.cpp | 0 .../leddevice/dev_hid/LedDevicePaintpack.h | 0 .../leddevice/dev_hid/LedDeviceRawHID.cpp | 0 .../leddevice/dev_hid/LedDeviceRawHID.h | 0 .../leddevice/dev_hid/ProviderHID.cpp | 0 .../leddevice/dev_hid/ProviderHID.h | 0 .../leddevice/dev_net/LedDeviceAtmoOrb.cpp | 133 +- .../leddevice/dev_net/LedDeviceAtmoOrb.h | 14 +- .../leddevice/dev_net/LedDeviceCololight.cpp | 59 +- .../leddevice/dev_net/LedDeviceCololight.h | 42 +- .../leddevice/dev_net/LedDeviceFadeCandy.cpp | 16 +- .../leddevice/dev_net/LedDeviceFadeCandy.h | 0 .../leddevice/dev_net/LedDeviceNanoleaf.cpp | 147 +- .../leddevice/dev_net/LedDeviceNanoleaf.h | 0 .../leddevice/dev_net/LedDevicePhilipsHue.cpp | 991 +++-- .../leddevice/dev_net/LedDevicePhilipsHue.h | 101 +- .../leddevice/dev_net/LedDeviceTpm2net.cpp | 32 +- .../leddevice/dev_net/LedDeviceTpm2net.h | 8 +- .../leddevice/dev_net/LedDeviceUdpArtNet.cpp | 103 + .../leddevice/dev_net/LedDeviceUdpArtNet.h | 12 +- .../leddevice/dev_net/LedDeviceUdpE131.cpp | 54 +- .../leddevice/dev_net/LedDeviceUdpE131.h | 58 +- .../leddevice/dev_net/LedDeviceUdpH801.cpp | 14 +- .../leddevice/dev_net/LedDeviceUdpH801.h | 10 +- sources/leddevice/dev_net/LedDeviceUdpRaw.cpp | 29 + .../leddevice/dev_net/LedDeviceUdpRaw.h | 8 +- .../leddevice/dev_net/LedDeviceWled.cpp | 113 +- .../leddevice/dev_net/LedDeviceWled.h | 12 +- .../leddevice/dev_net/LedDeviceYeelight.cpp | 1520 +++++++ .../leddevice/dev_net/LedDeviceYeelight.h | 108 +- sources/leddevice/dev_net/ProviderRestApi.cpp | 421 ++ .../leddevice/dev_net/ProviderRestApi.h | 116 +- .../leddevice/dev_net/ProviderUdp.cpp | 33 +- .../leddevice/dev_net/ProviderUdp.h | 0 .../leddevice/dev_net/ProviderUdpSSL.cpp | 159 +- .../leddevice/dev_net/ProviderUdpSSL.h | 12 +- sources/leddevice/dev_other/LedDeviceFile.cpp | 120 + .../leddevice/dev_other/LedDeviceFile.h | 15 +- .../dev_other/LedDevicePiBlaster.cpp | 0 .../leddevice/dev_other/LedDevicePiBlaster.h | 0 .../leddevice/dev_rpi_pwm/LedDeviceWS281x.cpp | 34 +- .../leddevice/dev_rpi_pwm/LedDeviceWS281x.h | 8 +- .../dev_serial/LedDeviceAdalight.cpp | 38 +- .../leddevice/dev_serial/LedDeviceAdalight.h | 8 +- .../leddevice/dev_serial/LedDeviceAtmo.cpp | 14 +- .../leddevice/dev_serial/LedDeviceAtmo.h | 8 +- .../leddevice/dev_serial/LedDeviceDMX.cpp | 42 +- .../leddevice/dev_serial/LedDeviceDMX.h | 8 +- .../leddevice/dev_serial/LedDeviceKarate.cpp | 61 + .../leddevice/dev_serial/LedDeviceKarate.h | 8 +- .../leddevice/dev_serial/LedDeviceSedu.cpp | 14 +- .../leddevice/dev_serial/LedDeviceSedu.h | 8 +- .../leddevice/dev_serial/LedDeviceTpm2.cpp | 10 +- .../leddevice/dev_serial/LedDeviceTpm2.h | 8 +- .../leddevice/dev_serial/ProviderRs232.cpp | 88 +- .../leddevice/dev_serial/ProviderRs232.h | 8 +- .../leddevice/dev_spi/LedDeviceAPA102.cpp | 30 +- .../leddevice/dev_spi/LedDeviceAPA102.h | 10 +- .../leddevice/dev_spi/LedDeviceAPA104.cpp | 30 +- .../leddevice/dev_spi/LedDeviceAPA104.h | 8 +- .../leddevice/dev_spi/LedDeviceAWA_spi.cpp | 28 +- .../leddevice/dev_spi/LedDeviceAWA_spi.h | 12 +- .../leddevice/dev_spi/LedDeviceLpd6803.cpp | 24 +- .../leddevice/dev_spi/LedDeviceLpd6803.h | 8 +- .../leddevice/dev_spi/LedDeviceLpd8806.cpp | 30 +- .../leddevice/dev_spi/LedDeviceLpd8806.h | 8 +- .../leddevice/dev_spi/LedDeviceP9813.cpp | 26 +- .../leddevice/dev_spi/LedDeviceP9813.h | 10 +- .../leddevice/dev_spi/LedDeviceSK9822.cpp | 39 +- .../leddevice/dev_spi/LedDeviceSK9822.h | 12 +- .../leddevice/dev_spi/LedDeviceSk6812SPI.cpp | 43 +- .../leddevice/dev_spi/LedDeviceSk6812SPI.h | 8 +- .../leddevice/dev_spi/LedDeviceSk6822SPI.cpp | 83 +- .../leddevice/dev_spi/LedDeviceSk6822SPI.h | 8 +- sources/leddevice/dev_spi/LedDeviceWs2801.cpp | 25 + .../leddevice/dev_spi/LedDeviceWs2801.h | 8 +- .../leddevice/dev_spi/LedDeviceWs2812SPI.cpp | 46 +- .../leddevice/dev_spi/LedDeviceWs2812SPI.h | 8 +- .../leddevice/dev_spi/ProviderSpi.cpp | 46 +- .../leddevice/dev_spi/ProviderSpi.h | 6 +- .../dev_tinker/LedDeviceTinkerforge.cpp | 0 .../dev_tinker/LedDeviceTinkerforge.h | 0 .../leddevice/schemas/schema-adalight.json | 0 .../leddevice/schemas/schema-apa102.json | 0 .../leddevice/schemas/schema-apa104.json | 0 .../leddevice/schemas/schema-artnet.json | 0 .../leddevice/schemas/schema-atmo.json | 0 .../leddevice/schemas/schema-atmoorb.json | 0 .../leddevice/schemas/schema-awa_spi.json | 0 .../leddevice/schemas/schema-cololight.json | 0 .../leddevice/schemas/schema-dmx.json | 0 .../leddevice/schemas/schema-e131.json | 0 .../leddevice/schemas/schema-fadecandy.json | 0 .../leddevice/schemas/schema-file.json | 0 .../leddevice/schemas/schema-h801.json | 0 .../schemas/schema-hyperionusbasp.json | 0 .../leddevice/schemas/schema-karate.json | 0 .../leddevice/schemas/schema-lightpack.json | 0 .../leddevice/schemas/schema-lpd6803.json | 0 .../leddevice/schemas/schema-lpd8806.json | 0 .../leddevice/schemas/schema-nanoleaf.json | 0 .../leddevice/schemas/schema-p9813.json | 0 .../leddevice/schemas/schema-paintpack.json | 0 .../leddevice/schemas/schema-philipshue.json | 2 +- .../leddevice/schemas/schema-piblaster.json | 0 .../leddevice/schemas/schema-rawhid.json | 0 .../leddevice/schemas/schema-sedu.json | 0 .../leddevice/schemas/schema-sk6812spi.json | 0 .../leddevice/schemas/schema-sk6822spi.json | 0 .../leddevice/schemas/schema-sk9822.json | 0 .../leddevice/schemas/schema-tinkerforge.json | 0 .../leddevice/schemas/schema-tpm2.json | 0 .../leddevice/schemas/schema-tpm2net.json | 0 .../leddevice/schemas/schema-udpraw.json | 0 .../leddevice/schemas/schema-wled.json | 0 .../leddevice/schemas/schema-ws2801.json | 0 .../leddevice/schemas/schema-ws2812spi.json | 0 .../leddevice/schemas/schema-ws281x.json | 0 .../leddevice/schemas/schema-yeelight.json | 0 .../protoserver/CMakeLists.txt | 6 +- .../protoserver/ProtoClientConnection.cpp | 0 .../protoserver/ProtoClientConnection.h | 0 .../protoserver/ProtoServer.cpp | 0 {libsrc => sources}/protoserver/message.proto | 0 {libsrc => sources}/ssdp/CMakeLists.txt | 2 +- {libsrc => sources}/ssdp/SSDPDescription.h | 0 {libsrc => sources}/ssdp/SSDPDiscover.cpp | 146 +- {libsrc => sources}/ssdp/SSDPHandler.cpp | 106 +- {libsrc => sources}/ssdp/SSDPServer.cpp | 180 +- sources/utils/CMakeLists.txt | 22 + {libsrc => sources}/utils/ColorRgb.cpp | 0 sources/utils/ColorRgbw.cpp | 90 + sources/utils/ColorSys.cpp | 66 + sources/utils/DefaultSignalHandler.cpp | 186 + sources/utils/FileUtils.cpp | 151 + .../utils/FrameDecoder.cpp | 154 +- {libsrc => sources}/utils/ImageData.cpp | 0 {libsrc => sources}/utils/JsonUtils.cpp | 34 +- {libsrc => sources}/utils/Logger.cpp | 143 +- {libsrc => sources}/utils/NetOrigin.cpp | 26 +- sources/utils/PerformanceCounters.cpp | 306 ++ .../utils/RgbChannelAdjustment.cpp | 56 +- {libsrc => sources}/utils/RgbTransform.cpp | 130 +- {libsrc => sources}/utils/SysInfo.cpp | 34 +- sources/utils/SystemPerformanceCounters.cpp | 388 ++ sources/utils/SystemPerformanceCounters.mm | 208 + sources/utils/VideoMemoryManager.cpp | 187 + .../utils/jsonschema/QJsonSchemaChecker.cpp | 130 +- {libsrc => sources}/webserver/CMakeLists.txt | 2 +- sources/webserver/CgiHandler.cpp | 52 + {libsrc => sources}/webserver/CgiHandler.h | 11 +- sources/webserver/QtHttpClientWrapper.cpp | 376 ++ sources/webserver/QtHttpClientWrapper.h | 63 + .../webserver/QtHttpHeader.cpp | 0 sources/webserver/QtHttpHeader.h | 44 + sources/webserver/QtHttpReply.cpp | 91 + sources/webserver/QtHttpReply.h | 62 + sources/webserver/QtHttpRequest.cpp | 101 + sources/webserver/QtHttpRequest.h | 61 + sources/webserver/QtHttpServer.cpp | 191 + sources/webserver/QtHttpServer.h | 91 + sources/webserver/StaticFileServing.cpp | 150 + .../webserver/StaticFileServing.h | 12 +- .../webserver/WebConfig.qrc.in | 0 {libsrc => sources}/webserver/WebJsonRpc.cpp | 14 +- {libsrc => sources}/webserver/WebJsonRpc.h | 3 +- {libsrc => sources}/webserver/WebServer.cpp | 94 +- .../webserver/WebSocketClient.cpp | 180 +- .../webserver/WebSocketClient.h | 19 +- .../webserver/WebSocketUtils.h | 36 +- src/CMakeLists.txt | 4 - src/hyperhdr/console.h | 18 - 719 files changed, 25657 insertions(+), 21582 deletions(-) rename .github/workflows/{push-master-copy.bak => push-master.bak} (78%) delete mode 100644 assets/webconfig/js/lib/semver.js delete mode 100644 bin/.gitignore delete mode 100755 bin/compile.sh delete mode 100644 bin/openelec/hyperhdr-remote.sh delete mode 100644 bin/scripts/docker-compile.sh delete mode 100644 bin/service/hyperhdr.systemd.RO rename {bin => cmake/debian}/service/hyperhdr.init (100%) rename {bin => cmake/debian}/service/hyperhdr.initctl (100%) rename {bin => cmake/debian}/service/hyperhdr.systemd (100%) create mode 100644 cmake/osxbundle/autorun.scpt create mode 100644 cmake/osxbundle/background.png delete mode 100644 include/api/apiStructs.h delete mode 100644 include/commandline/SwitchOption.h create mode 100644 include/grabber/PipewireGrabber.h create mode 100644 include/grabber/PipewireWrapper.h create mode 100644 include/grabber/smartPipewire.h create mode 100644 include/hyperhdrbase/ImageProcessingUnit.h rename include/hyperhdrbase/{LinearColorSmoothing.h => LinearSmoothing.h} (76%) delete mode 100644 include/utils/ColorArgb.h delete mode 100644 include/utils/ColorBgr.h delete mode 100644 include/utils/ColorRgba.h create mode 100644 include/utils/FrameDecoder.h delete mode 100644 include/utils/ImageResampler.h delete mode 100644 include/utils/NetUtils.h create mode 100644 include/utils/PerformanceCounters.h delete mode 100644 include/utils/Process.h delete mode 100644 include/utils/Profiler.h delete mode 100644 include/utils/RgbToRgbw.h delete mode 100644 include/utils/Sleep.h create mode 100644 include/utils/SystemPerformanceCounters.h delete mode 100644 include/utils/global_defines.h delete mode 100644 include/utils/hyperhdr.h delete mode 100644 include/utils/jsonschema/QJsonFactory.h delete mode 100644 libsrc/api/API.cpp delete mode 100644 libsrc/api/JSONRPC_schema/schema.json delete mode 100644 libsrc/blackborder/BlackBorderDetector.cpp delete mode 100644 libsrc/commandline/BooleanOption.cpp delete mode 100644 libsrc/commandline/ColorOption.cpp delete mode 100644 libsrc/commandline/DoubleOption.cpp delete mode 100644 libsrc/commandline/ImageOption.cpp delete mode 100644 libsrc/commandline/IntOption.cpp delete mode 100644 libsrc/commandline/RegularExpressionOption.cpp delete mode 100644 libsrc/commandline/SwitchOption.cpp delete mode 100644 libsrc/commandline/ValidatorOption.cpp delete mode 100644 libsrc/effectengine/Animation4Music_PulseBlue.cpp delete mode 100644 libsrc/effectengine/Animation4Music_PulseGreen.cpp delete mode 100644 libsrc/effectengine/Animation4Music_PulseMulti.cpp delete mode 100644 libsrc/effectengine/Animation4Music_PulseMultiFast.cpp delete mode 100644 libsrc/effectengine/Animation4Music_PulseMultiSlow.cpp delete mode 100644 libsrc/effectengine/Animation4Music_PulseRed.cpp delete mode 100644 libsrc/effectengine/Animation4Music_PulseWhite.cpp delete mode 100644 libsrc/effectengine/Animation4Music_PulseYellow.cpp delete mode 100644 libsrc/effectengine/Animation4Music_StereoBlue.cpp delete mode 100644 libsrc/effectengine/Animation4Music_StereoGreen.cpp delete mode 100644 libsrc/effectengine/Animation4Music_StereoMulti.cpp delete mode 100644 libsrc/effectengine/Animation4Music_StereoMultiFast.cpp delete mode 100644 libsrc/effectengine/Animation4Music_StereoMultiSlow.cpp delete mode 100644 libsrc/effectengine/Animation4Music_StereoRed.cpp delete mode 100644 libsrc/effectengine/Animation4Music_StereoWhite.cpp delete mode 100644 libsrc/effectengine/Animation4Music_StereoYellow.cpp delete mode 100644 libsrc/effectengine/Animation4Music_TestEq.cpp delete mode 100644 libsrc/effectengine/Animation4Music_WavesPulse.cpp delete mode 100644 libsrc/effectengine/Animation4Music_WavesPulseFast.cpp delete mode 100644 libsrc/effectengine/Animation4Music_WavesPulseSlow.cpp delete mode 100644 libsrc/effectengine/AnimationBase.cpp delete mode 100644 libsrc/effectengine/Animation_AtomicSwirl.cpp delete mode 100644 libsrc/effectengine/Animation_BlueMoodBlobs.cpp delete mode 100644 libsrc/effectengine/Animation_Breath.cpp delete mode 100644 libsrc/effectengine/Animation_Candle.cpp delete mode 100644 libsrc/effectengine/Animation_CandleLight.cpp delete mode 100644 libsrc/effectengine/Animation_CinemaBrightenLights.cpp delete mode 100644 libsrc/effectengine/Animation_CinemaDimLights.cpp delete mode 100644 libsrc/effectengine/Animation_ColdMoodBlobs.cpp delete mode 100644 libsrc/effectengine/Animation_DoubleSwirl.cpp delete mode 100644 libsrc/effectengine/Animation_FullColorMoodBlobs.cpp delete mode 100644 libsrc/effectengine/Animation_GreenMoodBlobs.cpp delete mode 100644 libsrc/effectengine/Animation_KnightRider.cpp delete mode 100644 libsrc/effectengine/Animation_NotifyBlue.cpp delete mode 100644 libsrc/effectengine/Animation_Plasma.cpp delete mode 100644 libsrc/effectengine/Animation_PoliceLightsSingle.cpp delete mode 100644 libsrc/effectengine/Animation_PoliceLightsSolid.cpp delete mode 100644 libsrc/effectengine/Animation_RainbowSwirl.cpp delete mode 100644 libsrc/effectengine/Animation_RedMoodBlobs.cpp delete mode 100644 libsrc/effectengine/Animation_SeaWaves.cpp delete mode 100644 libsrc/effectengine/Animation_Sparks.cpp delete mode 100644 libsrc/effectengine/Animation_StrobeRed.cpp delete mode 100644 libsrc/effectengine/Animation_StrobeWhite.cpp delete mode 100644 libsrc/effectengine/Animation_SwirlFast.cpp delete mode 100644 libsrc/effectengine/Animation_WarmMoodBlobs.cpp delete mode 100644 libsrc/effectengine/Animation_WavesWithColor.cpp delete mode 100644 libsrc/flatbufserver/hyperhdr_reply_generated.h delete mode 100644 libsrc/flatbufserver/hyperhdr_request_generated.h delete mode 100644 libsrc/grabber/AVF/AVFWrapper.cpp delete mode 100644 libsrc/grabber/MF/MFWrapper.cpp delete mode 100644 libsrc/grabber/SoundCapWindows/SoundCapWindows.cpp delete mode 100644 libsrc/grabber/X11/X11Wrapper.cpp delete mode 100644 libsrc/grabber/macOS/macOsWrapper.cpp delete mode 100644 libsrc/hyperhdrbase/ImageProcessor.cpp delete mode 100644 libsrc/hyperhdrbase/ImageToLedsMap.cpp delete mode 100644 libsrc/hyperhdrbase/LedString.cpp delete mode 100644 libsrc/hyperhdrbase/MultiColorAdjustment.cpp delete mode 100644 libsrc/leddevice/dev_net/LedDeviceUdpArtNet.cpp delete mode 100644 libsrc/leddevice/dev_net/LedDeviceUdpRaw.cpp delete mode 100644 libsrc/leddevice/dev_net/LedDeviceYeelight.cpp delete mode 100644 libsrc/leddevice/dev_net/ProviderRestApi.cpp delete mode 100644 libsrc/leddevice/dev_other/LedDeviceFile.cpp delete mode 100644 libsrc/leddevice/dev_serial/LedDeviceKarate.cpp delete mode 100644 libsrc/leddevice/dev_spi/LedDeviceWs2801.cpp delete mode 100644 libsrc/utils/CMakeLists.txt delete mode 100644 libsrc/utils/ColorArgb.cpp delete mode 100644 libsrc/utils/ColorBgr.cpp delete mode 100644 libsrc/utils/ColorRgba.cpp delete mode 100644 libsrc/utils/ColorRgbw.cpp delete mode 100644 libsrc/utils/ColorSys.cpp delete mode 100644 libsrc/utils/DefaultSignalHandler.cpp delete mode 100644 libsrc/utils/FileUtils.cpp delete mode 100644 libsrc/utils/Process.cpp delete mode 100644 libsrc/utils/Profiler.cpp delete mode 100644 libsrc/utils/RgbToRgbw.cpp delete mode 100644 libsrc/utils/VideoMemoryManager.cpp delete mode 100644 libsrc/webserver/CgiHandler.cpp delete mode 100644 libsrc/webserver/QtHttpClientWrapper.cpp delete mode 100644 libsrc/webserver/QtHttpClientWrapper.h delete mode 100644 libsrc/webserver/QtHttpHeader.h delete mode 100644 libsrc/webserver/QtHttpReply.cpp delete mode 100644 libsrc/webserver/QtHttpReply.h delete mode 100644 libsrc/webserver/QtHttpRequest.cpp delete mode 100644 libsrc/webserver/QtHttpRequest.h delete mode 100644 libsrc/webserver/QtHttpServer.cpp delete mode 100644 libsrc/webserver/QtHttpServer.h delete mode 100644 libsrc/webserver/StaticFileServing.cpp rename {libsrc => sources}/CMakeLists.txt (81%) create mode 100644 sources/api/API.cpp rename {libsrc => sources}/api/CMakeLists.txt (89%) rename {libsrc => sources}/api/JSONRPC_schema/schema-adjustment.json (100%) rename {libsrc => sources}/api/JSONRPC_schema/schema-authorize.json (100%) rename {libsrc => sources}/api/JSONRPC_schema/schema-benchmark.json (100%) rename {libsrc => sources}/api/JSONRPC_schema/schema-classic.json (100%) rename {libsrc => sources}/api/JSONRPC_schema/schema-clear.json (100%) rename {libsrc => sources}/api/JSONRPC_schema/schema-clearall.json (100%) rename {libsrc => sources}/api/JSONRPC_schema/schema-color.json (100%) rename {libsrc => sources}/api/JSONRPC_schema/schema-componentstate.json (100%) rename {libsrc => sources}/api/JSONRPC_schema/schema-config.json (84%) rename {libsrc => sources}/api/JSONRPC_schema/schema-create-effect.json (100%) rename {libsrc => sources}/api/JSONRPC_schema/schema-delete-effect.json (100%) rename {libsrc => sources}/api/JSONRPC_schema/schema-effect.json (100%) rename {libsrc => sources}/api/JSONRPC_schema/schema-help.json (100%) rename {libsrc => sources}/api/JSONRPC_schema/schema-image.json (100%) rename {libsrc => sources}/api/JSONRPC_schema/schema-instance.json (100%) rename {libsrc => sources}/api/JSONRPC_schema/schema-ledcolors.json (100%) rename {libsrc => sources}/api/JSONRPC_schema/schema-leddevice.json (100%) rename {libsrc => sources}/api/JSONRPC_schema/schema-load-db.json (100%) rename {libsrc => sources}/api/JSONRPC_schema/schema-logging.json (100%) create mode 100644 sources/api/JSONRPC_schema/schema-performance-counters.json rename {libsrc => sources}/api/JSONRPC_schema/schema-processing.json (100%) rename {libsrc => sources}/api/JSONRPC_schema/schema-save-db.json (100%) rename {libsrc => sources}/api/JSONRPC_schema/schema-serverinfo.json (100%) rename {libsrc => sources}/api/JSONRPC_schema/schema-signal-calibration.json (100%) rename {libsrc => sources}/api/JSONRPC_schema/schema-sourceselect.json (100%) rename {libsrc => sources}/api/JSONRPC_schema/schema-sysinfo.json (100%) rename {libsrc => sources}/api/JSONRPC_schema/schema-video-controls.json (100%) rename {libsrc => sources}/api/JSONRPC_schema/schema-video-crop.json (100%) rename {libsrc => sources}/api/JSONRPC_schema/schema-videomode.json (100%) rename {libsrc => sources}/api/JSONRPC_schema/schema-videomodehdr.json (100%) create mode 100644 sources/api/JSONRPC_schema/schema.json rename {libsrc => sources}/api/JSONRPC_schemas.qrc (92%) rename {libsrc => sources}/api/JsonAPI.cpp (76%) rename {libsrc => sources}/api/JsonCB.cpp (79%) create mode 100644 sources/blackborder/BlackBorderDetector.cpp rename {libsrc => sources}/blackborder/BlackBorderProcessor.cpp (57%) rename {libsrc => sources}/blackborder/CMakeLists.txt (84%) rename {libsrc => sources}/boblightserver/BoblightClientConnection.cpp (91%) rename {libsrc => sources}/boblightserver/BoblightClientConnection.h (83%) rename {libsrc => sources}/boblightserver/BoblightServer.cpp (82%) rename {libsrc => sources}/boblightserver/CMakeLists.txt (84%) rename {libsrc => sources}/bonjour/CMakeLists.txt (92%) rename {libsrc => sources}/bonjour/bonjourbrowserwrapper.cpp (100%) rename {libsrc => sources}/bonjour/bonjourservicebrowser.cpp (100%) rename {libsrc => sources}/bonjour/bonjourserviceregister.cpp (100%) rename {libsrc => sources}/bonjour/bonjourserviceresolver.cpp (100%) rename {libsrc => sources}/cec/CMakeLists.txt (88%) rename {libsrc => sources}/cec/cecHandler.cpp (100%) create mode 100644 sources/commandline/BooleanOption.cpp rename {libsrc => sources}/commandline/CMakeLists.txt (84%) create mode 100644 sources/commandline/ColorOption.cpp rename {libsrc => sources}/commandline/ColorsOption.cpp (52%) create mode 100644 sources/commandline/DoubleOption.cpp create mode 100644 sources/commandline/ImageOption.cpp create mode 100644 sources/commandline/IntOption.cpp rename {libsrc => sources}/commandline/Option.cpp (52%) rename {libsrc => sources}/commandline/Parser.cpp (86%) create mode 100644 sources/commandline/RegularExpressionOption.cpp create mode 100644 sources/commandline/ValidatorOption.cpp rename {libsrc => sources}/db/AuthTable.cpp (78%) rename {libsrc => sources}/db/CMakeLists.txt (86%) rename {libsrc => sources}/db/DBManager.cpp (75%) rename {libsrc => sources}/db/InstanceTable.cpp (81%) rename {libsrc => sources}/db/MetaTable.cpp (79%) rename {libsrc => sources}/db/SettingsTable.cpp (81%) create mode 100644 sources/effectengine/Animation4Music_PulseBlue.cpp create mode 100644 sources/effectengine/Animation4Music_PulseGreen.cpp create mode 100644 sources/effectengine/Animation4Music_PulseMulti.cpp create mode 100644 sources/effectengine/Animation4Music_PulseMultiFast.cpp create mode 100644 sources/effectengine/Animation4Music_PulseMultiSlow.cpp create mode 100644 sources/effectengine/Animation4Music_PulseRed.cpp create mode 100644 sources/effectengine/Animation4Music_PulseWhite.cpp create mode 100644 sources/effectengine/Animation4Music_PulseYellow.cpp rename {libsrc => sources}/effectengine/Animation4Music_QuatroBlue.cpp (57%) rename {libsrc => sources}/effectengine/Animation4Music_QuatroGreen.cpp (58%) rename {libsrc => sources}/effectengine/Animation4Music_QuatroMulti.cpp (58%) rename {libsrc => sources}/effectengine/Animation4Music_QuatroMultiFast.cpp (58%) rename {libsrc => sources}/effectengine/Animation4Music_QuatroMultiSlow.cpp (56%) rename {libsrc => sources}/effectengine/Animation4Music_QuatroRed.cpp (57%) rename {libsrc => sources}/effectengine/Animation4Music_QuatroWhite.cpp (58%) rename {libsrc => sources}/effectengine/Animation4Music_QuatroYellow.cpp (58%) create mode 100644 sources/effectengine/Animation4Music_StereoBlue.cpp create mode 100644 sources/effectengine/Animation4Music_StereoGreen.cpp create mode 100644 sources/effectengine/Animation4Music_StereoMulti.cpp create mode 100644 sources/effectengine/Animation4Music_StereoMultiFast.cpp create mode 100644 sources/effectengine/Animation4Music_StereoMultiSlow.cpp create mode 100644 sources/effectengine/Animation4Music_StereoRed.cpp create mode 100644 sources/effectengine/Animation4Music_StereoWhite.cpp create mode 100644 sources/effectengine/Animation4Music_StereoYellow.cpp create mode 100644 sources/effectengine/Animation4Music_TestEq.cpp create mode 100644 sources/effectengine/Animation4Music_WavesPulse.cpp create mode 100644 sources/effectengine/Animation4Music_WavesPulseFast.cpp create mode 100644 sources/effectengine/Animation4Music_WavesPulseSlow.cpp create mode 100644 sources/effectengine/AnimationBase.cpp rename {libsrc => sources}/effectengine/AnimationBaseMusic.cpp (56%) create mode 100644 sources/effectengine/Animation_AtomicSwirl.cpp create mode 100644 sources/effectengine/Animation_BlueMoodBlobs.cpp create mode 100644 sources/effectengine/Animation_Breath.cpp create mode 100644 sources/effectengine/Animation_Candle.cpp create mode 100644 sources/effectengine/Animation_CandleLight.cpp create mode 100644 sources/effectengine/Animation_CinemaBrightenLights.cpp create mode 100644 sources/effectengine/Animation_CinemaDimLights.cpp create mode 100644 sources/effectengine/Animation_ColdMoodBlobs.cpp create mode 100644 sources/effectengine/Animation_DoubleSwirl.cpp rename {libsrc => sources}/effectengine/Animation_Fade.cpp (64%) create mode 100644 sources/effectengine/Animation_FullColorMoodBlobs.cpp create mode 100644 sources/effectengine/Animation_GreenMoodBlobs.cpp create mode 100644 sources/effectengine/Animation_KnightRider.cpp rename {libsrc => sources}/effectengine/Animation_MoodBlobs.cpp (70%) create mode 100644 sources/effectengine/Animation_NotifyBlue.cpp create mode 100644 sources/effectengine/Animation_Plasma.cpp rename {libsrc => sources}/effectengine/Animation_Police.cpp (52%) create mode 100644 sources/effectengine/Animation_PoliceLightsSingle.cpp create mode 100644 sources/effectengine/Animation_PoliceLightsSolid.cpp create mode 100644 sources/effectengine/Animation_RainbowSwirl.cpp create mode 100644 sources/effectengine/Animation_RedMoodBlobs.cpp create mode 100644 sources/effectengine/Animation_SeaWaves.cpp create mode 100644 sources/effectengine/Animation_Sparks.cpp create mode 100644 sources/effectengine/Animation_StrobeRed.cpp create mode 100644 sources/effectengine/Animation_StrobeWhite.cpp rename {libsrc => sources}/effectengine/Animation_Swirl.cpp (66%) create mode 100644 sources/effectengine/Animation_SwirlFast.cpp rename {libsrc => sources}/effectengine/Animation_SystemShutdown.cpp (58%) create mode 100644 sources/effectengine/Animation_WarmMoodBlobs.cpp rename {libsrc => sources}/effectengine/Animation_Waves.cpp (60%) create mode 100644 sources/effectengine/Animation_WavesWithColor.cpp rename {libsrc => sources}/effectengine/CMakeLists.txt (85%) rename {libsrc => sources}/effectengine/Effect.cpp (83%) rename {libsrc => sources}/effectengine/EffectDBHandler.cpp (85%) rename {libsrc => sources}/effectengine/EffectDefinition.schema.json (100%) rename {libsrc => sources}/effectengine/EffectEngine.cpp (50%) rename {libsrc => sources}/flatbufserver/CMakeLists.txt (93%) rename {libsrc => sources}/flatbufserver/FlatBufferClient.cpp (81%) rename {libsrc => sources}/flatbufserver/FlatBufferClient.h (81%) rename {libsrc => sources}/flatbufserver/FlatBufferConnection.cpp (73%) rename {libsrc => sources}/flatbufserver/FlatBufferServer.cpp (81%) rename {libsrc => sources}/flatbufserver/hyperhdr_reply.fbs (100%) rename {libsrc => sources}/flatbufserver/hyperhdr_request.fbs (100%) rename {libsrc => sources}/grabber/AVF/AVFGrabber.mm (89%) rename {libsrc => sources}/grabber/AVF/AVFWorker.cpp (65%) create mode 100644 sources/grabber/AVF/AVFWrapper.cpp rename {libsrc => sources}/grabber/AVF/CMakeLists.txt (87%) rename {libsrc => sources}/grabber/CMakeLists.txt (89%) rename {libsrc => sources}/grabber/DX/CMakeLists.txt (83%) rename {libsrc => sources}/grabber/DX/DxGrabber.cpp (75%) rename {libsrc => sources}/grabber/DX/DxWrapper.cpp (70%) rename {libsrc => sources}/grabber/MF/CMakeLists.txt (87%) rename {libsrc => sources}/grabber/MF/MFCallback.cpp (66%) rename {libsrc => sources}/grabber/MF/MFGrabber.cpp (91%) rename {libsrc => sources}/grabber/MF/MFWorker.cpp (60%) create mode 100644 sources/grabber/MF/MFWrapper.cpp rename {libsrc => sources}/grabber/SoundCapLinux/CMakeLists.txt (86%) rename {libsrc => sources}/grabber/SoundCapLinux/SoundCapLinux.cpp (84%) rename {libsrc => sources}/grabber/SoundCapMacOS/CMakeLists.txt (83%) rename {libsrc => sources}/grabber/SoundCapMacOS/SoundCapMacOS.mm (87%) rename {libsrc => sources}/grabber/SoundCapWindows/CMakeLists.txt (82%) create mode 100644 sources/grabber/SoundCapWindows/SoundCapWindows.cpp rename {libsrc => sources}/grabber/X11/CMakeLists.txt (91%) rename {libsrc => sources}/grabber/X11/X11Grabber.cpp (84%) create mode 100644 sources/grabber/X11/X11Wrapper.cpp rename {libsrc => sources}/grabber/X11/smartX11.cpp (70%) rename {libsrc => sources}/grabber/macOS/CMakeLists.txt (84%) rename {libsrc => sources}/grabber/macOS/macOsGrabber.mm (81%) create mode 100644 sources/grabber/macOS/macOsWrapper.cpp create mode 100644 sources/grabber/pipewire/CMakeLists.txt create mode 100644 sources/grabber/pipewire/PipewireGrabber.cpp create mode 100644 sources/grabber/pipewire/PipewireHandler.cpp create mode 100644 sources/grabber/pipewire/PipewireHandler.h create mode 100644 sources/grabber/pipewire/PipewireWrapper.cpp create mode 100644 sources/grabber/pipewire/smartPipewire.cpp rename {libsrc => sources}/grabber/v4l2/CMakeLists.txt (87%) rename {libsrc => sources}/grabber/v4l2/V4L2Grabber.cpp (76%) rename {libsrc => sources}/grabber/v4l2/V4L2Worker.cpp (52%) rename {libsrc => sources}/grabber/v4l2/V4L2Wrapper.cpp (100%) rename {src => sources}/hyperhdr-remote/CMakeLists.txt (100%) rename {src => sources}/hyperhdr-remote/JsonConnection.cpp (82%) rename {src => sources}/hyperhdr-remote/JsonConnection.h (79%) rename {src => sources}/hyperhdr-remote/hyperhdr-remote.cpp (73%) rename {src => sources}/hyperhdr/CMakeLists.txt (95%) rename {src => sources}/hyperhdr/detectProcess.h (100%) rename {src => sources}/hyperhdr/hyperhdr.cpp (82%) rename {src => sources}/hyperhdr/hyperhdr.h (69%) rename {src => sources}/hyperhdr/main.cpp (65%) rename {src => sources}/hyperhdr/systray.cpp (76%) rename {src => sources}/hyperhdr/systray.h (88%) rename {libsrc => sources}/hyperhdrbase/AuthManager.cpp (75%) create mode 100644 sources/hyperhdrbase/BGEffectHandler.cpp rename {libsrc => sources}/hyperhdrbase/CMakeLists.txt (84%) rename {libsrc => sources}/hyperhdrbase/ComponentRegister.cpp (73%) rename {libsrc => sources}/hyperhdrbase/DetectionAutomatic.cpp (87%) rename {libsrc => sources}/hyperhdrbase/DetectionManual.cpp (98%) rename {libsrc => sources}/hyperhdrbase/Grabber.cpp (66%) rename {libsrc => sources}/hyperhdrbase/GrabberWrapper.cpp (72%) rename {libsrc => sources}/hyperhdrbase/HyperHdrIManager.cpp (64%) rename {libsrc => sources}/hyperhdrbase/HyperHdrInstance.cpp (66%) create mode 100644 sources/hyperhdrbase/ImageProcessingUnit.cpp create mode 100644 sources/hyperhdrbase/ImageProcessor.cpp create mode 100644 sources/hyperhdrbase/ImageToLedsMap.cpp create mode 100644 sources/hyperhdrbase/LedString.cpp rename libsrc/hyperhdrbase/LinearColorSmoothing.cpp => sources/hyperhdrbase/LinearSmoothing.cpp (63%) rename {libsrc => sources}/hyperhdrbase/MessageForwarder.cpp (69%) create mode 100644 sources/hyperhdrbase/MultiColorAdjustment.cpp rename {libsrc => sources}/hyperhdrbase/PriorityMuxer.cpp (79%) rename {libsrc => sources}/hyperhdrbase/SettingsManager.cpp (79%) rename {libsrc => sources}/hyperhdrbase/SoundCapture.cpp (77%) rename {libsrc => sources}/hyperhdrbase/SystemControl.cpp (62%) rename {libsrc => sources}/hyperhdrbase/SystemWrapper.cpp (62%) rename {libsrc => sources}/hyperhdrbase/VideoControl.cpp (68%) rename {libsrc => sources}/hyperhdrbase/hyperhdr.schema.json (100%) rename {libsrc => sources}/hyperhdrbase/resource.qrc (100%) rename {libsrc => sources}/hyperhdrbase/schema/schema-backgroundEffect.json (100%) rename {libsrc => sources}/hyperhdrbase/schema/schema-blackborderdetector.json (100%) rename {libsrc => sources}/hyperhdrbase/schema/schema-boblightServer.json (100%) rename {libsrc => sources}/hyperhdrbase/schema/schema-color.json (100%) rename {libsrc => sources}/hyperhdrbase/schema/schema-device.json (100%) rename {libsrc => sources}/hyperhdrbase/schema/schema-effects.json (100%) rename {libsrc => sources}/hyperhdrbase/schema/schema-flatbufServer.json (100%) rename {libsrc => sources}/hyperhdrbase/schema/schema-foregroundEffect.json (100%) rename {libsrc => sources}/hyperhdrbase/schema/schema-forwarder.json (100%) rename {libsrc => sources}/hyperhdrbase/schema/schema-general.json (67%) rename {libsrc => sources}/hyperhdrbase/schema/schema-jsonServer.json (100%) rename {libsrc => sources}/hyperhdrbase/schema/schema-ledConfig.json (100%) rename {libsrc => sources}/hyperhdrbase/schema/schema-leds.json (100%) rename {libsrc => sources}/hyperhdrbase/schema/schema-logger.json (100%) rename {libsrc => sources}/hyperhdrbase/schema/schema-network.json (100%) rename {libsrc => sources}/hyperhdrbase/schema/schema-protoServer.json (100%) rename {libsrc => sources}/hyperhdrbase/schema/schema-smoothing.json (100%) rename {libsrc => sources}/hyperhdrbase/schema/schema-soundEffect.json (100%) rename {libsrc => sources}/hyperhdrbase/schema/schema-systemControl.json (100%) rename {libsrc => sources}/hyperhdrbase/schema/schema-systemGrabber.json (100%) rename {libsrc => sources}/hyperhdrbase/schema/schema-videoControl.json (100%) rename {libsrc => sources}/hyperhdrbase/schema/schema-videoDetection.json (100%) rename {libsrc => sources}/hyperhdrbase/schema/schema-videoGrabber.json (100%) rename {libsrc => sources}/hyperhdrbase/schema/schema-webConfig.json (100%) rename {libsrc => sources}/jsonserver/CMakeLists.txt (85%) rename {libsrc => sources}/jsonserver/JsonClientConnection.cpp (85%) rename {libsrc => sources}/jsonserver/JsonClientConnection.h (88%) rename {libsrc => sources}/jsonserver/JsonServer.cpp (75%) rename {libsrc => sources}/leddevice/CMakeLists.txt (98%) rename {libsrc => sources}/leddevice/LedDevice.cpp (56%) rename {libsrc => sources}/leddevice/LedDeviceFactory.cpp (81%) rename {libsrc => sources}/leddevice/LedDeviceSchemas.qrc (100%) rename {libsrc => sources}/leddevice/LedDeviceTemplate.cpp (61%) rename {libsrc => sources}/leddevice/LedDeviceTemplate.h (82%) rename {libsrc => sources}/leddevice/LedDeviceWrapper.cpp (66%) rename {libsrc => sources}/leddevice/dev_hid/LedDeviceLightpack.cpp (100%) rename {libsrc => sources}/leddevice/dev_hid/LedDeviceLightpack.h (100%) rename {libsrc => sources}/leddevice/dev_hid/LedDevicePaintpack.cpp (100%) rename {libsrc => sources}/leddevice/dev_hid/LedDevicePaintpack.h (100%) rename {libsrc => sources}/leddevice/dev_hid/LedDeviceRawHID.cpp (100%) rename {libsrc => sources}/leddevice/dev_hid/LedDeviceRawHID.h (100%) rename {libsrc => sources}/leddevice/dev_hid/ProviderHID.cpp (100%) rename {libsrc => sources}/leddevice/dev_hid/ProviderHID.h (100%) rename {libsrc => sources}/leddevice/dev_net/LedDeviceAtmoOrb.cpp (66%) rename {libsrc => sources}/leddevice/dev_net/LedDeviceAtmoOrb.h (89%) rename {libsrc => sources}/leddevice/dev_net/LedDeviceCololight.cpp (93%) rename {libsrc => sources}/leddevice/dev_net/LedDeviceCololight.h (92%) rename {libsrc => sources}/leddevice/dev_net/LedDeviceFadeCandy.cpp (93%) rename {libsrc => sources}/leddevice/dev_net/LedDeviceFadeCandy.h (100%) rename {libsrc => sources}/leddevice/dev_net/LedDeviceNanoleaf.cpp (83%) rename {libsrc => sources}/leddevice/dev_net/LedDeviceNanoleaf.h (100%) rename {libsrc => sources}/leddevice/dev_net/LedDevicePhilipsHue.cpp (58%) rename {libsrc => sources}/leddevice/dev_net/LedDevicePhilipsHue.h (86%) rename {libsrc => sources}/leddevice/dev_net/LedDeviceTpm2net.cpp (60%) rename {libsrc => sources}/leddevice/dev_net/LedDeviceTpm2net.h (80%) create mode 100644 sources/leddevice/dev_net/LedDeviceUdpArtNet.cpp rename {libsrc => sources}/leddevice/dev_net/LedDeviceUdpArtNet.h (86%) rename {libsrc => sources}/leddevice/dev_net/LedDeviceUdpE131.cpp (65%) rename {libsrc => sources}/leddevice/dev_net/LedDeviceUdpE131.h (69%) rename {libsrc => sources}/leddevice/dev_net/LedDeviceUdpH801.cpp (78%) rename {libsrc => sources}/leddevice/dev_net/LedDeviceUdpH801.h (78%) create mode 100644 sources/leddevice/dev_net/LedDeviceUdpRaw.cpp rename {libsrc => sources}/leddevice/dev_net/LedDeviceUdpRaw.h (78%) rename {libsrc => sources}/leddevice/dev_net/LedDeviceWled.cpp (64%) rename {libsrc => sources}/leddevice/dev_net/LedDeviceWled.h (88%) create mode 100644 sources/leddevice/dev_net/LedDeviceYeelight.cpp rename {libsrc => sources}/leddevice/dev_net/LedDeviceYeelight.h (82%) create mode 100644 sources/leddevice/dev_net/ProviderRestApi.cpp rename {libsrc => sources}/leddevice/dev_net/ProviderRestApi.h (70%) rename {libsrc => sources}/leddevice/dev_net/ProviderUdp.cpp (74%) rename {libsrc => sources}/leddevice/dev_net/ProviderUdp.h (100%) rename {libsrc => sources}/leddevice/dev_net/ProviderUdpSSL.cpp (62%) rename {libsrc => sources}/leddevice/dev_net/ProviderUdpSSL.h (90%) create mode 100644 sources/leddevice/dev_other/LedDeviceFile.cpp rename {libsrc => sources}/leddevice/dev_other/LedDeviceFile.h (82%) rename {libsrc => sources}/leddevice/dev_other/LedDevicePiBlaster.cpp (100%) rename {libsrc => sources}/leddevice/dev_other/LedDevicePiBlaster.h (100%) rename {libsrc => sources}/leddevice/dev_rpi_pwm/LedDeviceWS281x.cpp (70%) rename {libsrc => sources}/leddevice/dev_rpi_pwm/LedDeviceWS281x.h (84%) rename {libsrc => sources}/leddevice/dev_serial/LedDeviceAdalight.cpp (77%) rename {libsrc => sources}/leddevice/dev_serial/LedDeviceAdalight.h (80%) rename {libsrc => sources}/leddevice/dev_serial/LedDeviceAtmo.cpp (60%) rename {libsrc => sources}/leddevice/dev_serial/LedDeviceAtmo.h (76%) rename {libsrc => sources}/leddevice/dev_serial/LedDeviceDMX.cpp (58%) rename {libsrc => sources}/leddevice/dev_serial/LedDeviceDMX.h (80%) create mode 100644 sources/leddevice/dev_serial/LedDeviceKarate.cpp rename {libsrc => sources}/leddevice/dev_serial/LedDeviceKarate.h (78%) rename {libsrc => sources}/leddevice/dev_serial/LedDeviceSedu.cpp (63%) rename {libsrc => sources}/leddevice/dev_serial/LedDeviceSedu.h (78%) rename {libsrc => sources}/leddevice/dev_serial/LedDeviceTpm2.cpp (68%) rename {libsrc => sources}/leddevice/dev_serial/LedDeviceTpm2.h (78%) rename {libsrc => sources}/leddevice/dev_serial/ProviderRs232.cpp (72%) rename {libsrc => sources}/leddevice/dev_serial/ProviderRs232.h (91%) rename {libsrc => sources}/leddevice/dev_spi/LedDeviceAPA102.cpp (61%) rename {libsrc => sources}/leddevice/dev_spi/LedDeviceAPA102.h (78%) rename {libsrc => sources}/leddevice/dev_spi/LedDeviceAPA104.cpp (71%) rename {libsrc => sources}/leddevice/dev_spi/LedDeviceAPA104.h (80%) rename {libsrc => sources}/leddevice/dev_spi/LedDeviceAWA_spi.cpp (80%) rename {libsrc => sources}/leddevice/dev_spi/LedDeviceAWA_spi.h (78%) rename {libsrc => sources}/leddevice/dev_spi/LedDeviceLpd6803.cpp (62%) rename {libsrc => sources}/leddevice/dev_spi/LedDeviceLpd6803.h (84%) rename {libsrc => sources}/leddevice/dev_spi/LedDeviceLpd8806.cpp (55%) rename {libsrc => sources}/leddevice/dev_spi/LedDeviceLpd8806.h (95%) rename {libsrc => sources}/leddevice/dev_spi/LedDeviceP9813.cpp (56%) rename {libsrc => sources}/leddevice/dev_spi/LedDeviceP9813.h (77%) rename {libsrc => sources}/leddevice/dev_spi/LedDeviceSK9822.cpp (84%) rename {libsrc => sources}/leddevice/dev_spi/LedDeviceSK9822.h (83%) rename {libsrc => sources}/leddevice/dev_spi/LedDeviceSk6812SPI.cpp (58%) rename {libsrc => sources}/leddevice/dev_spi/LedDeviceSk6812SPI.h (80%) rename {libsrc => sources}/leddevice/dev_spi/LedDeviceSk6822SPI.cpp (55%) rename {libsrc => sources}/leddevice/dev_spi/LedDeviceSk6822SPI.h (80%) create mode 100644 sources/leddevice/dev_spi/LedDeviceWs2801.cpp rename {libsrc => sources}/leddevice/dev_spi/LedDeviceWs2801.h (78%) rename {libsrc => sources}/leddevice/dev_spi/LedDeviceWs2812SPI.cpp (66%) rename {libsrc => sources}/leddevice/dev_spi/LedDeviceWs2812SPI.h (80%) rename {libsrc => sources}/leddevice/dev_spi/ProviderSpi.cpp (76%) rename {libsrc => sources}/leddevice/dev_spi/ProviderSpi.h (91%) rename {libsrc => sources}/leddevice/dev_tinker/LedDeviceTinkerforge.cpp (100%) rename {libsrc => sources}/leddevice/dev_tinker/LedDeviceTinkerforge.h (100%) rename {libsrc => sources}/leddevice/schemas/schema-adalight.json (100%) rename {libsrc => sources}/leddevice/schemas/schema-apa102.json (100%) rename {libsrc => sources}/leddevice/schemas/schema-apa104.json (100%) rename {libsrc => sources}/leddevice/schemas/schema-artnet.json (100%) rename {libsrc => sources}/leddevice/schemas/schema-atmo.json (100%) rename {libsrc => sources}/leddevice/schemas/schema-atmoorb.json (100%) rename {libsrc => sources}/leddevice/schemas/schema-awa_spi.json (100%) rename {libsrc => sources}/leddevice/schemas/schema-cololight.json (100%) rename {libsrc => sources}/leddevice/schemas/schema-dmx.json (100%) rename {libsrc => sources}/leddevice/schemas/schema-e131.json (100%) rename {libsrc => sources}/leddevice/schemas/schema-fadecandy.json (100%) rename {libsrc => sources}/leddevice/schemas/schema-file.json (100%) rename {libsrc => sources}/leddevice/schemas/schema-h801.json (100%) rename {libsrc => sources}/leddevice/schemas/schema-hyperionusbasp.json (100%) rename {libsrc => sources}/leddevice/schemas/schema-karate.json (100%) rename {libsrc => sources}/leddevice/schemas/schema-lightpack.json (100%) rename {libsrc => sources}/leddevice/schemas/schema-lpd6803.json (100%) rename {libsrc => sources}/leddevice/schemas/schema-lpd8806.json (100%) rename {libsrc => sources}/leddevice/schemas/schema-nanoleaf.json (100%) rename {libsrc => sources}/leddevice/schemas/schema-p9813.json (100%) rename {libsrc => sources}/leddevice/schemas/schema-paintpack.json (100%) rename {libsrc => sources}/leddevice/schemas/schema-philipshue.json (99%) rename {libsrc => sources}/leddevice/schemas/schema-piblaster.json (100%) rename {libsrc => sources}/leddevice/schemas/schema-rawhid.json (100%) rename {libsrc => sources}/leddevice/schemas/schema-sedu.json (100%) rename {libsrc => sources}/leddevice/schemas/schema-sk6812spi.json (100%) rename {libsrc => sources}/leddevice/schemas/schema-sk6822spi.json (100%) rename {libsrc => sources}/leddevice/schemas/schema-sk9822.json (100%) rename {libsrc => sources}/leddevice/schemas/schema-tinkerforge.json (100%) rename {libsrc => sources}/leddevice/schemas/schema-tpm2.json (100%) rename {libsrc => sources}/leddevice/schemas/schema-tpm2net.json (100%) rename {libsrc => sources}/leddevice/schemas/schema-udpraw.json (100%) rename {libsrc => sources}/leddevice/schemas/schema-wled.json (100%) rename {libsrc => sources}/leddevice/schemas/schema-ws2801.json (100%) rename {libsrc => sources}/leddevice/schemas/schema-ws2812spi.json (100%) rename {libsrc => sources}/leddevice/schemas/schema-ws281x.json (100%) rename {libsrc => sources}/leddevice/schemas/schema-yeelight.json (100%) rename {libsrc => sources}/protoserver/CMakeLists.txt (81%) rename {libsrc => sources}/protoserver/ProtoClientConnection.cpp (100%) rename {libsrc => sources}/protoserver/ProtoClientConnection.h (100%) rename {libsrc => sources}/protoserver/ProtoServer.cpp (100%) rename {libsrc => sources}/protoserver/message.proto (100%) rename {libsrc => sources}/ssdp/CMakeLists.txt (84%) rename {libsrc => sources}/ssdp/SSDPDescription.h (100%) rename {libsrc => sources}/ssdp/SSDPDiscover.cpp (73%) rename {libsrc => sources}/ssdp/SSDPHandler.cpp (69%) rename {libsrc => sources}/ssdp/SSDPServer.cpp (56%) create mode 100644 sources/utils/CMakeLists.txt rename {libsrc => sources}/utils/ColorRgb.cpp (100%) create mode 100644 sources/utils/ColorRgbw.cpp create mode 100644 sources/utils/ColorSys.cpp create mode 100644 sources/utils/DefaultSignalHandler.cpp create mode 100644 sources/utils/FileUtils.cpp rename libsrc/utils/ImageResampler.cpp => sources/utils/FrameDecoder.cpp (77%) rename {libsrc => sources}/utils/ImageData.cpp (100%) rename {libsrc => sources}/utils/JsonUtils.cpp (74%) rename {libsrc => sources}/utils/Logger.cpp (59%) rename {libsrc => sources}/utils/NetOrigin.cpp (58%) create mode 100644 sources/utils/PerformanceCounters.cpp rename {libsrc => sources}/utils/RgbChannelAdjustment.cpp (73%) rename {libsrc => sources}/utils/RgbTransform.cpp (72%) rename {libsrc => sources}/utils/SysInfo.cpp (58%) create mode 100644 sources/utils/SystemPerformanceCounters.cpp create mode 100644 sources/utils/SystemPerformanceCounters.mm create mode 100644 sources/utils/VideoMemoryManager.cpp rename {libsrc => sources}/utils/jsonschema/QJsonSchemaChecker.cpp (73%) rename {libsrc => sources}/webserver/CMakeLists.txt (93%) create mode 100644 sources/webserver/CgiHandler.cpp rename {libsrc => sources}/webserver/CgiHandler.h (64%) create mode 100644 sources/webserver/QtHttpClientWrapper.cpp create mode 100644 sources/webserver/QtHttpClientWrapper.h rename {libsrc => sources}/webserver/QtHttpHeader.cpp (100%) create mode 100644 sources/webserver/QtHttpHeader.h create mode 100644 sources/webserver/QtHttpReply.cpp create mode 100644 sources/webserver/QtHttpReply.h create mode 100644 sources/webserver/QtHttpRequest.cpp create mode 100644 sources/webserver/QtHttpRequest.h create mode 100644 sources/webserver/QtHttpServer.cpp create mode 100644 sources/webserver/QtHttpServer.h create mode 100644 sources/webserver/StaticFileServing.cpp rename {libsrc => sources}/webserver/StaticFileServing.h (71%) rename {libsrc => sources}/webserver/WebConfig.qrc.in (100%) rename {libsrc => sources}/webserver/WebJsonRpc.cpp (89%) rename {libsrc => sources}/webserver/WebJsonRpc.h (88%) rename {libsrc => sources}/webserver/WebServer.cpp (67%) rename {libsrc => sources}/webserver/WebSocketClient.cpp (61%) rename {libsrc => sources}/webserver/WebSocketClient.h (81%) rename {libsrc => sources}/webserver/WebSocketUtils.h (57%) delete mode 100644 src/CMakeLists.txt delete mode 100644 src/hyperhdr/console.h diff --git a/.ci/ci_build.sh b/.ci/ci_build.sh index c029eaca9..f621bf4ba 100755 --- a/.ci/ci_build.sh +++ b/.ci/ci_build.sh @@ -66,7 +66,7 @@ elif [[ $CI_NAME == *"mingw64_nt"* || "$CI_NAME" == 'windows_nt' ]]; then echo "Number of Cores $NUMBER_OF_PROCESSORS" mkdir build || exit 1 cd build - cmake -G "Visual Studio 16 2019" -A x64 -DPLATFORM=${PLATFORM} -DCMAKE_BUILD_TYPE=${BUILD_TYPE} -DCMAKE_GITHUB_ACTION=1 ../ || exit 2 + cmake -G "Visual Studio 17 2022" -A x64 -DPLATFORM=${PLATFORM} -DCMAKE_BUILD_TYPE=${BUILD_TYPE} -DCMAKE_GITHUB_ACTION=1 ../ || exit 2 cmake --build . --target package --config Release -- -nologo -v:m -maxcpucount || exit 3 exit 0; exit 1 || { echo "---> Hyperhdr compilation failed! Abort"; exit 5; } diff --git a/.editorconfig b/.editorconfig index f62c15586..f6c32112c 100644 --- a/.editorconfig +++ b/.editorconfig @@ -17,8 +17,8 @@ indent_size = 4 # js and webui [*.{ts,js,html}] -indent_style = space -indent_size = 2 +indent_style = tab +indent_size = 4 # version file [version] diff --git a/.github/workflows/push-master-copy.bak b/.github/workflows/push-master.bak similarity index 78% rename from .github/workflows/push-master-copy.bak rename to .github/workflows/push-master.bak index f3aca71b1..b125e05ba 100644 --- a/.github/workflows/push-master-copy.bak +++ b/.github/workflows/push-master.bak @@ -4,6 +4,7 @@ on: [push] env: USE_CACHE: "1" + RESET_CACHE: "0" jobs: @@ -17,19 +18,24 @@ jobs: strategy: matrix: + debian: [ bullseye ] dockerImage: [ x86_64, rpi012-armv6l, rpi34-armv7l, arm-aarch64 ] - include: + include: - dockerImage: x86_64 - dockerName: Debian Buster (x86_64) + debian: bullseye + dockerName: Debian Bullseye (x86_64) platform: linux - dockerImage: rpi012-armv6l - dockerName: Debian Buster (Raspberry Pi ZERO, 1 & 2) + debian: bullseye + dockerName: Debian Bullseye (Raspberry Pi ZERO, 1 & 2) platform: rpi - dockerImage: rpi34-armv7l - dockerName: Debian Buster (Raspberry Pi 3 & 4) + debian: bullseye + dockerName: Debian Bullseye (Raspberry Pi 3 & 4) platform: rpi - dockerImage: arm-aarch64 - dockerName: Debian Buster (ARM aarch64) + debian: bullseye + dockerName: Debian Bullseye (ARM aarch64) platform: rpi steps: @@ -49,20 +55,21 @@ jobs: # download cache - name: ccache cache files - if: env.USE_CACHE == '1' + if: ( env.USE_CACHE == '1' ) uses: actions/cache@v1.1.0 with: path: .ccache - key: ${{ matrix.dockerImage }}-ccache-${{ steps.ccache_cache_timestamp.outputs.timestamp }} - restore-keys: ${{ matrix.dockerImage }}-ccache- + key: ${{ matrix.debian }}-${{ matrix.dockerImage }}-ccache-${{ steps.ccache_cache_timestamp.outputs.timestamp }} + restore-keys: ${{ matrix.debian }}-${{ matrix.dockerImage }}-ccache- - name: Build packages env: DOCKER_IMAGE: ${{ matrix.dockerImage }} - DOCKER_TAG: buster + DOCKER_TAG: ${{ matrix.debian }} DOCKER_NAME: ${{ matrix.dockerName }} PLATFORM: ${{ matrix.platform }} USE_CCACHE: ${{ env.USE_CACHE }} + RESET_CACHE: ${{ env.RESET_CACHE }} shell: bash run: ./.ci/ci_build.sh @@ -78,7 +85,7 @@ jobs: if: (startsWith(github.event.ref, 'refs/tags') != true) uses: actions/upload-artifact@v2 with: - name: ${{ matrix.dockerImage }} + name: Linux-${{ matrix.debian }}-${{ matrix.dockerImage }}-DEB-installer path: deploy/Hyper*.deb ###################### @@ -87,7 +94,7 @@ jobs: macOS: name: macOS - runs-on: macos-latest + runs-on: macOS-10.15 steps: # Checkout - uses: actions/checkout@v1 @@ -105,7 +112,7 @@ jobs: # Download cache - name: ccache cache files - if: env.USE_CACHE == '1' + if: ( env.USE_CACHE == '1' ) uses: actions/cache@v1.1.0 with: path: .ccache @@ -115,13 +122,14 @@ jobs: # Install deps - name: Install deps shell: bash - run: brew update && brew install qt@5 xz ccache + run: brew update && brew install qt@6 xz ccache protobuf # Build process - name: Build packages env: PLATFORM: osx USE_CCACHE: ${{ env.USE_CACHE }} + RESET_CACHE: ${{ env.RESET_CACHE }} shell: bash run: ./.ci/ci_build.sh @@ -137,7 +145,7 @@ jobs: if: (startsWith(github.event.ref, 'refs/tags') != true) uses: actions/upload-artifact@v2 with: - name: macOS_x64 + name: Apple_macOS_x64_DMG_installer path: build/Hyper*.dmg ###################### @@ -146,10 +154,10 @@ jobs: windows: name: Windows - runs-on: windows-latest + runs-on: windows-2022 env: - VCINSTALLDIR: 'C:\Program Files (x86)\Microsoft Visual Studio\2019\Enterprise\VC' - QT_VERSION: 5.15.2 + VCINSTALLDIR: 'C:\Program Files\Microsoft Visual Studio\2022\Enterprise\VC' + QT_VERSION: 6.2.2 steps: - name: Checkout uses: actions/checkout@v1 @@ -162,15 +170,13 @@ jobs: with: path: ${{ runner.workspace }}/Qt key: ${{ runner.os }}-Qt.${{ env.QT_VERSION }} + + - name: Install QT + if: steps.cache-qt-windows.outputs.cache-hit != 'true' + run: | + pip install aqtinstall + aqt install-qt -O ${{ runner.workspace }}/Qt windows desktop ${{ env.QT_VERSION }} win64_msvc2019_64 -m qtserialport - - name: Install Qt - uses: jurplel/install-qt-action@v2 - with: - version: ${{ env.QT_VERSION }} - target: 'desktop' - arch: 'win64_msvc2019_64' - cached: ${{ steps.cache-qt-windows.outputs.cache-hit }} - - name: Set up x64 build architecture environment shell: cmd run: call "${{env.VCINSTALLDIR}}\Auxiliary\Build\vcvars64.bat" @@ -182,8 +188,10 @@ jobs: - name: Build packages env: PLATFORM: windows + CMAKE_PREFIX_PATH: "${{ runner.workspace }}/Qt/${{ env.QT_VERSION }}/msvc2019_64/lib/cmake/" shell: bash - run: ./.ci/ci_build.sh + run: | + ./.ci/ci_build.sh # upload artifacts (only on tagged commit) - name: Upload artifacts @@ -197,9 +205,9 @@ jobs: if: (startsWith(github.event.ref, 'refs/tags') != true) uses: actions/upload-artifact@v2 with: - name: windows + name: Windows_x64_setup path: build/Hyper*.exe - + ################################ ###### Publish Releases ######## ################################ diff --git a/.github/workflows/push-master.yml b/.github/workflows/push-master.yml index c12d1b2b6..b125e05ba 100644 --- a/.github/workflows/push-master.yml +++ b/.github/workflows/push-master.yml @@ -18,25 +18,9 @@ jobs: strategy: matrix: - debian: [ buster, bullseye ] + debian: [ bullseye ] dockerImage: [ x86_64, rpi012-armv6l, rpi34-armv7l, arm-aarch64 ] - include: - - dockerImage: x86_64 - debian: buster - dockerName: Debian Buster (x86_64) - platform: linux - - dockerImage: rpi012-armv6l - debian: buster - dockerName: Debian Buster (Raspberry Pi ZERO, 1 & 2) - platform: rpi - - dockerImage: rpi34-armv7l - debian: buster - dockerName: Debian Buster (Raspberry Pi 3 & 4) - platform: rpi - - dockerImage: arm-aarch64 - debian: buster - dockerName: Debian Buster (ARM aarch64) - platform: rpi + include: - dockerImage: x86_64 debian: bullseye dockerName: Debian Bullseye (x86_64) @@ -170,10 +154,10 @@ jobs: windows: name: Windows - runs-on: windows-latest + runs-on: windows-2022 env: - VCINSTALLDIR: 'C:\Program Files (x86)\Microsoft Visual Studio\2019\Enterprise\VC' - QT_VERSION: 6.2.0 + VCINSTALLDIR: 'C:\Program Files\Microsoft Visual Studio\2022\Enterprise\VC' + QT_VERSION: 6.2.2 steps: - name: Checkout uses: actions/checkout@v1 diff --git a/.gitignore b/.gitignore index d91ea6dd9..d1da54e17 100644 --- a/.gitignore +++ b/.gitignore @@ -20,8 +20,8 @@ CMakeCache.txt compile_commands.json # Autogenerated by flatbuffers -libsrc/flatbufserver/hyperion_reply_generated.h -libsrc/flatbufserver/hyperion_request_generated.h +sources/flatbufserver/hyperhdr_reply_generated.h +sources/flatbufserver/hyperhdr_request_generated.h # Kdevelop project files *.kdev* diff --git a/3RD_PARTY_LICENSES b/3RD_PARTY_LICENSES index 754d8c6c1..dc7a9b270 100644 --- a/3RD_PARTY_LICENSES +++ b/3RD_PARTY_LICENSES @@ -2934,215 +2934,6 @@ OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - -============================== - semver-lite -============================== - - Apache License - Version 2.0, January 2004 - http://www.apache.org/licenses/ - - TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION - - 1. Definitions. - - "License" shall mean the terms and conditions for use, reproduction, - and distribution as defined by Sections 1 through 9 of this document. - - "Licensor" shall mean the copyright owner or entity authorized by - the copyright owner that is granting the License. - - "Legal Entity" shall mean the union of the acting entity and all - other entities that control, are controlled by, or are under common - control with that entity. For the purposes of this definition, - "control" means (i) the power, direct or indirect, to cause the - direction or management of such entity, whether by contract or - otherwise, or (ii) ownership of fifty percent (50%) or more of the - outstanding shares, or (iii) beneficial ownership of such entity. - - "You" (or "Your") shall mean an individual or Legal Entity - exercising permissions granted by this License. - - "Source" form shall mean the preferred form for making modifications, - including but not limited to software source code, documentation - source, and configuration files. - - "Object" form shall mean any form resulting from mechanical - transformation or translation of a Source form, including but - not limited to compiled object code, generated documentation, - and conversions to other media types. - - "Work" shall mean the work of authorship, whether in Source or - Object form, made available under the License, as indicated by a - copyright notice that is included in or attached to the work - (an example is provided in the Appendix below). - - "Derivative Works" shall mean any work, whether in Source or Object - form, that is based on (or derived from) the Work and for which the - editorial revisions, annotations, elaborations, or other modifications - represent, as a whole, an original work of authorship. For the purposes - of this License, Derivative Works shall not include works that remain - separable from, or merely link (or bind by name) to the interfaces of, - the Work and Derivative Works thereof. - - "Contribution" shall mean any work of authorship, including - the original version of the Work and any modifications or additions - to that Work or Derivative Works thereof, that is intentionally - submitted to Licensor for inclusion in the Work by the copyright owner - or by an individual or Legal Entity authorized to submit on behalf of - the copyright owner. For the purposes of this definition, "submitted" - means any form of electronic, verbal, or written communication sent - to the Licensor or its representatives, including but not limited to - communication on electronic mailing lists, source code control systems, - and issue tracking systems that are managed by, or on behalf of, the - Licensor for the purpose of discussing and improving the Work, but - excluding communication that is conspicuously marked or otherwise - designated in writing by the copyright owner as "Not a Contribution." - - "Contributor" shall mean Licensor and any individual or Legal Entity - on behalf of whom a Contribution has been received by Licensor and - subsequently incorporated within the Work. - - 2. Grant of Copyright License. Subject to the terms and conditions of - this License, each Contributor hereby grants to You a perpetual, - worldwide, non-exclusive, no-charge, royalty-free, irrevocable - copyright license to reproduce, prepare Derivative Works of, - publicly display, publicly perform, sublicense, and distribute the - Work and such Derivative Works in Source or Object form. - - 3. Grant of Patent License. Subject to the terms and conditions of - this License, each Contributor hereby grants to You a perpetual, - worldwide, non-exclusive, no-charge, royalty-free, irrevocable - (except as stated in this section) patent license to make, have made, - use, offer to sell, sell, import, and otherwise transfer the Work, - where such license applies only to those patent claims licensable - by such Contributor that are necessarily infringed by their - Contribution(s) alone or by combination of their Contribution(s) - with the Work to which such Contribution(s) was submitted. If You - institute patent litigation against any entity (including a - cross-claim or counterclaim in a lawsuit) alleging that the Work - or a Contribution incorporated within the Work constitutes direct - or contributory patent infringement, then any patent licenses - granted to You under this License for that Work shall terminate - as of the date such litigation is filed. - - 4. Redistribution. You may reproduce and distribute copies of the - Work or Derivative Works thereof in any medium, with or without - modifications, and in Source or Object form, provided that You - meet the following conditions: - - (a) You must give any other recipients of the Work or - Derivative Works a copy of this License; and - - (b) You must cause any modified files to carry prominent notices - stating that You changed the files; and - - (c) You must retain, in the Source form of any Derivative Works - that You distribute, all copyright, patent, trademark, and - attribution notices from the Source form of the Work, - excluding those notices that do not pertain to any part of - the Derivative Works; and - - (d) If the Work includes a "NOTICE" text file as part of its - distribution, then any Derivative Works that You distribute must - include a readable copy of the attribution notices contained - within such NOTICE file, excluding those notices that do not - pertain to any part of the Derivative Works, in at least one - of the following places: within a NOTICE text file distributed - as part of the Derivative Works; within the Source form or - documentation, if provided along with the Derivative Works; or, - within a display generated by the Derivative Works, if and - wherever such third-party notices normally appear. The contents - of the NOTICE file are for informational purposes only and - do not modify the License. You may add Your own attribution - notices within Derivative Works that You distribute, alongside - or as an addendum to the NOTICE text from the Work, provided - that such additional attribution notices cannot be construed - as modifying the License. - - You may add Your own copyright statement to Your modifications and - may provide additional or different license terms and conditions - for use, reproduction, or distribution of Your modifications, or - for any such Derivative Works as a whole, provided Your use, - reproduction, and distribution of the Work otherwise complies with - the conditions stated in this License. - - 5. Submission of Contributions. Unless You explicitly state otherwise, - any Contribution intentionally submitted for inclusion in the Work - by You to the Licensor shall be under the terms and conditions of - this License, without any additional terms or conditions. - Notwithstanding the above, nothing herein shall supersede or modify - the terms of any separate license agreement you may have executed - with Licensor regarding such Contributions. - - 6. Trademarks. This License does not grant permission to use the trade - names, trademarks, service marks, or product names of the Licensor, - except as required for reasonable and customary use in describing the - origin of the Work and reproducing the content of the NOTICE file. - - 7. Disclaimer of Warranty. Unless required by applicable law or - agreed to in writing, Licensor provides the Work (and each - Contributor provides its Contributions) on an "AS IS" BASIS, - WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or - implied, including, without limitation, any warranties or conditions - of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A - PARTICULAR PURPOSE. You are solely responsible for determining the - appropriateness of using or redistributing the Work and assume any - risks associated with Your exercise of permissions under this License. - - 8. Limitation of Liability. In no event and under no legal theory, - whether in tort (including negligence), contract, or otherwise, - unless required by applicable law (such as deliberate and grossly - negligent acts) or agreed to in writing, shall any Contributor be - liable to You for damages, including any direct, indirect, special, - incidental, or consequential damages of any character arising as a - result of this License or out of the use or inability to use the - Work (including but not limited to damages for loss of goodwill, - work stoppage, computer failure or malfunction, or any and all - other commercial damages or losses), even if such Contributor - has been advised of the possibility of such damages. - - 9. Accepting Warranty or Additional Liability. While redistributing - the Work or Derivative Works thereof, You may choose to offer, - and charge a fee for, acceptance of support, warranty, indemnity, - or other liability obligations and/or rights consistent with this - License. However, in accepting such obligations, You may act only - on Your own behalf and on Your sole responsibility, not on behalf - of any other Contributor, and only if You agree to indemnify, - defend, and hold each Contributor harmless for any liability - incurred by, or claims asserted against, such Contributor by reason - of your accepting any such warranty or additional liability. - - END OF TERMS AND CONDITIONS - - APPENDIX: How to apply the Apache License to your work. - - To apply the Apache License to your work, attach the following - boilerplate notice, with the fields enclosed by brackets "{}" - replaced with your own identifying information. (Don't include - the brackets!) The text should be enclosed in the appropriate - comment syntax for the file format. We also recommend that a - file or class name and description of purpose be included on the - same "printed page" as the copyright notice for easier - identification within third-party archives. - - Copyright {yyyy} {name of copyright owner} - - Licensed under the Apache License, Version 2.0 (the "License"); - you may not use this file except in compliance with the License. - You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - - Unless required by applicable law or agreed to in writing, software - distributed under the License is distributed on an "AS IS" BASIS, - WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - See the License for the specific language governing permissions and - limitations under the License. - - - ============================== tinkerforge ============================== diff --git a/CMakeLists.txt b/CMakeLists.txt index 2e5457e3a..a186e59dd 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -31,6 +31,28 @@ else() message ( STATUS "CCache is not found" ) endif(CCACHE_FOUND) +# find QT libs +find_package(Qt6 COMPONENTS Core Gui Network Sql Widgets SerialPort QUIET) + +if (Qt6Core_FOUND AND NOT (DO_NOT_USE_QT_VERSION_6_LIBS STREQUAL "ON")) + message( STATUS "Found Qt Version: ${Qt6Core_VERSION}" ) + SET( Qt_VERSION 6 ) +ELSE() + if (DO_NOT_USE_QT_VERSION_6_LIBS STREQUAL "ON") + message( STATUS "Search for QT version 6 is disabled: QT5 is preferred. Enable QT6 by setting DO_NOT_USE_QT_VERSION_6_LIBS to OFF." ) + else() + message( STATUS "QT version 6 not found. Searching for QT version 5 instead." ) + endif() + SET(QT_MIN_VERSION "5.10.0") + find_package(Qt5 COMPONENTS Core Gui Network SerialPort Sql Widgets REQUIRED) + message( STATUS "Found Qt Version: ${Qt5Core_VERSION}" ) + IF ( "${Qt5Core_VERSION}" VERSION_LESS "${QT_MIN_VERSION}" ) + message( FATAL_ERROR "Your Qt version is to old! Minimum required ${QT_MIN_VERSION}" ) + ENDIF() + SET( Qt_VERSION 5 ) +ENDIF() + + # Set build variables SET ( DO_NOT_USE_QT_VERSION_6_LIBS OFF ) SET ( DEFAULT_PROTOBUF ON ) @@ -46,6 +68,7 @@ SET ( DEFAULT_AVF OFF ) SET ( DEFAULT_MAC_SYSTEM OFF ) SET ( DEFAULT_V4L2 OFF ) SET ( DEFAULT_X11 OFF ) +SET ( DEFAULT_PIPEWIRE OFF ) SET ( DEFAULT_SOUNDCAPWINDOWS OFF ) SET ( DEFAULT_SOUNDCAPMACOS OFF ) SET ( DEFAULT_CEC OFF ) @@ -54,6 +77,7 @@ IF ( ${CMAKE_SYSTEM} MATCHES "Linux" ) SET ( DEFAULT_SOUNDCAPLINUX ON ) SET ( DEFAULT_V4L2 ON ) SET ( DEFAULT_X11 ON ) + SET ( DEFAULT_PIPEWIRE ON ) SET ( DEFAULT_SPIDEV ON ) SET ( DEFAULT_TINKERFORGE ON ) SET ( DEFAULT_USB_HID OFF ) @@ -200,6 +224,22 @@ if (DEFAULT_X11) endif() endif() +if (DEFAULT_PIPEWIRE) + find_package(Qt${Qt_VERSION} COMPONENTS DBus QUIET ) + if (NOT Qt${Qt_VERSION}DBus_FOUND) + message( WARNING "QT dbus library is required for PipeWire/Portal support" ) + SET ( DEFAULT_PIPEWIRE OFF ) + else() + + pkg_check_modules(PIPEWIRE libpipewire-0.3) + if(NOT PIPEWIRE_FOUND OR NOT PIPEWIRE_INCLUDE_DIRS OR NOT PIPEWIRE_LIBRARIES) + message( WARNING "Pipewire >= 3.0 not found (did you install libpipewire-0.3-dev?). Disabling support for PipeWire software grabber.") + SET ( DEFAULT_PIPEWIRE OFF ) + endif() + + endif() +endif() + # CEC library find_library (CEC_SUPPORT p8-platform NAMES libp8-platform.so.2 libp8-platform p8-platform ) if(NOT CEC_SUPPORT AND DEFAULT_CEC) @@ -241,6 +281,9 @@ message(STATUS "ENABLE_V4L2 = ${ENABLE_V4L2}") option(ENABLE_X11 "Enable the X11 Linux system grabber" ${DEFAULT_X11}) message(STATUS "ENABLE_X11 = ${ENABLE_X11}") +option(ENABLE_PIPEWIRE "Enable the pipewire/portal Linux system grabber" ${DEFAULT_PIPEWIRE}) +message(STATUS "ENABLE_PIPEWIRE = ${ENABLE_PIPEWIRE}") + option(ENABLE_WS281XPWM "Enable the WS281x-PWM device" ${DEFAULT_WS281XPWM} ) message(STATUS "ENABLE_WS281XPWM = ${ENABLE_WS281XPWM}") @@ -339,27 +382,6 @@ endif () # find Threads libs find_package(Threads REQUIRED) -# find QT libs -find_package(Qt6 COMPONENTS Core Gui Network Sql Widgets SerialPort QUIET) - -if (Qt6Core_FOUND AND NOT (DO_NOT_USE_QT_VERSION_6_LIBS STREQUAL "ON")) - message( STATUS "Found Qt Version: ${Qt6Core_VERSION}" ) - SET( Qt_VERSION 6 ) -ELSE() - if (DO_NOT_USE_QT_VERSION_6_LIBS STREQUAL "ON") - message( STATUS "Search for QT version 6 is disabled: QT5 is preferred. Enable QT6 by setting DO_NOT_USE_QT_VERSION_6_LIBS to OFF." ) - else() - message( STATUS "QT version 6 not found. Searching for QT version 5 instead." ) - endif() - SET(QT_MIN_VERSION "5.10.0") - find_package(Qt5 COMPONENTS Core Gui Network SerialPort Sql Widgets REQUIRED) - message( STATUS "Found Qt Version: ${Qt5Core_VERSION}" ) - IF ( "${Qt5Core_VERSION}" VERSION_LESS "${QT_MIN_VERSION}" ) - message( FATAL_ERROR "Your Qt version is to old! Minimum required ${QT_MIN_VERSION}" ) - ENDIF() - SET( Qt_VERSION 5 ) -ENDIF() - # add QT5 dependency IF ( CMAKE_CROSSCOMPILING ) @@ -422,8 +444,7 @@ endif() # Add the source/lib directories add_subdirectory(dependencies) -add_subdirectory(libsrc) -add_subdirectory(src) +add_subdirectory(sources) # Add resources directory add_subdirectory(resources) @@ -443,7 +464,7 @@ add_custom_target(uninstall COMMAND ${CMAKE_COMMAND} -P ${CMAKE_CURRENT_BINARY_D include (${CMAKE_CURRENT_SOURCE_DIR}/cmake/packages.cmake) # external targets -set_target_properties(apidoc flatbuffers flatc flatc flathash lib mbedcrypto mbedtls mbedx509 PROPERTIES FOLDER ExternalLibsTargets) +set_target_properties(apidoc flatbuffers flatc flatc flathash lib mbedcrypto mbedtls mbedx509 resources uninstall PROPERTIES FOLDER ExternalLibsTargets) if (TARGET jsimdcfg) set_target_properties(jsimdcfg PROPERTIES FOLDER ExternalLibsTargets) diff --git a/HyperhdrConfig.h.in b/HyperhdrConfig.h.in index 6b56dccad..b96dd658c 100644 --- a/HyperhdrConfig.h.in +++ b/HyperhdrConfig.h.in @@ -12,6 +12,9 @@ // x11 linux system grabber #cmakedefine ENABLE_X11 +// PipeWire system grabber +#cmakedefine ENABLE_PIPEWIRE + // Define to enable boblight server #cmakedefine ENABLE_BOBLIGHT diff --git a/assets/webconfig/content/overview.html b/assets/webconfig/content/overview.html index 2a671e798..f68479c32 100644 --- a/assets/webconfig/content/overview.html +++ b/assets/webconfig/content/overview.html @@ -1,122 +1,206 @@ -
+
+
+
+ +
-
- -
-
-
-
-
- - Information +
+
+
+ + Information +
+
+
+
+
+
unknown
-
-
-
-
-
unknown
-
-
-
Platform:
-
-
-
-
Video device
-
+
+
Platform:
+
+
+
+
Video device
+
+
+
+
Video mode
+
+
+
+
LED type:
+
+
+
+
Instance
+
+
+
+
HyperHDR version:
+
unknown
+
+
+
Latest version:
+
unknown
+
+
+
+

Smart Access

+ +


+ +
+
+
+
+ + Performance +
+
+
+
+
+
+
+
+ CPU +
+
+
+
+
+
+
+
+ RAM +
+
+
+
+
+
-
-
Video mode
-
+
+
+
+ Temperature +
+
+
+
+
+
+
+
+ Undervoltage +
+
+
+
+
+
-
-
LED type:
-
+
+
+ +
+
+ +
-
-
Instance
-
+
+
+
+
+ Instance +
+
+ ⇒ Smoothing ⇒ +
+
+
+
+ LED device +
-
-
HyperHDR version:
-
unknown
+
-
-
Latest version:
-
unknown
+
+
+
-
-

Smart Access

- -


- +
-
-
-
- - Components status -
-
- - - - - - - - - -
ComponentStatus
-
+
+
+
+
+
+ + Components status +
+
+ + + + + + + + + +
ComponentStatus
+
+
+
+ + +
+ - + diff --git a/assets/webconfig/content/update.html b/assets/webconfig/content/update.html index 7219a4924..4230455ce 100644 --- a/assets/webconfig/content/update.html +++ b/assets/webconfig/content/update.html @@ -24,13 +24,15 @@

if (callback) { var matches = 0; for (var key in window.gitHubVersionList) { - if ( - window.gitHubVersionList[key].name == null || - window.gitHubVersionList[key].tag_name.includes("rc") || - (window.serverConfig.general.watchedVersionBranch == "Stable" && (window.gitHubVersionList[key].tag_name.includes("beta") || window.gitHubVersionList[key].tag_name.includes("alpha"))) || - (window.serverConfig.general.watchedVersionBranch == "Beta" && window.gitHubVersionList[key].tag_name.includes("alpha")) - ) { + + if (window.gitHubVersionList[key].name == null) continue; + + if (window.gitHubVersionList[key].tag_name.includes("beta") || + window.gitHubVersionList[key].tag_name.includes("alpha")) + { + if (compareHyperHdrVersion(window.currentVersion, window.gitHubVersionList[key].tag_name)) + continue; } var danger; diff --git a/assets/webconfig/i18n/en.json b/assets/webconfig/i18n/en.json index b27bcca34..953a77b7b 100644 --- a/assets/webconfig/i18n/en.json +++ b/assets/webconfig/i18n/en.json @@ -1134,5 +1134,15 @@ "benchmark_av_delay" : "Average measured latency:", "benchmark_exp_delay" : "Perfect minimal latency (related to FPS):", "edt_conf_video_cache_title" : "Frames cache", - "edt_conf_video_cache_expl" : "Enable frames caching. Could help for higher resolutions & framerates" + "edt_conf_video_cache_expl" : "Enable frames caching. Could help for higher resolutions & framerates", + "perf_usb_grabber" : "USB grabber", + "perf_usb_instance" : "Instance", + "dashboard_performance_label_title" : "Performance", + "perf_please_wait" : "please wait", + "perf_temperature" : "Temperature", + "perf_undervoltage" : "Undervoltage detected", + "perf_no" : "No", + "perf_decoding_time": "time", + "perf_frames" : "frames", + "perf_invalid_frames" : "invalid frames" } diff --git a/assets/webconfig/index.html b/assets/webconfig/index.html index 6e15a5afe..eac77420d 100644 --- a/assets/webconfig/index.html +++ b/assets/webconfig/index.html @@ -29,9 +29,6 @@ - - - diff --git a/assets/webconfig/js/hyperhdr.js b/assets/webconfig/js/hyperhdr.js index 02512def2..2b3a2d65b 100644 --- a/assets/webconfig/js/hyperhdr.js +++ b/assets/webconfig/js/hyperhdr.js @@ -6,10 +6,6 @@ window.gitHubReleaseApiUrl = "https://api.github.com/repos/awawa-dev/HyperHDR/re window.currentChannel = null; window.currentVersion = null; window.latestVersion = null; -window.latestStableVersion = null; -window.latestBetaVersion = null; -window.latestAlphaVersion = null; -window.latestRcVersion = null; window.gitHubVersionList = null; window.serverInfo = {}; window.serverSchema = {}; @@ -37,16 +33,16 @@ window.currentHyperHdrInstanceName = getInstanceNameByIndex(window.currentHyperH function storageComp() { - if (typeof(Storage) !== "undefined") + if (typeof (Storage) !== "undefined") return true; return false; } function getStorage(item, session) { - if(storageComp()) + if (storageComp()) { - if(session === true) + if (session === true) return sessionStorage.getItem(item); else return localStorage.getItem(item); @@ -56,9 +52,9 @@ function getStorage(item, session) function setStorage(item, value, session) { - if(storageComp()) + if (storageComp()) { - if(session === true) + if (session === true) sessionStorage.setItem(item, value); else localStorage.setItem(item, value); @@ -67,9 +63,9 @@ function setStorage(item, value, session) function removeStorage(item, session) { - if(storageComp()) + if (storageComp()) { - if(session === true) + if (session === true) sessionStorage.removeItem(item); else localStorage.removeItem(item); @@ -79,34 +75,26 @@ function removeStorage(item, session) function getInstanceNameByIndex(index) { var instData = window.serverInfo.instance; - for(var key in instData) + for (var key in instData) { - if(instData[key].instance == index) + if (instData[key].instance == index) return instData[key].friendly_name; } return "unknown"; } -function initRestart() -{ - $(window.hyperhdr).off(); - requestServerConfigReload(); - window.watchdog = 10; - connectionLostDetection('restart'); -} - function connectionLostDetection(type) { - if ( window.watchdog > 2 ) + if (window.watchdog > 2) { - var interval_id = window.setInterval(function(){clearInterval(interval_id);}, 9999); // Get a reference to the last + var interval_id = window.setInterval(function () { clearInterval(interval_id); }, 9999); // Get a reference to the last for (var i = 1; i < interval_id; i++) window.clearInterval(i); - if(type == 'restart') + if (type == 'restart') { $("body").html($("#container_restart").html()); // setTimeout delay for probably slower systems, some browser don't execute THIS action - setTimeout(restartAction,250); + setTimeout(restartAction, 250); } else { @@ -116,7 +104,7 @@ function connectionLostDetection(type) } else { - $.get( "/cgi/cfg_jsonserver", function() {window.watchdog=0}).fail(function() {window.watchdog++;}); + $.get("/cgi/cfg_jsonserver", function () { window.watchdog = 0 }).fail(function () { window.watchdog++; }); } } @@ -131,34 +119,37 @@ function initWebSocket() if (window.websocket == null) { window.jsonPort = ''; - if(document.location.port == '' && document.location.protocol == "http:") + if (document.location.port == '' && document.location.protocol == "http:") window.jsonPort = '80'; else if (document.location.port == '' && document.location.protocol == "https:") window.jsonPort = '443'; else - window.jsonPort = document.location.port; - + window.jsonPort = document.location.port; + try { - window.websocket = (document.location.protocol == "https:") ? new WebSocket('wss://'+document.location.hostname+":"+window.jsonPort) : new WebSocket('ws://'+document.location.hostname+":"+window.jsonPort); + window.websocket = (document.location.protocol == "https:") ? new WebSocket('wss://' + document.location.hostname + ":" + window.jsonPort) : new WebSocket('ws://' + document.location.hostname + ":" + window.jsonPort); } - catch(error) + catch (error) { alert("Connection to websocket failed. Please open this page in a new page/tab in your browser or use secure port 8092 (for example https://localhost:8092)."); } - window.websocket.onopen = function (event) { - $(window.hyperhdr).trigger({type:"open"}); + window.websocket.onopen = function (event) + { + $(window.hyperhdr).trigger({ type: "open" }); - $(window.hyperhdr).on("cmd-serverinfo", function(event) { + $(window.hyperhdr).on("cmd-serverinfo", function (event) + { window.watchdog = 0; }); }; - window.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) + switch (event.code) { case 1000: reason = "Normal closure, meaning that the purpose for which the connection was established has been fulfilled."; break; case 1001: reason = "An endpoint is \"going away\", such as a server going down or a browser having navigated away from a page."; break; @@ -175,42 +166,45 @@ 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"; } - $(window.hyperhdr).trigger({type:"close", reason:reason}); + $(window.hyperhdr).trigger({ type: "close", reason: reason }); window.watchdog = 10; connectionLostDetection(); }; - window.websocket.onmessage = function (event) { + window.websocket.onmessage = function (event) + { try { var response = JSON.parse(event.data); var success = response.success; var cmd = response.command; var tan = response.tan; - if (success || typeof(success) == "undefined") + if (success || typeof (success) == "undefined") { - $(window.hyperhdr).trigger({type:"cmd-"+cmd, response:response}); + $(window.hyperhdr).trigger({ type: "cmd-" + cmd, response: response }); } else { - // skip tan -1 error handling - if(tan != -1){ - var error = response.hasOwnProperty("error")? response.error : "unknown"; - $(window.hyperhdr).trigger({type:"error",reason:error}); - console.log("[window.websocket::onmessage] ",error); - } + // skip tan -1 error handling + if (tan != -1) + { + var error = response.hasOwnProperty("error") ? response.error : "unknown"; + $(window.hyperhdr).trigger({ type: "error", reason: error }); + console.log("[window.websocket::onmessage] ", error); + } } } - catch(exception_error) + catch (exception_error) { - $(window.hyperhdr).trigger({type:"error",reason:exception_error}); - console.log("[window.websocket::onmessage] ",exception_error); + $(window.hyperhdr).trigger({ type: "error", reason: exception_error }); + console.log("[window.websocket::onmessage] ", exception_error); } }; - window.websocket.onerror = function (error) { - $(window.hyperhdr).trigger({type:"error",reason:error}); - console.log("[window.websocket::onerror] ",error); + window.websocket.onerror = function (error) + { + $(window.hyperhdr).trigger({ type: "error", reason: error }); + console.log("[window.websocket::onerror] ", error); }; } } @@ -225,16 +219,16 @@ function initWebSocket() function sendToHyperhdr(command, subcommand, msg) { if (typeof subcommand != 'undefined' && subcommand.length > 0) - subcommand = ',"subcommand":"'+subcommand+'"'; + subcommand = ',"subcommand":"' + subcommand + '"'; else subcommand = ""; if (typeof msg != 'undefined' && msg.length > 0) - msg = ","+msg; + msg = "," + msg; else msg = ""; - window.websocket.send('{"command":"'+command+'", "tan":'+window.wsTan+subcommand+msg+'}'); + window.websocket.send('{"command":"' + command + '", "tan":' + window.wsTan + subcommand + msg + '}'); } // Send a json message to Hyperhdr and wait for a matching response @@ -244,19 +238,20 @@ function sendToHyperhdr(command, subcommand, msg) // data: The json data as Object // tan: The optional tan, default 1. If the tan is -1, we skip global response error handling // Returns data of response or false if timeout -async function sendAsyncToHyperhdr (command, subcommand, data, tan = 1) { +async function sendAsyncToHyperhdr(command, subcommand, data, tan = 1) +{ let obj = { command, tan }; - + if (subcommand) { - Object.assign(obj, {subcommand}); + Object.assign(obj, { subcommand }); } - + if (data) { Object.assign(obj, data); } - + //if (process.env.DEV || sstore.getters['common/getDebugState']) console.log('SENDAS', obj) return __sendAsync(obj); } @@ -264,38 +259,41 @@ async function sendAsyncToHyperhdr (command, subcommand, data, tan = 1) { // Send a json message to Hyperhdr and wait for a matching response // A response matches, when command(+subcommand) of request and response is the same // Returns data of response or false if timeout -async function __sendAsync (data) { - return new Promise((resolve, reject) => { +async function __sendAsync(data) +{ + return new Promise((resolve, reject) => + { let cmd = data.command; let subc = data.subcommand; let tan = data.tan; - + if (subc) - cmd = `${cmd}-${subc}`; + cmd = `${cmd}-${subc}`; - let func = (e) => { + let func = (e) => + { let rdata; - + try { rdata = JSON.parse(e.data); } catch (error) { - console.error("[window.websocket::onmessage] ",error); + console.error("[window.websocket::onmessage] ", error); resolve(false); } - + if (rdata.command == cmd && rdata.tan == tan) { window.websocket.removeEventListener('message', func); resolve(rdata); } }; - + // after 7 sec we resolve false setTimeout(() => { window.websocket.removeEventListener('message', func); resolve(false); }, 7000); - + window.websocket.addEventListener('message', func); window.websocket.send(JSON.stringify(data) + '\n'); }) @@ -307,84 +305,85 @@ async function __sendAsync (data) { // Test if admin requires authentication function requestRequiresAdminAuth() { - sendToHyperhdr("authorize","adminRequired"); + sendToHyperhdr("authorize", "adminRequired"); } // Test if the default password needs to be changed function requestRequiresDefaultPasswortChange() { - sendToHyperhdr("authorize","newPasswordRequired"); + sendToHyperhdr("authorize", "newPasswordRequired"); } // Change password function requestChangePassword(oldPw, newPw) { - sendToHyperhdr("authorize","newPassword",'"password": "'+oldPw+'", "newPassword":"'+newPw+'"'); + sendToHyperhdr("authorize", "newPassword", '"password": "' + oldPw + '", "newPassword":"' + newPw + '"'); } function requestAuthorization(password) { - sendToHyperhdr("authorize","login",'"password": "' + password + '"'); + sendToHyperhdr("authorize", "login", '"password": "' + password + '"'); } function requestTokenAuthorization(token) { - sendToHyperhdr("authorize","login",'"token": "' + token + '"'); + sendToHyperhdr("authorize", "login", '"token": "' + token + '"'); } function requestToken(comment) { - sendToHyperhdr("authorize","createToken",'"comment": "'+comment+'"'); + sendToHyperhdr("authorize", "createToken", '"comment": "' + comment + '"'); } function requestTokenInfo() { - sendToHyperhdr("authorize","getTokenList",""); + sendToHyperhdr("authorize", "getTokenList", ""); } -function requestGetPendingTokenRequests (id, state) { +function requestGetPendingTokenRequests(id, state) +{ sendToHyperhdr("authorize", "getPendingTokenRequests", ""); } function requestHandleTokenRequest(id, state) { - sendToHyperhdr("authorize","answerRequest",'"id":"'+id+'", "accept":'+state); + sendToHyperhdr("authorize", "answerRequest", '"id":"' + id + '", "accept":' + state); } function requestTokenDelete(id) { - sendToHyperhdr("authorize","deleteToken",'"id":"'+id+'"'); + sendToHyperhdr("authorize", "deleteToken", '"id":"' + id + '"'); } function requestInstanceRename(inst, name) { - sendToHyperhdr("instance", "saveName",'"instance": '+inst+', "name": "'+name+'"'); + sendToHyperhdr("instance", "saveName", '"instance": ' + inst + ', "name": "' + name + '"'); } function requestInstanceStartStop(inst, start) { - if(start) - sendToHyperhdr("instance","startInstance",'"instance": '+inst); + if (start) + sendToHyperhdr("instance", "startInstance", '"instance": ' + inst); else - sendToHyperhdr("instance","stopInstance",'"instance": '+inst); + sendToHyperhdr("instance", "stopInstance", '"instance": ' + inst); } function requestInstanceDelete(inst) { - sendToHyperhdr("instance","deleteInstance",'"instance": '+inst); + sendToHyperhdr("instance", "deleteInstance", '"instance": ' + inst); } function requestInstanceCreate(name) { - sendToHyperhdr("instance","createInstance",'"name": "'+name+'"'); + sendToHyperhdr("instance", "createInstance", '"name": "' + name + '"'); } function requestInstanceSwitch(inst) { - sendToHyperhdr("instance","switchTo",'"instance": '+inst); + sendToHyperhdr("instance", "switchTo", '"instance": ' + inst); } function requestServerInfo() { - sendToHyperhdr("serverinfo","",'"subscribe":["components-update","sessions-update","priorities-update", "imageToLedMapping-update", "adjustment-update", "videomode-update", "videomodehdr-update", "effects-update", "settings-update", "instance-update", "grabberstate-update", "benchmark-update"]'); + sendToHyperhdr("serverinfo", "", '"subscribe":["components-update","sessions-update","priorities-update", "imageToLedMapping-update", "adjustment-update", "videomode-update", "videomodehdr-update", "effects-update", "settings-update", "instance-update", "grabberstate-update", "benchmark-update"]'); } function requestSysInfo() @@ -394,7 +393,7 @@ function requestSysInfo() function requestServerConfigSchema() { - sendToHyperhdr("config","getschema"); + sendToHyperhdr("config", "getschema"); } function requestServerConfig() @@ -402,41 +401,36 @@ function requestServerConfig() sendToHyperhdr("config", "getconfig"); } -function requestServerConfigReload() -{ - sendToHyperhdr("config", "reload"); -} - function requestLedColorsStart() { - window.ledStreamActive=true; + window.ledStreamActive = true; sendToHyperhdr("ledcolors", "ledstream-start"); } function requestLedColorsStop() { - window.ledStreamActive=false; + window.ledStreamActive = false; sendToHyperhdr("ledcolors", "ledstream-stop"); } function requestLedImageStart() { - window.imageStreamActive=true; + window.imageStreamActive = true; sendToHyperhdr("ledcolors", "imagestream-start"); } function requestLedImageStop() { - window.imageStreamActive=false; + window.imageStreamActive = false; sendToHyperhdr("ledcolors", "imagestream-stop"); } function requestPriorityClear(prio) { - if(typeof prio !== 'number') + if (typeof prio !== 'number') prio = window.webPrio; - sendToHyperhdr("clear", "", '"priority":'+prio+''); + sendToHyperhdr("clear", "", '"priority":' + prio + ''); } function requestClearAll() @@ -446,83 +440,92 @@ function requestClearAll() function requestPlayEffect(effectName, duration) { - sendToHyperhdr("effect", "", '"effect":{"name":"'+effectName+'"},"priority":'+window.webPrio+',"duration":'+validateDuration(duration)+',"origin":"'+window.webOrigin+'"'); + sendToHyperhdr("effect", "", '"effect":{"name":"' + effectName + '"},"priority":' + window.webPrio + ',"duration":' + validateDuration(duration) + ',"origin":"' + window.webOrigin + '"'); } -function requestSetColor(r,g,b,duration) +function requestSetColor(r, g, b, duration) { - sendToHyperhdr("color", "", '"color":['+r+','+g+','+b+'], "priority":'+window.webPrio+',"duration":'+validateDuration(duration)+',"origin":"'+window.webOrigin+'"'); + sendToHyperhdr("color", "", '"color":[' + r + ',' + g + ',' + b + '], "priority":' + window.webPrio + ',"duration":' + validateDuration(duration) + ',"origin":"' + window.webOrigin + '"'); } -function requestSetImage(data,duration,name) +function requestSetImage(data, duration, name) { - sendToHyperhdr("image", "", '"imagedata":"'+data+'", "priority":'+window.webPrio+',"duration":'+validateDuration(duration)+', "format":"auto", "origin":"'+window.webOrigin+'", "name":"'+name+'"'); + sendToHyperhdr("image", "", '"imagedata":"' + data + '", "priority":' + window.webPrio + ',"duration":' + validateDuration(duration) + ', "format":"auto", "origin":"' + window.webOrigin + '", "name":"' + name + '"'); } function requestSetComponentState(comp, state) { var state_str = state ? "true" : "false"; - sendToHyperhdr("componentstate", "", '"componentstate":{"component":"'+comp+'","state":'+state_str+'}'); + sendToHyperhdr("componentstate", "", '"componentstate":{"component":"' + comp + '","state":' + state_str + '}'); } function requestSetSource(prio) { - if ( prio == "auto" ) + if (prio == "auto") sendToHyperhdr("sourceselect", "", '"auto":true'); else - sendToHyperhdr("sourceselect", "", '"priority":'+prio); + sendToHyperhdr("sourceselect", "", '"priority":' + prio); } function requestWriteConfig(config, full) { - if(full === true) + if (full === true) window.serverConfig = config; else { - jQuery.each(config, function(i, val) { + jQuery.each(config, function (i, val) + { window.serverConfig[i] = val; }); } - sendToHyperhdr("config","setconfig", '"config":'+JSON.stringify(window.serverConfig)); + sendToHyperhdr("config", "setconfig", '"config":' + JSON.stringify(window.serverConfig)); } -function requestWriteEffect(effectName,effectPy,effectArgs,data) +function requestWriteEffect(effectName, effectPy, effectArgs, data) { var cutArgs = effectArgs.slice(1, -1); - sendToHyperhdr("create-effect", "", '"name":"'+effectName+'", "script":"'+effectPy+'", '+cutArgs+',"imageData":"'+data+'"'); + sendToHyperhdr("create-effect", "", '"name":"' + effectName + '", "script":"' + effectPy + '", ' + cutArgs + ',"imageData":"' + data + '"'); } -function requestTestEffect(effectName,effectPy,effectArgs,data) +function requestTestEffect(effectName, effectPy, effectArgs, data) { - sendToHyperhdr("effect", "", '"effect":{"name":"'+effectName+'", "args":'+effectArgs+'}, "priority":'+window.webPrio+', "origin":"'+window.webOrigin+'", "pythonScript":"'+effectPy+'", "imageData":"'+data+'"'); + sendToHyperhdr("effect", "", '"effect":{"name":"' + effectName + '", "args":' + effectArgs + '}, "priority":' + window.webPrio + ', "origin":"' + window.webOrigin + '", "pythonScript":"' + effectPy + '", "imageData":"' + data + '"'); } function requestDeleteEffect(effectName) { - sendToHyperhdr("delete-effect", "", '"name":"'+effectName+'"'); + sendToHyperhdr("delete-effect", "", '"name":"' + effectName + '"'); } function requestLoggingStart() { - window.loggingStreamActive=true; + window.loggingStreamActive = true; sendToHyperhdr("logging", "start"); } function requestLoggingStop() { - window.loggingStreamActive=false; + window.loggingStreamActive = false; sendToHyperhdr("logging", "stop"); } function requestMappingType(type) { - sendToHyperhdr("processing", "", '"mappingType": "'+type+'"'); + sendToHyperhdr("processing", "", '"mappingType": "' + type + '"'); } function requestVideoMode(newMode) { - sendToHyperhdr("videomode", "", '"videoMode": "'+newMode+'"'); + sendToHyperhdr("videomode", "", '"videoMode": "' + newMode + '"'); +} + +function requestPerformanceCounter(allCounter) +{ + if (allCounter) + sendToHyperhdr("performance-counters", "all", ""); + else + sendToHyperhdr("performance-counters", "resources", ""); } function requestCalibrationStart() @@ -542,23 +545,23 @@ async function requestCalibrationData() function requestVideoModeHdr(newMode) { - sendToHyperhdr("videomodehdr", "", '"HDR": '+newMode+''); + sendToHyperhdr("videomodehdr", "", '"HDR": ' + newMode + ''); } function requestAdjustment(type, value, complete) { - if(complete === true) - sendToHyperhdr("adjustment", "", '"adjustment": '+type+''); + if (complete === true) + sendToHyperhdr("adjustment", "", '"adjustment": ' + type + ''); else - sendToHyperhdr("adjustment", "", '"adjustment": {"'+type+'": '+value+'}'); + sendToHyperhdr("adjustment", "", '"adjustment": {"' + type + '": ' + value + '}'); } async function requestLedDeviceDiscovery(type, params) { let data = { ledDeviceType: type, params: params }; - return sendAsyncToHyperhdr("leddevice", "discover", data, Math.floor(Math.random() * 1000) ); + return sendAsyncToHyperhdr("leddevice", "discover", data, Math.floor(Math.random() * 1000)); } async function requestLedDeviceProperties(type, params) @@ -570,7 +573,7 @@ async function requestLedDeviceProperties(type, params) function requestLedDeviceIdentification(type, params) { - sendToHyperhdr("leddevice", "identify", '"ledDeviceType": "'+type+'","params": '+JSON.stringify(params)+''); + sendToHyperhdr("leddevice", "identify", '"ledDeviceType": "' + type + '","params": ' + JSON.stringify(params) + ''); } async function requestGetDB() @@ -579,11 +582,11 @@ async function requestGetDB() } function requestRestoreDB(backupData) -{ - sendToHyperhdr("load-db","", '"config":'+JSON.stringify(backupData)); +{ + sendToHyperhdr("load-db", "", '"config":' + JSON.stringify(backupData)); } function requestBenchmark(mode, status) { - sendToHyperhdr("benchmark", mode, '"status": '+status); -} \ No newline at end of file + sendToHyperhdr("benchmark", mode, '"status": ' + status); +} diff --git a/assets/webconfig/js/lib/semver.js b/assets/webconfig/js/lib/semver.js deleted file mode 100644 index ea42455be..000000000 --- a/assets/webconfig/js/lib/semver.js +++ /dev/null @@ -1,350 +0,0 @@ -(function webpackUniversalModuleDefinition(root, factory) { - if(typeof exports === 'object' && typeof module === 'object') - module.exports = factory(); - else if(typeof define === 'function' && define.amd) - define([], factory); - else if(typeof exports === 'object') - exports["semverLite"] = factory(); - else - root["semverLite"] = factory(); -})(this, function() { -return /******/ (function(modules) { // webpackBootstrap -/******/ // The module cache -/******/ var installedModules = {}; -/******/ -/******/ // The require function -/******/ function __webpack_require__(moduleId) { -/******/ -/******/ // Check if module is in cache -/******/ if(installedModules[moduleId]) { -/******/ return installedModules[moduleId].exports; -/******/ } -/******/ // Create a new module (and put it into the cache) -/******/ var module = installedModules[moduleId] = { -/******/ i: moduleId, -/******/ l: false, -/******/ exports: {} -/******/ }; -/******/ -/******/ // Execute the module function -/******/ modules[moduleId].call(module.exports, module, module.exports, __webpack_require__); -/******/ -/******/ // Flag the module as loaded -/******/ module.l = true; -/******/ -/******/ // Return the exports of the module -/******/ return module.exports; -/******/ } -/******/ -/******/ -/******/ // expose the modules object (__webpack_modules__) -/******/ __webpack_require__.m = modules; -/******/ -/******/ // expose the module cache -/******/ __webpack_require__.c = installedModules; -/******/ -/******/ // define getter function for harmony exports -/******/ __webpack_require__.d = function(exports, name, getter) { -/******/ if(!__webpack_require__.o(exports, name)) { -/******/ Object.defineProperty(exports, name, { -/******/ configurable: false, -/******/ enumerable: true, -/******/ get: getter -/******/ }); -/******/ } -/******/ }; -/******/ -/******/ // getDefaultExport function for compatibility with non-harmony modules -/******/ __webpack_require__.n = function(module) { -/******/ var getter = module && module.__esModule ? -/******/ function getDefault() { return module['default']; } : -/******/ function getModuleExports() { return module; }; -/******/ __webpack_require__.d(getter, 'a', getter); -/******/ return getter; -/******/ }; -/******/ -/******/ // Object.prototype.hasOwnProperty.call -/******/ __webpack_require__.o = function(object, property) { return Object.prototype.hasOwnProperty.call(object, property); }; -/******/ -/******/ // __webpack_public_path__ -/******/ __webpack_require__.p = ""; -/******/ -/******/ // Load entry module and return exports -/******/ return __webpack_require__(__webpack_require__.s = 0); -/******/ }) -/************************************************************************/ -/******/ ([ -/* 0 */ -/***/ (function(module, exports, __webpack_require__) { - -"use strict"; - - -var SemverVersion = __webpack_require__(1); - -var semver = { - version: '0.0.5', - SemverVersion: SemverVersion, - validate: function validate(version) { - return SemverVersion.validate(version); - }, - compare: function compare(a, b, needCompareBuildVersion) { - return new SemverVersion(a).compare(new SemverVersion(b), needCompareBuildVersion); - }, - format: function format(version) { - return new SemverVersion(version).format(); - }, - instance: function instance(version) { - return new SemverVersion(version); - }, - compareMainVersion: function compareMainVersion(a, b) { - return new SemverVersion(a).compareMainVersion(new SemverVersion(b)); - }, - gt: function gt(a, b, needCompareBuildVersion) { - var result = this.compare(a, b, needCompareBuildVersion); - return result === 1; - }, - gte: function gte(a, b, needCompareBuildVersion) { - var result = this.compare(a, b, needCompareBuildVersion); - return result === 1 || result === 0; - }, - lt: function lt(a, b, needCompareBuildVersion) { - var result = this.compare(a, b, needCompareBuildVersion); - return result === -1; - }, - lte: function lte(a, b, needCompareBuildVersion) { - var result = this.compare(a, b, needCompareBuildVersion); - return result === -1 || result === 0; - }, - equal: function equal(a, b, needCompareBuildVersion) { - var result = this.compare(a, b, needCompareBuildVersion); - return result === 0; - }, - equalMain: function equalMain(a, b) { - return new SemverVersion(a).mainVersion === new SemverVersion(b).mainVersion; - }, - - // 主版本转成数字类型方便比较 - mainVersionToNumeric: function mainVersionToNumeric(version) { - var digit = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 6; - - var semverVersion = new SemverVersion(version); - return semverVersion.mainVersionToNumeric(digit); - } -}; - -module.exports = semver; - -/***/ }), -/* 1 */ -/***/ (function(module, exports, __webpack_require__) { - -"use strict"; - - -var _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }(); - -function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } } - -var MAX_LENGTH = 256; -var MAX_SAFE_INTEGER = Number.MAX_SAFE_INTEGER || 9007199254740991; - -// 正则标识 -// 数字,禁止纯数字补 0 -var NUMERIC_IDENTIFIER = '0|[1-9]\\d*'; -// 数字,字母,横线 -var NUMERIC_LETTERS_IDENTIFIER = '[0-9A-Za-z-]*'; -var BUILD_IDENTIFIER = '[0-9A-Za-z-]+'; -// 数字和字母组合,达到禁止纯数字补0的目的 -var NON_NUMERIC_IDENTIFIER = '\\d*[a-zA-Z-][a-zA-Z0-9-]*'; -var MAIN_VERSION_IDENTIFIER = '(' + NUMERIC_IDENTIFIER + ')\\.(' + NUMERIC_IDENTIFIER + ')\\.(' + NUMERIC_IDENTIFIER + ')'; -// 先行版本号,由 ASCII 码的英数字和连接号 [0-9A-Za-z-] 组成, -// 且“禁止 MUST NOT ”留白。数字型的标识符号“禁止 MUST NOT ”在前方补零 -var PRERELEASE_IDENTIFIER = '(?:' + NUMERIC_IDENTIFIER + '|' + NON_NUMERIC_IDENTIFIER + ')'; -var PRERELEASE = '(?:\\.(' + PRERELEASE_IDENTIFIER + '(?:\\.' + PRERELEASE_IDENTIFIER + ')*))'; -// 编译版本号 -var BUILD = '(?:\\+(' + BUILD_IDENTIFIER + '(?:\\.' + BUILD_IDENTIFIER + ')*))'; -var FULL_VERSION_IDENTIFIER = '^v?' + MAIN_VERSION_IDENTIFIER + PRERELEASE + '?' + BUILD + '?$'; - -// 根据正则标识实例化正则 -var REGEX_MAIN_VERSION = new RegExp(MAIN_VERSION_IDENTIFIER); -var REGEX_FULL_VERSION = new RegExp(FULL_VERSION_IDENTIFIER); -var REGEX_NUMERIC = /^[0-9]+$/; - -var SemverVersion = function () { - function SemverVersion(version) { - _classCallCheck(this, SemverVersion); - - if (version instanceof SemverVersion) { - return version; - } else if (typeof version !== 'string') { - throw new TypeError('Invalid Version: ' + version); - } - - version = version.replace(/[vV]/g, ''); - - if (version.length > MAX_LENGTH) { - throw new TypeError('version is longer than ' + MAX_LENGTH + ' characters'); - } - - if (!(this instanceof SemverVersion)) { - return new SemverVersion(version); - } - - var matches = version.trim().match(REGEX_FULL_VERSION); - - this.rawVersion = version; - this.major = +matches[1]; - this.minor = +matches[2]; - this.patch = +matches[3]; - - this._isThrowVersionNumericError(this.major, 'major'); - this._isThrowVersionNumericError(this.minor, 'minor'); - this._isThrowVersionNumericError(this.patch, 'patch'); - - if (matches[4]) { - this.prereleaseArray = matches[4].split('.').map(function (id) { - if (REGEX_NUMERIC.test(id)) { - var num = +id; - if (num >= 0 && num < MAX_SAFE_INTEGER) { - return num; - } - } - return id; - }); - } else { - this.prereleaseArray = []; - } - - //this.build = matches[5] ? matches[5].split('.') : []; - - this.prerelease = matches[4]; - this.build = matches[5]; - this.mainVersion = [this.major, this.minor, this.patch].join('.'); - this.version = this.mainVersion + (this.prerelease ? '-' + this.prerelease : '') + (this.build ? '+' + this.build : ''); - } - - _createClass(SemverVersion, [{ - key: '_isThrowVersionNumericError', - value: function _isThrowVersionNumericError(versionNumber, versionName) { - if (versionNumber > MAX_SAFE_INTEGER || this.major < 0) { - throw new TypeError('Invalid ' + versionName + ' version'); - } - } - }, { - key: '_isNumeric', - value: function _isNumeric(numeric) { - return REGEX_NUMERIC.test(numeric); - } - }, { - key: '_padNumber', - value: function _padNumber(num, fill) { - var length = ('' + num).length; - return Array(fill > length ? fill - length + 1 || 0 : 0).join(0) + num; - } - }, { - key: 'mainVersionToNumeric', - value: function mainVersionToNumeric(digit) { - var numericStr = [this._padNumber(this.major, digit), this._padNumber(this.minor, digit), this._padNumber(this.patch, digit)].join(''); - return parseInt(numericStr); - } - }, { - key: 'compare', - value: function compare(other) { - var needCompareBuildVersion = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : false; - - var otherSemver = other; - if (!(other instanceof SemverVersion)) { - otherSemver = new SemverVersion(other); - } - var result = this.compareMainVersion(otherSemver) || this.comparePreReleaseVersion(otherSemver); - if (!result && needCompareBuildVersion) { - return this.compareBuildVersion(otherSemver); - } else { - return result; - } - } - - // 比较数字 - - }, { - key: 'compareNumeric', - value: function compareNumeric(a, b) { - return a > b ? 1 : a < b ? -1 : 0; - } - }, { - key: 'compareIdentifiers', - value: function compareIdentifiers(a, b) { - var aIsNumeric = this._isNumeric(a); - var bIsNumeric = this._isNumeric(b); - if (aIsNumeric && bIsNumeric) { - a = +a; - b = +b; - } - // 字符比数字大 - if (aIsNumeric && !bIsNumeric) { - return -1; - } else if (bIsNumeric && !aIsNumeric) { - return 1; - } else { - return this.compareNumeric(a, b); - } - } - }, { - key: 'compareMainVersion', - value: function compareMainVersion(otherSemver) { - return this.compareNumeric(this.major, otherSemver.major) || this.compareNumeric(this.minor, otherSemver.minor) || this.compareNumeric(this.patch, otherSemver.patch); - } - }, { - key: 'comparePreReleaseVersion', - value: function comparePreReleaseVersion(otherSemver) { - if (this.prereleaseArray.length && !otherSemver.prereleaseArray.length) { - return -1; - } else if (!this.prereleaseArray.length && otherSemver.prereleaseArray.length) { - return 1; - } else if (!this.prereleaseArray.length && !otherSemver.prereleaseArray.length) { - return 0; - } - var i = 0; - do { - var a = this.prereleaseArray[i]; - var b = otherSemver.prereleaseArray[i]; - if (a === undefined && b === undefined) { - return 0; - } else if (b === undefined) { - return 1; - } else if (a === undefined) { - return -1; - } else if (a === b) { - continue; - } else { - return this.compareIdentifiers(a, b); - } - } while (++i); - } - }, { - key: 'compareBuildVersion', - value: function compareBuildVersion(otherSemver) { - if (this.build && !otherSemver.build) { - return 1; - } else if (!this.build && otherSemver.build) { - return -1; - } else { - return this.compareIdentifiers(this.build, otherSemver.build); - } - } - }], [{ - key: 'validate', - value: function validate(version) { - return REGEX_FULL_VERSION.test(version); - } - }]); - - return SemverVersion; -}(); - -module.exports = SemverVersion; - -/***/ }) -/******/ ]); -}); \ No newline at end of file diff --git a/assets/webconfig/js/overview.js b/assets/webconfig/js/overview.js index f1752b06f..4858bb987 100644 --- a/assets/webconfig/js/overview.js +++ b/assets/webconfig/js/overview.js @@ -1,29 +1,284 @@ -$(document).ready( function() { +if (perfTimer == undefined || perfTimer == null) +{ + var perfTimer = setInterval(function () + { + let counters = document.getElementsByClassName("perf_counter"); + if (counters != null && counters.length > 0) + { + for (let i = 0; i < counters.length; i++) + { + let pElem = counters[i].innerHTML; + pElem = pElem.substring(1, pElem.length - 1); + if (!isNaN(pElem)) + { + counters[i].innerHTML = `(${Math.max(Number(pElem) - 1, 0)})`; + } + } + } + else + { + clearInterval(perfTimer); + perfTimer = null; + } + }, 1000); +} + +if (sysPerfTimer == undefined || sysPerfTimer == null) +{ + var sysPerfTimer = setInterval(function () + { + let counters = document.getElementById("performance_counters_card"); + if (counters != null) + { + requestPerformanceCounter(false); + } + else + { + clearInterval(sysPerfTimer); + sysPerfTimer = null; + } + }, 1000); +} + +$(document).ready(function () +{ + let performance = []; + performTranslation(); putInstanceName(document.getElementById("compent_status_header")); - + function updateGrabber() - { + { $("#dash_current_video_device").html(window.serverInfo.grabberstate.device); $("#dash_current_video_mode").html(window.serverInfo.grabberstate.videoMode); } - + + function insertReport(report) + { + let inserted = false; + + for (var i = 0; i < performance.length; i++) + { + if (performance[i].type == report.type && performance[i].id == report.id) + { + if (report.remove == 0) + { + performance[i] = report; + inserted = true; + } + else + { + performance.splice(i, 1); + + if (report.type == 1) + { + document.getElementById("perf_usb_data_holder").innerHTML = ""; + let grabberContainer = document.getElementById("perf_grabber_data"); + if (grabberContainer != null) + { + grabberContainer.classList.add("d-none"); + } + } + else if (report.type == 2 || report.type == 3) + { + let holder = document.getElementById("perf_per_instance_data_row" + report.id); + + if (!(holder === null)) + { + let placer = (report == 2) ? holder.firstElementChild : holder.lastElementChild; + + if (!(placer === null)) + placer.parentNode.removeChild(placer); + + if (holder.childElementCount == 0) + holder.parentNode.removeChild(holder); + } + } + + return; + } + } + } + + if (!inserted && report.remove == 0) + { + performance.push(report); + } + } + + function updatePerformance(report) + { + if (document.getElementById("perf_per_instance_data_row") == null) + return; + + if (report.hasOwnProperty("broadcast")) + { + for (var i = 0; i < report.broadcast.length; i++) + { + insertReport(report.broadcast[i]); + } + } + else + insertReport(report); + + renderReport(); + } + + function renderReport() + { + const waitingSpinner = ' ' + $.i18n("perf_please_wait"); + const fpsTag = 'fps'; + + for (var i = 0; i < performance.length; i++) + { + if (performance[i].hasOwnProperty("rendered")) + continue; + + const curElem = performance[i]; + + curElem.rendered = true; + + if (curElem.type == 1) + { + let render = (curElem.token <= 0) ? waitingSpinner : + `${curElem.param1.toFixed(2)} fps` + + ` ${$.i18n("perf_decoding_time")}: ${curElem.param2}ms, ${$.i18n("perf_frames")}: ${curElem.param3}, ${$.i18n("perf_invalid_frames")}: ${curElem.param4}`; + render += ` (${curElem.refresh})`; + + let content = document.getElementById("perf_usb_data_holder"); + + if (content!=null) + content.innerHTML = render; + + let grabberContainer = document.getElementById("perf_grabber_data"); + if (grabberContainer != null) + { + grabberContainer.classList.remove("d-none"); + } + } + else if (curElem.type == 2 || curElem.type == 3) + { + let idElem = "perf_per_instance_data_row" + curElem.id; + let holder = document.getElementById(idElem); + + if (holder == null) + { + let hook = document.getElementById("perf_per_instance_data_holder"); + if (hook != null) + { + holder = document.getElementById("perf_per_instance_data_row").cloneNode(true); + holder.id = idElem; + holder.classList.add("border-bottom"); + hook.appendChild(holder); + } + } + + if (holder != null) + { + let placer = (curElem.type == 2) ? holder.firstElementChild : holder.lastElementChild; + + if (placer != null) + { + let render = (curElem.token <= 0) ? ((curElem.type == 2) ? `${curElem.name} ` : "") + waitingSpinner : (curElem.type == 2) ? + `${curElem.name} ${curElem.param1.toFixed(2)} fps ${curElem.param2}` : + `${curElem.name} ${curElem.param1.toFixed(2)} fps ${curElem.param3} ${curElem.param2}`; + render += ` (${curElem.refresh})`; + placer.innerHTML = render; + } + } + } + else if (curElem.type == 4) + { + let holderCPU = document.getElementById("perf_cpu_usage"); + if (holderCPU != null) + { + holderCPU.innerHTML = curElem.name; + } + holderCPU = document.getElementById("perf_cell_cpu_usage"); + if (holderCPU != null) + { + holderCPU.classList.remove("d-none"); + } + holderCPU = document.getElementById("perf_cell_hardware"); + if (holderCPU != null) + { + holderCPU.classList.remove("d-none"); + } + } + else if (curElem.type == 5) + { + let holderRAM = document.getElementById("perf_ram_usage"); + if (holderRAM != null) + { + holderRAM.innerHTML = curElem.name; + } + holderRAM = document.getElementById("perf_cell_ram_usage"); + if (holderRAM != null) + { + holderRAM.classList.remove("d-none"); + } + holderRAM = document.getElementById("perf_cell_hardware"); + if (holderRAM != null) + { + holderRAM.classList.remove("d-none"); + } + } + else if (curElem.type == 6) + { + let holderTEMP = document.getElementById("perf_temperature"); + if (holderTEMP != null) + { + holderTEMP.innerHTML = curElem.name + "℃"; + } + holderTEMP = document.getElementById("perf_cell_temperature"); + if (holderTEMP != null) + { + holderTEMP.classList.remove("d-none"); + } + holderTEMP = document.getElementById("perf_cell_linux"); + if (holderTEMP != null) + { + holderTEMP.classList.remove("d-none"); + } + } + else if (curElem.type == 7) + { + let holderVOLTAGE = document.getElementById("perf_undervoltage"); + if (holderVOLTAGE != null) + { + holderVOLTAGE.innerHTML = (curElem.name != "1") ? "" + $.i18n('perf_no') + "" : "" + $.i18n('general_btn_yes') + " "; + } + holderVOLTAGE = document.getElementById("perf_cell_undervoltage"); + if (holderVOLTAGE != null) + { + holderVOLTAGE.classList.remove("d-none"); + } + holderVOLTAGE = document.getElementById("perf_cell_linux"); + if (holderVOLTAGE != null) + { + holderVOLTAGE.classList.remove("d-none"); + } + } + } + } + function updateComponents() { var components = window.comps; var components_html = ""; - for (var idx=0; idx'; + if (components[idx].name != "ALL" && components[idx].name != "GRABBER") + components_html += '' + $.i18n('general_comp_' + components[idx].name) + ''; } $("#tab_components").html(components_html); //info var hyperhdr_enabled = true; - components.forEach( function(obj) { + components.forEach(function (obj) + { if (obj.name == "ALL") { hyperhdr_enabled = obj.enabled @@ -32,8 +287,8 @@ $(document).ready( function() { var instancename = window.currentHyperHdrInstanceName; - $('#dash_statush').html(hyperhdr_enabled ? ''+$.i18n('general_btn_on')+'' : ''+$.i18n('general_btn_off')+''); - $('#btn_hsc').html(hyperhdr_enabled ? '' : ''); + $('#dash_statush').html(hyperhdr_enabled ? '' + $.i18n('general_btn_on') + '' : '' + $.i18n('general_btn_off') + ''); + $('#btn_hsc').html(hyperhdr_enabled ? '' : ''); } // add more info @@ -41,26 +296,26 @@ $(document).ready( function() { $('#dash_currv').html(window.currentVersion); $('#dash_instance').html(window.currentHyperHdrInstanceName); - getReleases(function(callback){ - if(callback) + getReleases(function (callback) + { + if (callback) { $('#dash_latev').html(window.latestVersion.tag_name); - if (semverLite.gt(window.latestVersion.tag_name, window.currentVersion)) - $('#versioninforesult').html(''); + if (compareHyperHdrVersion(window.latestVersion.tag_name, window.currentVersion)) + $('#versioninforesult').html(''); else - $('#versioninforesult').html('
'+$.i18n('dashboard_infobox_message_updatesuccess')+'
'); + $('#versioninforesult').html('
' + $.i18n('dashboard_infobox_message_updatesuccess') + '
'); - } + } }); - //determine platform var html = ""; - + if (window.serverInfo.grabbers != null && window.serverInfo.grabbers != undefined && - window.serverInfo.grabbers.active != null && window.serverInfo.grabbers.active != undefined) + window.serverInfo.grabbers.active != null && window.serverInfo.grabbers.active != undefined) { var grabbers = window.serverInfo.grabbers.active; if (grabbers.indexOf('Media Foundation') > -1) @@ -68,7 +323,7 @@ $(document).ready( function() { else if (grabbers.indexOf('macOS AVF') > -1) html += 'macOS (AVF)'; else if (grabbers.indexOf('V4L2') > -1) - html += 'Linux (V4L2)'; + html += 'Linux (V4L2)'; else html += 'Unknown'; } @@ -83,9 +338,17 @@ $(document).ready( function() { //interval update updateComponents(); updateGrabber(); - - $(window.hyperhdr).on("components-updated",updateComponents); - $(window.hyperhdr).on("grabberstate-update",updateGrabber); + + $(window.hyperhdr).on("components-updated", updateComponents); + $(window.hyperhdr).on("grabberstate-update", updateGrabber); + + sendToHyperhdr("serverinfo", "", '"subscribe":["performance-update"]'); + $(window.hyperhdr).off("cmd-performance-update").on("cmd-performance-update", function (event) + { + updatePerformance(event.response.data); + }); + + requestPerformanceCounter(true); removeOverlay(); }); diff --git a/assets/webconfig/js/remote.js b/assets/webconfig/js/remote.js index 280eab181..d457a9d7b 100644 --- a/assets/webconfig/js/remote.js +++ b/assets/webconfig/js/remote.js @@ -83,28 +83,32 @@ $(document).ready(function() color : window.schema.color.properties.channelAdjustment.items }, true, true); - for(var key in window.schema.color.properties.channelAdjustment.items.properties) + function BindColorCalibration() { - const sourceKey = key; - const sourcePath = 'root.color.'+key; - const selectEditor = editor_color.getEditor(sourcePath); - - if ((selectEditor.path == "root.color.id") || (selectEditor.path == "root.color.leds")) - selectEditor.container.hidden = true; - else - editor_color.watch(sourcePath,() => { - const editor = editor_color.getEditor(sourcePath); - - if (editor.format === "colorpicker") - requestAdjustment(sourceKey, '['+editor.retVal[0]+','+editor.retVal[1]+','+editor.retVal[2]+']'); - else - requestAdjustment(sourceKey, editor.value); - }); + for(var key in window.schema.color.properties.channelAdjustment.items.properties) + { + const sourceKey = key; + const sourcePath = 'root.color.'+key; + const selectEditor = editor_color.getEditor(sourcePath); + + if ((selectEditor.path == "root.color.id") || (selectEditor.path == "root.color.leds")) + selectEditor.container.hidden = true; + else + editor_color.watch(sourcePath,() => { + const editor = editor_color.getEditor(sourcePath); + + if (editor.format === "colorpicker") + requestAdjustment(sourceKey, '['+editor.retVal[0]+','+editor.retVal[1]+','+editor.retVal[2]+']'); + else + requestAdjustment(sourceKey, editor.value); + }); + } } function updateColorAdjustment() { editor_color.getEditor("root.color").setValue(window.serverConfig['color'].channelAdjustment[0]); + BindColorCalibration(); } @@ -315,11 +319,18 @@ $(document).ready(function() // In case Buttons were disabled before, status may be different to component status if (component.enabled != $(`#${comp_btn_id}`).prop("checked")) { + $(`#${comp_btn_id}`).off('change'); + // console.log ("Update status to Checked = ", component.enabled); if (component.enabled) $(`#${comp_btn_id}`).bootstrapToggle("on"); else $(`#${comp_btn_id}`).bootstrapToggle("off"); + + $(`#${comp_btn_id}`).change(e => + { + requestSetComponentState(e.currentTarget.id.split('_').pop(), e.currentTarget.checked); + }); } } } diff --git a/assets/webconfig/js/settings.js b/assets/webconfig/js/settings.js index 47aafa3de..2ddec8bba 100644 --- a/assets/webconfig/js/settings.js +++ b/assets/webconfig/js/settings.js @@ -150,3 +150,79 @@ $(document).ready( function() { }); }); + +function compareHyperHdrVersion(compareA, compareB) +{ + if (compareA.length == 0 || compareB.length == 0) + { + console.log(`Invalid length: A:${compareA.length} B:${compareB.length}`); + return true; + } + + if (isNaN(compareA[0])) + compareA = compareA.substring(1); + if (isNaN(compareB[0])) + compareB = compareB.substring(1); + + if ((compareA.indexOf('alpha') >= 0) && + (compareB.indexOf('alpha') < 0)) + { + return false; + } + + if ((compareB.indexOf('alpha') >= 0) && + (compareA.indexOf('alpha') < 0)) + { + return true; + } + + + var valueA = compareA.split('.'); + var valueB = compareB.split('.'); + + if (valueA.length < 4 || valueB.length < 4) + { + console.log(`Invalid length: A:${valueA.length} B:${valueB.length}`); + return true; + } + + var finalA = ""; + for (var i = 0; i < valueA[3].length; i++) + if (!isNaN(valueA[3][i])) + finalA = finalA.concat(valueA[3][i]); + valueA[3] = finalA; + + var finalB = ""; + for (var i = 0; i < valueB[3].length; i++) + if (!isNaN(valueB[3][i])) + finalB = finalB.concat(valueB[3][i]); + valueB[3] = finalB; + + if ((compareA.indexOf('beta') >= 0 || compareA.indexOf('alpha') >= 0) && + (compareB.indexOf('beta') < 0 && compareB.indexOf('alpha') < 0)) + { + if (Number(valueA[0]) <= Number(valueB[0])) + return false; + } + + if ((compareB.indexOf('beta') >= 0 || compareB.indexOf('alpha') >= 0) && + (compareA.indexOf('beta') < 0 && compareA.indexOf('alpha') < 0)) + { + if (Number(valueA[0]) >= Number(valueB[0])) + return true; + } + + for (var i = 0; i < 4; i++) + { + if (Number(valueA[i]) > Number(valueB[i])) + { + return true; + } + else if (Number(valueA[i]) < Number(valueB[i])) + { + return false; + } + } + + return false; +} diff --git a/assets/webconfig/js/ui_utils.js b/assets/webconfig/js/ui_utils.js index 705b71866..593afe4de 100644 --- a/assets/webconfig/js/ui_utils.js +++ b/assets/webconfig/js/ui_utils.js @@ -1030,69 +1030,24 @@ function getReleases(callback) success: function(releases) { window.gitHubVersionList = releases; + var highestRelease = { - tag_name: '0.0.0' - }; - var highestAlphaRelease = { - tag_name: '0.0.0' - }; - var highestBetaRelease = { - tag_name: '0.0.0' - }; - var highestRcRelease = { - tag_name: '0.0.0' + tag_name: '0.0.0.0' }; for(var i in releases) { - - //drafts will be ignored if(releases[i].draft) continue; - if(releases[i].tag_name.includes('alpha')) - { - if (sem = semverLite.gt(releases[i].tag_name, highestAlphaRelease.tag_name)) - highestAlphaRelease = releases[i]; - } - else if (releases[i].tag_name.includes('beta')) + if(!releases[i].tag_name.includes('alpha') && !releases[i].tag_name.includes('beta')) { - if (sem = semverLite.gt(releases[i].tag_name, highestBetaRelease.tag_name)) - highestBetaRelease = releases[i]; - } - else if (releases[i].tag_name.includes('rc')) - { - if (semverLite.gt(releases[i].tag_name, highestRcRelease.tag_name)) - highestRcRelease = releases[i]; - } - else - { - if (semverLite.gt(releases[i].tag_name, highestRelease.tag_name)) + if (compareHyperHdrVersion(releases[i].tag_name, highestRelease.tag_name)) highestRelease = releases[i]; } } - window.latestStableVersion = highestRelease; - window.latestBetaVersion = highestBetaRelease; - window.latestAlphaVersion= highestAlphaRelease; - window.latestRcVersion = highestRcRelease; - - - if(window.serverConfig.general.watchedVersionBranch == "Beta" && semverLite.gt(highestBetaRelease.tag_name, highestRelease.tag_name)) - window.latestVersion = highestBetaRelease; - else - window.latestVersion = highestRelease; - - if(window.serverConfig.general.watchedVersionBranch == "Alpha" && semverLite.gt(highestAlphaRelease.tag_name, highestBetaRelease.tag_name)) - window.latestVersion = highestAlphaRelease; - - if(window.serverConfig.general.watchedVersionBranch == "Alpha" && semverLite.lt(highestAlphaRelease.tag_name, highestBetaRelease.tag_name)) - window.latestVersion = highestBetaRelease; - //next two if statements are only necessary if we don't have a beta or stable release. We need one alpha release at least - if(window.latestVersion.tag_name == '0.0.0' && highestBetaRelease.tag_name != '0.0.0') - window.latestVersion = highestBetaRelease; + window.latestVersion = highestRelease; - if(window.latestVersion.tag_name == '0.0.0' && highestAlphaRelease.tag_name != '0.0.0') - window.latestVersion = highestAlphaRelease; callback(true); diff --git a/assets/webconfig/js/wizard.js b/assets/webconfig/js/wizard.js index 568e1fb2d..23924298b 100644 --- a/assets/webconfig/js/wizard.js +++ b/assets/webconfig/js/wizard.js @@ -1,153 +1,161 @@ //clear priority and other tasks if people reload the page or lost connection while a wizard was active -$(window.hyperhdr).one("ready", function (event) { - if (getStorage("wizardactive") === 'true') { - requestPriorityClear(); - setStorage("wizardactive", false); - if (getStorage("kodiAddress") != null) { - kodiAddress = getStorage("kodiAddress"); - sendToKodi("stop"); - } - } +$(window.hyperhdr).one("ready", function (event) +{ + if (getStorage("wizardactive") === 'true') + { + requestPriorityClear(); + setStorage("wizardactive", false); + if (getStorage("kodiAddress") != null) + { + kodiAddress = getStorage("kodiAddress"); + sendToKodi("stop"); + } + } }); -function resetWizard(reload) { - $("#wizard_modal").modal('hide'); - clearInterval(wIntveralId); - requestPriorityClear(); - setStorage("wizardactive", false); - $('#wizp1').toggle(true); - $('#wizp2').toggle(false); - $('#wizp3').toggle(false); - //cc - if (withKodi) - sendToKodi("stop"); - step = 0; - if (!reload) location.reload(); +function resetWizard(reload) +{ + $("#wizard_modal").modal('hide'); + clearInterval(wIntveralId); + requestPriorityClear(); + setStorage("wizardactive", false); + $('#wizp1').toggle(true); + $('#wizp2').toggle(false); + $('#wizp3').toggle(false); + //cc + if (withKodi) + sendToKodi("stop"); + step = 0; + if (!reload) location.reload(); } //rgb byte order wizard var wIntveralId; var new_rgb_order; -function changeColor() { - var color = $("#wiz_canv_color").css('background-color'); - - if (color == 'rgb(255, 0, 0)') { - $("#wiz_canv_color").css('background-color', 'rgb(0, 255, 0)'); - requestSetColor('0', '255', '0'); - } - else { - $("#wiz_canv_color").css('background-color', 'rgb(255, 0, 0)'); - requestSetColor('255', '0', '0'); - } +function changeColor() +{ + var color = $("#wiz_canv_color").css('background-color'); + + if (color == 'rgb(255, 0, 0)') + { + $("#wiz_canv_color").css('background-color', 'rgb(0, 255, 0)'); + requestSetColor('0', '255', '0'); + } + else + { + $("#wiz_canv_color").css('background-color', 'rgb(255, 0, 0)'); + requestSetColor('255', '0', '0'); + } } -function startWizardRGB() { - //create html - $('#wiz_header').html('' + $.i18n('wiz_rgb_title')); - $('#wizp1_body').html('

' + $.i18n('wiz_rgb_title') + '

' + $.i18n('wiz_rgb_intro1') + '

' + $.i18n('wiz_rgb_intro2') + '

'); - $('#wizp1_footer').html(''); - $('#wizp2_body').html('

' + $.i18n('wiz_rgb_expl') + '

'); - $('#wizp2_body').append('
' + $.i18n('edt_append_s') + '
'); - $('#wizp2_body').append(''); - $('#wizp2_body').append('
'); - $('#wizp2_footer').html(''); - - //open modal - var ta5 = new bootstrap.Modal($("#wizard_modal"), { - backdrop: "static", - keyboard: false - }); - - ta5.show(); - - //listen for continue - $('#btn_wiz_cont').off().on('click', function () { - beginWizardRGB(); - $('#wizp1').toggle(false); - $('#wizp2').toggle(true); - }); +function startWizardRGB() +{ + //create html + $('#wiz_header').html('' + $.i18n('wiz_rgb_title')); + $('#wizp1_body').html('

' + $.i18n('wiz_rgb_title') + '

' + $.i18n('wiz_rgb_intro1') + '

' + $.i18n('wiz_rgb_intro2') + '

'); + $('#wizp1_footer').html(''); + $('#wizp2_body').html('

' + $.i18n('wiz_rgb_expl') + '

'); + $('#wizp2_body').append('
' + $.i18n('edt_append_s') + '
'); + $('#wizp2_body').append(''); + $('#wizp2_body').append('
'); + $('#wizp2_footer').html(''); + + //open modal + var ta5 = new bootstrap.Modal($("#wizard_modal"), { + backdrop: "static", + keyboard: false + }); + + ta5.show(); + + //listen for continue + $('#btn_wiz_cont').off().on('click', function () + { + beginWizardRGB(); + $('#wizp1').toggle(false); + $('#wizp2').toggle(true); + }); } -function beginWizardRGB() { - $("#wiz_switchtime_select").off().on('change', function () { - clearInterval(wIntveralId); - var time = $("#wiz_switchtime_select").val(); - wIntveralId = setInterval(function () { changeColor(); }, time * 1000); - }); - - $('.wselect').change(function () { - 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, ""); - - for (var i = 0; i < rgb_order.length; i++) { - if (redS == rgb_order[i]) - $('#wiz_g_select option[value=' + rgb_order[i] + ']').attr('disabled', true); - else - $('#wiz_g_select option[value=' + rgb_order[i] + ']').attr('disabled', false); - if (greenS == rgb_order[i]) - $('#wiz_r_select option[value=' + rgb_order[i] + ']').attr('disabled', true); - else - $('#wiz_r_select option[value=' + rgb_order[i] + ']').attr('disabled', false); - } - - if (redS != 'null' && greenS != 'null') { - $('#btn_wiz_save').attr('disabled', false); - - for (var i = 0; i < rgb_order.length; i++) { - if (rgb_order[i] == "r") - rgb_order[i] = redS; - else if (rgb_order[i] == "g") - rgb_order[i] = greenS; - else - rgb_order[i] = blueS; - } - - rgb_order = rgb_order.toString().replace(/,/g, ""); - - if (redS == "r" && greenS == "g") { - $('#btn_wiz_save').toggle(false); - $('#btn_wiz_checkok').toggle(true); - - window.readOnlyMode ? $('#btn_wiz_checkok').attr('disabled', true) : $('#btn_wiz_checkok').attr('disabled', false); - } - else { - $('#btn_wiz_save').toggle(true); - window.readOnlyMode ? $('#btn_wiz_save').attr('disabled', true) : $('#btn_wiz_save').attr('disabled', false); - - $('#btn_wiz_checkok').toggle(false); - } - new_rgb_order = rgb_order; - } - else - $('#btn_wiz_save').attr('disabled', true); - }); - - $("#wiz_switchtime_select").append(createSelOpt('5', '5'), createSelOpt('10', '10'), createSelOpt('15', '15'), createSelOpt('30', '30')); - $("#wiz_switchtime_select").trigger('change'); - - $("#wiz_r_select").append(createSelOpt("null", ""), createSelOpt('r', $.i18n('general_col_red')), createSelOpt('g', $.i18n('general_col_green')), createSelOpt('b', $.i18n('general_col_blue'))); - $("#wiz_g_select").html($("#wiz_r_select").html()); - $("#wiz_r_select").trigger('change'); - - requestSetColor('255', '0', '0'); - setTimeout(requestSetSource, 100, 'auto'); - setStorage("wizardactive", true); - - $('#btn_wiz_abort').off().on('click', function () { resetWizard(true); }); - - $('#btn_wiz_checkok').off().on('click', function () { - showInfoDialog('success', "", $.i18n('infoDialog_wizrgb_text')); - resetWizard(); - }); - - $('#btn_wiz_save').off().on('click', function () { - resetWizard(); - window.serverConfig.device.colorOrder = new_rgb_order; - requestWriteConfig({ "device": window.serverConfig.device }); - }); +function beginWizardRGB() +{ + $("#wiz_switchtime_select").off().on('change', function () + { + clearInterval(wIntveralId); + var time = $("#wiz_switchtime_select").val(); + wIntveralId = setInterval(function () { changeColor(); }, time * 1000); + }); + + $('.wselect').change(function () + { + 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, ""); + + for (var i = 0; i < rgb_order.length; i++) + { + if (redS == rgb_order[i]) + $('#wiz_g_select option[value=' + rgb_order[i] + ']').attr('disabled', true); + else + $('#wiz_g_select option[value=' + rgb_order[i] + ']').attr('disabled', false); + if (greenS == rgb_order[i]) + $('#wiz_r_select option[value=' + rgb_order[i] + ']').attr('disabled', true); + else + $('#wiz_r_select option[value=' + rgb_order[i] + ']').attr('disabled', false); + } + + if (redS != 'null' && greenS != 'null') + { + $('#btn_wiz_save').attr('disabled', false); + + var final_rgb_order = "rgb"; + new_rgb_order = ""; + for (var i = 0; i < final_rgb_order.length; i++) + { + if (final_rgb_order[i] == "r") + new_rgb_order = new_rgb_order + redS; + else if (final_rgb_order[i] == "g") + new_rgb_order = new_rgb_order + greenS; + else + new_rgb_order = new_rgb_order + blueS; + } + + $('#btn_wiz_save').toggle(true); + window.readOnlyMode ? $('#btn_wiz_save').attr('disabled', true) : $('#btn_wiz_save').attr('disabled', false); + + $('#btn_wiz_checkok').toggle(false); + } + else + $('#btn_wiz_save').attr('disabled', true); + }); + + $("#wiz_switchtime_select").append(createSelOpt('5', '5'), createSelOpt('10', '10'), createSelOpt('15', '15'), createSelOpt('30', '30')); + $("#wiz_switchtime_select").trigger('change'); + + $("#wiz_r_select").append(createSelOpt("null", ""), createSelOpt('r', $.i18n('general_col_red')), createSelOpt('g', $.i18n('general_col_green')), createSelOpt('b', $.i18n('general_col_blue'))); + $("#wiz_g_select").html($("#wiz_r_select").html()); + $("#wiz_r_select").trigger('change'); + + requestSetColor('255', '0', '0'); + setTimeout(requestSetSource, 100, 'auto'); + setStorage("wizardactive", true); + + $('#btn_wiz_abort').off().on('click', function () { resetWizard(true); }); + + $('#btn_wiz_checkok').off().on('click', function () + { + showInfoDialog('success', "", $.i18n('infoDialog_wizrgb_text')); + resetWizard(); + }); + + $('#btn_wiz_save').off().on('click', function () + { + resetWizard(); + window.serverConfig.device.colorOrder = new_rgb_order; + requestWriteConfig({ "device": window.serverConfig.device }); + }); } $('#btn_wizard_byteorder').off().on('click', startWizardRGB); @@ -170,370 +178,431 @@ var vidAddress = "https://sourceforge.net/projects/hyperion-project/files/resour var picnr = 0; var availVideos = ["Sweet_Cocoon", "Caminandes_2_GranDillama", "Caminandes_3_Llamigos"]; -if (getStorage("kodiAddress") != null) { +if (getStorage("kodiAddress") != null) +{ - kodiAddress = getStorage("kodiAddress"); - [kodiHost, kodiPort] = kodiAddress.split(":", 2); + kodiAddress = getStorage("kodiAddress"); + [kodiHost, kodiPort] = kodiAddress.split(":", 2); - // Ensure that Kodi's default REST-API port is not used, as now the Web-Socket port is used - if (kodiPort === "8080") { - kodiAddress = kodiHost; - kodiPort = undefined; - setStorage("kodiAddress", kodiAddress); - } + // Ensure that Kodi's default REST-API port is not used, as now the Web-Socket port is used + if (kodiPort === "8080") + { + kodiAddress = kodiHost; + kodiPort = undefined; + setStorage("kodiAddress", kodiAddress); + } } -function switchPicture(pictures) { - if (typeof pictures[picnr] === 'undefined') - picnr = 0; +function switchPicture(pictures) +{ + if (typeof pictures[picnr] === 'undefined') + picnr = 0; - sendToKodi('playP', pictures[picnr]); - picnr++; + sendToKodi('playP', pictures[picnr]); + picnr++; } -function sendToKodi(type, content, cb) { - var command; - - switch (type) { - case "msg": - command = { "jsonrpc": "2.0", "method": "GUI.ShowNotification", "params": { "title": $.i18n('wiz_cc_title'), "message": content, "image": "info", "displaytime": 5000 }, "id": "1" }; - break; - case "stop": - command = { "jsonrpc": "2.0", "method": "Player.Stop", "params": { "playerid": 2 }, "id": "1" }; - break; - case "playP": - content = imgAddress + content + '.png'; - command = { "jsonrpc": "2.0", "method": "Player.Open", "params": { "item": { "file": content } }, "id": "1" }; - break; - case "playV": - content = vidAddress + content; - command = { "jsonrpc": "2.0", "method": "Player.Open", "params": { "item": { "file": content } }, "id": "1" }; - break; - case "rotate": - command = { "jsonrpc": "2.0", "method": "Player.Rotate", "params": { "playerid": 2 }, "id": "1" }; - break; - default: - if (cb != undefined) { - cb("error"); - } - } - - if ("WebSocket" in window) { - //Add kodi default web-socket port, in case port has been explicitly provided - if (kodiPort == undefined) { - kodiPort = 9090; - } - - var ws = new WebSocket("ws://" + kodiHost + ":" + kodiPort + "/jsonrpc/websocket"); - - ws.onopen = function () { - ws.send(JSON.stringify(command)); - }; - - ws.onmessage = function (evt) { - var response = JSON.parse(evt.data); - - if (cb != undefined) { - if (response.result != undefined) { - if (response.result === "OK") { - cb("success"); - } else { - cb("error"); - } - } - } - }; - - ws.onerror = function (evt) { - if (cb != undefined) { - cb("error"); - } - }; - } - else { - console.log("Kodi Access: WebSocket NOT supported by this browser"); - cb("error"); - } +function sendToKodi(type, content, cb) +{ + var command; + + switch (type) + { + case "msg": + command = { "jsonrpc": "2.0", "method": "GUI.ShowNotification", "params": { "title": $.i18n('wiz_cc_title'), "message": content, "image": "info", "displaytime": 5000 }, "id": "1" }; + break; + case "stop": + command = { "jsonrpc": "2.0", "method": "Player.Stop", "params": { "playerid": 2 }, "id": "1" }; + break; + case "playP": + content = imgAddress + content + '.png'; + command = { "jsonrpc": "2.0", "method": "Player.Open", "params": { "item": { "file": content } }, "id": "1" }; + break; + case "playV": + content = vidAddress + content; + command = { "jsonrpc": "2.0", "method": "Player.Open", "params": { "item": { "file": content } }, "id": "1" }; + break; + case "rotate": + command = { "jsonrpc": "2.0", "method": "Player.Rotate", "params": { "playerid": 2 }, "id": "1" }; + break; + default: + if (cb != undefined) + { + cb("error"); + } + } + + if ("WebSocket" in window) + { + //Add kodi default web-socket port, in case port has been explicitly provided + if (kodiPort == undefined) + { + kodiPort = 9090; + } + + var ws = new WebSocket("ws://" + kodiHost + ":" + kodiPort + "/jsonrpc/websocket"); + + ws.onopen = function () + { + ws.send(JSON.stringify(command)); + }; + + ws.onmessage = function (evt) + { + var response = JSON.parse(evt.data); + + if (cb != undefined) + { + if (response.result != undefined) + { + if (response.result === "OK") + { + cb("success"); + } else + { + cb("error"); + } + } + } + }; + + ws.onerror = function (evt) + { + if (cb != undefined) + { + cb("error"); + } + }; + } + else + { + console.log("Kodi Access: WebSocket NOT supported by this browser"); + cb("error"); + } } -function performAction() { - var h; - - if (step == 1) { - $('#wiz_cc_desc').html($.i18n('wiz_cc_chooseid')); - updateWEditor(["id"]); - $('#btn_wiz_back').attr("disabled", true); - } - else - $('#btn_wiz_back').attr("disabled", false); - - if (step == 2) { - updateWEditor(["white"]); - h = $.i18n('wiz_cc_adjustit', $.i18n('edt_conf_color_white_title')); - if (withKodi) { - h += '
' + $.i18n('wiz_cc_kodishould', $.i18n('edt_conf_color_white_title')); - sendToKodi('playP', "white"); - } - else - h += '
' + $.i18n('wiz_cc_lettvshow', $.i18n('edt_conf_color_white_title')); - $('#wiz_cc_desc').html(h); - } - if (step == 3) { - updateWEditor(["gammaRed", "gammaGreen", "gammaBlue"]); - h = '

' + $.i18n('wiz_cc_adjustgamma') + '

'; - if (withKodi) { - sendToKodi('playP', "HGradient"); - h += ''; - } - else - h += '

' + $.i18n('wiz_cc_lettvshowm', "grey_1, grey_2, grey_3, HGradient, VGradient") + '

'; - $('#wiz_cc_desc').html(h); - $('#wiz_cc_btn_sp').off().on('click', function () { - switchPicture(["VGradient", "grey_1", "grey_2", "grey_3", "HGradient"]); - }); - } - if (step == 4) { - updateWEditor(["red"]); - h = $.i18n('wiz_cc_adjustit', $.i18n('edt_conf_color_red_title')); - if (withKodi) { - h += '
' + $.i18n('wiz_cc_kodishould', $.i18n('edt_conf_color_red_title')); - sendToKodi('playP', "red"); - } - else - h += '
' + $.i18n('wiz_cc_lettvshow', $.i18n('edt_conf_color_red_title')); - $('#wiz_cc_desc').html(h); - } - if (step == 5) { - updateWEditor(["green"]); - h = $.i18n('wiz_cc_adjustit', $.i18n('edt_conf_color_green_title')); - if (withKodi) { - h += '
' + $.i18n('wiz_cc_kodishould', $.i18n('edt_conf_color_green_title')); - sendToKodi('playP', "green"); - } - else - h += '
' + $.i18n('wiz_cc_lettvshow', $.i18n('edt_conf_color_green_title')); - $('#wiz_cc_desc').html(h); - } - if (step == 6) { - updateWEditor(["blue"]); - h = $.i18n('wiz_cc_adjustit', $.i18n('edt_conf_color_blue_title')); - if (withKodi) { - h += '
' + $.i18n('wiz_cc_kodishould', $.i18n('edt_conf_color_blue_title')); - sendToKodi('playP', "blue"); - } - else - h += '
' + $.i18n('wiz_cc_lettvshow', $.i18n('edt_conf_color_blue_title')); - $('#wiz_cc_desc').html(h); - } - if (step == 7) { - updateWEditor(["cyan"]); - h = $.i18n('wiz_cc_adjustit', $.i18n('edt_conf_color_cyan_title')); - if (withKodi) { - h += '
' + $.i18n('wiz_cc_kodishould', $.i18n('edt_conf_color_cyan_title')); - sendToKodi('playP', "cyan"); - } - else - h += '
' + $.i18n('wiz_cc_lettvshow', $.i18n('edt_conf_color_cyan_title')); - $('#wiz_cc_desc').html(h); - } - if (step == 8) { - updateWEditor(["magenta"]); - h = $.i18n('wiz_cc_adjustit', $.i18n('edt_conf_color_magenta_title')); - if (withKodi) { - h += '
' + $.i18n('wiz_cc_kodishould', $.i18n('edt_conf_color_magenta_title')); - sendToKodi('playP', "magenta"); - } - else - h += '
' + $.i18n('wiz_cc_lettvshow', $.i18n('edt_conf_color_magenta_title')); - $('#wiz_cc_desc').html(h); - } - if (step == 9) { - updateWEditor(["yellow"]); - h = $.i18n('wiz_cc_adjustit', $.i18n('edt_conf_color_yellow_title')); - if (withKodi) { - h += '
' + $.i18n('wiz_cc_kodishould', $.i18n('edt_conf_color_yellow_title')); - sendToKodi('playP', "yellow"); - } - else - h += '
' + $.i18n('wiz_cc_lettvshow', $.i18n('edt_conf_color_yellow_title')); - $('#wiz_cc_desc').html(h); - } - if (step == 10) { - updateWEditor(["backlightThreshold", "backlightColored"]); - h = $.i18n('wiz_cc_backlight'); - if (withKodi) { - h += '
' + $.i18n('wiz_cc_kodishould', $.i18n('edt_conf_color_black_title')); - sendToKodi('playP', "black"); - } - else - h += '
' + $.i18n('wiz_cc_lettvshow', $.i18n('edt_conf_color_black_title')); - $('#wiz_cc_desc').html(h); - } - if (step == 11) { - updateWEditor([""], true); - h = '

' + $.i18n('wiz_cc_testintro') + '

'; - if (withKodi) { - h += '

' + $.i18n('wiz_cc_testintrok') + '

'; - sendToKodi('stop'); - for (var i = 0; i < availVideos.length; i++) { - var txt = availVideos[i].replace(/_/g, " "); - h += '
'; - } - h += '
'; - } - else - h += '

' + $.i18n('wiz_cc_testintrowok') + ' ' + $.i18n('wiz_cc_link') + '

'; - h += '

' + $.i18n('wiz_cc_summary') + '

'; - $('#wiz_cc_desc').html(h); - - $('.videobtn').off().on('click', function (e) { - if (e.target.id == "stop") - sendToKodi("stop"); - else - sendToKodi("playV", e.target.id + '.mp4'); - - $(this).attr("disabled", true); - setTimeout(function () { $('.videobtn').attr("disabled", false) }, 10000); - }); - - $('#btn_wiz_next').attr("disabled", true); - $('#btn_wiz_save').toggle(true); - window.readOnlyMode ? $('#btn_wiz_save').attr('disabled', true) : $('#btn_wiz_save').attr('disabled', false); - } - else { - $('#btn_wiz_next').attr("disabled", false); - $('#btn_wiz_save').toggle(false); - } +function performAction() +{ + var h; + + if (step == 1) + { + $('#wiz_cc_desc').html($.i18n('wiz_cc_chooseid')); + updateWEditor(["id"]); + $('#btn_wiz_back').attr("disabled", true); + } + else + $('#btn_wiz_back').attr("disabled", false); + + if (step == 2) + { + updateWEditor(["white"]); + h = $.i18n('wiz_cc_adjustit', $.i18n('edt_conf_color_white_title')); + if (withKodi) + { + h += '
' + $.i18n('wiz_cc_kodishould', $.i18n('edt_conf_color_white_title')); + sendToKodi('playP', "white"); + } + else + h += '
' + $.i18n('wiz_cc_lettvshow', $.i18n('edt_conf_color_white_title')); + $('#wiz_cc_desc').html(h); + } + if (step == 3) + { + updateWEditor(["gammaRed", "gammaGreen", "gammaBlue"]); + h = '

' + $.i18n('wiz_cc_adjustgamma') + '

'; + if (withKodi) + { + sendToKodi('playP', "HGradient"); + h += ''; + } + else + h += '

' + $.i18n('wiz_cc_lettvshowm', "grey_1, grey_2, grey_3, HGradient, VGradient") + '

'; + $('#wiz_cc_desc').html(h); + $('#wiz_cc_btn_sp').off().on('click', function () + { + switchPicture(["VGradient", "grey_1", "grey_2", "grey_3", "HGradient"]); + }); + } + if (step == 4) + { + updateWEditor(["red"]); + h = $.i18n('wiz_cc_adjustit', $.i18n('edt_conf_color_red_title')); + if (withKodi) + { + h += '
' + $.i18n('wiz_cc_kodishould', $.i18n('edt_conf_color_red_title')); + sendToKodi('playP', "red"); + } + else + h += '
' + $.i18n('wiz_cc_lettvshow', $.i18n('edt_conf_color_red_title')); + $('#wiz_cc_desc').html(h); + } + if (step == 5) + { + updateWEditor(["green"]); + h = $.i18n('wiz_cc_adjustit', $.i18n('edt_conf_color_green_title')); + if (withKodi) + { + h += '
' + $.i18n('wiz_cc_kodishould', $.i18n('edt_conf_color_green_title')); + sendToKodi('playP', "green"); + } + else + h += '
' + $.i18n('wiz_cc_lettvshow', $.i18n('edt_conf_color_green_title')); + $('#wiz_cc_desc').html(h); + } + if (step == 6) + { + updateWEditor(["blue"]); + h = $.i18n('wiz_cc_adjustit', $.i18n('edt_conf_color_blue_title')); + if (withKodi) + { + h += '
' + $.i18n('wiz_cc_kodishould', $.i18n('edt_conf_color_blue_title')); + sendToKodi('playP', "blue"); + } + else + h += '
' + $.i18n('wiz_cc_lettvshow', $.i18n('edt_conf_color_blue_title')); + $('#wiz_cc_desc').html(h); + } + if (step == 7) + { + updateWEditor(["cyan"]); + h = $.i18n('wiz_cc_adjustit', $.i18n('edt_conf_color_cyan_title')); + if (withKodi) + { + h += '
' + $.i18n('wiz_cc_kodishould', $.i18n('edt_conf_color_cyan_title')); + sendToKodi('playP', "cyan"); + } + else + h += '
' + $.i18n('wiz_cc_lettvshow', $.i18n('edt_conf_color_cyan_title')); + $('#wiz_cc_desc').html(h); + } + if (step == 8) + { + updateWEditor(["magenta"]); + h = $.i18n('wiz_cc_adjustit', $.i18n('edt_conf_color_magenta_title')); + if (withKodi) + { + h += '
' + $.i18n('wiz_cc_kodishould', $.i18n('edt_conf_color_magenta_title')); + sendToKodi('playP', "magenta"); + } + else + h += '
' + $.i18n('wiz_cc_lettvshow', $.i18n('edt_conf_color_magenta_title')); + $('#wiz_cc_desc').html(h); + } + if (step == 9) + { + updateWEditor(["yellow"]); + h = $.i18n('wiz_cc_adjustit', $.i18n('edt_conf_color_yellow_title')); + if (withKodi) + { + h += '
' + $.i18n('wiz_cc_kodishould', $.i18n('edt_conf_color_yellow_title')); + sendToKodi('playP', "yellow"); + } + else + h += '
' + $.i18n('wiz_cc_lettvshow', $.i18n('edt_conf_color_yellow_title')); + $('#wiz_cc_desc').html(h); + } + if (step == 10) + { + updateWEditor(["backlightThreshold", "backlightColored"]); + h = $.i18n('wiz_cc_backlight'); + if (withKodi) + { + h += '
' + $.i18n('wiz_cc_kodishould', $.i18n('edt_conf_color_black_title')); + sendToKodi('playP', "black"); + } + else + h += '
' + $.i18n('wiz_cc_lettvshow', $.i18n('edt_conf_color_black_title')); + $('#wiz_cc_desc').html(h); + } + if (step == 11) + { + updateWEditor([""], true); + h = '

' + $.i18n('wiz_cc_testintro') + '

'; + if (withKodi) + { + h += '

' + $.i18n('wiz_cc_testintrok') + '

'; + sendToKodi('stop'); + for (var i = 0; i < availVideos.length; i++) + { + var txt = availVideos[i].replace(/_/g, " "); + h += '
'; + } + h += '
'; + } + else + h += '

' + $.i18n('wiz_cc_testintrowok') + ' ' + $.i18n('wiz_cc_link') + '

'; + h += '

' + $.i18n('wiz_cc_summary') + '

'; + $('#wiz_cc_desc').html(h); + + $('.videobtn').off().on('click', function (e) + { + if (e.target.id == "stop") + sendToKodi("stop"); + else + sendToKodi("playV", e.target.id + '.mp4'); + + $(this).attr("disabled", true); + setTimeout(function () { $('.videobtn').attr("disabled", false) }, 10000); + }); + + $('#btn_wiz_next').attr("disabled", true); + $('#btn_wiz_save').toggle(true); + window.readOnlyMode ? $('#btn_wiz_save').attr('disabled', true) : $('#btn_wiz_save').attr('disabled', false); + } + else + { + $('#btn_wiz_next').attr("disabled", false); + $('#btn_wiz_save').toggle(false); + } } -function updateWEditor(el, all) { - for (var key in cobj) { - if (all === true || el[0] == key || el[1] == key || el[2] == key) - $('#editor_container_wiz [data-schemapath*=".' + profile + '.' + key + '"]').toggle(true); - else - $('#editor_container_wiz [data-schemapath*=".' + profile + '.' + key + '"]').toggle(false); - } +function updateWEditor(el, all) +{ + for (var key in cobj) + { + if (all === true || el[0] == key || el[1] == key || el[2] == key) + $('#editor_container_wiz [data-schemapath*=".' + profile + '.' + key + '"]').toggle(true); + else + $('#editor_container_wiz [data-schemapath*=".' + profile + '.' + key + '"]').toggle(false); + } } -function startWizardCC() { - - // Ensure that Kodi's default REST-API port is not used, as now the Web-Socket port is used - [kodiHost, kodiPort] = kodiAddress.split(":", 2); - if (kodiPort === "8080") { - kodiAddress = kodiHost; - kodiPort = undefined; - } - //create html - $('#wiz_header').html('' + $.i18n('wiz_cc_title')); - $('#wizp1_body').html('

' + $.i18n('wiz_cc_title') + '

' + $.i18n('wiz_cc_intro1') + '

'); - $('#wizp1_footer').html(''); - $('#wizp2_body').html('
'); - $('#wizp2_footer').html(''); - - //open modal - var ta6 = new bootstrap.Modal($("#wizard_modal"), { - backdrop: "static", - keyboard: false - }); - - ta6.show(); - - $('#wiz_cc_kodiip').off().on('change', function () { - - kodiAddress = $(this).val().trim(); - $('#wizp1_body').find("kodiAddress").val(kodiAddress); - - $('#kodi_status').html(''); - - // Remove Kodi's default Web-Socket port (9090) from display and ensure Kodi's default REST-API port (8080) is mapped to web-socket port to ease migration - if (kodiAddress !== "") { - [kodiHost, kodiPort] = kodiAddress.split(":", 2); - if (kodiPort === "9090" || kodiPort === "8080") { - kodiAddress = kodiHost; - kodiPort = undefined; - } - sendToKodi("msg", $.i18n('wiz_cc_kodimsg_start'), function (cb) { - if (cb == "error") { - $('#kodi_status').html('

' + $.i18n('wiz_cc_kodidiscon') + '

'); - withKodi = false; - } - else { - setStorage("kodiAddress", kodiAddress); - - $('#kodi_status').html('

' + $.i18n('wiz_cc_kodicon') + '

'); - withKodi = true; - } - - $('#btn_wiz_cont').attr('disabled', false); - }); - } - }); - - //listen for continue - $('#btn_wiz_cont').off().on('click', function () { - beginWizardCC(); - $('#wizp1').toggle(false); - $('#wizp2').toggle(true); - }); - - $('#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); - - //check profile count - if (colorLength.length > 1) { - $('#multi_cali').html('

' + $.i18n('wiz_cc_morethanone') + '

'); - for (var i = 0; i < colorLength.length; i++) - $('#wiz_select').append(createSelOpt(i, i + 1 + ' (' + colorLength[i].id + ')')); - - $('#wiz_select').off().on('change', function () { - profile = $(this).val(); - }); - } - - //prepare editor - wiz_editor = createJsonEditor('editor_container_wiz', { - color: window.schema.color - }, true, true); - - $('#editor_container_wiz h4').toggle(false); - $('#editor_container_wiz .btn-group').toggle(false); - $('#editor_container_wiz [data-schemapath="root.color.imageToLedMappingType"]').toggle(false); - $('#editor_container_wiz [data-schemapath="root.color.sparse_processing"]').toggle(false); - for (var i = 0; i < colorLength.length; i++) - $('#editor_container_wiz [data-schemapath*="root.color.channelAdjustment.' + i + '."]').toggle(false); +function startWizardCC() +{ + + // Ensure that Kodi's default REST-API port is not used, as now the Web-Socket port is used + [kodiHost, kodiPort] = kodiAddress.split(":", 2); + if (kodiPort === "8080") + { + kodiAddress = kodiHost; + kodiPort = undefined; + } + //create html + $('#wiz_header').html('' + $.i18n('wiz_cc_title')); + $('#wizp1_body').html('

' + $.i18n('wiz_cc_title') + '

' + $.i18n('wiz_cc_intro1') + '

'); + $('#wizp1_footer').html(''); + $('#wizp2_body').html('
'); + $('#wizp2_footer').html(''); + + //open modal + var ta6 = new bootstrap.Modal($("#wizard_modal"), { + backdrop: "static", + keyboard: false + }); + + ta6.show(); + + $('#wiz_cc_kodiip').off().on('change', function () + { + + kodiAddress = $(this).val().trim(); + $('#wizp1_body').find("kodiAddress").val(kodiAddress); + + $('#kodi_status').html(''); + + // Remove Kodi's default Web-Socket port (9090) from display and ensure Kodi's default REST-API port (8080) is mapped to web-socket port to ease migration + if (kodiAddress !== "") + { + [kodiHost, kodiPort] = kodiAddress.split(":", 2); + if (kodiPort === "9090" || kodiPort === "8080") + { + kodiAddress = kodiHost; + kodiPort = undefined; + } + sendToKodi("msg", $.i18n('wiz_cc_kodimsg_start'), function (cb) + { + if (cb == "error") + { + $('#kodi_status').html('

' + $.i18n('wiz_cc_kodidiscon') + '

'); + withKodi = false; + } + else + { + setStorage("kodiAddress", kodiAddress); + + $('#kodi_status').html('

' + $.i18n('wiz_cc_kodicon') + '

'); + withKodi = true; + } + + $('#btn_wiz_cont').attr('disabled', false); + }); + } + }); + + //listen for continue + $('#btn_wiz_cont').off().on('click', function () + { + beginWizardCC(); + $('#wizp1').toggle(false); + $('#wizp2').toggle(true); + }); + + $('#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); + + //check profile count + if (colorLength.length > 1) + { + $('#multi_cali').html('

' + $.i18n('wiz_cc_morethanone') + '

'); + for (var i = 0; i < colorLength.length; i++) + $('#wiz_select').append(createSelOpt(i, i + 1 + ' (' + colorLength[i].id + ')')); + + $('#wiz_select').off().on('change', function () + { + profile = $(this).val(); + }); + } + + //prepare editor + wiz_editor = createJsonEditor('editor_container_wiz', { + color: window.schema.color + }, true, true); + + $('#editor_container_wiz h4').toggle(false); + $('#editor_container_wiz .btn-group').toggle(false); + $('#editor_container_wiz [data-schemapath="root.color.imageToLedMappingType"]').toggle(false); + $('#editor_container_wiz [data-schemapath="root.color.sparse_processing"]').toggle(false); + for (var i = 0; i < colorLength.length; i++) + $('#editor_container_wiz [data-schemapath*="root.color.channelAdjustment.' + i + '."]').toggle(false); } -function beginWizardCC() { - $('#btn_wiz_next').off().on('click', function () { - step++; - performAction(); - }); - - $('#btn_wiz_back').off().on('click', function () { - step--; - performAction(); - }); - - $('#btn_wiz_abort').off().on('click', resetWizard); - - $('#btn_wiz_save').off().on('click', function () { - requestWriteConfig(wiz_editor.getValue()); - resetWizard(); - }); - - wiz_editor.on("change", function (e) { - var val = wiz_editor.getEditor('root.color.channelAdjustment.' + profile + '').getValue(); - var temp = JSON.parse(JSON.stringify(val)); - delete temp.leds - requestAdjustment(JSON.stringify(temp), "", true); - }); - - step++ - performAction(); +function beginWizardCC() +{ + $('#btn_wiz_next').off().on('click', function () + { + step++; + performAction(); + }); + + $('#btn_wiz_back').off().on('click', function () + { + step--; + performAction(); + }); + + $('#btn_wiz_abort').off().on('click', resetWizard); + + $('#btn_wiz_save').off().on('click', function () + { + requestWriteConfig(wiz_editor.getValue()); + resetWizard(); + }); + + wiz_editor.on("change", function (e) + { + var val = wiz_editor.getEditor('root.color.channelAdjustment.' + profile + '').getValue(); + var temp = JSON.parse(JSON.stringify(val)); + delete temp.leds + requestAdjustment(JSON.stringify(temp), "", true); + }); + + step++ + performAction(); } $('#btn_wizard_colorcalibration').off().on('click', startWizardCC); @@ -555,99 +624,106 @@ var lightPosRightMiddle = { hmin: 0.85, hmax: 1.0, vmin: 0.25, vmax: 0.75 }; var lightPosRightBottom = { hmin: 0.85, hmax: 1.0, vmin: 0.5, vmax: 1.0 }; var lightPosEntire = { hmin: 0.0, hmax: 1.0, vmin: 0.0, vmax: 1.0 }; -var lightPosBottomLeft14 = { hmin: 0, hmax: 0.25, vmin: 0.85, vmax: 1.0 }; -var lightPosBottomLeft12 = { hmin: 0.25, hmax: 0.5, vmin: 0.85, vmax: 1.0 }; -var lightPosBottomLeft34 = { hmin: 0.5, hmax: 0.75, vmin: 0.85, vmax: 1.0 }; -var lightPosBottomLeft11 = { hmin: 0.75, hmax: 1, vmin: 0.85, vmax: 1.0 }; - -var lightPosBottomLeft112 = { hmin: 0, hmax: 0.5, vmin: 0.85, vmax: 1.0 }; -var lightPosBottomLeft121 = { hmin: 0.5, hmax: 1, vmin: 0.85, vmax: 1.0 }; -var lightPosBottomLeftNewMid = { hmin: 0.25, hmax: 0.75, vmin: 0.85, vmax: 1.0 }; - -var lightPosTopLeft112 = { hmin: 0, hmax: 0.5, vmin: 0, vmax: 0.15 }; -var lightPosTopLeft121 = { hmin: 0.5, hmax: 1, vmin: 0, vmax: 0.15 }; -var lightPosTopLeftNewMid = { hmin: 0.25, hmax: 0.75, vmin: 0, vmax: 0.15 }; - -function assignLightPos(id, pos, name) { - var i = null; - - if (pos === "top") - i = lightPosTop; - else if (pos === "topleft") - i = lightPosTopLeft; - else if (pos === "topright") - i = lightPosTopRight; - else if (pos === "bottom") - i = lightPosBottom; - else if (pos === "bottomleft") - i = lightPosBottomLeft; - else if (pos === "bottomright") - i = lightPosBottomRight; - else if (pos === "left") - i = lightPosLeft; - else if (pos === "lefttop") - i = lightPosLeftTop; - else if (pos === "leftmiddle") - i = lightPosLeftMiddle; - else if (pos === "leftbottom") - i = lightPosLeftBottom; - else if (pos === "right") - i = lightPosRight; - else if (pos === "righttop") - i = lightPosRightTop; - else if (pos === "rightmiddle") - i = lightPosRightMiddle; - else if (pos === "rightbottom") - i = lightPosRightBottom; - else if (pos === "lightPosBottomLeft14") - i = lightPosBottomLeft14; - else if (pos === "lightPosBottomLeft12") - i = lightPosBottomLeft12; - else if (pos === "lightPosBottomLeft34") - i = lightPosBottomLeft34; - else if (pos === "lightPosBottomLeft11") - i = lightPosBottomLeft11; - else if (pos === "lightPosBottomLeft112") - i = lightPosBottomLeft112; - else if (pos === "lightPosBottomLeft121") - i = lightPosBottomLeft121; - else if (pos === "lightPosBottomLeftNewMid") - i = lightPosBottomLeftNewMid; - else if (pos === "lightPosTopLeft112") - i = lightPosTopLeft112; - else if (pos === "lightPosTopLeft121") - i = lightPosTopLeft121; - else if (pos === "lightPosTopLeftNewMid") - i = lightPosTopLeftNewMid; - else - i = lightPosEntire; - - i.name = name; - return i; +var lightPosBottomLeft14 = { hmin: 0, hmax: 0.25, vmin: 0.85, vmax: 1.0 }; +var lightPosBottomLeft12 = { hmin: 0.25, hmax: 0.5, vmin: 0.85, vmax: 1.0 }; +var lightPosBottomLeft34 = { hmin: 0.5, hmax: 0.75, vmin: 0.85, vmax: 1.0 }; +var lightPosBottomLeft11 = { hmin: 0.75, hmax: 1, vmin: 0.85, vmax: 1.0 }; + +var lightPosBottomLeft112 = { hmin: 0, hmax: 0.5, vmin: 0.85, vmax: 1.0 }; +var lightPosBottomLeft121 = { hmin: 0.5, hmax: 1, vmin: 0.85, vmax: 1.0 }; +var lightPosBottomLeftNewMid = { hmin: 0.25, hmax: 0.75, vmin: 0.85, vmax: 1.0 }; + +var lightPosTopLeft112 = { hmin: 0, hmax: 0.5, vmin: 0, vmax: 0.15 }; +var lightPosTopLeft121 = { hmin: 0.5, hmax: 1, vmin: 0, vmax: 0.15 }; +var lightPosTopLeftNewMid = { hmin: 0.25, hmax: 0.75, vmin: 0, vmax: 0.15 }; + +function assignLightPos(id, pos, name) +{ + var i = null; + + if (pos === "top") + i = lightPosTop; + else if (pos === "topleft") + i = lightPosTopLeft; + else if (pos === "topright") + i = lightPosTopRight; + else if (pos === "bottom") + i = lightPosBottom; + else if (pos === "bottomleft") + i = lightPosBottomLeft; + else if (pos === "bottomright") + i = lightPosBottomRight; + else if (pos === "left") + i = lightPosLeft; + else if (pos === "lefttop") + i = lightPosLeftTop; + else if (pos === "leftmiddle") + i = lightPosLeftMiddle; + else if (pos === "leftbottom") + i = lightPosLeftBottom; + else if (pos === "right") + i = lightPosRight; + else if (pos === "righttop") + i = lightPosRightTop; + else if (pos === "rightmiddle") + i = lightPosRightMiddle; + else if (pos === "rightbottom") + i = lightPosRightBottom; + else if (pos === "lightPosBottomLeft14") + i = lightPosBottomLeft14; + else if (pos === "lightPosBottomLeft12") + i = lightPosBottomLeft12; + else if (pos === "lightPosBottomLeft34") + i = lightPosBottomLeft34; + else if (pos === "lightPosBottomLeft11") + i = lightPosBottomLeft11; + else if (pos === "lightPosBottomLeft112") + i = lightPosBottomLeft112; + else if (pos === "lightPosBottomLeft121") + i = lightPosBottomLeft121; + else if (pos === "lightPosBottomLeftNewMid") + i = lightPosBottomLeftNewMid; + else if (pos === "lightPosTopLeft112") + i = lightPosTopLeft112; + else if (pos === "lightPosTopLeft121") + i = lightPosTopLeft121; + else if (pos === "lightPosTopLeftNewMid") + i = lightPosTopLeftNewMid; + else + i = lightPosEntire; + + i.name = name; + return i; } -function getHostInLights(hostname) { - return lights.filter( - function (lights) { - return lights.host === hostname - } - ); +function getHostInLights(hostname) +{ + return lights.filter( + function (lights) + { + return lights.host === hostname + } + ); } -function getIpInLights(ip) { - return lights.filter( - function (lights) { - return lights.ip === ip - } - ); +function getIpInLights(ip) +{ + return lights.filter( + function (lights) + { + return lights.ip === ip + } + ); } -function getIdInLights(id) { - return lights.filter( - function (lights) { - return lights.id === id - } - ); +function getIdInLights(id) +{ + return lights.filter( + function (lights) + { + return lights.id === id + } + ); } //**************************** @@ -663,1223 +739,1395 @@ var groupLights = []; var groupLightsLocations = []; var hueType = "philipshue"; -function startWizardPhilipsHue(e) { - if (typeof e.data.type != "undefined") hueType = e.data.type; - - //create html - - var hue_title = 'wiz_hue_title'; - var hue_intro1 = 'wiz_hue_intro1'; - var hue_intro2 = 'wiz_hue_intro2'; - var hue_desc1 = 'wiz_hue_desc1'; - var hue_create_user = 'wiz_hue_create_user'; - if (hueType == 'philipshueentertainment') { - hue_title = 'wiz_hue_e_title'; - hue_intro1 = 'wiz_hue_e_intro1'; - hue_desc1 = 'wiz_hue_e_desc1'; - hue_create_user = 'wiz_hue_e_create_user'; - } - $('#wiz_header').html('' + $.i18n(hue_title)); - $('#wizp1_body').html('

' + $.i18n(hue_title) + '

' + $.i18n(hue_intro1) + '

' + $.i18n(hue_intro2)); - $('#wizp1_footer').html(''); - $('#wizp2_body').html('
'); - $('#wh_topcontainer').append('

' + $.i18n(hue_desc1) + '

'); - $('#wh_topcontainer').append(); - $('#wh_topcontainer').append(''); - if (hueType == 'philipshue') { - $('#usrcont').append('
'); - } - if (hueType == 'philipshueentertainment') { - $('#usrcont').append('
'); - } - $('#usrcont').append('
'); - if (hueType == 'philipshueentertainment') { - $('#wizp2_body').append(''); - createTableFlex("gidsh", "gidsb", "hue_grp_ids_t"); - $('.gidsh').append(createTableRowFlex([$.i18n('edt_dev_spec_groupId_title'), $.i18n('wiz_hue_e_use_group')], true)); - $('#wizp2_body').append(''); - } - else { - $('#wizp2_body').append(''); - } - createTableFlex("lidsh", "lidsb", "hue_ids_t"); - $('.lidsh').append(createTableRowFlex([$.i18n('edt_dev_spec_lightid_title'), $.i18n('wiz_pos'), $.i18n('wiz_identify')], true)); - $('#wizp2_footer').html(''); - $('#wizp3_body').html('' + $.i18n('wiz_hue_press_link') + '


'); - - //open modal - var phiWiz= new bootstrap.Modal($("#wizard_modal"), { - backdrop: "static", - keyboard: false - }); - - phiWiz.show(); - - //listen for continue - $('#btn_wiz_cont').off().on('click', function () { - beginWizardHue(); - $('#wizp1').toggle(false); - $('#wizp2').toggle(true); - }); +function startWizardPhilipsHue(e) +{ + if (typeof e.data.type != "undefined") hueType = e.data.type; + + //create html + + var hue_title = 'wiz_hue_title'; + var hue_intro1 = 'wiz_hue_intro1'; + var hue_intro2 = 'wiz_hue_intro2'; + var hue_desc1 = 'wiz_hue_desc1'; + var hue_create_user = 'wiz_hue_create_user'; + if (hueType == 'philipshueentertainment') + { + hue_title = 'wiz_hue_e_title'; + hue_intro1 = 'wiz_hue_e_intro1'; + hue_desc1 = 'wiz_hue_e_desc1'; + hue_create_user = 'wiz_hue_e_create_user'; + } + $('#wiz_header').html('' + $.i18n(hue_title)); + $('#wizp1_body').html('

' + $.i18n(hue_title) + '

' + $.i18n(hue_intro1) + '

' + $.i18n(hue_intro2)); + $('#wizp1_footer').html(''); + $('#wizp2_body').html('
'); + $('#wh_topcontainer').append('

' + $.i18n(hue_desc1) + '

'); + $('#wh_topcontainer').append(); + $('#wh_topcontainer').append(''); + if (hueType == 'philipshue') + { + $('#usrcont').append('
'); + } + if (hueType == 'philipshueentertainment') + { + $('#usrcont').append('
'); + } + $('#usrcont').append('
'); + if (hueType == 'philipshueentertainment') + { + $('#wizp2_body').append(''); + createTableFlex("gidsh", "gidsb", "hue_grp_ids_t"); + $('.gidsh').append(createTableRowFlex([$.i18n('edt_dev_spec_groupId_title'), $.i18n('wiz_hue_e_use_group')], true)); + $('#wizp2_body').append(''); + } + else + { + $('#wizp2_body').append(''); + } + createTableFlex("lidsh", "lidsb", "hue_ids_t"); + $('.lidsh').append(createTableRowFlex([$.i18n('edt_dev_spec_lightid_title'), $.i18n('wiz_pos'), $.i18n('wiz_identify')], true)); + $('#wizp2_footer').html(''); + $('#wizp3_body').html('' + $.i18n('wiz_hue_press_link') + '


'); + + //open modal + var phiWiz = new bootstrap.Modal($("#wizard_modal"), { + backdrop: "static", + keyboard: false + }); + + phiWiz.show(); + + //listen for continue + $('#btn_wiz_cont').off().on('click', function () + { + beginWizardHue(); + $('#wizp1').toggle(false); + $('#wizp2').toggle(true); + }); } -function checkHueBridge(cb, hueUser) { - var usr = (typeof hueUser != "undefined") ? hueUser : 'config'; - if (usr == 'config') $('#wiz_hue_discovered').html(""); - $.ajax({ - url: 'http://' + hueIPs[hueIPsinc].internalipaddress + '/api/' + usr, - type: "GET", - dataType: "json", - success: function (json) { - if (json.config) { - cb(true, usr); - } else if (json.name && json.bridgeid && json.modelid) { - $('#wiz_hue_discovered').html("Bridge: " + json.name + ", Modelid: " + json.modelid + ", API-Version: " + json.apiversion); - cb(true); - } else { - cb(false); - } - }, - timeout: 2500 - }).fail(function () { - cb(false); - }); +function checkHueBridge(cb, hueUser) +{ + var usr = (typeof hueUser != "undefined") ? hueUser : 'config'; + if (usr == 'config') $('#wiz_hue_discovered').html(""); + $.ajax({ + url: 'http://' + hueIPs[hueIPsinc].internalipaddress + '/api/' + usr, + type: "GET", + dataType: "json", + success: function (json) + { + if (json.config) + { + cb(true, usr); + } else if (json.name && json.bridgeid && json.modelid) + { + $('#wiz_hue_discovered').html("Bridge: " + json.name + ", Modelid: " + json.modelid + ", API-Version: " + json.apiversion); + cb(true); + } else + { + cb(false); + } + }, + timeout: 2500 + }).fail(function () + { + cb(false); + }); } -function checkBridgeResult(reply, usr) { - if (reply) { - //abort checking, first reachable result is used - $('#wiz_hue_ipstate').html(""); - $('#ip').val(hueIPs[hueIPsinc].internalipaddress) - - //now check hue user on this bridge - $('#usrcont').toggle(true); - checkHueBridge(checkUserResult, $('#user').val() ? $('#user').val() : "newdeveloper"); - } - else { - //increment and check again - if (hueIPs.length - 1 > hueIPsinc) { - hueIPsinc++; - checkHueBridge(checkBridgeResult); - } - else { - $('#usrcont').toggle(false); - $('#wiz_hue_ipstate').html($.i18n('wiz_hue_failure_ip')); - } - } +function checkBridgeResult(reply, usr) +{ + if (reply) + { + //abort checking, first reachable result is used + $('#wiz_hue_ipstate').html(""); + $('#ip').val(hueIPs[hueIPsinc].internalipaddress) + + //now check hue user on this bridge + $('#usrcont').toggle(true); + checkHueBridge(checkUserResult, $('#user').val() ? $('#user').val() : "newdeveloper"); + } + else + { + //increment and check again + if (hueIPs.length - 1 > hueIPsinc) + { + hueIPsinc++; + checkHueBridge(checkBridgeResult); + } + else + { + $('#usrcont').toggle(false); + $('#wiz_hue_ipstate').html($.i18n('wiz_hue_failure_ip')); + } + } }; -function checkUserResult(reply, usr) { - if (reply) { - $('#user').val(usr); - if (hueType == 'philipshueentertainment' && $('#clientkey').val() == "") { - $('#usrcont').toggle(true); - $('#wiz_hue_usrstate').html($.i18n('wiz_hue_e_clientkey_needed')); - $('#wiz_hue_create_user').toggle(true); - } else { - $('#wiz_hue_usrstate').html(""); - $('#wiz_hue_create_user').toggle(false); - if (hueType == 'philipshue') { - get_hue_lights(); - } - if (hueType == 'philipshueentertainment') { - get_hue_groups(); - } - } - } - else { - $('#wiz_hue_usrstate').html($.i18n('wiz_hue_failure_user')); - $('#wiz_hue_create_user').toggle(true); - } +function checkUserResult(reply, usr) +{ + if (reply) + { + $('#user').val(usr); + if (hueType == 'philipshueentertainment' && $('#clientkey').val() == "") + { + $('#usrcont').toggle(true); + $('#wiz_hue_usrstate').html($.i18n('wiz_hue_e_clientkey_needed')); + $('#wiz_hue_create_user').toggle(true); + } else + { + $('#wiz_hue_usrstate').html(""); + $('#wiz_hue_create_user').toggle(false); + if (hueType == 'philipshue') + { + get_hue_lights(); + } + if (hueType == 'philipshueentertainment') + { + get_hue_groups(); + } + } + } + else + { + $('#wiz_hue_usrstate').html($.i18n('wiz_hue_failure_user')); + $('#wiz_hue_create_user').toggle(true); + } }; -function identHueId(id, off, oState) { - if (off !== true) { - setTimeout(identHueId, 1500, id, true, oState); - var put_data = '{"on":true,"bri":254,"hue":47000,"sat":254}'; - } - else { - var put_data = '{"on":' + oState.on + ',"bri":' + oState.bri + ',"hue":' + oState.hue + ',"sat":' + oState.sat + '}'; - } - - $.ajax({ - url: 'http://' + $('#ip').val() + '/api/' + $('#user').val() + '/lights/' + id + '/state', - type: 'PUT', - timeout: 2000, - data: put_data - }) +function identHueId(id, off, oState) +{ + if (off !== true) + { + setTimeout(identHueId, 1500, id, true, oState); + var put_data = '{"on":true,"bri":254,"hue":47000,"sat":254}'; + } + else + { + var put_data = '{"on":' + oState.on + ',"bri":' + oState.bri + ',"hue":' + oState.hue + ',"sat":' + oState.sat + '}'; + } + + $.ajax({ + url: 'http://' + $('#ip').val() + '/api/' + $('#user').val() + '/lights/' + id + '/state', + type: 'PUT', + timeout: 2000, + data: put_data + }) } -function useGroupId(id) { - $('#groupId').val(id); - groupLights = groupIDs[id].lights; - groupLightsLocations = groupIDs[id].locations; - get_hue_lights(); +function useGroupId(id) +{ + $('#groupId').val(id); + groupLights = groupIDs[id].lights; + groupLightsLocations = groupIDs[id].locations; + get_hue_lights(); } -async function discover_hue_bridges() { - const res = await requestLedDeviceDiscovery('philipshue'); - - // TODO: error case unhandled - // res can be: false (timeout) or res.error (not found) - if (res && !res.error) { - const r = res.info; - - // Process devices returned by discovery - console.log(r); - - if (r.devices.length == 0) - $('#wiz_hue_ipstate').html($.i18n('wiz_hue_failure_ip')); - else { - for (const device of r.devices) { - console.log("Device:", device); - - var ip = device.hostname + ":" + device.port; - console.log("Host:", ip); - - hueIPs.push({ internalipaddress: ip }); - } - var usr = $('#user').val(); - if (usr != "") { - checkHueBridge(checkUserResult, usr); - } else { - checkHueBridge(checkBridgeResult); - } - } - } +async function discover_hue_bridges() +{ + const res = await requestLedDeviceDiscovery('philipshue'); + + // TODO: error case unhandled + // res can be: false (timeout) or res.error (not found) + if (res && !res.error) + { + const r = res.info; + + // Process devices returned by discovery + console.log(r); + + if (r.devices.length == 0) + $('#wiz_hue_ipstate').html($.i18n('wiz_hue_failure_ip')); + else + { + for (const device of r.devices) + { + console.log("Device:", device); + + var ip = device.hostname + ":" + device.port; + console.log("Host:", ip); + + hueIPs.push({ internalipaddress: ip }); + } + var usr = $('#user').val(); + if (usr != "") + { + checkHueBridge(checkUserResult, usr); + } else + { + checkHueBridge(checkBridgeResult); + } + } + } } -async function getProperties_hue_bridge(hostAddress, username, resourceFilter) { - let params = { host: hostAddress, user: username, filter: resourceFilter }; +async function getProperties_hue_bridge(hostAddress, username, resourceFilter) +{ + let params = { host: hostAddress, user: username, filter: resourceFilter }; - const res = await requestLedDeviceProperties('philipshue', params); + const res = await requestLedDeviceProperties('philipshue', params); - // TODO: error case unhandled - // res can be: false (timeout) or res.error (not found) - if (res && !res.error) { - const r = res.info + // TODO: error case unhandled + // res can be: false (timeout) or res.error (not found) + if (res && !res.error) + { + const r = res.info - // Process properties returned - console.log(r); - } + // Process properties returned + console.log(r); + } } -function identify_hue_device(hostAddress, username, id) { - let params = { host: hostAddress, user: username, lightId: id }; - requestLedDeviceIdentification("philipshue", params); +function identify_hue_device(hostAddress, username, id) +{ + let params = { host: hostAddress, user: username, lightId: id }; + requestLedDeviceIdentification("philipshue", params); } -function getHueIPs() { - $('#wiz_hue_ipstate').html($.i18n('wiz_hue_searchb')); - $.ajax({ - url: 'https://discovery.meethue.com', - crossDomain: true, - type: 'GET', - timeout: 3000 - }) - .done(function (data, textStatus, jqXHR) { - if (data.length == 0) { - $('#wiz_hue_ipstate').html($.i18n('wiz_hue_failure_ip')); - } else { - hueIPs = data; - checkHueBridge(checkBridgeResult); - } - }) - .fail(function (jqXHR, textStatus) { - $('#wiz_hue_ipstate').html($.i18n('wiz_hue_failure_ip')); - }); +function getHueIPs() +{ + $('#wiz_hue_ipstate').html($.i18n('wiz_hue_searchb')); + $.ajax({ + url: 'https://discovery.meethue.com', + crossDomain: true, + type: 'GET', + timeout: 3000 + }) + .done(function (data, textStatus, jqXHR) + { + if (data.length == 0) + { + $('#wiz_hue_ipstate').html($.i18n('wiz_hue_failure_ip')); + } else + { + hueIPs = data; + checkHueBridge(checkBridgeResult); + } + }) + .fail(function (jqXHR, textStatus) + { + $('#wiz_hue_ipstate').html($.i18n('wiz_hue_failure_ip')); + }); }; //return editor Value -function eV(vn , defaultVal = "") { - var editor = (vn) ? conf_editor.getEditor("root.specificOptions." + vn) : null; - return (editor == null) ? defaultVal : ((defaultVal != "" && !isNaN(defaultVal) && isNaN(editor.getValue())) ? defaultVal : editor.getValue()); +function eV(vn, defaultVal = "") +{ + var editor = (vn) ? conf_editor.getEditor("root.specificOptions." + vn) : null; + return (editor == null) ? defaultVal : ((defaultVal != "" && !isNaN(defaultVal) && isNaN(editor.getValue())) ? defaultVal : editor.getValue()); } -function beginWizardHue() { - var usr = eV("username"); - if (usr != "") { - $('#user').val(usr); - } - - if (hueType == 'philipshueentertainment') { - var clkey = eV("clientkey"); - if (clkey != "") { - $('#clientkey').val(clkey); - } - } - //check if ip is empty/reachable/search for bridge - if (eV("output") == "") { - //getHueIPs(); - discover_hue_bridges(); - } - else { - var ip = eV("output"); - $('#ip').val(ip); - hueIPs.unshift({ internalipaddress: ip }); - if (usr != "") { - checkHueBridge(checkUserResult, usr); - } else { - checkHueBridge(checkBridgeResult); - } - } - - $('#retry_bridge').off().on('click', function () { - if ($('#ip').val() != "") { - hueIPs.unshift({ internalipaddress: $('#ip').val() }) - hueIPsinc = 0; - } - else discover_hue_bridges(); - - var usr = $('#user').val(); - if (usr != "") { - checkHueBridge(checkUserResult, usr); - } else { - checkHueBridge(checkBridgeResult); - } - }); - - $('#retry_usr').off().on('click', function () { - checkHueBridge(checkUserResult, $('#user').val() ? $('#user').val() : "newdeveloper"); - }); - - $('#wiz_hue_create_user').off().on('click', function () { - if ($('#ip').val() != "") hueIPs.unshift({ internalipaddress: $('#ip').val() }); - createHueUser(); - }); - - $('#btn_wiz_save').off().on("click", function () { - var hueLedConfig = []; - var finalLightIds = []; - - //create hue led config - for (var key in lightIDs) { - if (hueType == 'philipshueentertainment') { - if (groupLights.indexOf(key) == -1) continue; - } - if ($('#hue_' + key).val() != "disabled") { - finalLightIds.push(key); - var idx_content = assignLightPos(key, $('#hue_' + key).val(), lightIDs[key].name); - hueLedConfig.push(JSON.parse(JSON.stringify(idx_content))); - } - } - - var sc = window.serverConfig; - sc.leds = hueLedConfig; - - //Adjust gamma, brightness and compensation - var c = sc.color.channelAdjustment[0]; - c.gammaBlue = 1.0; - c.gammaRed = 1.0; - c.gammaGreen = 1.0; - c.brightness = 100; - c.brightnessCompensation = 0; - - //device config - - //Start with a clean configuration - var d = {}; - - d.output = $('#ip').val(); - d.username = $('#user').val(); - d.type = 'philipshue'; - d.colorOrder = 'rgb'; - d.lightIds = finalLightIds; - d.transitiontime = parseInt(eV("transitiontime", 1)); - d.restoreOriginalState = (eV("restoreOriginalState", false) == true); - d.switchOffOnBlack = (eV("switchOffOnBlack", false) == true); - - d.blackLevel = parseFloat(eV("blackLevel", 0.009)); - d.onBlackTimeToPowerOff = parseInt(eV("onBlackTimeToPowerOff", 600)); - d.onBlackTimeToPowerOn = parseInt(eV("onBlackTimeToPowerOn", 300)); - d.brightnessFactor = parseFloat(eV("brightnessFactor", 1)); - - d.clientkey = $('#clientkey').val(); - d.groupId = parseInt($('#groupId').val()); - d.blackLightsTimeout = parseInt(eV("blackLightsTimeout", 5000)); - d.brightnessMin = parseFloat(eV("brightnessMin", 0)); - d.brightnessMax = parseFloat(eV("brightnessMax", 1)); - d.brightnessThreshold = parseFloat(eV("brightnessThreshold", 0.0001)); - d.handshakeTimeoutMin = parseInt(eV("handshakeTimeoutMin", 300)); - d.handshakeTimeoutMax = parseInt(eV("handshakeTimeoutMax", 1000)); - d.verbose = (eV("verbose") == true); - - if (hueType == 'philipshue') { - d.useEntertainmentAPI = false; - d.hardwareLedCount = finalLightIds.length; - d.refreshTime = 0; - d.verbose = false; - //smoothing off - sc.smoothing.enable = false; - } - - if (hueType == 'philipshueentertainment') { - d.useEntertainmentAPI = true; - d.hardwareLedCount = groupLights.length; - d.refreshTime = 20; - //smoothing on - sc.smoothing.enable = true; - } - - window.serverConfig.device = d; - - requestWriteConfig(sc, true); - resetWizard(); - }); - - $('#btn_wiz_abort').off().on('click', resetWizard); +function beginWizardHue() +{ + var usr = eV("username"); + if (usr != "") + { + $('#user').val(usr); + } + + if (hueType == 'philipshueentertainment') + { + var clkey = eV("clientkey"); + if (clkey != "") + { + $('#clientkey').val(clkey); + } + } + //check if ip is empty/reachable/search for bridge + if (eV("output") == "") + { + //getHueIPs(); + discover_hue_bridges(); + } + else + { + var ip = eV("output"); + $('#ip').val(ip); + hueIPs.unshift({ internalipaddress: ip }); + if (usr != "") + { + checkHueBridge(checkUserResult, usr); + } else + { + checkHueBridge(checkBridgeResult); + } + } + + $('#retry_bridge').off().on('click', function () + { + if ($('#ip').val() != "") + { + hueIPs.unshift({ internalipaddress: $('#ip').val() }) + hueIPsinc = 0; + } + else discover_hue_bridges(); + + var usr = $('#user').val(); + if (usr != "") + { + checkHueBridge(checkUserResult, usr); + } else + { + checkHueBridge(checkBridgeResult); + } + }); + + $('#retry_usr').off().on('click', function () + { + checkHueBridge(checkUserResult, $('#user').val() ? $('#user').val() : "newdeveloper"); + }); + + $('#wiz_hue_create_user').off().on('click', function () + { + if ($('#ip').val() != "") hueIPs.unshift({ internalipaddress: $('#ip').val() }); + createHueUser(); + }); + + $('#btn_wiz_save').off().on("click", function () + { + var hueLedConfig = []; + var finalLightIds = []; + + //create hue led config + for (var key in lightIDs) + { + if (hueType == 'philipshueentertainment') + { + if (groupLights.indexOf(key) == -1) continue; + } + if ($('#hue_' + key).val() != "disabled") + { + finalLightIds.push(key); + var idx_content = assignLightPos(key, $('#hue_' + key).val(), lightIDs[key].name); + hueLedConfig.push(JSON.parse(JSON.stringify(idx_content))); + } + } + + var sc = window.serverConfig; + sc.leds = hueLedConfig; + + //Adjust gamma, brightness and compensation + var c = sc.color.channelAdjustment[0]; + c.gammaBlue = 1.0; + c.gammaRed = 1.0; + c.gammaGreen = 1.0; + c.brightness = 100; + c.brightnessCompensation = 0; + + //device config + + //Start with a clean configuration + var d = {}; + + d.output = $('#ip').val(); + d.username = $('#user').val(); + d.type = 'philipshue'; + d.colorOrder = 'rgb'; + d.lightIds = finalLightIds; + d.transitiontime = parseInt(eV("transitiontime", 1)); + d.restoreOriginalState = (eV("restoreOriginalState", false) == true); + d.switchOffOnBlack = (eV("switchOffOnBlack", false) == true); + + d.blackLevel = parseFloat(eV("blackLevel", 0.009)); + d.onBlackTimeToPowerOff = parseInt(eV("onBlackTimeToPowerOff", 600)); + d.onBlackTimeToPowerOn = parseInt(eV("onBlackTimeToPowerOn", 300)); + d.brightnessFactor = parseFloat(eV("brightnessFactor", 1)); + + d.clientkey = $('#clientkey').val(); + d.groupId = parseInt($('#groupId').val()); + d.blackLightsTimeout = parseInt(eV("blackLightsTimeout", 5000)); + d.brightnessMin = parseFloat(eV("brightnessMin", 0)); + d.brightnessMax = parseFloat(eV("brightnessMax", 1)); + d.brightnessThreshold = parseFloat(eV("brightnessThreshold", 0.0001)); + d.handshakeTimeoutMin = parseInt(eV("handshakeTimeoutMin", 300)); + d.handshakeTimeoutMax = parseInt(eV("handshakeTimeoutMax", 1000)); + d.verbose = (eV("verbose") == true); + + if (hueType == 'philipshue') + { + d.useEntertainmentAPI = false; + d.hardwareLedCount = finalLightIds.length; + d.refreshTime = 0; + d.verbose = false; + //smoothing off + sc.smoothing.enable = false; + } + + if (hueType == 'philipshueentertainment') + { + d.useEntertainmentAPI = true; + d.hardwareLedCount = groupLights.length; + d.refreshTime = 20; + //smoothing on + sc.smoothing.enable = true; + } + + window.serverConfig.device = d; + + requestWriteConfig(sc, true); + resetWizard(); + }); + + $('#btn_wiz_abort').off().on('click', resetWizard); } -function createHueUser() { - var connectionRetries = 30; - var data = { "devicetype": "hyperhdr#" + Date.now() } - if (hueType == 'philipshueentertainment') { - data = { "devicetype": "hyperhdr#" + Date.now(), "generateclientkey": true } - } - var UserInterval = setInterval(function () { - $.ajax({ - type: "POST", - url: 'http://' + $("#ip").val() + '/api', - processData: false, - timeout: 1000, - contentType: 'application/json', - data: JSON.stringify(data), - success: function (r) { - $('#wizp1').toggle(false); - $('#wizp2').toggle(false); - $('#wizp3').toggle(true); - - connectionRetries--; - $("#connectionTime").html(connectionRetries); - if (connectionRetries == 0) { - abortConnection(UserInterval); - } - else { - if (typeof r[0].error != 'undefined') { - console.log(connectionRetries + ": link not pressed"); - } - if (typeof r[0].success != 'undefined') { - $('#wizp1').toggle(false); - $('#wizp2').toggle(true); - $('#wizp3').toggle(false); - if (r[0].success.username != 'undefined') { - $('#user').val(r[0].success.username); - conf_editor.getEditor("root.specificOptions.username").setValue(r[0].success.username); - } - if (hueType == 'philipshueentertainment') { - if (r[0].success.clientkey != 'undefined') { - $('#clientkey').val(r[0].success.clientkey); - conf_editor.getEditor("root.specificOptions.clientkey").setValue(r[0].success.clientkey); - } - } - checkHueBridge(checkUserResult, r[0].success.username); - clearInterval(UserInterval); - } - } - }, - error: function (XMLHttpRequest, textStatus, errorThrown) { - $('#wizp1').toggle(false); - $('#wizp2').toggle(true); - $('#wizp3').toggle(false); - clearInterval(UserInterval); - } - }); - }, 1000); +function createHueUser() +{ + var connectionRetries = 30; + var data = { "devicetype": "hyperhdr#" + Date.now() } + if (hueType == 'philipshueentertainment') + { + data = { "devicetype": "hyperhdr#" + Date.now(), "generateclientkey": true } + } + var UserInterval = setInterval(function () + { + $.ajax({ + type: "POST", + url: 'http://' + $("#ip").val() + '/api', + processData: false, + timeout: 1000, + contentType: 'application/json', + data: JSON.stringify(data), + success: function (r) + { + $('#wizp1').toggle(false); + $('#wizp2').toggle(false); + $('#wizp3').toggle(true); + + connectionRetries--; + $("#connectionTime").html(connectionRetries); + if (connectionRetries == 0) + { + abortConnection(UserInterval); + } + else + { + if (typeof r[0].error != 'undefined') + { + console.log(connectionRetries + ": link not pressed"); + } + if (typeof r[0].success != 'undefined') + { + $('#wizp1').toggle(false); + $('#wizp2').toggle(true); + $('#wizp3').toggle(false); + if (r[0].success.username != 'undefined') + { + $('#user').val(r[0].success.username); + conf_editor.getEditor("root.specificOptions.username").setValue(r[0].success.username); + } + if (hueType == 'philipshueentertainment') + { + if (r[0].success.clientkey != 'undefined') + { + $('#clientkey').val(r[0].success.clientkey); + conf_editor.getEditor("root.specificOptions.clientkey").setValue(r[0].success.clientkey); + } + } + checkHueBridge(checkUserResult, r[0].success.username); + clearInterval(UserInterval); + } + } + }, + error: function (XMLHttpRequest, textStatus, errorThrown) + { + $('#wizp1').toggle(false); + $('#wizp2').toggle(true); + $('#wizp3').toggle(false); + clearInterval(UserInterval); + } + }); + }, 1000); } -function get_hue_groups() { - $.ajax({ - type: "GET", - url: 'http://' + $("#ip").val() + '/api/' + $("#user").val() + '/groups', - processData: false, - contentType: 'application/json', - success: function (r) { - if (Object.keys(r).length > 0) { - $('#wh_topcontainer').toggle(false); - $('#hue_grp_ids_t').toggle(true); - - groupIDs = r; - - var gC = 0; - for (var groupid in r) { - if (r[groupid].type == 'Entertainment') { - $('.gidsb').append(createTableRowFlex([groupid + ' (' + r[groupid].name + ')', ''])); - gC++; - } - } - if (gC == 0) { - noAPISupport('wiz_hue_e_noegrpids'); - } - } - else { - noAPISupport('wiz_hue_e_nogrpids'); - } - } - }); +function get_hue_groups() +{ + $.ajax({ + type: "GET", + url: 'http://' + $("#ip").val() + '/api/' + $("#user").val() + '/groups', + processData: false, + contentType: 'application/json', + success: function (r) + { + if (Object.keys(r).length > 0) + { + $('#wh_topcontainer').toggle(false); + $('#hue_grp_ids_t').toggle(true); + + groupIDs = r; + + var gC = 0; + for (var groupid in r) + { + if (r[groupid].type == 'Entertainment') + { + $('.gidsb').append(createTableRowFlex([groupid + ' (' + r[groupid].name + ')', ''])); + gC++; + } + } + if (gC == 0) + { + noAPISupport('wiz_hue_e_noegrpids'); + } + } + else + { + noAPISupport('wiz_hue_e_nogrpids'); + } + } + }); } -function noAPISupport(txt) { - showNotification('danger', $.i18n('wiz_hue_e_title'), $.i18n('wiz_hue_e_noapisupport_hint')); - conf_editor.getEditor("root.specificOptions.useEntertainmentAPI").setValue(false); - $("input[name='root[specificOptions][useEntertainmentAPI]']").trigger("change"); - $('#btn_wiz_holder').append('
' + $.i18n('wiz_hue_e_noapisupport_hint') + '
'); - $('#hue_grp_ids_t').toggle(false); - var txt = (txt) ? $.i18n(txt) : $.i18n('wiz_hue_e_nogrpids'); - $('

' + txt + '
' + $.i18n('wiz_hue_e_noapisupport') + '

').insertBefore('#wizp2_body #hue_ids_t'); - $('#hue_id_headline').html($.i18n('wiz_hue_desc2')); - hueType = 'philipshue'; - get_hue_lights(); +function noAPISupport(txt) +{ + showNotification('danger', $.i18n('wiz_hue_e_title'), $.i18n('wiz_hue_e_noapisupport_hint')); + conf_editor.getEditor("root.specificOptions.useEntertainmentAPI").setValue(false); + $("input[name='root[specificOptions][useEntertainmentAPI]']").trigger("change"); + $('#btn_wiz_holder').append('
' + $.i18n('wiz_hue_e_noapisupport_hint') + '
'); + $('#hue_grp_ids_t').toggle(false); + var txt = (txt) ? $.i18n(txt) : $.i18n('wiz_hue_e_nogrpids'); + $('

' + txt + '
' + $.i18n('wiz_hue_e_noapisupport') + '

').insertBefore('#wizp2_body #hue_ids_t'); + $('#hue_id_headline').html($.i18n('wiz_hue_desc2')); + hueType = 'philipshue'; + get_hue_lights(); } -function get_light_state(id) { - $.ajax({ - type: "GET", - url: 'http://' + $("#ip").val() + '/api/' + $("#user").val() + '/lights/' + id, - processData: false, - contentType: 'application/json', - success: function (r) { - if (Object.keys(r).length > 0) { - identHueId(id, false, r['state']); - } - } - }); +function get_light_state(id) +{ + $.ajax({ + type: "GET", + url: 'http://' + $("#ip").val() + '/api/' + $("#user").val() + '/lights/' + id, + processData: false, + contentType: 'application/json', + success: function (r) + { + if (Object.keys(r).length > 0) + { + identHueId(id, false, r['state']); + } + } + }); } -function get_hue_lights() { - $.ajax({ - type: "GET", - url: 'http://' + $("#ip").val() + '/api/' + $("#user").val() + '/lights', - processData: false, - contentType: 'application/json', - success: function (r) { - if (Object.keys(r).length > 0) { - if (hueType == 'philipshue') { - $('#wh_topcontainer').toggle(false); - } - $('#hue_ids_t, #btn_wiz_save').toggle(true); - lightIDs = r; - var lightOptions = [ - "top", "topleft", "topright", - "bottom", "bottomleft", "bottomright", - "left", "lefttop", "leftmiddle", "leftbottom", - "right", "righttop", "rightmiddle", "rightbottom", - "entire", - "lightPosBottomLeft14", "lightPosBottomLeft12", "lightPosBottomLeft34", "lightPosBottomLeft11", - "lightPosBottomLeft112", "lightPosBottomLeftNewMid", "lightPosBottomLeft121", - "lightPosTopLeft112", "lightPosTopLeftNewMid", "lightPosTopLeft121" - ]; - - if (hueType == 'philipshue') { - lightOptions.unshift("disabled"); - } - - $('.lidsb').html(""); - var pos = ""; - for (var lightid in r) { - if (hueType == 'philipshueentertainment') { - if (groupLights.indexOf(lightid) == -1) continue; - - if (groupLightsLocations.hasOwnProperty(lightid)) { - lightLocation = groupLightsLocations[lightid]; - var x = lightLocation[0]; - var y = lightLocation[1]; - var z = lightLocation[2]; - var xval = (x < 0) ? "left" : "right"; - if (z != 1 && x >= -0.25 && x <= 0.25) xval = ""; - switch (z) { - case 1: // top / Ceiling height - pos = "top" + xval; - break; - case 0: // middle / TV height - pos = (xval == "" && y >= 0.75) ? "bottom" : xval + "middle"; - break; - case -1: // bottom / Ground height - pos = xval + "bottom"; - break; - } - } - } - var options = ""; - for (var opt in lightOptions) { - var val = lightOptions[opt]; - var txt = (val != 'entire' && val != 'disabled') ? 'conf_leds_layout_cl_' : 'wiz_ids_'; - options += '