refactoring and cleanup (#2)

* make hyperion to singelton.
remove arguments for config and hyperion - both are gettable via Hyperion::getInstance

* refactor hyperiond

* remove qt4 comapt
make zeroconf mandatory
refactor hyperiond

* xbmcchecker is now a singleton

* cleanup in hyperiond
zeroconf switchable between static and shared linking

* fix xbmcchecker
This commit is contained in:
redPanther
2016-06-17 01:25:40 +02:00
committed by brindosch
parent 5206202568
commit 88fbc4dfde
51 changed files with 507 additions and 723 deletions

View File

@@ -1,15 +1,9 @@
cmake_minimum_required(VERSION 2.8)
project(hyperion-remote)
# find Qt
if(ENABLE_QT5)
find_package(Qt5 COMPONENTS Core Gui Widgets Network 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()
find_package(Qt4 REQUIRED QtCore QtGui QtNetwork)
endif()
# 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
@@ -36,11 +30,7 @@ target_link_libraries(${PROJECT_NAME}
getoptPlusPlus
${QT_LIBRARIES})
if(ENABLE_QT5)
qt5_use_modules(${PROJECT_NAME} Widgets Core Network)
else()
qt4_use_modules(${PROJECT_NAME} Core Gui Network )
endif()
qt5_use_modules(${PROJECT_NAME} Widgets Core Network)
install ( TARGETS ${PROJECT_NAME} DESTINATION "bin" COMPONENT ambilight )

View File

@@ -51,13 +51,8 @@ int main(int argc, char * argv[])
// create the option parser and initialize all parameters
OptionsParser optionParser("Simple application to send a command to hyperion using the Json interface");
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());
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]");
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");