Index: leahi.pro
===================================================================
diff -u -rd9993ef9458e1c25abc86a63d4d10b666ff8cd2c -r89077421d8f021c14b19e76e4f22b57ec3fb648b
--- leahi.pro (.../leahi.pro) (revision d9993ef9458e1c25abc86a63d4d10b666ff8cd2c)
+++ leahi.pro (.../leahi.pro) (revision 89077421d8f021c14b19e76e4f22b57ec3fb648b)
@@ -1,4 +1,4 @@
-QT += qml quick serialbus concurrent charts bluetooth
+QT += qml quick serialbus concurrent charts bluetooth multimedia
CONFIG += c++17 warn_on
# CONFIG += disable-desktop
# QMAKE_CXX = clazy
Index: leahi.qrc
===================================================================
diff -u -r1164ea502e3fabdb55aa41923e0e566505f197ef -r89077421d8f021c14b19e76e4f22b57ec3fb648b
--- leahi.qrc (.../leahi.qrc) (revision 1164ea502e3fabdb55aa41923e0e566505f197ef)
+++ leahi.qrc (.../leahi.qrc) (revision 89077421d8f021c14b19e76e4f22b57ec3fb648b)
@@ -112,6 +112,24 @@
resources/images/Volume.png
resources/images/water_sample_fail.png
resources/images/water_sample_pass.png
+ resources/images/gifgif.gif
+
+ resources/images/rainbow_kitty.gif
+ resources/images/movie_test_360p.avi
+ resources/images/movie_test_720p.mp4
+ resources/images/cat_frame_1.png
+ resources/images/cat_frame_2.png
+ resources/images/cat_frame_3.png
+ resources/images/cat_frame_4.png
+ resources/images/cat_frame_5.png
+ resources/images/cat_frame_6.png
+ resources/images/cat_frame_7.png
+ resources/images/cat_frame_8.png
+ resources/images/cat_frame_9.png
+ resources/images/cat_frame_10.png
+ resources/images/cat_frame_11.png
+ resources/images/cat_frame_12.png
+
sources/gui/qml/components/MainMenu.qml
Index: main.cpp
===================================================================
diff -u -re49c956894f999f6539b0c404dd1c9b18a76bb4b -r89077421d8f021c14b19e76e4f22b57ec3fb648b
--- main.cpp (.../main.cpp) (revision e49c956894f999f6539b0c404dd1c9b18a76bb4b)
+++ main.cpp (.../main.cpp) (revision 89077421d8f021c14b19e76e4f22b57ec3fb648b)
@@ -35,6 +35,8 @@
#include
#include
#include
+#include // SQ
+#include // SQ
// FW
#include "Compatible.h"
@@ -635,6 +637,20 @@
//! - Initializing the CloudSync controller
_CloudSyncController.init(Threads::_CloudSync_Thread);
+ const auto imageFormatList = QImageReader::supportedImageFormats();
+ QString imageFormats;
+ for (const auto format : imageFormatList) {
+ imageFormats += QString(imageFormats.length() > 0 ? ", %1" : "%1").arg(QString::fromUtf8(format));
+ }
+ qDebug() << QString("******** QImageReader::supportedImageFormats: %1").arg(imageFormats); // SQ
+
+ const auto movieFormatList = QMovie::supportedFormats();
+ QString movieFormats;
+ for (const auto format : movieFormatList) {
+ movieFormats += QString(movieFormats.length() > 0 ? ", %1" : "%1").arg(QString::fromUtf8(format));
+ }
+ qDebug() << QString("******** QMovie::supportedFormats: %1").arg(movieFormats); // SQ
+
//! - Initialize the QML Viewer and starts GUI
int app_exec = -1;
LOG_DEBUG("UI Initializing");
Index: sources/gui/qml/dialogs/NotificationDialog.qml
===================================================================
diff -u -rbea36be2766046e63c4e82539a630b5cee7ce1c6 -r89077421d8f021c14b19e76e4f22b57ec3fb648b
--- sources/gui/qml/dialogs/NotificationDialog.qml (.../NotificationDialog.qml) (revision bea36be2766046e63c4e82539a630b5cee7ce1c6)
+++ sources/gui/qml/dialogs/NotificationDialog.qml (.../NotificationDialog.qml) (revision 89077421d8f021c14b19e76e4f22b57ec3fb648b)
@@ -16,6 +16,7 @@
// Qt
import QtQuick 2.12
import QtGraphicalEffects 1.12
+import QtMultimedia 5.15
// Project
// Qml imports
@@ -208,16 +209,6 @@
text : model.instruction
wrapMode : Text.WordWrap
}
-
- MouseArea {
- anchors.fill: parent
- onClicked: {
- if (_listView.currentIndex !== index) {
- _listView.currentIndex = index
- _root.figureImageSource = model.image
- }
- }
- }
}
}
@@ -321,6 +312,19 @@
backgroundColor: Colors.white
fgColor : isPressed ? Colors.white : borderColor
selectColor : Qt.darker(borderColor, 1.15)
+ onClicked : {
+ let func = (value) => {
+ switch (value) {
+ case MediaPlayer.Available: return "Available"
+ case MediaPlayer.Busy: return "Busy"
+ case MediaPlayer.Unavailable: return "Unavailable"
+ case MediaPlayer.ResourceMissing: return "ResourceMissing"
+ }
+ }
+ _animatedImage.visible = false
+ _imageSequence.visible = false
+ _video.visible = ! _video.visible
+ } // SQ
}
TouchRect { id : _rinsebackTouchRect
@@ -331,6 +335,12 @@
backgroundColor: Colors.white
fgColor : isPressed ? Colors.white : borderColor
selectColor : Qt.darker(borderColor, 1.15)
+ onClicked : {
+ _imageSequence.visible = false
+ _video.visible = false
+ _animatedImage.visible = ! _animatedImage.visible
+
+ } // SQ
}
TouchRect { id : _endTouchRect
@@ -341,6 +351,11 @@
backgroundColor: Colors.white
fgColor : isPressed ? Colors.white : borderColor
selectColor : Qt.darker(borderColor, 1.15)
+ onClicked : {
+ _animatedImage.visible = false
+ _video.visible = false
+ _imageSequence.visible = ! _imageSequence.visible
+ } // SQ
}
TouchRect { id : _okTouchRect
@@ -367,6 +382,99 @@
font.pixelSize : Fonts.fontPixelAlarmID
}
+ Video { id: _video
+ anchors {
+ right: parent.right
+ rightMargin: Variables.defaultMargin * 3
+ verticalCenter: parent.verticalCenter
+ }
+ width: parent.width/3
+ height: parent.height/3
+ loops: MediaPlayer.Infinite
+ source: "qrc:/images/movie_test_720p"
+ visible: false
+ onVisibleChanged: {
+ visible ? play() : stop()
+ }
+ onPlaybackStateChanged: {
+ let func = (value) => {
+ switch (value) {
+ case MediaPlayer.PlayingState: return "playing"
+ case MediaPlayer.PausedState: return "paused"
+ case MediaPlayer.StoppedState: return "stopped"
+ }
+ }
+ console.log("video is " + func(playbackState))
+ }
+ }
+
+ AnimatedImage { id: _animatedImage
+ anchors {
+ right: parent.right
+ rightMargin: Variables.defaultMargin * 3
+ verticalCenter: parent.verticalCenter
+ }
+ width: parent.width/3
+ height: parent.height/3
+ source: "qrc:/images/rainbow_kitty"
+ visible: false
+ onVisibleChanged: {
+ if (visible) {
+ currentFrame = 0
+ }
+ }
+ }
+
+ Image { id: _imageSequence
+ anchors {
+ right: parent.right
+ rightMargin: Variables.defaultMargin * 3
+ verticalCenter: parent.verticalCenter
+ }
+ width: parent.width/3
+ height: parent.height/3
+ source: frames[currentIndex]
+ visible: false
+
+ property int currentIndex: 0
+ readonly property var frames: [
+ "qrc:/images/cat_frame_1",
+ "qrc:/images/cat_frame_2",
+ "qrc:/images/cat_frame_3",
+ "qrc:/images/cat_frame_4",
+ "qrc:/images/cat_frame_5",
+ "qrc:/images/cat_frame_6",
+ "qrc:/images/cat_frame_7",
+ "qrc:/images/cat_frame_8",
+ "qrc:/images/cat_frame_9",
+ "qrc:/images/cat_frame_10",
+ "qrc:/images/cat_frame_11",
+ "qrc:/images/cat_frame_12"
+ ]
+
+ onVisibleChanged: {
+ if (visible) {
+ currentIndex = 0
+ _imageSequenceTimer.running = true
+ }
+ else {
+ _imageSequenceTimer.running = false
+ }
+ }
+
+ Timer { id: _imageSequenceTimer
+ interval: 33
+ repeat: true
+ running: false
+ onTriggered: {
+ _imageSequence.currentIndex = (_imageSequence.currentIndex + 1) % _imageSequence.frames.length
+ }
+ onRunningChanged: {
+ console.log("image sequence is " + (_imageSequenceTimer.running ? "running" : "stopped"))
+ }
+ }
+ }
+
Connections { target: vAlarmStatus
function onDidAlarmRaise ( ) {
// image is out of sync when a new alarm is appears so on new alarm go to step 1 image