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;
|
|
|
|
}
|
2020-08-08 13:22:37 +02:00
|
|
|
|
2019-01-01 19:47:07 +01:00
|
|
|
private:
|
2020-07-12 09:19:59 +02:00
|
|
|
GlobalSignals() = default;
|
2019-01-01 19:47:07 +01:00
|
|
|
|
|
|
|
public:
|
2020-06-28 23:12:22 +02:00
|
|
|
GlobalSignals(GlobalSignals const&) = delete;
|
|
|
|
void operator=(GlobalSignals const&) = delete;
|
2019-01-01 19:47:07 +01:00
|
|
|
|
|
|
|
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);
|
|
|
|
|
2022-05-29 17:47:08 +02:00
|
|
|
#if defined(ENABLE_FLATBUF_SERVER) || defined(ENABLE_PROTOBUF_SERVER)
|
|
|
|
///
|
|
|
|
/// @brief PIPE Flat-/Proto- buffer images to Hyperion class
|
|
|
|
/// @param name The name of the buffer capture that is currently active
|
|
|
|
/// @param image The prepared image
|
|
|
|
///
|
|
|
|
void setBufferImage(const QString& name, const Image<ColorRgb>& image);
|
|
|
|
#endif
|
|
|
|
|
2023-02-19 09:36:39 +01:00
|
|
|
///
|
|
|
|
/// @brief PIPE audioCapture images from audioCapture over HyperionDaemon to Hyperion class
|
|
|
|
/// @param name The name of the audio capture (path) that is currently active
|
|
|
|
/// @param image The prepared image
|
|
|
|
///
|
|
|
|
void setAudioImage(const QString& name, const Image<ColorRgb>& image);
|
|
|
|
|
2019-07-29 19:09:26 +02:00
|
|
|
///
|
|
|
|
/// @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
|
|
|
|
///
|
2020-08-08 13:09:15 +02:00
|
|
|
void registerGlobalInput(int priority, hyperion::Components component, const QString& origin = "External", const QString& owner = "", unsigned smooth_cfg = 0);
|
2019-07-29 19:09:26 +02:00
|
|
|
|
|
|
|
///
|
|
|
|
/// @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
|
|
|
|
///
|
2020-08-08 13:09:15 +02:00
|
|
|
void setGlobalImage(int priority, const Image<ColorRgb>& image, int timeout_ms, bool clearEffect = true);
|
2019-07-29 19:09:26 +02:00
|
|
|
|
|
|
|
///
|
|
|
|
/// @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-08-08 13:09:15 +02:00
|
|
|
void setGlobalColor(int priority, const std::vector<ColorRgb> &ledColor, 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);
|
|
|
|
|
2020-03-26 17:49:36 +01:00
|
|
|
///
|
|
|
|
/// @brief Tell v4l2/screen capture the listener state
|
|
|
|
/// @param component The component to handle
|
|
|
|
/// @param hyperionInd The Hyperion instance index as identifier
|
|
|
|
/// @param listen True when listening, else false
|
|
|
|
///
|
2020-08-08 13:09:15 +02:00
|
|
|
void requestSource(hyperion::Components component, int hyperionInd, bool listen);
|
2020-03-26 17:49:36 +01:00
|
|
|
|
2019-01-01 19:47:07 +01:00
|
|
|
};
|