Index: leahi.qrc
===================================================================
diff -u -r721e055ca19c92525a45be953ad1cffdc2d69abb -r85acfb989e40d697550f788b85a1d287b3316728
--- leahi.qrc (.../leahi.qrc) (revision 721e055ca19c92525a45be953ad1cffdc2d69abb)
+++ leahi.qrc (.../leahi.qrc) (revision 85acfb989e40d697550f788b85a1d287b3316728)
@@ -71,6 +71,8 @@
resources/images/chevron-left.png
resources/images/chevron-right.png
resources/images/DenaliDevice.png
+ resources/images/Backward.png
+ resources/images/Forward.png
sources/gui/qml/components/MainMenu.qml
@@ -131,6 +133,7 @@
sources/gui/qml/components/EntryDialog.qml
sources/gui/qml/components/SliderArrows.qml
sources/gui/qml/components/QRCode.qml
+ sources/gui/qml/components/VideoScreen.qml
sources/gui/qml/compounds/PressureRangeSlider.qml
Index: resources/images/Backward.png
===================================================================
diff -u
Binary files differ
Index: resources/images/Forward.png
===================================================================
diff -u
Binary files differ
Index: sources/gui/qml/components/VideoScreen.qml
===================================================================
diff -u
--- sources/gui/qml/components/VideoScreen.qml (revision 0)
+++ sources/gui/qml/components/VideoScreen.qml (revision 85acfb989e40d697550f788b85a1d287b3316728)
@@ -0,0 +1,211 @@
+
+/*!
+ *
+ * Copyright (c) 2019-2025 Diality Inc. - All Rights Reserved.
+ * \copyright
+ * THIS CODE MAY NOT BE COPIED OR REPRODUCED IN ANY FORM, IN PART OR IN
+ * WHOLE, WITHOUT THE EXPLICIT PERMISSION OF THE COPYRIGHT OWNER.
+ *
+ * \file VideoScreen.qml
+ * \author (last) Behrouz NematiPour
+ * \date (last) 2-Feb-2025
+ * \author (original) Behrouz NematiPour
+ * \date (original) 2-Feb-2025
+ *
+ */
+
+// Qt
+import QtQuick 2.12
+import QtMultimedia 5.9
+
+// Qml imports
+import "qrc:/globals"
+import "qrc:/components"
+
+ScreenItem { id: _root
+
+ property alias source : _mediaplayer.source
+ property bool showButtons : false
+ property int showButtonsTimeOut : 3000 // ms
+ property int transitionInterval : 300 // ms
+ property int stepsInterval : 5000 // ms
+
+ visible : true
+ backgroundRect.width : parent.width
+ backgroundRect.height : parent.height
+ backgroundRect.color : "transparent"
+
+
+ // Video Play Controller
+ function resumeClicked() {
+ _mediaplayer.play()
+ _imageResume.visible = false
+ _imagePause.visible = !_imageResume.visible
+ }
+
+ function pauseClicked() {
+ _mediaplayer.pause()
+ _imagePause.visible = false
+ _imageResume.visible = !_imagePause.visible
+ }
+
+ function backwardClicked() {
+ _mediaplayer.seek(_mediaplayer.position - stepsInterval)
+ }
+
+ function forwardClicked() {
+ _mediaplayer.seek(_mediaplayer.position + stepsInterval)
+ }
+
+ function showButtonsHandler() {
+ showButtons = true
+ _singleShotTimer.restart()
+ }
+
+ // Media Object
+ MediaPlayer { id: _mediaplayer
+ // TODO: Temporarily, the video is stored in the following location
+ source : "file:///home/denali/videos/big_buck_bunny.mp4"
+
+ onStatusChanged: {
+ switch (_mediaplayer.status) {
+
+ case MediaPlayer.UnknownStatus:
+ // TODO: What should be the next action
+ console.log("[ISSUE::UnknownStatus] What should be the next step?")
+ break
+
+ case MediaPlayer.EndOfMedia:
+ //Reset
+ _imageResume.visible = true
+ _imagePause.visible = !_imageResume.visible
+ break
+ }
+ }
+ }
+
+ VideoOutput { id: _videoOutput
+ anchors.fill: parent
+ source : _mediaplayer
+ }
+
+ // Page Event Handler
+ onVisibleChanged: {
+ if(visible) {
+ // Autoplay
+ showButtons = false
+ resumeClicked()
+ }
+ else {
+ //actions before exiting the screen
+ _mediaplayer.stop()
+ _singleShotTimer.stop()
+ }
+ }
+
+ MouseArea { id: _playArea
+ anchors.fill: parent
+ onPressed: {
+ showButtonsHandler()
+ }
+ }
+
+ Timer { id: _singleShotTimer
+ interval: showButtonsTimeOut
+ running : false
+ repeat : false
+ onTriggered: {
+ showButtons = false
+ _singleShotTimer.stop()
+ }
+ }
+
+ // State handler for dynamically show/hide the video control buttons with transition
+ states: [
+ State {
+ name: "showButtons"
+ when: showButtons
+ PropertyChanges {
+ target: _buttonRow
+ opacity: 100
+ }
+ },
+
+ State {
+ name: "hideButtons"
+ when: !showButtons
+ PropertyChanges {
+ target: _buttonRow
+ opacity: 0
+ }
+ }
+ ]
+
+ transitions: Transition { id: _transition
+ SequentialAnimation {
+ OpacityAnimator {
+ duration: transitionInterval
+ }
+ }
+ }
+
+ // Video Control Buttons
+ Row { id: _buttonRow
+ opacity: 0
+ enabled: showButtons
+ spacing: 175
+ anchors {
+ horizontalCenter: _root.horizontalCenter
+ bottom: _root.bottom
+ bottomMargin: Variables.notificationHeight + 55 // + the texts height
+ }
+
+ ImageText {
+ id: _imageBackward
+ visible: true
+ enabled: (_mediaplayer.position > 0) ? true : false
+ anchors.bottom: _buttonRow.bottom
+ diameter: Variables.rinsebackIconDiameterDefault
+ source: "qrc:/images/iBackward"
+ text: qsTr("Backward")
+ fontSize: Fonts.fontPixelRinsebackAdjustmentButton
+ onClicked: backwardClicked()
+ }
+
+ ImageText {
+ id: _imageResume
+ visible: true
+ enabled: true
+ anchors.bottom: _buttonRow.bottom
+ diameter: Variables.rinsebackIconDiameterResumePause
+ source: "qrc:/images/iResume"
+ text: qsTr("Resume")
+ fontSize: Fonts.fontPixelRinsebackAdjustmentButton
+ onClicked: resumeClicked()
+ }
+
+ ImageText {
+ id: _imagePause
+ visible: !_imageResume.visible
+ anchors.bottom: _buttonRow.bottom
+ diameter: Variables.rinsebackIconDiameterResumePause
+ source: "qrc:/images/iPauseLightBlue"
+ text: qsTr("Pause")
+ fontSize: Fonts.fontPixelRinsebackAdjustmentButton
+ onClicked: pauseClicked()
+ }
+
+ ImageText {
+ id: _imageForeward
+ visible: true
+ enabled: !_mediaplayer.EndOfMedia
+ || ((_mediaplayer.duration - _mediaplayer.position) > 0) ? true : false
+ anchors.bottom: _buttonRow.bottom
+ diameter: Variables.rinsebackIconDiameterDefault
+ source: "qrc:/images/iForward"
+ text: qsTr("Foreward")
+ fontSize: Fonts.fontPixelRinsebackAdjustmentButton
+ onClicked: forwardClicked()
+ }
+ }
+}
Index: sources/gui/qml/dialogs/DiagnosticsDialog.qml
===================================================================
diff -u -r26433c42f2efa2cb18af95f523581c7eeeff049d -r85acfb989e40d697550f788b85a1d287b3316728
--- sources/gui/qml/dialogs/DiagnosticsDialog.qml (.../DiagnosticsDialog.qml) (revision 26433c42f2efa2cb18af95f523581c7eeeff049d)
+++ sources/gui/qml/dialogs/DiagnosticsDialog.qml (.../DiagnosticsDialog.qml) (revision 85acfb989e40d697550f788b85a1d287b3316728)
@@ -40,6 +40,15 @@
return idx * 100 + gap
}
+ // Jira: LEAH-1976-implement-a-simple-video-screen
+ // For testing the rest of code is comment out.
+ // Please uncomment the rest of code later
+ VideoScreen { id: _video
+ anchors.centerIn: parent
+ width : parent.width
+ height : parent.height
+ }
+
Rectangle {
anchors.centerIn: _closeButton
border.color : Colors.white
@@ -59,6 +68,7 @@
onClicked : close()
}
+ /*
DebugDataColumn { id: _DGROPumpColumn
textObjectName :"_DGROPumpData"
title : qsTr(" ROP ")
@@ -159,10 +169,11 @@
"HR" ,
]
}
-
- Text { id : _mouseEventCountText
- text: String("Touch: %1,%2").arg(GuiEventSpy.touchCount /*.toString().padStart(4,'0')*/ )
- .arg(GuiEventSpy.touchPoints /*.toString().padStart(4,'0')*/ )
+*/
+// Text { id : _mouseEventCountText
+// text: String("Touch: %1,%2").arg(GuiEventSpy.touchCount /*.toString().padStart(4,'0')*/ )
+// .arg(GuiEventSpy.touchPoints /*.toString().padStart(4,'0')*/ )
+/*
x: col(3.5)
y: row(1.5)
visible: true
@@ -631,6 +642,7 @@
]
}
+
Text { id : _hdResetInformation
x: col(0.2)
y: row(6.4)
@@ -659,5 +671,6 @@
}
}
}
+ */
}