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,16 +1,14 @@
|
||||
#pragma once
|
||||
|
||||
// Qt includes
|
||||
#include <QTimer>
|
||||
|
||||
// Hyperion includes
|
||||
#include <hyperion/Hyperion.h>
|
||||
#include <hyperion/ImageProcessor.h>
|
||||
#include <hyperion/GrabberWrapper.h>
|
||||
|
||||
// Grabber includes
|
||||
#include <grabber/V4L2Grabber.h>
|
||||
|
||||
class V4L2Wrapper : public QObject
|
||||
class V4L2Wrapper : public GrabberWrapper
|
||||
{
|
||||
Q_OBJECT
|
||||
|
||||
@@ -26,7 +24,7 @@ public:
|
||||
double redSignalThreshold,
|
||||
double greenSignalThreshold,
|
||||
double blueSignalThreshold,
|
||||
int hyperionPriority);
|
||||
const int priority);
|
||||
virtual ~V4L2Wrapper();
|
||||
|
||||
public slots:
|
||||
@@ -41,34 +39,22 @@ public slots:
|
||||
|
||||
void set3D(VideoMode mode);
|
||||
|
||||
signals:
|
||||
void emitColors(int priority, const std::vector<ColorRgb> &ledColors, const int timeout_ms);
|
||||
void emitImage(int priority, const Image<ColorRgb> & image, const int timeout_ms);
|
||||
// signals:
|
||||
// void emitColors(int priority, const std::vector<ColorRgb> &ledColors, const int timeout_ms);
|
||||
|
||||
private slots:
|
||||
void newFrame(const Image<ColorRgb> & image);
|
||||
|
||||
virtual void action();
|
||||
void checkSources();
|
||||
|
||||
private:
|
||||
/// The timeout of the led colors [ms]
|
||||
const int _timeout_ms;
|
||||
|
||||
/// The priority of the led colors
|
||||
const int _priority;
|
||||
|
||||
/// The V4L2 grabber
|
||||
V4L2Grabber _grabber;
|
||||
|
||||
/// The processor for transforming images to led colors
|
||||
ImageProcessor * _processor;
|
||||
|
||||
/// The Hyperion instance
|
||||
Hyperion * _hyperion;
|
||||
|
||||
/// The list with computed led colors
|
||||
std::vector<ColorRgb> _ledColors;
|
||||
|
||||
/// Timer which tests if a higher priority source is active
|
||||
QTimer _timer;
|
||||
};
|
||||
|
Reference in New Issue
Block a user