mirror of
https://github.com/hyperion-project/hyperion.ng.git
synced 2025-03-01 10:33:28 +00:00
enable components at runtime + grabber refactoring (#160)
* implement enable/disable on runtime for: - smoothing - kodi - udplistener - boblight * implement enable/disable for forwarder refactor component * - implement grabber enable/disable at runtime - big grabber refactoring. now with common base class for all grabbers * implement enable/disable at runtime for bb detector * osx fix * try to fix cutted travis output for osx build
This commit is contained in:
@@ -1,19 +1,15 @@
|
||||
#pragma once
|
||||
|
||||
// QT includes
|
||||
#include <QObject>
|
||||
#include <QTimer>
|
||||
|
||||
// Utils includes
|
||||
#include <utils/Image.h>
|
||||
#include <utils/ColorRgb.h>
|
||||
#include <utils/ColorRgba.h>
|
||||
#include <utils/GrabbingMode.h>
|
||||
#include <utils/VideoMode.h>
|
||||
#include <hyperion/GrabberWrapper.h>
|
||||
|
||||
// Forward class declaration
|
||||
class DispmanxFrameGrabber;
|
||||
class Hyperion;
|
||||
class ImageProcessor;
|
||||
|
||||
///
|
||||
@@ -21,7 +17,7 @@ class ImageProcessor;
|
||||
/// displayed content. This ImageRgb is processed to a ColorRgb for each led and commmited to the
|
||||
/// attached Hyperion.
|
||||
///
|
||||
class DispmanxWrapper: public QObject
|
||||
class DispmanxWrapper: public GrabberWrapper
|
||||
{
|
||||
Q_OBJECT
|
||||
public:
|
||||
@@ -41,20 +37,10 @@ public:
|
||||
virtual ~DispmanxWrapper();
|
||||
|
||||
public slots:
|
||||
///
|
||||
/// Starts the grabber wich produces led values with the specified update rate
|
||||
///
|
||||
void start();
|
||||
|
||||
///
|
||||
/// Performs a single frame grab and computes the led-colors
|
||||
///
|
||||
void action();
|
||||
|
||||
///
|
||||
/// Stops the grabber
|
||||
///
|
||||
void stop();
|
||||
virtual void action();
|
||||
|
||||
void setCropping(const unsigned cropLeft, const unsigned cropRight,
|
||||
const unsigned cropTop, const unsigned cropBottom);
|
||||
@@ -71,9 +57,6 @@ public slots:
|
||||
///
|
||||
void setVideoMode(const VideoMode videoMode);
|
||||
|
||||
signals:
|
||||
void emitImage(int priority, const Image<ColorRgb> & image, const int timeout_ms);
|
||||
|
||||
private:
|
||||
/// The update rate [Hz]
|
||||
const int _updateInterval_ms;
|
||||
@@ -82,22 +65,11 @@ private:
|
||||
/// The priority of the led colors
|
||||
const int _priority;
|
||||
|
||||
/// The timer for generating events with the specified update rate
|
||||
QTimer _timer;
|
||||
|
||||
/// The image used for grabbing frames
|
||||
Image<ColorRgba> _image;
|
||||
/// The actual grabber
|
||||
DispmanxFrameGrabber * _frameGrabber;
|
||||
/// The processor for transforming images to led colors
|
||||
ImageProcessor * _processor;
|
||||
DispmanxFrameGrabber * _grabber;
|
||||
|
||||
/// The list with computed led colors
|
||||
std::vector<ColorRgb> _ledColors;
|
||||
|
||||
/// Pointer to Hyperion for writing led values
|
||||
Hyperion * _hyperion;
|
||||
|
||||
// forwarding enabled
|
||||
bool _forward;
|
||||
};
|
||||
|
Reference in New Issue
Block a user