Skip to content

Commit

Permalink
Merge branch 'master' into LED_context_menu
Browse files Browse the repository at this point in the history
  • Loading branch information
awawa-dev committed Nov 6, 2022
2 parents f68448c + 77a1f59 commit 35a40ca
Show file tree
Hide file tree
Showing 8 changed files with 170 additions and 243 deletions.
6 changes: 3 additions & 3 deletions .ci/ci_build.sh
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ if [[ "$CI_NAME" == 'osx' || "$CI_NAME" == 'darwin' ]]; then
CCACHE_PATH=$PWD
cd ..
cachecommand="-DCMAKE_C_COMPILER_LAUNCHER=ccache"
export CCACHE_DIR=${CCACHE_PATH} && export CCACHE_COMPRESS=true && export CCACHE_COMPRESSLEVEL=6 && export CCACHE_MAXSIZE=400M
export CCACHE_DIR=${CCACHE_PATH} && export CCACHE_COMPRESS=true && export CCACHE_COMPRESSLEVEL=1 && export CCACHE_MAXSIZE=400M
echo "CCache parameters: ${cachecommand}"
ls -a .ccache

Expand Down Expand Up @@ -88,9 +88,9 @@ elif [[ "$CI_NAME" == 'linux' ]]; then

if [[ "$RESET_CACHE" == '1' ]]; then
echo "Clearing ccache"
cache_env="export CCACHE_DIR=/.ccache && export CCACHE_COMPRESS=true && export CCACHE_COMPRESSLEVEL=6 && export CCACHE_MAXSIZE=400M && cd /.ccache && rm -rf ..?* .[!.]* *"
cache_env="export CCACHE_SLOPPINESS=pch_defines,time_macros && export CCACHE_DIR=/.ccache && export CCACHE_NOCOMPRESS=true && export CCACHE_MAXSIZE=600M && cd /.ccache && rm -rf ..?* .[!.]* *"
else
cache_env="export CCACHE_DIR=/.ccache && export CCACHE_COMPRESS=true && export CCACHE_COMPRESSLEVEL=6 && export CCACHE_MAXSIZE=400M"
cache_env="export CCACHE_SLOPPINESS=pch_defines,time_macros && export CCACHE_DIR=/.ccache && export CCACHE_NOCOMPRESS=true && export CCACHE_MAXSIZE=600M"
fi

echo "CCache parameters: ${cachecommand}, env: ${cache_env}"
Expand Down
6 changes: 3 additions & 3 deletions .github/workflows/push-master.yml
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@ jobs:
# download cache
- name: ccache cache files
if: ( env.USE_CACHE == '1' )
uses: actions/cache@v1.1.0
uses: actions/cache@v3
with:
path: .ccache
key: ${{ matrix.debian }}-${{ matrix.dockerImage }}-ccache-${{ steps.ccache_cache_timestamp.outputs.timestamp }}
Expand Down Expand Up @@ -113,7 +113,7 @@ jobs:
# Download cache
- name: ccache cache files
if: ( env.USE_CACHE == '1' )
uses: actions/cache@v1.1.0
uses: actions/cache@v3
with:
path: .ccache
key: macOS-ccache-${{ steps.ccache_cache_timestamp.outputs.timestamp }}
Expand Down Expand Up @@ -165,7 +165,7 @@ jobs:
submodules: true

- name: Cache Qt
uses: actions/cache@v2
uses: actions/cache@v3
id: cache-qt-windows
with:
path: ${{ runner.workspace }}/Qt
Expand Down
101 changes: 67 additions & 34 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ set_property(GLOBAL PROPERTY USE_FOLDERS ON)

