mirror of
https://github.com/hyperion-project/hyperion.ng.git
synced 2023-10-10 13:36:59 +02:00
9a2b167db7
spilt grabber components in "GRABBER" and "V4L"
77 lines
1.6 KiB
C++
77 lines
1.6 KiB
C++
#pragma once
|
|
|
|
#include <QObject>
|
|
#include <QTimer>
|
|
#include <string>
|
|
|
|
#include <utils/Logger.h>
|
|
#include <utils/Components.h>
|
|
#include <utils/GrabbingMode.h>
|
|
#include <hyperion/Hyperion.h>
|
|
|
|
class ImageProcessor;
|
|
|
|
class GrabberWrapper : public QObject
|
|
{
|
|
Q_OBJECT
|
|
public:
|
|
GrabberWrapper(std::string grabberName, const int priority, hyperion::Components grabberComponentId=hyperion::COMP_GRABBER);
|
|
|
|
virtual ~GrabberWrapper();
|
|
|
|
///
|
|
/// Starts the grabber wich produces led values with the specified update rate
|
|
///
|
|
virtual bool start();
|
|
|
|
///
|
|
/// Stop grabber
|
|
///
|
|
virtual void stop();
|
|
|
|
public slots:
|
|
void componentStateChanged(const hyperion::Components component, bool enable);
|
|
|
|
///
|
|
/// virtual method, should perform single frame grab and computes the led-colors
|
|
///
|
|
virtual void action() = 0;
|
|
|
|
///
|
|
/// Set the grabbing mode
|
|
/// @param[in] mode The new grabbing mode
|
|
///
|
|
void setGrabbingMode(const GrabbingMode mode);
|
|
|
|
signals:
|
|
void emitImage(int priority, const Image<ColorRgb> & image, const int timeout_ms);
|
|
|
|
protected:
|
|
|
|
virtual void kodiPlay();
|
|
virtual void kodiOff();
|
|
virtual void kodiPause();
|
|
|
|
std::string _grabberName;
|
|
|
|
/// Pointer to Hyperion for writing led values
|
|
Hyperion * _hyperion;
|
|
|
|
/// The priority of the led colors
|
|
const int _priority;
|
|
|
|
/// The timer for generating events with the specified update rate
|
|
QTimer _timer;
|
|
|
|
/// The Logger instance
|
|
Logger * _log;
|
|
|
|
// forwarding enabled
|
|
bool _forward;
|
|
|
|
/// The processor for transforming images to led colors
|
|
ImageProcessor * _processor;
|
|
|
|
hyperion::Components _grabberComponentId;
|
|
};
|