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:
@@ -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