mirror of
https://github.com/hyperion-project/hyperion.ng.git
synced 2025-03-01 10:33:28 +00:00
Refactor event handling incl.CEC
This commit is contained in:
@@ -24,9 +24,7 @@
|
||||
// Determine the cmake options
|
||||
#include <HyperionConfig.h>
|
||||
|
||||
#if defined(ENABLE_CEC)
|
||||
#include <cec/CECEvent.h>
|
||||
#endif
|
||||
#include <events/Event.h>
|
||||
|
||||
///
|
||||
/// Capture class for V4L2 devices
|
||||
@@ -77,13 +75,10 @@ public:
|
||||
void setSignalThreshold(double redSignalThreshold, double greenSignalThreshold, double blueSignalThreshold, int noSignalCounterThreshold = 50);
|
||||
void setSignalDetectionOffset( double verticalMin, double horizontalMin, double verticalMax, double horizontalMax);
|
||||
void setSignalDetectionEnable(bool enable);
|
||||
void setCecDetectionEnable(bool enable);
|
||||
bool reload(bool force = false);
|
||||
|
||||
QRectF getSignalDetectionOffset() const { return QRectF(_x_frac_min, _y_frac_min, _x_frac_max, _y_frac_max); } //used from hyperion-v4l2
|
||||
|
||||
|
||||
|
||||
///
|
||||
/// @brief Discover available V4L2 USB devices (for configuration).
|
||||
/// @param[in] params Parameters used to overwrite discovery default behaviour
|
||||
@@ -97,9 +92,7 @@ public slots:
|
||||
void stop();
|
||||
void newThreadFrame(Image<ColorRgb> image);
|
||||
|
||||
#if defined(ENABLE_CEC)
|
||||
void handleCecEvent(CECEvent event);
|
||||
#endif
|
||||
void handleEvent(Event event);
|
||||
|
||||
signals:
|
||||
void newFrame(const Image<ColorRgb> & image);
|
||||
@@ -167,7 +160,7 @@ private:
|
||||
// signal detection
|
||||
int _noSignalCounterThreshold;
|
||||
ColorRgb _noSignalThresholdColor;
|
||||
bool _cecDetectionEnabled, _cecStandbyActivated, _signalDetectionEnabled, _noSignalDetected;
|
||||
bool _standbyActivated, _signalDetectionEnabled, _noSignalDetected;
|
||||
int _noSignalCounter;
|
||||
int _brightness, _contrast, _saturation, _hue;
|
||||
double _x_frac_min;
|
||||
|
@@ -9,9 +9,7 @@
|
||||
#include <grabber/V4L2Grabber.h>
|
||||
#endif
|
||||
|
||||
#if defined(ENABLE_CEC)
|
||||
#include <cec/CECEvent.h>
|
||||
#endif
|
||||
#include <events/Event.h>
|
||||
|
||||
class VideoWrapper : public GrabberWrapper
|
||||
{
|
||||
@@ -25,9 +23,7 @@ public slots:
|
||||
bool start() override;
|
||||
void stop() override;
|
||||
|
||||
#if defined(ENABLE_CEC)
|
||||
void handleCecEvent(CECEvent event);
|
||||
#endif
|
||||
void handleEvent(Event event);
|
||||
|
||||
void handleSettingsUpdate(settings::type type, const QJsonDocument& config) override;
|
||||
|
||||
|
Reference in New Issue
Block a user