# Set build variables
SET ( DEFAULT_PROTOBUF ON )
SET ( DEFAULT_BOBLIGHT ON )
SET ( DEFAULT_BOBLIGHT OFF )
SET ( DEFAULT_WS281XPWM OFF )
SET ( DEFAULT_USE_SYSTEM_FLATBUFFERS_LIBS OFF )
SET ( DEFAULT_USE_SYSTEM_MBEDTLS_LIBS OFF )
Expand All @@ -43,10 +43,9 @@ SET ( DEFAULT_PRECOMPILED_HEADERS ON )
find_program(CCACHE_FOUND ccache)
if ( CCACHE_FOUND )
if (DEFINED ENV{CCACHE_DIR})
message ( STATUS "Found CCache and its env settings: $ENV{CCACHE_DIR}. Will try to use it. Disabling precompiled headers." )
message ( STATUS "Found CCache and its env settings: $ENV{CCACHE_DIR}. Will try to use it." )
set_property(GLOBAL PROPERTY RULE_LAUNCH_COMPILE ccache)
set_property(GLOBAL PROPERTY RULE_LAUNCH_LINK ccache)
SET ( DEFAULT_PRECOMPILED_HEADERS OFF )
else()
message ( WARNING "Found CCache but env settings: CCACHE_DIR is not set. Skipping." )
endif()
Expand Down Expand Up @@ -301,65 +300,99 @@ if (WIN32)
endif()

# set the build options
option(ENABLE_BOBLIGHT "Enable BOBLIGHT component" ${DEFAULT_BOBLIGHT} )
message(STATUS "ENABLE_BOBLIGHT = ${ENABLE_BOBLIGHT}")
if(NOT WIN32)
string(ASCII 27 EscChar)
set(ColorReset "${EscChar}[m")
set(RedColor "${EscChar}[31m")
set(GreenColor "${EscChar}[32m")
set(YellowColor "${EscChar}[33m")
set(BlueColor "${EscChar}[34m")
set(CyanColor "${EscChar}[36m")
endif()

function(colorMe value1 value2)
if (value2)
message( STATUS "${value1}${GreenColor}${value2}${ColorReset}")
else()
message( STATUS "${value1}${RedColor}${value2}${ColorReset}")
endif()
endfunction()

message( STATUS "\n${CyanColor}LED DEVICES${ColorReset}")

option(ENABLE_SPIDEV "Enable the SPIDEV device" ${DEFAULT_SPIDEV} )
message(STATUS "ENABLE_SPIDEV = ${ENABLE_SPIDEV}")
colorMe("ENABLE_SPIDEV = " ${ENABLE_SPIDEV})

option(ENABLE_V4L2 "Enable the V4L2 grabber" ${DEFAULT_V4L2})
message(STATUS "ENABLE_V4L2 = ${ENABLE_V4L2}")
option(ENABLE_WS281XPWM "Enable the WS281x-PWM device" ${DEFAULT_WS281XPWM} )
colorMe("ENABLE_WS281XPWM = " ${ENABLE_WS281XPWM})

option(ENABLE_X11 "Enable the X11 Linux system grabber" ${DEFAULT_X11})
message(STATUS "ENABLE_X11 = ${ENABLE_X11}")
message( STATUS "\n${CyanColor}SOFTWARE GRABBERS${ColorReset}")

option(ENABLE_DX "Enable Windows DirectX 11 system grabber" ${DEFAULT_DX})
colorMe("ENABLE_DX = " ${ENABLE_DX})

option(ENABLE_FRAMEBUFFER "Enable the framebuffer Linux system grabber" ${DEFAULT_FRAMEBUFFER})
message(STATUS "ENABLE_FRAMEBUFFER = ${ENABLE_FRAMEBUFFER}")
colorMe("ENABLE_FRAMEBUFFER = " ${ENABLE_FRAMEBUFFER})

option(ENABLE_MAC_SYSTEM "Enable macOS system grabber" ${DEFAULT_MAC_SYSTEM})
colorMe("ENABLE_MAC_SYSTEM = " ${ENABLE_MAC_SYSTEM})

option(ENABLE_PIPEWIRE "Enable the pipewire/portal Linux system grabber" ${DEFAULT_PIPEWIRE})
message(STATUS "ENABLE_PIPEWIRE = ${ENABLE_PIPEWIRE}")
colorMe("ENABLE_PIPEWIRE = " ${ENABLE_PIPEWIRE})

