Skip to content

Commit

Permalink
Merge pull request mipops#834 from mipops/#817_rebased
Browse files Browse the repository at this point in the history
introduce frames detection timer
  • Loading branch information
dericed authored Mar 24, 2024
2 parents 47a5161 + 79b0fcf commit 9702892
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 0 deletions.
11 changes: 11 additions & 0 deletions Source/GUI/dvrescue/dvrescue/CapturePage.qml
Original file line number Diff line number Diff line change
Expand Up @@ -73,6 +73,15 @@ Rectangle {
}
}

Timer {
id: framesDetector
repeat: false
interval: 1000
onRunningChanged: {
noFrames = !running
}
}

property int indexOfFramePos: -1;
property int indexOfTimecode: -1;
property int indexOfRecDateTime: -1;
Expand Down Expand Up @@ -147,6 +156,8 @@ Rectangle {

dataModel.append(framePos, blockErrorsEven, blockErrors, captureView.capturingModeInt == captureView.playing)
}

framesDetector.restart()
}

function doCapture(captureCmd, captureStatus) {
Expand Down
4 changes: 4 additions & 0 deletions Source/GUI/dvrescue/dvrescue/CaptureView.qml
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,7 @@ Column {
property alias dataModel: dataModel

property int frameSpeed: 0
property bool noFrames: true

readonly property int thresholdBetweenFastPlayAndPlay: 35
readonly property int thresholdBetweenPlayAndSlowPlay: 30
Expand Down Expand Up @@ -316,6 +317,9 @@ Column {
anchors.fill: speedInterpretation
source: speedInterpretation
color: {
if(noFrames)
return "white"

if(frameSpeed <= -thresholdBetweenFastPlayAndPlay || frameSpeed >= thresholdBetweenFastPlayAndPlay)
return "purple"

Expand Down

0 comments on commit 9702892

Please sign in to comment.