mirror of
https://github.com/hyperion-project/hyperion.ng.git
synced 2023-10-10 13:36:59 +02:00
add led color streaming mutex and
timeout for led color refresh
This commit is contained in:
parent
ccbfe4c5b3
commit
4c81614c69
@ -7,7 +7,6 @@
|
|||||||
#include <hyperion/Hyperion.h>
|
#include <hyperion/Hyperion.h>
|
||||||
|
|
||||||
// qt includess
|
// qt includess
|
||||||
#include <QTimer>
|
|
||||||
#include <QJsonObject>
|
#include <QJsonObject>
|
||||||
#include <QMutex>
|
#include <QMutex>
|
||||||
#include <QString>
|
#include <QString>
|
||||||
@ -64,8 +63,11 @@ public:
|
|||||||
void forceServerInfo();
|
void forceServerInfo();
|
||||||
|
|
||||||
public slots:
|
public slots:
|
||||||
/// _timer_ledcolors requests ledcolor updates (if enabled)
|
///
|
||||||
void streamLedcolorsUpdate();
|
/// @brief is called whenever the current Hyperion instance pushes new led raw values (if enabled)
|
||||||
|
/// @param ledColors The current ledColors
|
||||||
|
///
|
||||||
|
void streamLedcolorsUpdate(const std::vector<ColorRgb>& ledColors);
|
||||||
|
|
||||||
/// push images whenever hyperion emits (if enabled)
|
/// push images whenever hyperion emits (if enabled)
|
||||||
void setImage(int priority, const Image<ColorRgb> & image, int duration_ms);
|
void setImage(int priority, const Image<ColorRgb> & image, int duration_ms);
|
||||||
@ -107,23 +109,26 @@ private:
|
|||||||
/// returns if hyperion is on or off
|
/// returns if hyperion is on or off
|
||||||
inline bool hyperionIsActive() { return JsonProcessor::_componentsPrevState.empty(); };
|
inline bool hyperionIsActive() { return JsonProcessor::_componentsPrevState.empty(); };
|
||||||
|
|
||||||
/// timer for ledcolors streaming
|
|
||||||
QTimer _timer_ledcolors;
|
|
||||||
|
|
||||||
// streaming buffers
|
// streaming buffers
|
||||||
QJsonObject _streaming_leds_reply;
|
QJsonObject _streaming_leds_reply;
|
||||||
QJsonObject _streaming_image_reply;
|
QJsonObject _streaming_image_reply;
|
||||||
QJsonObject _streaming_logging_reply;
|
QJsonObject _streaming_logging_reply;
|
||||||
|
bool _ledcolorsLedsActive = false;
|
||||||
|
|
||||||
/// flag to determine state of log streaming
|
/// flag to determine state of log streaming
|
||||||
bool _streaming_logging_activated;
|
bool _streaming_logging_activated;
|
||||||
|
|
||||||
/// mutex to determine state of image streaming
|
/// mutex to determine state of image streaming
|
||||||
QMutex _image_stream_mutex;
|
QMutex _image_stream_mutex;
|
||||||
|
/// mutex to determine state of led color streaming
|
||||||
|
QMutex _led_stream_mutex;
|
||||||
|
|
||||||
/// timeout for live video refresh
|
/// timeout for live video refresh
|
||||||
volatile qint64 _image_stream_timeout;
|
volatile qint64 _image_stream_timeout;
|
||||||
|
|
||||||
|
/// timeout for led color refresh
|
||||||
|
volatile qint64 _led_stream_timeout;
|
||||||
|
|
||||||
///
|
///
|
||||||
/// Handle an incoming JSON Color message
|
/// Handle an incoming JSON Color message
|
||||||
///
|
///
|
||||||
|
Loading…
Reference in New Issue
Block a user