option(ENABLE_WS281XPWM "Enable the WS281x-PWM device" ${DEFAULT_WS281XPWM} )
message(STATUS "ENABLE_WS281XPWM = ${ENABLE_WS281XPWM}")
option(ENABLE_X11 "Enable the X11 Linux system grabber" ${DEFAULT_X11})
colorMe("ENABLE_X11 = " ${ENABLE_X11})

option(ENABLE_BONJOUR "Enable the network discovery service" ${DEFAULT_BONJOUR} )
message(STATUS "ENABLE_BONJOUR = ${ENABLE_BONJOUR}")
message( STATUS "\n${CyanColor}HARDWARE GRABBERS${ColorReset}")

option(ENABLE_AVF "Enable AV Foundation macOS grabber" ${DEFAULT_AVF})
colorMe("ENABLE_AVF = " ${ENABLE_AVF})

option(ENABLE_MF "Enable Windows Media Foundation grabber" ${DEFAULT_MF})
message(STATUS "ENABLE_MF = ${ENABLE_MF}")
colorMe("ENABLE_MF = " ${ENABLE_MF})

option(ENABLE_DX "Enable Windows DirectX 11 system grabber" ${DEFAULT_DX})
message(STATUS "ENABLE_DX = ${ENABLE_DX}")
option(ENABLE_V4L2 "Enable the V4L2 grabber" ${DEFAULT_V4L2})
colorMe("ENABLE_V4L2 = " ${ENABLE_V4L2})

option(ENABLE_AVF "Enable AV Foundation macOS grabber" ${DEFAULT_AVF})
message(STATUS "ENABLE_AVF = ${ENABLE_AVF}")
message( STATUS "\n${CyanColor}SOUND CAPTURING${ColorReset}")

option(ENABLE_MAC_SYSTEM "Enable macOS system grabber" ${DEFAULT_MAC_SYSTEM})
message(STATUS "ENABLE_MAC_SYSTEM = ${ENABLE_MAC_SYSTEM}")
option(ENABLE_SOUNDCAPLINUX "Enable Linux Sound Capture" ${DEFAULT_SOUNDCAPLINUX})
colorMe("ENABLE_SOUNDCAPLINUX = " ${ENABLE_SOUNDCAPLINUX})

option(ENABLE_SOUNDCAPMACOS "Enable macOS Sound Capture" ${DEFAULT_SOUNDCAPMACOS})
colorMe("ENABLE_SOUNDCAPMACOS = " ${ENABLE_SOUNDCAPMACOS})

option(ENABLE_SOUNDCAPWINDOWS "Enable Windows Sound Capture" ${DEFAULT_SOUNDCAPWINDOWS})
message(STATUS "ENABLE_SOUNDCAPWINDOWS = ${ENABLE_SOUNDCAPWINDOWS}")
colorMe("ENABLE_SOUNDCAPWINDOWS = " ${ENABLE_SOUNDCAPWINDOWS})

option(ENABLE_SOUNDCAPMACOS "Enable macOS Sound Capture" ${DEFAULT_SOUNDCAPMACOS})
message(STATUS "ENABLE_SOUNDCAPMACOS = ${ENABLE_SOUNDCAPMACOS}")
message( STATUS "\n${CyanColor}SERVICE SUPPORT${ColorReset}")

option(ENABLE_SOUNDCAPLINUX "Enable Linux Sound Capture" ${DEFAULT_SOUNDCAPLINUX})
message(STATUS "ENABLE_SOUNDCAPLINUX = ${ENABLE_SOUNDCAPLINUX}")
option(ENABLE_BOBLIGHT "Enable BOBLIGHT component" ${DEFAULT_BOBLIGHT} )
colorMe("ENABLE_BOBLIGHT = " ${ENABLE_BOBLIGHT})

option(ENABLE_BONJOUR "Enable the network discovery service" ${DEFAULT_BONJOUR} )
colorMe("ENABLE_BONJOUR = " ${ENABLE_BONJOUR})

