mirror of
https://github.com/hyperion-project/hyperion.ng.git
synced 2025-03-01 10:33:28 +00:00
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:
@@ -42,13 +42,8 @@ SET(Hyperion_RESOURCES
|
||||
${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()
|
||||
QT4_WRAP_CPP(Hyperion_HEADERS_MOC ${Hyperion_QT_HEADERS})
|
||||
QT4_ADD_RESOURCES(Hyperion_RESOURCES_RCC ${Hyperion_RESOURCES} OPTIONS "-no-compress")
|
||||
endif()
|
||||
QT5_WRAP_CPP(Hyperion_HEADERS_MOC ${Hyperion_QT_HEADERS})
|
||||
QT5_ADD_RESOURCES(Hyperion_RESOURCES_RCC ${Hyperion_RESOURCES} OPTIONS "-no-compress")
|
||||
|
||||
add_library(hyperion
|
||||
${Hyperion_HEADERS}
|
||||
@@ -58,9 +53,7 @@ add_library(hyperion
|
||||
${Hyperion_RESOURCES_RCC}
|
||||
)
|
||||
|
||||
if(ENABLE_QT5)
|
||||
qt5_use_modules(hyperion Widgets)
|
||||
endif()
|
||||
qt5_use_modules(hyperion Widgets)
|
||||
|
||||
target_link_libraries(hyperion
|
||||
blackborder
|
||||
|
@@ -1,6 +1,7 @@
|
||||
|
||||
// STL includes
|
||||
#include <cassert>
|
||||
#include <exception>
|
||||
|
||||
// QT includes
|
||||
#include <QDateTime>
|
||||
@@ -31,6 +32,24 @@
|
||||
// effect engine includes
|
||||
#include <effectengine/EffectEngine.h>
|
||||
|
||||
Hyperion* Hyperion::_hyperion = nullptr;
|
||||
|
||||
Hyperion* Hyperion::initInstance(const Json::Value& jsonConfig, const std::string configFile)
|
||||
{
|
||||
if ( Hyperion::_hyperion != nullptr )
|
||||
throw std::runtime_error("Hyperion::initInstance can be called only one time");
|
||||
Hyperion::_hyperion = new Hyperion(jsonConfig,configFile);
|
||||
|
||||
return Hyperion::_hyperion;
|
||||
}
|
||||
|
||||
Hyperion* Hyperion::getInstance()
|
||||
{
|
||||
if ( Hyperion::_hyperion == nullptr )
|
||||
throw std::runtime_error("Hyperion::getInstance used without call of Hyperion::initInstance before");
|
||||
|
||||
return Hyperion::_hyperion;
|
||||
}
|
||||
|
||||
ColorOrder Hyperion::createColorOrder(const Json::Value &deviceConfig)
|
||||
{
|
||||
|
Reference in New Issue
Block a user