2019-01-01 19:47:07 +01:00
|
|
|
#pragma once
|
|
|
|
|
|
|
|
// util
|
|
|
|
#include <utils/Image.h>
|
|
|
|
#include <utils/ColorRgb.h>
|
2019-07-29 19:09:26 +02:00
|
|
|
#include <utils/Components.h>
|
2019-01-01 19:47:07 +01:00
|
|
|
|
|
|
|
// qt
|
|
|
|
#include <QObject>
|
|
|
|
|
|
|
|
///
|
|
|
|
/// Singleton instance for simple signal sharing across threads, should be never used with Qt:DirectConnection!
|
|
|
|
///
|
|
|
|
class GlobalSignals : public QObject
|
|
|
|
{
|
|
|
|
Q_OBJECT
|
|
|
|
public:
|
|
|
|
static GlobalSignals* getInstance()
|
|
|
|
{
|
|
|
|
static GlobalSignals instance;
|
|
|
|
return & instance;
|
|
|
|
}
|
|
|
|
private:
|
|
|
|
GlobalSignals() {}
|
|
|
|
|
|
|
|
public:
|
|
|
|
GlobalSignals(GlobalSignals const&) = delete;
|
|
|
|
void operator=(GlobalSignals const&) = delete;
|
|
|
|
|
|
|
|
signals:
|
2019-07-29 19:09:26 +02:00
|
|
|
///////////////////////////////////////
|
|
|
|
///////////// TO HYPERION /////////////
|
|
|
|
///////////////////////////////////////
|
|
|
|
|
2019-01-01 19:47:07 +01:00
|
|
|
///
|
|
|
|
/// @brief PIPE SystemCapture images from GrabberWrapper to Hyperion class
|
2019-02-17 15:26:11 +01:00
|
|
|
/// @param name The name of the platform capture that is currently active
|
2019-01-01 19:47:07 +01:00
|
|
|
/// @param image The prepared image
|
|
|
|
///
|
2019-02-17 15:26:11 +01:00
|
|
|
void setSystemImage(const QString& name, const Image<ColorRgb>& image);
|
2019-01-01 19:47:07 +01:00
|
|
|
|
|
|
|
///
|
|
|
|
/// @brief PIPE v4lCapture images from v4lCapture over HyperionDaemon to Hyperion class
|
2019-02-17 15:26:11 +01:00
|
|
|
/// @param name The name of the v4l capture (path) that is currently active
|
2019-01-01 19:47:07 +01:00
|
|
|
/// @param image The prepared image
|
|
|
|
///
|
2019-07-29 19:09:26 +02:00
|
|
|
void setV4lImage(const QString& name, const Image<ColorRgb>& image);
|
|
|
|
|
|
|
|
///
|
|
|
|
/// @brief PIPE the register command for a new global input over HyperionDaemon to Hyperion class
|
|
|
|
/// @param[in] priority The priority of the channel
|
|
|
|
/// @param[in] component The component of the channel
|
|
|
|
/// @param[in] origin Who set the channel (CustomString@IP)
|
|
|
|
/// @param[in] owner Specific owner string, might be empty
|
|
|
|
/// @param[in] smooth_cfg The smooth id to use
|
|
|
|
///
|
|
|
|
void registerGlobalInput(const int priority, const hyperion::Components& component, const QString& origin = "External", const QString& owner = "", unsigned smooth_cfg = 0);
|
|
|
|
|
|
|
|
///
|
|
|
|
/// @brief PIPE the clear command for the global priority channel over HyperionDaemon to Hyperion class
|
2020-02-26 18:54:56 +01:00
|
|
|
/// @param[in] priority The priority channel (-1 to clear all possible priorities)
|
|
|
|
/// @param[in] forceclearAll Force the clear
|
2019-07-29 19:09:26 +02:00
|
|
|
///
|
2020-02-26 18:54:56 +01:00
|
|
|
void clearGlobalInput(int priority, bool forceClearAll=false);
|
2019-07-29 19:09:26 +02:00
|
|
|
|
|
|
|
///
|
|
|
|
/// @brief PIPE external images over HyperionDaemon to Hyperion class
|
|
|
|
/// @param[in] priority The priority of the channel
|
|
|
|
/// @param image The prepared image
|
|
|
|
/// @param[in] timeout_ms The timeout in milliseconds
|
|
|
|
/// @param clearEffect Should be true when NOT called from an effect
|
|
|
|
///
|
|
|
|
void setGlobalImage(const int priority, const Image<ColorRgb>& image, const int timeout_ms, const bool& clearEffect = true);
|
|
|
|
|
|
|
|
///
|
|
|
|
/// @brief PIPE external color message over HyperionDaemon to Hyperion class
|
|
|
|
/// @param[in] priority The priority of the channel
|
|
|
|
/// @param image The prepared color
|
|
|
|
/// @param[in] timeout_ms The timeout in milliseconds
|
|
|
|
/// @param[in] origin The setter
|
|
|
|
/// @param clearEffect Should be true when NOT called from an effect
|
|
|
|
///
|
2020-02-26 18:54:56 +01:00
|
|
|
void setGlobalColor(const int priority, const std::vector<ColorRgb> &ledColor, const int timeout_ms, const QString& origin = "External" ,bool clearEffects = true);
|
2019-07-29 19:09:26 +02:00
|
|
|
|
|
|
|
///////////////////////////////////////
|
|
|
|
//////////// FROM HYPERION ////////////
|
|
|
|
///////////////////////////////////////
|
|
|
|
|
|
|
|
///
|
|
|
|
/// @brief PIPE a registration request from the Hyperion class to the priority channel
|
|
|
|
/// @param[in] priority The priority channel
|
|
|
|
///
|
|
|
|
void globalRegRequired(int priority);
|
|
|
|
|
2019-01-01 19:47:07 +01:00
|
|
|
};
|