option(ENABLE_CEC "Enable CEC" ${DEFAULT_CEC})
message(STATUS "ENABLE_CEC = ${ENABLE_CEC}")
colorMe("ENABLE_CEC = " ${ENABLE_CEC})

option(ENABLE_MQTT "Enable MQTT" ${DEFAULT_MQTT})
colorMe("ENABLE_MQTT = " ${ENABLE_MQTT})

option(ENABLE_PROTOBUF "Enable PROTOBUF" ${DEFAULT_PROTOBUF})
message(STATUS "ENABLE_PROTOBUF = ${ENABLE_PROTOBUF}")
colorMe("ENABLE_PROTOBUF = " ${ENABLE_PROTOBUF})

option(ENABLE_MQTT "Enable MQTT" ${DEFAULT_MQTT})
message(STATUS "ENABLE_MQTT = ${ENABLE_MQTT}")
message( STATUS "\n${CyanColor}BUILD FEATURES${ColorReset}")

option(USE_STATIC_QT_PLUGINS "Enable static QT plugins" ${DEFAULT_STATIC_QT_PLUGINS})
message(STATUS "USE_STATIC_QT_PLUGINS = ${USE_STATIC_QT_PLUGINS}")
colorMe("USE_STATIC_QT_PLUGINS = " ${USE_STATIC_QT_PLUGINS})

option(USE_PRECOMPILED_HEADERS "Enable precompiled headers (PCH)" ${DEFAULT_PRECOMPILED_HEADERS})
message(STATUS "USE_PRECOMPILED_HEADERS = ${USE_PRECOMPILED_HEADERS}")
colorMe("USE_PRECOMPILED_HEADERS = " ${USE_PRECOMPILED_HEADERS})

message( STATUS "\n")

# next part

SET ( FLATBUFFERS_INSTALL_BIN_DIR ${CMAKE_BINARY_DIR}/flatbuf )
SET ( FLATBUFFERS_INSTALL_LIB_DIR ${CMAKE_BINARY_DIR}/flatbuf )
Expand Down
1 change: 1 addition & 0 deletions include/utils/ColorRgb.h
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
#include <iostream>

#include <QTextStream>
#include <QString>

///
/// Plain-Old-Data structure containing the red-green-blue color specification. Size of the
Expand Down
6 changes: 3 additions & 3 deletions sources/api/JsonAPI.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1509,7 +1509,7 @@ void JsonAPI::handleAuthorizeCommand(const QJsonObject& message, const QString&
if (!token.isEmpty())
{
// userToken is longer
if (token.count() > 36)
if (token.length() > 36)
{
if (API::isUserTokenAuthorized(token))
sendSuccessReply(command + "-" + subc, tan);
Expand All @@ -1519,7 +1519,7 @@ void JsonAPI::handleAuthorizeCommand(const QJsonObject& message, const QString&
return;
}
// usual app token is 36
if (token.count() == 36)
if (token.length() == 36)
{
if (API::isTokenAuthorized(token))
{
Expand All @@ -1533,7 +1533,7 @@ void JsonAPI::handleAuthorizeCommand(const QJsonObject& message, const QString&

// password
// use password
if (password.count() >= 8)
if (password.length() >= 8)
{
QString userTokenRep;
if (API::isUserAuthorized(password) && API::getUserToken(userTokenRep))
Expand Down
5 changes: 2 additions & 3 deletions sources/leddevice/dev_net/LedDeviceWled.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -138,9 +138,8 @@ bool LedDeviceWled::powerOn()
{
this->setInError(response.getErrorReason());

// power on simultaneously with Rpi causes timeout
if (_maxRetry > 0 && response.error() &&
(response.getNetworkReplyError() == 99 || response.getNetworkReplyError() == 1 || response.getNetworkReplyError() == 2 || response.getNetworkReplyError() == 5))
// power on simultaneously with Rpi causes timeout
if (_maxRetry > 0 && response.error())
{
if (_currentRetry <= 0)
_currentRetry = _maxRetry + 1;
Expand Down
Loading

0 comments on commit 35a40ca

Please sign in to comment.