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

@@ -33,7 +33,7 @@ public:
/// @param[in] updateRate_Hz The image grab rate [Hz]
/// @param[in] hyperion The instance of Hyperion used to write the led values
///
AmlogicWrapper(const unsigned grabWidth, const unsigned grabHeight, const unsigned updateRate_Hz, const int priority, Hyperion * hyperion);
AmlogicWrapper(const unsigned grabWidth, const unsigned grabHeight, const unsigned updateRate_Hz, const int priority);
///
/// Destructor of this dispmanx frame grabber. Releases any claimed resources.

View File

@@ -33,7 +33,7 @@ public:
/// @param[in] updateRate_Hz The image grab rate [Hz]
/// @param[in] hyperion The instance of Hyperion used to write the led values
///
DispmanxWrapper(const unsigned grabWidth, const unsigned grabHeight, const unsigned updateRate_Hz, const int priority, Hyperion * hyperion);
DispmanxWrapper(const unsigned grabWidth, const unsigned grabHeight, const unsigned updateRate_Hz, const int priority);
///
/// Destructor of this dispmanx frame grabber. Releases any claimed resources.

View File

@@ -31,9 +31,8 @@ public:
/// @param[in] grabWidth The width of the grabbed image [pixels]
/// @param[in] grabHeight The height of the grabbed images [pixels]
/// @param[in] updateRate_Hz The image grab rate [Hz]
/// @param[in] hyperion The instance of Hyperion used to write the led values
///
FramebufferWrapper(const std::string & device, const unsigned grabWidth, const unsigned grabHeight, const unsigned updateRate_Hz, const int priority, Hyperion * hyperion);
FramebufferWrapper(const std::string & device, const unsigned grabWidth, const unsigned grabHeight, const unsigned updateRate_Hz, const int priority);
///
/// Destructor of this framebuffer frame grabber. Releases any claimed resources.

View File

@@ -34,7 +34,7 @@ public:
/// @param[in] updateRate_Hz The image grab rate [Hz]
/// @param[in] hyperion The instance of Hyperion used to write the led values
///
OsxWrapper(const unsigned display, const unsigned grabWidth, const unsigned grabHeight, const unsigned updateRate_Hz, const int priority, Hyperion * hyperion);
OsxWrapper(const unsigned display, const unsigned grabWidth, const unsigned grabHeight, const unsigned updateRate_Hz, const int priority);
///
/// Destructor of this osx frame grabber. Releases any claimed resources.

View File

@@ -26,7 +26,6 @@ public:
double redSignalThreshold,
double greenSignalThreshold,
double blueSignalThreshold,
Hyperion * hyperion,
int hyperionPriority);
virtual ~V4L2Wrapper();

View File

@@ -62,18 +62,15 @@ public:
SATURATION_GAIN, VALUE_GAIN, THRESHOLD, GAMMA, BLACKLEVEL, WHITELEVEL
};
///
/// Constructs the Hyperion instance based on the given Json configuration
///
/// @param[in] jsonConfig The Json configuration
///
Hyperion(const Json::Value& jsonConfig, const std::string configFile);
///
/// Destructor; cleans up resourcess
///
~Hyperion();
static Hyperion* initInstance(const Json::Value& jsonConfig, const std::string configFile);
static Hyperion* getInstance();
///
/// Returns the number of attached leds
///
@@ -228,6 +225,8 @@ public slots:
int setEffect(const std::string & effectName, const Json::Value & args, int priority, int timeout = -1);
public:
static Hyperion *_hyperion;
static ColorOrder createColorOrder(const Json::Value & deviceConfig);
/**
* Construct the 'led-string' with the integration area definition per led and the color
@@ -271,6 +270,14 @@ private slots:
void update();
private:
///
/// Constructs the Hyperion instance based on the given Json configuration
///
/// @param[in] jsonConfig The Json configuration
///
Hyperion(const Json::Value& jsonConfig, const std::string configFile);
/// The specifiation of the led frame construction and picture integration
LedString _ledString;

View File

@@ -13,7 +13,7 @@ class WebConfig : public QObject {
Q_OBJECT
public:
WebConfig (Hyperion *hyperion, QObject * parent = NULL);
WebConfig (QObject * parent = NULL);
virtual ~WebConfig (void);

View File

@@ -29,19 +29,8 @@ class XBMCVideoChecker : public QObject
Q_OBJECT
public:
///
/// Constructor
///
/// @param address Network address of the XBMC instance
/// @param port Port number to use (XBMC default = 9090)
/// @param grabVideo Whether or not to grab when the XBMC video player is playing
/// @param grabPhoto Whether or not to grab when the XBMC photo player is playing
/// @param grabAudio Whether or not to grab when the XBMC audio player is playing
/// @param grabMenu Whether or not to grab when nothing is playing (in XBMC menu)
/// @param grabScreensaver Whether or not to grab when the XBMC screensaver is activated
/// @param enable3DDetection Wheter or not to enable the detection of 3D movies playing
///
XBMCVideoChecker(const std::string & address, uint16_t port, bool grabVideo, bool grabPhoto, bool grabAudio, bool grabMenu, bool grabPause, bool grabScreensaver, bool enable3DDetection);
static XBMCVideoChecker* initInstance(const std::string & address, uint16_t port, bool grabVideo, bool grabPhoto, bool grabAudio, bool grabMenu, bool grabPause, bool grabScreensaver, bool enable3DDetection);
static XBMCVideoChecker* getInstance();
///
/// Start polling XBMC
@@ -72,6 +61,20 @@ private slots:
void connectionError(QAbstractSocket::SocketError error);
private:
///
/// Constructor
///
/// @param address Network address of the XBMC instance
/// @param port Port number to use (XBMC default = 9090)
/// @param grabVideo Whether or not to grab when the XBMC video player is playing
/// @param grabPhoto Whether or not to grab when the XBMC photo player is playing
/// @param grabAudio Whether or not to grab when the XBMC audio player is playing
/// @param grabMenu Whether or not to grab when nothing is playing (in XBMC menu)
/// @param grabScreensaver Whether or not to grab when the XBMC screensaver is activated
/// @param enable3DDetection Wheter or not to enable the detection of 3D movies playing
///
XBMCVideoChecker(const std::string & address, uint16_t port, bool grabVideo, bool grabPhoto, bool grabAudio, bool grabMenu, bool grabPause, bool grabScreensaver, bool enable3DDetection);
/// Set the grabbing mode
void setGrabbingMode(GrabbingMode grabbingMode);
@@ -137,4 +140,6 @@ private:
/// XBMC version number
int _xbmcVersion;
static XBMCVideoChecker* _kodichecker;
};