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:
@@ -12,7 +12,7 @@
|
||||
#include <grabber/AmlogicGrabber.h>
|
||||
|
||||
|
||||
AmlogicWrapper::AmlogicWrapper(const unsigned grabWidth, const unsigned grabHeight, const unsigned updateRate_Hz, const int priority, Hyperion * hyperion) :
|
||||
AmlogicWrapper::AmlogicWrapper(const unsigned grabWidth, const unsigned grabHeight, const unsigned updateRate_Hz, const int priority) :
|
||||
_updateInterval_ms(1000/updateRate_Hz),
|
||||
_timeout_ms(2 * _updateInterval_ms),
|
||||
_priority(priority),
|
||||
@@ -20,8 +20,8 @@ AmlogicWrapper::AmlogicWrapper(const unsigned grabWidth, const unsigned grabHeig
|
||||
_image(grabWidth, grabHeight),
|
||||
_frameGrabber(new AmlogicGrabber(grabWidth, grabHeight)),
|
||||
_processor(ImageProcessorFactory::getInstance().newImageProcessor()),
|
||||
_ledColors(hyperion->getLedCount(), ColorRgb{0,0,0}),
|
||||
_hyperion(hyperion)
|
||||
_ledColors(Hyperion::getInstance()->getLedCount(), ColorRgb{0,0,0}),
|
||||
_hyperion(Hyperion::getInstance())
|
||||
{
|
||||
// Configure the timer to generate events every n milliseconds
|
||||
_timer.setInterval(_updateInterval_ms);
|
||||
|
@@ -15,11 +15,7 @@ SET(AmlogicSOURCES
|
||||
${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})
|
||||
endif(ENABLE_QT5)
|
||||
|
||||
add_library(amlogic-grabber
|
||||
${AmlogicHEADERS}
|
||||
|
@@ -21,11 +21,7 @@ SET(DispmanxGrabberSOURCES
|
||||
${CURRENT_SOURCE_DIR}/DispmanxFrameGrabber.cpp
|
||||
)
|
||||
|
||||
if(ENABLE_QT5)
|
||||
QT5_WRAP_CPP(DispmanxGrabberHEADERS_MOC ${DispmanxGrabberQT_HEADERS})
|
||||
else()
|
||||
QT4_WRAP_CPP(DispmanxGrabberHEADERS_MOC ${DispmanxGrabberQT_HEADERS})
|
||||
endif()
|
||||
QT5_WRAP_CPP(DispmanxGrabberHEADERS_MOC ${DispmanxGrabberQT_HEADERS})
|
||||
|
||||
add_library(dispmanx-grabber
|
||||
${DispmanxGrabberHEADERS}
|
||||
|
@@ -12,7 +12,7 @@
|
||||
#include <grabber/DispmanxFrameGrabber.h>
|
||||
|
||||
|
||||
DispmanxWrapper::DispmanxWrapper(const unsigned grabWidth, const unsigned grabHeight, const unsigned updateRate_Hz, const int priority, Hyperion * hyperion) :
|
||||
DispmanxWrapper::DispmanxWrapper(const unsigned grabWidth, const unsigned grabHeight, const unsigned updateRate_Hz, const int priority) :
|
||||
_updateInterval_ms(1000/updateRate_Hz),
|
||||
_timeout_ms(2 * _updateInterval_ms),
|
||||
_priority(priority),
|
||||
@@ -20,8 +20,8 @@ DispmanxWrapper::DispmanxWrapper(const unsigned grabWidth, const unsigned grabHe
|
||||
_image(grabWidth, grabHeight),
|
||||
_frameGrabber(new DispmanxFrameGrabber(grabWidth, grabHeight)),
|
||||
_processor(ImageProcessorFactory::getInstance().newImageProcessor()),
|
||||
_ledColors(hyperion->getLedCount(), ColorRgb{0,0,0}),
|
||||
_hyperion(hyperion)
|
||||
_ledColors(Hyperion::getInstance()->getLedCount(), ColorRgb{0,0,0}),
|
||||
_hyperion(Hyperion::getInstance())
|
||||
{
|
||||
// Configure the timer to generate events every n milliseconds
|
||||
_timer.setInterval(_updateInterval_ms);
|
||||
|
@@ -21,11 +21,7 @@ SET(FramebufferGrabberSOURCES
|
||||
${CURRENT_SOURCE_DIR}/FramebufferFrameGrabber.cpp
|
||||
)
|
||||
|
||||
if(ENABLE_QT5)
|
||||
QT5_WRAP_CPP(FramebufferGrabberHEADERS_MOC ${FramebufferGrabberQT_HEADERS})
|
||||
else()
|
||||
QT4_WRAP_CPP(FramebufferGrabberHEADERS_MOC ${FramebufferGrabberQT_HEADERS})
|
||||
endif()
|
||||
QT5_WRAP_CPP(FramebufferGrabberHEADERS_MOC ${FramebufferGrabberQT_HEADERS})
|
||||
|
||||
add_library(framebuffer-grabber
|
||||
${FramebufferGrabberHEADERS}
|
||||
|
@@ -7,7 +7,7 @@
|
||||
#include <grabber/FramebufferWrapper.h>
|
||||
#include <grabber/FramebufferFrameGrabber.h>
|
||||
|
||||
FramebufferWrapper::FramebufferWrapper(const std::string & device, const unsigned grabWidth, const unsigned grabHeight, const unsigned updateRate_Hz, const int priority, Hyperion * hyperion) :
|
||||
FramebufferWrapper::FramebufferWrapper(const std::string & device, const unsigned grabWidth, const unsigned grabHeight, const unsigned updateRate_Hz, const int priority) :
|
||||
_updateInterval_ms(1000/updateRate_Hz),
|
||||
_timeout_ms(2 * _updateInterval_ms),
|
||||
_priority(priority),
|
||||
@@ -15,8 +15,8 @@ FramebufferWrapper::FramebufferWrapper(const std::string & device, const unsigne
|
||||
_image(grabWidth, grabHeight),
|
||||
_frameGrabber(new FramebufferFrameGrabber(device, grabWidth, grabHeight)),
|
||||
_processor(ImageProcessorFactory::getInstance().newImageProcessor()),
|
||||
_ledColors(hyperion->getLedCount(), ColorRgb{0,0,0}),
|
||||
_hyperion(hyperion)
|
||||
_ledColors(Hyperion::getInstance()->getLedCount(), ColorRgb{0,0,0}),
|
||||
_hyperion(Hyperion::getInstance())
|
||||
{
|
||||
// Configure the timer to generate events every n milliseconds
|
||||
_timer.setInterval(_updateInterval_ms);
|
||||
|
@@ -16,11 +16,7 @@ SET(OsxGrabberSOURCES
|
||||
${CURRENT_SOURCE_DIR}/OsxFrameGrabber.cpp
|
||||
)
|
||||
|
||||
if(ENABLE_QT5)
|
||||
QT5_WRAP_CPP(OsxGrabberHEADERS_MOC ${OsxGrabberQT_HEADERS})
|
||||
else()
|
||||
QT4_WRAP_CPP(OsxGrabberHEADERS_MOC ${OsxGrabberQT_HEADERS})
|
||||
endif()
|
||||
QT5_WRAP_CPP(OsxGrabberHEADERS_MOC ${OsxGrabberQT_HEADERS})
|
||||
|
||||
add_library(osx-grabber
|
||||
${OsxGrabberHEADERS}
|
||||
|
@@ -7,7 +7,7 @@
|
||||
#include <grabber/OsxWrapper.h>
|
||||
#include <grabber/OsxFrameGrabber.h>
|
||||
|
||||
OsxWrapper::OsxWrapper(const unsigned display, const unsigned grabWidth, const unsigned grabHeight, const unsigned updateRate_Hz, const int priority, Hyperion * hyperion) :
|
||||
OsxWrapper::OsxWrapper(const unsigned display, const unsigned grabWidth, const unsigned grabHeight, const unsigned updateRate_Hz, const int priority) :
|
||||
_updateInterval_ms(1000/updateRate_Hz),
|
||||
_timeout_ms(2 * _updateInterval_ms),
|
||||
_priority(priority),
|
||||
@@ -15,8 +15,8 @@ OsxWrapper::OsxWrapper(const unsigned display, const unsigned grabWidth, const u
|
||||
_image(grabWidth, grabHeight),
|
||||
_frameGrabber(new OsxFrameGrabber(display, grabWidth, grabHeight)),
|
||||
_processor(ImageProcessorFactory::getInstance().newImageProcessor()),
|
||||
_ledColors(hyperion->getLedCount(), ColorRgb{0,0,0}),
|
||||
_hyperion(hyperion)
|
||||
_ledColors(Hyperion::getInstance()->getLedCount(), ColorRgb{0,0,0}),
|
||||
_hyperion(Hyperion::getInstance())
|
||||
{
|
||||
// Configure the timer to generate events every n milliseconds
|
||||
_timer.setInterval(_updateInterval_ms);
|
||||
|
@@ -16,11 +16,7 @@ SET(V4L2_SOURCES
|
||||
${CURRENT_SOURCE_DIR}/V4L2Wrapper.cpp
|
||||
)
|
||||
|
||||
if(ENABLE_QT5)
|
||||
QT5_WRAP_CPP(V4L2_HEADERS_MOC ${V4L2_QT_HEADERS})
|
||||
else()
|
||||
QT4_WRAP_CPP(V4L2_HEADERS_MOC ${V4L2_QT_HEADERS})
|
||||
endif()
|
||||
QT5_WRAP_CPP(V4L2_HEADERS_MOC ${V4L2_QT_HEADERS})
|
||||
|
||||
add_library(v4l2-grabber
|
||||
${V4L2_HEADERS}
|
||||
@@ -29,9 +25,7 @@ add_library(v4l2-grabber
|
||||
${V4L2_HEADERS_MOC}
|
||||
)
|
||||
|
||||
if(ENABLE_QT5)
|
||||
qt5_use_modules(v4l2-grabber Widgets)
|
||||
endif(ENABLE_QT5)
|
||||
|
||||
target_link_libraries(v4l2-grabber
|
||||
hyperion
|
||||
|
@@ -15,7 +15,6 @@ V4L2Wrapper::V4L2Wrapper(const std::string &device,
|
||||
double redSignalThreshold,
|
||||
double greenSignalThreshold,
|
||||
double blueSignalThreshold,
|
||||
Hyperion *hyperion,
|
||||
int hyperionPriority) :
|
||||
_timeout_ms(1000),
|
||||
_priority(hyperionPriority),
|
||||
@@ -29,8 +28,8 @@ V4L2Wrapper::V4L2Wrapper(const std::string &device,
|
||||
pixelDecimation,
|
||||
pixelDecimation),
|
||||
_processor(ImageProcessorFactory::getInstance().newImageProcessor()),
|
||||
_hyperion(hyperion),
|
||||
_ledColors(hyperion->getLedCount(), ColorRgb{0,0,0}),
|
||||
_hyperion(Hyperion::getInstance()),
|
||||
_ledColors(Hyperion::getInstance()->getLedCount(), ColorRgb{0,0,0}),
|
||||
_timer()
|
||||
{
|
||||
// set the signal detection threshold of the grabber
|
||||
|
@@ -22,11 +22,7 @@ SET(X11_SOURCES
|
||||
${CURRENT_SOURCE_DIR}/X11Grabber.cpp
|
||||
)
|
||||
|
||||
if(ENABLE_QT5)
|
||||
QT5_WRAP_CPP(X11_HEADERS_MOC ${X11_QT_HEADERS})
|
||||
else()
|
||||
QT4_WRAP_CPP(X11_HEADERS_MOC ${X11_QT_HEADERS})
|
||||
endif()
|
||||
QT5_WRAP_CPP(X11_HEADERS_MOC ${X11_QT_HEADERS})
|
||||
|
||||
add_library(x11-grabber
|
||||
${X11_HEADERS}
|
||||
|
Reference in New Issue
Block a user