mirror of
https://github.com/hyperion-project/hyperion.ng.git
synced 2023-10-10 13:36:59 +02:00
added optional QT5 support - LedDevicePhilipsHue needs proper fixes
Former-commit-id: 7f0971ccda221933da4be836628532e7cfc7c085
This commit is contained in:
parent
d5529e86df
commit
defe217c89
@ -37,6 +37,9 @@ message(STATUS "ENABLE_WS2812BPWM = " ${ENABLE_WS2812BPWM})
|
|||||||
option(ENABLE_X11 "Enable the X11 grabber" OFF)
|
option(ENABLE_X11 "Enable the X11 grabber" OFF)
|
||||||
message(STATUS "ENABLE_X11 = " ${ENABLE_X11})
|
message(STATUS "ENABLE_X11 = " ${ENABLE_X11})
|
||||||
|
|
||||||
|
option(ENABLE_QT5 "Enable QT5" OFF)
|
||||||
|
message(STATUS "ENABLE_QT5 = " ${ENABLE_QT5})
|
||||||
|
|
||||||
if(ENABLE_V4L2 AND NOT ENABLE_PROTOBUF)
|
if(ENABLE_V4L2 AND NOT ENABLE_PROTOBUF)
|
||||||
message(FATAL_ERROR "V4L2 grabber requires PROTOBUF. Disable V4L2 or enable PROTOBUF")
|
message(FATAL_ERROR "V4L2 grabber requires PROTOBUF. Disable V4L2 or enable PROTOBUF")
|
||||||
endif(ENABLE_V4L2 AND NOT ENABLE_PROTOBUF)
|
endif(ENABLE_V4L2 AND NOT ENABLE_PROTOBUF)
|
||||||
@ -53,6 +56,10 @@ if(ENABLE_OSX AND ENABLE_DISPMANX)
|
|||||||
message(FATAL_ERROR "dispmanx grabber and osx grabber cannot be used at the same time")
|
message(FATAL_ERROR "dispmanx grabber and osx grabber cannot be used at the same time")
|
||||||
endif(ENABLE_OSX AND ENABLE_DISPMANX)
|
endif(ENABLE_OSX AND ENABLE_DISPMANX)
|
||||||
|
|
||||||
|
#if(ENABLE_QT5)
|
||||||
|
# TODO vs ENABLE_QT4?
|
||||||
|
#endif(ENABLE_QT5)
|
||||||
|
|
||||||
# Createt the configuration file
|
# Createt the configuration file
|
||||||
# configure a header file to pass some of the CMake settings
|
# configure a header file to pass some of the CMake settings
|
||||||
# to the source code
|
# to the source code
|
||||||
@ -61,8 +68,14 @@ include_directories("${PROJECT_BINARY_DIR}")
|
|||||||
|
|
||||||
# Add project specific cmake modules (find, etc)
|
# Add project specific cmake modules (find, etc)
|
||||||
set(CMAKE_MODULE_PATH ${CMAKE_MODULE_PATH} ${CMAKE_CURRENT_SOURCE_DIR}/cmake)
|
set(CMAKE_MODULE_PATH ${CMAKE_MODULE_PATH} ${CMAKE_CURRENT_SOURCE_DIR}/cmake)
|
||||||
|
|
||||||
|
if(ENABLE_QT5)
|
||||||
|
ADD_DEFINITIONS ( -DENABLE_QT5 )
|
||||||
|
#find_package(Qt5Widgets)
|
||||||
|
else(ENABLE_QT5)
|
||||||
# Add specific cmake modules to find qt4 (default version finds first available QT which might not be qt4)
|
# Add specific cmake modules to find qt4 (default version finds first available QT which might not be qt4)
|
||||||
set(CMAKE_MODULE_PATH ${CMAKE_MODULE_PATH} ${CMAKE_CURRENT_SOURCE_DIR}/cmake/qt4)
|
set(CMAKE_MODULE_PATH ${CMAKE_MODULE_PATH} ${CMAKE_CURRENT_SOURCE_DIR}/cmake/qt4)
|
||||||
|
endif(ENABLE_QT5)
|
||||||
|
|
||||||
# Define the global output path of binaries
|
# Define the global output path of binaries
|
||||||
SET(LIBRARY_OUTPUT_PATH ${PROJECT_BINARY_DIR}/lib)
|
SET(LIBRARY_OUTPUT_PATH ${PROJECT_BINARY_DIR}/lib)
|
||||||
@ -85,15 +98,27 @@ set(CMAKE_BUILD_TYPE "Debug")
|
|||||||
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=c++0x -Wall")
|
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=c++0x -Wall")
|
||||||
#set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -stdlib=libc++ -std=c++11 -Wall")
|
#set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -stdlib=libc++ -std=c++11 -Wall")
|
||||||
|
|
||||||
|
if(ENABLE_QT5)
|
||||||
|
#find_package(Qt5Core REQUIRED)
|
||||||
|
find_package(Qt5 COMPONENTS Core Gui Widgets Network REQUIRED)
|
||||||
|
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} ${Qt5Widgets_EXECUTABLE_COMPILE_FLAGS}")
|
||||||
|
# set(CMAKE_CXX_FLAGS "-fPIC")
|
||||||
|
else(ENABLE_QT5)
|
||||||
# Configure the use of QT4
|
# Configure the use of QT4
|
||||||
find_package(Qt4 COMPONENTS QtCore QtGui QtNetwork REQUIRED QUIET)
|
find_package(Qt4 COMPONENTS QtCore QtGui QtNetwork REQUIRED QUIET)
|
||||||
|
endif(ENABLE_QT5)
|
||||||
|
|
||||||
#add libusb and pthreads
|
#add libusb and pthreads
|
||||||
find_package(libusb-1.0 REQUIRED)
|
find_package(libusb-1.0 REQUIRED)
|
||||||
find_package(Threads REQUIRED)
|
find_package(Threads REQUIRED)
|
||||||
|
if(ENABLE_QT5)
|
||||||
|
#include(${QT_USE_FILE})
|
||||||
|
add_definitions(${QT_DEFINITIONS})
|
||||||
|
else(ENABLE_QT5)
|
||||||
include(${QT_USE_FILE})
|
include(${QT_USE_FILE})
|
||||||
add_definitions(${QT_DEFINITIONS})
|
add_definitions(${QT_DEFINITIONS})
|
||||||
|
endif(ENABLE_QT5)
|
||||||
|
|
||||||
# TODO[TvdZ]: This linking directory should only be added if we are cross compiling
|
# TODO[TvdZ]: This linking directory should only be added if we are cross compiling
|
||||||
if(NOT APPLE)
|
if(NOT APPLE)
|
||||||
link_directories(${CMAKE_FIND_ROOT_PATH}/lib/arm-linux-gnueabihf)
|
link_directories(${CMAKE_FIND_ROOT_PATH}/lib/arm-linux-gnueabihf)
|
||||||
|
@ -59,8 +59,11 @@ void BoblightClientConnection::readData()
|
|||||||
while(bytes > 0)
|
while(bytes > 0)
|
||||||
{
|
{
|
||||||
// create message string (strip the newline)
|
// create message string (strip the newline)
|
||||||
|
#ifdef ENABLE_QT5
|
||||||
|
QString message = QString::fromLatin1(_receiveBuffer.data(), bytes-1);
|
||||||
|
#else
|
||||||
QString message = QString::fromAscii(_receiveBuffer.data(), bytes-1);
|
QString message = QString::fromAscii(_receiveBuffer.data(), bytes-1);
|
||||||
|
#endif
|
||||||
// remove message data from buffer
|
// remove message data from buffer
|
||||||
_receiveBuffer = _receiveBuffer.mid(bytes);
|
_receiveBuffer = _receiveBuffer.mid(bytes);
|
||||||
|
|
||||||
|
@ -17,7 +17,11 @@ set(BoblightServer_SOURCES
|
|||||||
${CURRENT_SOURCE_DIR}/BoblightClientConnection.cpp
|
${CURRENT_SOURCE_DIR}/BoblightClientConnection.cpp
|
||||||
)
|
)
|
||||||
|
|
||||||
|
if(ENABLE_QT5)
|
||||||
|
qt5_wrap_cpp(BoblightServer_HEADERS_MOC ${BoblightServer_QT_HEADERS})
|
||||||
|
else(ENABLE_QT5)
|
||||||
qt4_wrap_cpp(BoblightServer_HEADERS_MOC ${BoblightServer_QT_HEADERS})
|
qt4_wrap_cpp(BoblightServer_HEADERS_MOC ${BoblightServer_QT_HEADERS})
|
||||||
|
endif(ENABLE_QT5)
|
||||||
|
|
||||||
add_library(boblightserver
|
add_library(boblightserver
|
||||||
${BoblightServer_HEADERS}
|
${BoblightServer_HEADERS}
|
||||||
@ -26,6 +30,10 @@ add_library(boblightserver
|
|||||||
${BoblightServer_HEADERS_MOC}
|
${BoblightServer_HEADERS_MOC}
|
||||||
)
|
)
|
||||||
|
|
||||||
|
if(ENABLE_QT5)
|
||||||
|
qt5_use_modules(boblightserver Widgets)
|
||||||
|
endif(ENABLE_QT5)
|
||||||
|
|
||||||
target_link_libraries(boblightserver
|
target_link_libraries(boblightserver
|
||||||
hyperion
|
hyperion
|
||||||
hyperion-utils
|
hyperion-utils
|
||||||
|
@ -27,9 +27,13 @@ SET(EffectEngineSOURCES
|
|||||||
|
|
||||||
set(EffectEngine_RESOURCES ${CURRENT_SOURCE_DIR}/EffectEngine.qrc)
|
set(EffectEngine_RESOURCES ${CURRENT_SOURCE_DIR}/EffectEngine.qrc)
|
||||||
|
|
||||||
|
if(ENABLE_QT5)
|
||||||
|
QT5_WRAP_CPP(EffectEngineHEADERS_MOC ${EffectEngineQT_HEADERS})
|
||||||
|
qt5_add_resources(EffectEngine_RESOURCES_RCC ${EffectEngine_RESOURCES} OPTIONS "-no-compress")
|
||||||
|
else(ENABLE_QT5)
|
||||||
QT4_WRAP_CPP(EffectEngineHEADERS_MOC ${EffectEngineQT_HEADERS})
|
QT4_WRAP_CPP(EffectEngineHEADERS_MOC ${EffectEngineQT_HEADERS})
|
||||||
|
|
||||||
qt4_add_resources(EffectEngine_RESOURCES_RCC ${EffectEngine_RESOURCES} OPTIONS "-no-compress")
|
qt4_add_resources(EffectEngine_RESOURCES_RCC ${EffectEngine_RESOURCES} OPTIONS "-no-compress")
|
||||||
|
endif(ENABLE_QT5)
|
||||||
|
|
||||||
add_library(effectengine
|
add_library(effectengine
|
||||||
${EffectEngineHEADERS}
|
${EffectEngineHEADERS}
|
||||||
@ -39,6 +43,10 @@ add_library(effectengine
|
|||||||
${EffectEngineSOURCES}
|
${EffectEngineSOURCES}
|
||||||
)
|
)
|
||||||
|
|
||||||
|
if(ENABLE_QT5)
|
||||||
|
qt5_use_modules(effectengine Widgets)
|
||||||
|
endif(ENABLE_QT5)
|
||||||
|
|
||||||
target_link_libraries(effectengine
|
target_link_libraries(effectengine
|
||||||
hyperion
|
hyperion
|
||||||
jsoncpp
|
jsoncpp
|
||||||
|
@ -75,7 +75,11 @@ const std::list<EffectDefinition> &EffectEngine::getEffects() const
|
|||||||
|
|
||||||
bool EffectEngine::loadEffectDefinition(const std::string &path, const std::string &effectConfigFile, EffectDefinition & effectDefinition)
|
bool EffectEngine::loadEffectDefinition(const std::string &path, const std::string &effectConfigFile, EffectDefinition & effectDefinition)
|
||||||
{
|
{
|
||||||
|
#ifdef ENABLE_QT5
|
||||||
|
std::string fileName = path + QDir::separator().toLatin1() + effectConfigFile;
|
||||||
|
#else
|
||||||
std::string fileName = path + QDir::separator().toAscii() + effectConfigFile;
|
std::string fileName = path + QDir::separator().toAscii() + effectConfigFile;
|
||||||
|
#endif
|
||||||
std::ifstream file(fileName.c_str());
|
std::ifstream file(fileName.c_str());
|
||||||
|
|
||||||
if (!file.is_open())
|
if (!file.is_open())
|
||||||
@ -110,7 +114,11 @@ bool EffectEngine::loadEffectDefinition(const std::string &path, const std::stri
|
|||||||
|
|
||||||
// setup the definition
|
// setup the definition
|
||||||
effectDefinition.name = config["name"].asString();
|
effectDefinition.name = config["name"].asString();
|
||||||
|
#ifdef ENABLE_QT5
|
||||||
|
effectDefinition.script = path + QDir::separator().toLatin1() + config["script"].asString();
|
||||||
|
#else
|
||||||
effectDefinition.script = path + QDir::separator().toAscii() + config["script"].asString();
|
effectDefinition.script = path + QDir::separator().toAscii() + config["script"].asString();
|
||||||
|
#endif
|
||||||
effectDefinition.args = config["args"];
|
effectDefinition.args = config["args"];
|
||||||
|
|
||||||
// return succes
|
// return succes
|
||||||
|
@ -15,7 +15,11 @@ SET(AmlogicSOURCES
|
|||||||
${CURRENT_SOURCE_DIR}/AmlogicGrabber.cpp
|
${CURRENT_SOURCE_DIR}/AmlogicGrabber.cpp
|
||||||
)
|
)
|
||||||
|
|
||||||
|
if(ENABLE_QT5)
|
||||||
|
QT5_WRAP_CPP(AmlogicHEADERS_MOC ${AmlogicQT_HEADERS})
|
||||||
|
else(ENABLE_QT5)
|
||||||
QT4_WRAP_CPP(AmlogicHEADERS_MOC ${AmlogicQT_HEADERS})
|
QT4_WRAP_CPP(AmlogicHEADERS_MOC ${AmlogicQT_HEADERS})
|
||||||
|
endif(ENABLE_QT5)
|
||||||
|
|
||||||
add_library(amlogic-grabber
|
add_library(amlogic-grabber
|
||||||
${AmlogicHEADERS}
|
${AmlogicHEADERS}
|
||||||
|
@ -21,7 +21,11 @@ SET(DispmanxGrabberSOURCES
|
|||||||
${CURRENT_SOURCE_DIR}/DispmanxFrameGrabber.cpp
|
${CURRENT_SOURCE_DIR}/DispmanxFrameGrabber.cpp
|
||||||
)
|
)
|
||||||
|
|
||||||
|
if(ENABLE_QT5)
|
||||||
|
QT5_WRAP_CPP(DispmanxGrabberHEADERS_MOC ${DispmanxGrabberQT_HEADERS})
|
||||||
|
else(ENABLE_QT5)
|
||||||
QT4_WRAP_CPP(DispmanxGrabberHEADERS_MOC ${DispmanxGrabberQT_HEADERS})
|
QT4_WRAP_CPP(DispmanxGrabberHEADERS_MOC ${DispmanxGrabberQT_HEADERS})
|
||||||
|
endif(ENABLE_QT5)
|
||||||
|
|
||||||
add_library(dispmanx-grabber
|
add_library(dispmanx-grabber
|
||||||
${DispmanxGrabberHEADERS}
|
${DispmanxGrabberHEADERS}
|
||||||
|
@ -21,7 +21,11 @@ SET(FramebufferGrabberSOURCES
|
|||||||
${CURRENT_SOURCE_DIR}/FramebufferFrameGrabber.cpp
|
${CURRENT_SOURCE_DIR}/FramebufferFrameGrabber.cpp
|
||||||
)
|
)
|
||||||
|
|
||||||
|
if(ENABLE_QT5)
|
||||||
|
QT5_WRAP_CPP(FramebufferGrabberHEADERS_MOC ${FramebufferGrabberQT_HEADERS})
|
||||||
|
else(ENABLE_QT5)
|
||||||
QT4_WRAP_CPP(FramebufferGrabberHEADERS_MOC ${FramebufferGrabberQT_HEADERS})
|
QT4_WRAP_CPP(FramebufferGrabberHEADERS_MOC ${FramebufferGrabberQT_HEADERS})
|
||||||
|
endif(ENABLE_QT5)
|
||||||
|
|
||||||
add_library(framebuffer-grabber
|
add_library(framebuffer-grabber
|
||||||
${FramebufferGrabberHEADERS}
|
${FramebufferGrabberHEADERS}
|
||||||
|
@ -16,7 +16,11 @@ SET(OsxGrabberSOURCES
|
|||||||
${CURRENT_SOURCE_DIR}/OsxFrameGrabber.cpp
|
${CURRENT_SOURCE_DIR}/OsxFrameGrabber.cpp
|
||||||
)
|
)
|
||||||
|
|
||||||
|
if(ENABLE_QT5)
|
||||||
|
QT5_WRAP_CPP(OsxGrabberHEADERS_MOC ${OsxGrabberQT_HEADERS})
|
||||||
|
else(ENABLE_QT5)
|
||||||
QT4_WRAP_CPP(OsxGrabberHEADERS_MOC ${OsxGrabberQT_HEADERS})
|
QT4_WRAP_CPP(OsxGrabberHEADERS_MOC ${OsxGrabberQT_HEADERS})
|
||||||
|
endif(ENABLE_QT5)
|
||||||
|
|
||||||
add_library(osx-grabber
|
add_library(osx-grabber
|
||||||
${OsxGrabberHEADERS}
|
${OsxGrabberHEADERS}
|
||||||
|
@ -16,7 +16,11 @@ SET(V4L2_SOURCES
|
|||||||
${CURRENT_SOURCE_DIR}/V4L2Wrapper.cpp
|
${CURRENT_SOURCE_DIR}/V4L2Wrapper.cpp
|
||||||
)
|
)
|
||||||
|
|
||||||
|
if(ENABLE_QT5)
|
||||||
|
QT5_WRAP_CPP(V4L2_HEADERS_MOC ${V4L2_QT_HEADERS})
|
||||||
|
else(ENABLE_QT5)
|
||||||
QT4_WRAP_CPP(V4L2_HEADERS_MOC ${V4L2_QT_HEADERS})
|
QT4_WRAP_CPP(V4L2_HEADERS_MOC ${V4L2_QT_HEADERS})
|
||||||
|
endif(ENABLE_QT5)
|
||||||
|
|
||||||
add_library(v4l2-grabber
|
add_library(v4l2-grabber
|
||||||
${V4L2_HEADERS}
|
${V4L2_HEADERS}
|
||||||
@ -25,6 +29,10 @@ add_library(v4l2-grabber
|
|||||||
${V4L2_HEADERS_MOC}
|
${V4L2_HEADERS_MOC}
|
||||||
)
|
)
|
||||||
|
|
||||||
|
if(ENABLE_QT5)
|
||||||
|
qt5_use_modules(v4l2-grabber Widgets)
|
||||||
|
endif(ENABLE_QT5)
|
||||||
|
|
||||||
target_link_libraries(v4l2-grabber
|
target_link_libraries(v4l2-grabber
|
||||||
hyperion
|
hyperion
|
||||||
${QT_LIBRARIES}
|
${QT_LIBRARIES}
|
||||||
|
@ -22,7 +22,11 @@ SET(X11_SOURCES
|
|||||||
${CURRENT_SOURCE_DIR}/X11Grabber.cpp
|
${CURRENT_SOURCE_DIR}/X11Grabber.cpp
|
||||||
)
|
)
|
||||||
|
|
||||||
|
if(ENABLE_QT5)
|
||||||
|
QT5_WRAP_CPP(X11_HEADERS_MOC ${X11_QT_HEADERS})
|
||||||
|
else(ENABLE_QT5)
|
||||||
QT4_WRAP_CPP(X11_HEADERS_MOC ${X11_QT_HEADERS})
|
QT4_WRAP_CPP(X11_HEADERS_MOC ${X11_QT_HEADERS})
|
||||||
|
endif(ENABLE_QT5)
|
||||||
|
|
||||||
add_library(x11-grabber
|
add_library(x11-grabber
|
||||||
${X11_HEADERS}
|
${X11_HEADERS}
|
||||||
|
@ -36,9 +36,13 @@ set(Hyperion_RESOURCES
|
|||||||
${CURRENT_SOURCE_DIR}/resource.qrc
|
${CURRENT_SOURCE_DIR}/resource.qrc
|
||||||
)
|
)
|
||||||
|
|
||||||
|
if(ENABLE_QT5)
|
||||||
|
QT5_WRAP_CPP(Hyperion_HEADERS_MOC ${Hyperion_QT_HEADERS})
|
||||||
|
QT5_ADD_RESOURCES(Hyperion_RESOURCES_RCC ${Hyperion_RESOURCES} OPTIONS "-no-compress")
|
||||||
|
else(ENABLE_QT5)
|
||||||
QT4_WRAP_CPP(Hyperion_HEADERS_MOC ${Hyperion_QT_HEADERS})
|
QT4_WRAP_CPP(Hyperion_HEADERS_MOC ${Hyperion_QT_HEADERS})
|
||||||
|
|
||||||
QT4_ADD_RESOURCES(Hyperion_RESOURCES_RCC ${Hyperion_RESOURCES} OPTIONS "-no-compress")
|
QT4_ADD_RESOURCES(Hyperion_RESOURCES_RCC ${Hyperion_RESOURCES} OPTIONS "-no-compress")
|
||||||
|
endif(ENABLE_QT5)
|
||||||
|
|
||||||
add_library(hyperion
|
add_library(hyperion
|
||||||
${Hyperion_HEADERS}
|
${Hyperion_HEADERS}
|
||||||
@ -48,6 +52,10 @@ add_library(hyperion
|
|||||||
${Hyperion_RESOURCES_RCC}
|
${Hyperion_RESOURCES_RCC}
|
||||||
)
|
)
|
||||||
|
|
||||||
|
if(ENABLE_QT5)
|
||||||
|
qt5_use_modules(hyperion Widgets)
|
||||||
|
endif(ENABLE_QT5)
|
||||||
|
|
||||||
target_link_libraries(hyperion
|
target_link_libraries(hyperion
|
||||||
blackborder
|
blackborder
|
||||||
hyperion-utils
|
hyperion-utils
|
||||||
|
@ -20,10 +20,13 @@ set(JsonServer_SOURCES
|
|||||||
set(JsonServer_RESOURCES
|
set(JsonServer_RESOURCES
|
||||||
${CURRENT_SOURCE_DIR}/JsonSchemas.qrc
|
${CURRENT_SOURCE_DIR}/JsonSchemas.qrc
|
||||||
)
|
)
|
||||||
|
if(ENABLE_QT5)
|
||||||
|
qt5_wrap_cpp(JsonServer_HEADERS_MOC ${JsonServer_QT_HEADERS})
|
||||||
|
qt5_add_resources(JsonServer_RESOURCES_RCC ${JsonServer_RESOURCES} OPTIONS "-no-compress")
|
||||||
|
else(ENABLE_QT5)
|
||||||
qt4_wrap_cpp(JsonServer_HEADERS_MOC ${JsonServer_QT_HEADERS})
|
qt4_wrap_cpp(JsonServer_HEADERS_MOC ${JsonServer_QT_HEADERS})
|
||||||
|
|
||||||
qt4_add_resources(JsonServer_RESOURCES_RCC ${JsonServer_RESOURCES} OPTIONS "-no-compress")
|
qt4_add_resources(JsonServer_RESOURCES_RCC ${JsonServer_RESOURCES} OPTIONS "-no-compress")
|
||||||
|
endif(ENABLE_QT5)
|
||||||
|
|
||||||
add_library(jsonserver
|
add_library(jsonserver
|
||||||
${JsonServer_HEADERS}
|
${JsonServer_HEADERS}
|
||||||
@ -34,6 +37,10 @@ add_library(jsonserver
|
|||||||
${JsonServer_RESOURCES_RCC}
|
${JsonServer_RESOURCES_RCC}
|
||||||
)
|
)
|
||||||
|
|
||||||
|
if(ENABLE_QT5)
|
||||||
|
qt5_use_modules(jsonserver Widgets Network)
|
||||||
|
endif(ENABLE_QT5)
|
||||||
|
|
||||||
target_link_libraries(jsonserver
|
target_link_libraries(jsonserver
|
||||||
hyperion
|
hyperion
|
||||||
hyperion-utils
|
hyperion-utils
|
||||||
|
@ -102,8 +102,12 @@ if(ENABLE_TINKERFORGE)
|
|||||||
)
|
)
|
||||||
endif(ENABLE_TINKERFORGE)
|
endif(ENABLE_TINKERFORGE)
|
||||||
|
|
||||||
|
if(ENABLE_QT5)
|
||||||
|
QT5_WRAP_CPP(Leddevice_HEADERS_MOC ${Leddevice_QT_HEADERS})
|
||||||
|
else(ENABLE_QT5)
|
||||||
QT4_WRAP_CPP(Leddevice_HEADERS_MOC ${Leddevice_QT_HEADERS})
|
QT4_WRAP_CPP(Leddevice_HEADERS_MOC ${Leddevice_QT_HEADERS})
|
||||||
|
endif(ENABLE_QT5)
|
||||||
|
|
||||||
|
|
||||||
add_library(leddevice
|
add_library(leddevice
|
||||||
${Leddevice_HEADERS}
|
${Leddevice_HEADERS}
|
||||||
@ -112,6 +116,10 @@ add_library(leddevice
|
|||||||
${Leddevice_SOURCES}
|
${Leddevice_SOURCES}
|
||||||
)
|
)
|
||||||
|
|
||||||
|
if(ENABLE_QT5)
|
||||||
|
qt5_use_modules(leddevice Widgets Network)
|
||||||
|
endif(ENABLE_QT5)
|
||||||
|
|
||||||
target_link_libraries(leddevice
|
target_link_libraries(leddevice
|
||||||
hyperion-utils
|
hyperion-utils
|
||||||
serialport
|
serialport
|
||||||
|
@ -7,7 +7,12 @@
|
|||||||
// qt includes
|
// qt includes
|
||||||
#include <QtCore/qmath.h>
|
#include <QtCore/qmath.h>
|
||||||
#include <QUrl>
|
#include <QUrl>
|
||||||
|
#ifdef ENABLE_QT5
|
||||||
|
|
||||||
|
#else
|
||||||
#include <QHttpRequestHeader>
|
#include <QHttpRequestHeader>
|
||||||
|
#endif
|
||||||
|
|
||||||
#include <QEventLoop>
|
#include <QEventLoop>
|
||||||
|
|
||||||
#include <set>
|
#include <set>
|
||||||
@ -144,14 +149,22 @@ LedDevicePhilipsHue::LedDevicePhilipsHue(const std::string& output, const std::s
|
|||||||
int transitiontime, std::vector<unsigned int> lightIds) :
|
int transitiontime, std::vector<unsigned int> lightIds) :
|
||||||
host(output.c_str()), username(username.c_str()), switchOffOnBlack(switchOffOnBlack), transitiontime(
|
host(output.c_str()), username(username.c_str()), switchOffOnBlack(switchOffOnBlack), transitiontime(
|
||||||
transitiontime), lightIds(lightIds) {
|
transitiontime), lightIds(lightIds) {
|
||||||
|
#ifdef ENABLE_QT5
|
||||||
|
|
||||||
|
#else
|
||||||
http = new QHttp(host);
|
http = new QHttp(host);
|
||||||
timer.setInterval(3000);
|
timer.setInterval(3000);
|
||||||
timer.setSingleShot(true);
|
timer.setSingleShot(true);
|
||||||
connect(&timer, SIGNAL(timeout()), this, SLOT(restoreStates()));
|
connect(&timer, SIGNAL(timeout()), this, SLOT(restoreStates()));
|
||||||
|
#endif
|
||||||
}
|
}
|
||||||
|
|
||||||
LedDevicePhilipsHue::~LedDevicePhilipsHue() {
|
LedDevicePhilipsHue::~LedDevicePhilipsHue() {
|
||||||
|
#ifdef ENABLE_QT5
|
||||||
|
|
||||||
|
#else
|
||||||
delete http;
|
delete http;
|
||||||
|
#endif
|
||||||
}
|
}
|
||||||
|
|
||||||
int LedDevicePhilipsHue::write(const std::vector<ColorRgb> & ledValues) {
|
int LedDevicePhilipsHue::write(const std::vector<ColorRgb> & ledValues) {
|
||||||
@ -201,21 +214,32 @@ int LedDevicePhilipsHue::write(const std::vector<ColorRgb> & ledValues) {
|
|||||||
// Next light id.
|
// Next light id.
|
||||||
idx++;
|
idx++;
|
||||||
}
|
}
|
||||||
|
#ifdef ENABLE_QT5
|
||||||
|
|
||||||
|
#else
|
||||||
timer.start();
|
timer.start();
|
||||||
|
#endif
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
int LedDevicePhilipsHue::switchOff() {
|
int LedDevicePhilipsHue::switchOff() {
|
||||||
|
#ifdef ENABLE_QT5
|
||||||
|
|
||||||
|
#else
|
||||||
timer.stop();
|
timer.stop();
|
||||||
// If light states have been saved before, ...
|
// If light states have been saved before, ...
|
||||||
if (areStatesSaved()) {
|
if (areStatesSaved()) {
|
||||||
// ... restore them.
|
// ... restore them.
|
||||||
restoreStates();
|
restoreStates();
|
||||||
}
|
}
|
||||||
|
#endif
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
void LedDevicePhilipsHue::put(QString route, QString content) {
|
void LedDevicePhilipsHue::put(QString route, QString content) {
|
||||||
|
#ifdef ENABLE_QT5
|
||||||
|
|
||||||
|
#else
|
||||||
QString url = QString("/api/%1/%2").arg(username).arg(route);
|
QString url = QString("/api/%1/%2").arg(username).arg(route);
|
||||||
QHttpRequestHeader header("PUT", url);
|
QHttpRequestHeader header("PUT", url);
|
||||||
header.setValue("Host", host);
|
header.setValue("Host", host);
|
||||||
@ -229,9 +253,13 @@ void LedDevicePhilipsHue::put(QString route, QString content) {
|
|||||||
http->request(header, content.toAscii());
|
http->request(header, content.toAscii());
|
||||||
// Go into the loop until the request is finished.
|
// Go into the loop until the request is finished.
|
||||||
loop.exec();
|
loop.exec();
|
||||||
|
#endif
|
||||||
}
|
}
|
||||||
|
|
||||||
QByteArray LedDevicePhilipsHue::get(QString route) {
|
QByteArray LedDevicePhilipsHue::get(QString route) {
|
||||||
|
#ifdef ENABLE_QT5
|
||||||
|
return 0;
|
||||||
|
#else
|
||||||
QString url = QString("/api/%1/%2").arg(username).arg(route);
|
QString url = QString("/api/%1/%2").arg(username).arg(route);
|
||||||
// Event loop to block until request finished.
|
// Event loop to block until request finished.
|
||||||
QEventLoop loop;
|
QEventLoop loop;
|
||||||
@ -243,6 +271,7 @@ QByteArray LedDevicePhilipsHue::get(QString route) {
|
|||||||
loop.exec();
|
loop.exec();
|
||||||
// Read all data of the response.
|
// Read all data of the response.
|
||||||
return http->readAll();
|
return http->readAll();
|
||||||
|
#endif
|
||||||
}
|
}
|
||||||
|
|
||||||
QString LedDevicePhilipsHue::getStateRoute(unsigned int lightId) {
|
QString LedDevicePhilipsHue::getStateRoute(unsigned int lightId) {
|
||||||
|
@ -4,11 +4,14 @@
|
|||||||
#include <string>
|
#include <string>
|
||||||
|
|
||||||
// Qt includes
|
// Qt includes
|
||||||
|
#ifdef ENABLE_QT5
|
||||||
|
#include <QNetworkAccessManager>
|
||||||
|
#else
|
||||||
#include <QObject>
|
#include <QObject>
|
||||||
#include <QString>
|
#include <QString>
|
||||||
#include <QHttp>
|
#include <QHttp>
|
||||||
#include <QTimer>
|
#include <QTimer>
|
||||||
|
#endif
|
||||||
// Leddevice includes
|
// Leddevice includes
|
||||||
#include <leddevice/LedDevice.h>
|
#include <leddevice/LedDevice.h>
|
||||||
|
|
||||||
@ -165,9 +168,14 @@ private:
|
|||||||
/// User name for the API ("newdeveloper")
|
/// User name for the API ("newdeveloper")
|
||||||
QString username;
|
QString username;
|
||||||
/// Qhttp object for sending requests.
|
/// Qhttp object for sending requests.
|
||||||
|
#ifdef ENABLE_QT5
|
||||||
|
// TODO QNetworkAcessManager stuff
|
||||||
|
#else
|
||||||
QHttp* http;
|
QHttp* http;
|
||||||
|
|
||||||
/// Use timer to reset lights when we got into "GRABBINGMODE_OFF".
|
/// Use timer to reset lights when we got into "GRABBINGMODE_OFF".
|
||||||
QTimer timer;
|
QTimer timer;
|
||||||
|
#endif
|
||||||
///
|
///
|
||||||
bool switchOffOnBlack;
|
bool switchOffOnBlack;
|
||||||
/// Transition time in multiples of 100 ms.
|
/// Transition time in multiples of 100 ms.
|
||||||
|
@ -34,7 +34,11 @@ protobuf_generate_cpp(ProtoServer_PROTO_SRCS ProtoServer_PROTO_HDRS
|
|||||||
${ProtoServer_PROTOS}
|
${ProtoServer_PROTOS}
|
||||||
)
|
)
|
||||||
|
|
||||||
|
if(ENABLE_QT5)
|
||||||
|
qt5_wrap_cpp(ProtoServer_HEADERS_MOC ${ProtoServer_QT_HEADERS})
|
||||||
|
else(ENABLE_QT5)
|
||||||
qt4_wrap_cpp(ProtoServer_HEADERS_MOC ${ProtoServer_QT_HEADERS})
|
qt4_wrap_cpp(ProtoServer_HEADERS_MOC ${ProtoServer_QT_HEADERS})
|
||||||
|
endif(ENABLE_QT5)
|
||||||
|
|
||||||
add_library(protoserver
|
add_library(protoserver
|
||||||
${ProtoServer_HEADERS}
|
${ProtoServer_HEADERS}
|
||||||
@ -45,6 +49,9 @@ add_library(protoserver
|
|||||||
${ProtoServer_PROTO_SRCS}
|
${ProtoServer_PROTO_SRCS}
|
||||||
${ProtoServer_PROTO_HDRS}
|
${ProtoServer_PROTO_HDRS}
|
||||||
)
|
)
|
||||||
|
if(ENABLE_QT5)
|
||||||
|
qt5_use_modules(protoserver Widgets)
|
||||||
|
endif(ENABLE_QT5)
|
||||||
|
|
||||||
target_link_libraries(protoserver
|
target_link_libraries(protoserver
|
||||||
hyperion
|
hyperion
|
||||||
|
@ -15,7 +15,11 @@ SET(XBMCVideoChecker_SOURCES
|
|||||||
${CURRENT_SOURCE_DIR}/XBMCVideoChecker.cpp
|
${CURRENT_SOURCE_DIR}/XBMCVideoChecker.cpp
|
||||||
)
|
)
|
||||||
|
|
||||||
|
if(ENABLE_QT5)
|
||||||
|
QT5_WRAP_CPP(XBMCVideoChecker_HEADERS_MOC ${XBMCVideoChecker_QT_HEADERS})
|
||||||
|
else(ENABLE_QT5)
|
||||||
QT4_WRAP_CPP(XBMCVideoChecker_HEADERS_MOC ${XBMCVideoChecker_QT_HEADERS})
|
QT4_WRAP_CPP(XBMCVideoChecker_HEADERS_MOC ${XBMCVideoChecker_QT_HEADERS})
|
||||||
|
endif(ENABLE_QT5)
|
||||||
|
|
||||||
add_library(xbmcvideochecker
|
add_library(xbmcvideochecker
|
||||||
${XBMCVideoChecker_HEADERS}
|
${XBMCVideoChecker_HEADERS}
|
||||||
@ -24,6 +28,10 @@ add_library(xbmcvideochecker
|
|||||||
${XBMCVideoChecker_SOURCES}
|
${XBMCVideoChecker_SOURCES}
|
||||||
)
|
)
|
||||||
|
|
||||||
|
if(ENABLE_QT5)
|
||||||
|
qt5_use_modules(xbmcvideochecker Widgets)
|
||||||
|
endif(ENABLE_QT5)
|
||||||
|
|
||||||
target_link_libraries(xbmcvideochecker
|
target_link_libraries(xbmcvideochecker
|
||||||
hyperion
|
hyperion
|
||||||
${QT_LIBRARIES})
|
${QT_LIBRARIES})
|
||||||
|
@ -23,7 +23,11 @@ set(Hyperion_AML_SOURCES
|
|||||||
hyperion-aml.cpp
|
hyperion-aml.cpp
|
||||||
)
|
)
|
||||||
|
|
||||||
|
if(ENABLE_QT5)
|
||||||
|
QT5_WRAP_CPP(Hyperion_AML_HEADERS_MOC ${Hyperion_AML_QT_HEADERS})
|
||||||
|
else(ENABLE_QT5)
|
||||||
QT4_WRAP_CPP(Hyperion_AML_HEADERS_MOC ${Hyperion_AML_QT_HEADERS})
|
QT4_WRAP_CPP(Hyperion_AML_HEADERS_MOC ${Hyperion_AML_QT_HEADERS})
|
||||||
|
endif(ENABLE_QT5)
|
||||||
|
|
||||||
add_executable(hyperion-amlogic
|
add_executable(hyperion-amlogic
|
||||||
${Hyperion_AML_HEADERS}
|
${Hyperion_AML_HEADERS}
|
||||||
|
@ -3,7 +3,13 @@ cmake_minimum_required(VERSION 2.8)
|
|||||||
project(hyperion-remote)
|
project(hyperion-remote)
|
||||||
|
|
||||||
# find Qt4
|
# find Qt4
|
||||||
|
if(ENABLE_QT5)
|
||||||
|
find_package(Qt5 COMPONENTS Core Gui Widgets Network REQUIRED)
|
||||||
|
# set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} ${Qt5Widgets_EXECUTABLE_COMPILE_FLAGS}")
|
||||||
|
# set(CMAKE_CXX_FLAGS "-fPIC")
|
||||||
|
else(ENABLE_QT5)
|
||||||
find_package(Qt4 REQUIRED QtCore QtGui QtNetwork)
|
find_package(Qt4 REQUIRED QtCore QtGui QtNetwork)
|
||||||
|
endif(ENABLE_QT5)
|
||||||
|
|
||||||
# The following I do not undrstand completely...
|
# The following I do not undrstand completely...
|
||||||
# libQtCore.so uses some hardcoded library path inside which are incorrect after copying the file RPi file system
|
# libQtCore.so uses some hardcoded library path inside which are incorrect after copying the file RPi file system
|
||||||
@ -25,6 +31,10 @@ add_executable(hyperion-remote
|
|||||||
${hyperion-remote_HEADERS}
|
${hyperion-remote_HEADERS}
|
||||||
${hyperion-remote_SOURCES})
|
${hyperion-remote_SOURCES})
|
||||||
|
|
||||||
|
if(ENABLE_QT5)
|
||||||
|
qt5_use_modules(hyperion-remote Widgets Network)
|
||||||
|
endif(ENABLE_QT5)
|
||||||
|
|
||||||
target_link_libraries(hyperion-remote
|
target_link_libraries(hyperion-remote
|
||||||
jsoncpp
|
jsoncpp
|
||||||
getoptPlusPlus
|
getoptPlusPlus
|
||||||
|
@ -43,8 +43,13 @@ int main(int argc, char * argv[])
|
|||||||
// create the option parser and initialize all parameters
|
// create the option parser and initialize all parameters
|
||||||
OptionsParser optionParser("Simple application to send a command to hyperion using the Json interface");
|
OptionsParser optionParser("Simple application to send a command to hyperion using the Json interface");
|
||||||
ParameterSet & parameters = optionParser.getParameters();
|
ParameterSet & parameters = optionParser.getParameters();
|
||||||
|
#ifdef ENABLE_QT5
|
||||||
|
StringParameter & argAddress = parameters.add<StringParameter> ('a', "address" , QString("Set the address of the hyperion server [default: %1]").arg(defaultServerAddress).toLatin1().constData());
|
||||||
|
IntParameter & argPriority = parameters.add<IntParameter> ('p', "priority" , QString("Use to the provided priority channel (the lower the number, the higher the priority) [default: %1]").arg(defaultPriority).toLatin1().constData());
|
||||||
|
#else
|
||||||
StringParameter & argAddress = parameters.add<StringParameter> ('a', "address" , QString("Set the address of the hyperion server [default: %1]").arg(defaultServerAddress).toAscii().constData());
|
StringParameter & argAddress = parameters.add<StringParameter> ('a', "address" , QString("Set the address of the hyperion server [default: %1]").arg(defaultServerAddress).toAscii().constData());
|
||||||
IntParameter & argPriority = parameters.add<IntParameter> ('p', "priority" , QString("Use to the provided priority channel (the lower the number, the higher the priority) [default: %1]").arg(defaultPriority).toAscii().constData());
|
IntParameter & argPriority = parameters.add<IntParameter> ('p', "priority" , QString("Use to the provided priority channel (the lower the number, the higher the priority) [default: %1]").arg(defaultPriority).toAscii().constData());
|
||||||
|
#endif
|
||||||
IntParameter & argDuration = parameters.add<IntParameter> ('d', "duration" , "Specify how long the leds should be switched on in millseconds [default: infinity]");
|
IntParameter & argDuration = parameters.add<IntParameter> ('d', "duration" , "Specify how long the leds should be switched on in millseconds [default: infinity]");
|
||||||
ColorParameter & argColor = parameters.add<ColorParameter> ('c', "color" , "Set all leds to a constant color (either RRGGBB hex value or a color name. The color may be repeated multiple time like: RRGGBBRRGGBB)");
|
ColorParameter & argColor = parameters.add<ColorParameter> ('c', "color" , "Set all leds to a constant color (either RRGGBB hex value or a color name. The color may be repeated multiple time like: RRGGBBRRGGBB)");
|
||||||
ImageParameter & argImage = parameters.add<ImageParameter> ('i', "image" , "Set the leds to the colors according to the given image file");
|
ImageParameter & argImage = parameters.add<ImageParameter> ('i', "image" , "Set the leds to the colors according to the given image file");
|
||||||
|
@ -3,7 +3,14 @@ cmake_minimum_required(VERSION 2.8)
|
|||||||
project(hyperion-v4l2)
|
project(hyperion-v4l2)
|
||||||
|
|
||||||
# find Qt4
|
# find Qt4
|
||||||
|
if(ENABLE_QT5)
|
||||||
|
find_package(Qt5Widgets REQUIRED)
|
||||||
|
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} ${Qt5Widgets_EXECUTABLE_COMPILE_FLAGS}")
|
||||||
|
# set(CMAKE_CXX_FLAGS "-fPIC")
|
||||||
|
else(ENABLE_QT5)
|
||||||
find_package(Qt4 REQUIRED QtCore QtGui QtNetwork)
|
find_package(Qt4 REQUIRED QtCore QtGui QtNetwork)
|
||||||
|
endif(ENABLE_QT5)
|
||||||
|
|
||||||
|
|
||||||
include_directories(
|
include_directories(
|
||||||
${CMAKE_CURRENT_BINARY_DIR}/../../libsrc/protoserver
|
${CMAKE_CURRENT_BINARY_DIR}/../../libsrc/protoserver
|
||||||
@ -24,8 +31,11 @@ set(Hyperion_V4L2_SOURCES
|
|||||||
hyperion-v4l2.cpp
|
hyperion-v4l2.cpp
|
||||||
ScreenshotHandler.cpp
|
ScreenshotHandler.cpp
|
||||||
)
|
)
|
||||||
|
if(ENABLE_QT5)
|
||||||
|
QT5_WRAP_CPP(Hyperion_V4L2_MOC_SOURCES ${Hyperion_V4L2_QT_HEADERS})
|
||||||
|
else(ENABLE_QT5)
|
||||||
QT4_WRAP_CPP(Hyperion_V4L2_MOC_SOURCES ${Hyperion_V4L2_QT_HEADERS})
|
QT4_WRAP_CPP(Hyperion_V4L2_MOC_SOURCES ${Hyperion_V4L2_QT_HEADERS})
|
||||||
|
endif(ENABLE_QT5)
|
||||||
|
|
||||||
add_executable(hyperion-v4l2
|
add_executable(hyperion-v4l2
|
||||||
${Hyperion_V4L2_HEADERS}
|
${Hyperion_V4L2_HEADERS}
|
||||||
|
@ -4,8 +4,12 @@ cmake_minimum_required(VERSION 2.8)
|
|||||||
# Set the project name
|
# Set the project name
|
||||||
project(hyperion-x11)
|
project(hyperion-x11)
|
||||||
|
|
||||||
|
if(ENABLE_QT5)
|
||||||
|
find_package(Qt5Widgets REQUIRED)
|
||||||
|
else(ENABLE_QT5)
|
||||||
# find Qt4
|
# find Qt4
|
||||||
find_package(Qt4 REQUIRED QtCore QtGui QtNetwork)
|
find_package(Qt4 REQUIRED QtCore QtGui QtNetwork)
|
||||||
|
endif(ENABLE_QT5)
|
||||||
|
|
||||||
# Find X11
|
# Find X11
|
||||||
find_package(X11 REQUIRED)
|
find_package(X11 REQUIRED)
|
||||||
@ -28,7 +32,11 @@ set(Hyperion_X11_SOURCES
|
|||||||
X11Wrapper.cpp
|
X11Wrapper.cpp
|
||||||
)
|
)
|
||||||
|
|
||||||
|
if(ENABLE_QT5)
|
||||||
|
QT5_WRAP_CPP(Hyperion_X11_HEADERS_MOC ${Hyperion_X11_QT_HEADERS})
|
||||||
|
else(ENABLE_QT5)
|
||||||
QT4_WRAP_CPP(Hyperion_X11_HEADERS_MOC ${Hyperion_X11_QT_HEADERS})
|
QT4_WRAP_CPP(Hyperion_X11_HEADERS_MOC ${Hyperion_X11_QT_HEADERS})
|
||||||
|
endif(ENABLE_QT5)
|
||||||
|
|
||||||
add_executable(hyperion-x11
|
add_executable(hyperion-x11
|
||||||
${Hyperion_X11_HEADERS}
|
${Hyperion_X11_HEADERS}
|
||||||
@ -46,7 +54,11 @@ target_link_libraries(hyperion-x11
|
|||||||
pthread
|
pthread
|
||||||
)
|
)
|
||||||
|
|
||||||
|
if(ENABLE_QT5)
|
||||||
|
qt5_use_modules(hyperion-x11 Widgets Core Gui Network)
|
||||||
|
else(ENABLE_QT5)
|
||||||
qt4_use_modules(hyperion-x11
|
qt4_use_modules(hyperion-x11
|
||||||
Core
|
Core
|
||||||
Gui
|
Gui
|
||||||
Network)
|
Network)
|
||||||
|
endif(ENABLE_QT5)
|
||||||
|
@ -53,6 +53,11 @@ add_executable(test_qtscreenshot TestQtScreenshot.cpp)
|
|||||||
target_link_libraries(test_qtscreenshot
|
target_link_libraries(test_qtscreenshot
|
||||||
${QT_LIBRARIES})
|
${QT_LIBRARIES})
|
||||||
|
|
||||||
|
if(ENABLE_QT5)
|
||||||
|
qt5_use_modules(test_qregexp Widgets)
|
||||||
|
qt5_use_modules(test_qtscreenshot Widgets)
|
||||||
|
endif(ENABLE_QT5)
|
||||||
|
|
||||||
if(ENABLE_X11)
|
if(ENABLE_X11)
|
||||||
# Find X11
|
# Find X11
|
||||||
find_package(X11 REQUIRED)
|
find_package(X11 REQUIRED)
|
||||||
|
Loading…
Reference in New Issue
Block a user