* Fix #604 and #605

Signed-off-by: Paulchen-Panther <Paulchen-Panter@protonmail.com>

* clear current prio on color command

Signed-off-by: Paulchen-Panther <Paulchen-Panter@protonmail.com>

* Fix QTimer threading issues

* Call QTimer start() stop() from QEvent

Signed-off-by: Paulchen-Panther <Paulchen-Panter@protonmail.com>

* send initial color/image to WebUI
hide error message when opening webbrowser

Signed-off-by: Paulchen-Panther <Paulchen-Panter@protonmail.com>

* added streaming timer to update WebUI Preview

Signed-off-by: Paulchen-Panther <Paulchen-Panter@protonmail.com>

* remove QMetaObject::invokeMethod()

Signed-off-by: Paulchen-Panther <Paulchen-Panter@protonmail.com>

* added parent to streaming timers

Signed-off-by: Paulchen-Panther <Paulchen-Panter@protonmail.com>

* header cleanup
This commit is contained in:
Paulchen Panther
2019-08-24 22:53:30 +02:00
committed by brindosch
parent c419f305f3
commit 24495bbc65
8 changed files with 150 additions and 74 deletions

View File

@@ -2,21 +2,17 @@
// hyperion includes
#include <utils/Logger.h>
#include <utils/jsonschema/QJsonSchemaChecker.h>
#include <utils/Components.h>
#include <hyperion/Hyperion.h>
#include <hyperion/HyperionIManager.h>
// qt includes
#include <QJsonObject>
#include <QMutex>
#include <QString>
// HyperionInstanceManager
#include <hyperion/HyperionIManager.h>
class QTimer;
class JsonCB;
class AuthManager;
class HyperionIManager;
class JsonAPI : public QObject
{
@@ -43,15 +39,20 @@ public:
public slots:
///
/// @brief is called whenever the current Hyperion instance pushes new led raw values (if enabled)
/// @param ledColors The current ledColors
/// @brief Is called whenever the current Hyperion instance pushes new led raw values (if enabled)
/// @param ledColors The current led colors
///
void streamLedcolorsUpdate(const std::vector<ColorRgb>& ledColors);
/// push images whenever hyperion emits (if enabled)
///
/// @brief Push images whenever hyperion emits (if enabled)
/// @param image The current image
///
void setImage(const Image<ColorRgb> & image);
/// process and push new log messages from logger (if enabled)
///
/// @brief Process and push new log messages from logger (if enabled)
///
void incommingLogMessage(const Logger::T_LOG_MESSAGE&);
private slots:
@@ -128,17 +129,23 @@ private:
/// flag to determine state of log streaming
bool _streaming_logging_activated;
/// mutex to determine state of image streaming
QMutex _image_stream_mutex;
/// timer for live video refresh
QTimer* _imageStreamTimer;
/// mutex to determine state of led streaming
QMutex _led_stream_mutex;
/// image stream connection handle
QMetaObject::Connection _imageStreamConnection;
/// timeout for live video refresh
volatile qint64 _image_stream_timeout;
/// the current streaming image
Image<ColorRgb> _currentImage;
/// timeout for led color refresh
volatile qint64 _led_stream_timeout;
/// timer for led color refresh
QTimer* _ledStreamTimer;
/// led stream connection handle
QMetaObject::Connection _ledStreamConnection;
/// the current streaming led values
std::vector<ColorRgb> _currentLedValues;
///
/// @brief Handle the switches of Hyperion instances

View File

@@ -245,6 +245,17 @@ public:
return (ssize_t) _width * _height * sizeof(Pixel_T);
}
/// Clear the image
//
void clear()
{
_width = 1;
_height = 1;
_pixels = new Pixel_T[2];
_endOfPixels = _pixels + 1;
memset(_pixels, 0, _width * _height * sizeof(Pixel_T));
}
private:
///