[chronojump] Better feedback for camera record



commit 19fd18b6622302633002b4fa1964ad8eb0057983
Author: Xavier de Blas <xaviblas gmail com>
Date:   Thu Jul 19 12:46:11 2018 +0200

    Better feedback for camera record

 src/gui/chronojump.cs   | 18 ++++++++++++++----
 src/gui/eventExecute.cs |  5 -----
 2 files changed, 14 insertions(+), 9 deletions(-)
---
diff --git a/src/gui/chronojump.cs b/src/gui/chronojump.cs
index 56d388fb..35eb2c0e 100644
--- a/src/gui/chronojump.cs
+++ b/src/gui/chronojump.cs
@@ -4239,15 +4239,25 @@ public partial class ChronoJumpWindow
                webcam = new Webcam();
                Webcam.Result result = webcam.MplayerCapture(preferences.videoDevice);
                if(result.success)
+               {
                        webcam.RecordStart();
+                       label_video_feedback.Text = "Rec.";
+               }
+               else
+               {
+                       new DialogMessage(Constants.MessageTypes.WARNING, result.error);
+                       button_video_play_this_test.Sensitive = false;
+               }
        }
 
-       //TODO: manage don't call here if webcamRecordStart has not succeeded
-       private void webcamRecordEnd(Constants.TestTypes testType, int testID)
+       private void webcamRecordEnd (Constants.TestTypes testType, int testID)
        {
                Webcam.Result result = webcam.RecordEnd (currentSession.UniqueID, testType, testID);
                if(! result.success)
+               {
                        new DialogMessage(Constants.MessageTypes.WARNING, result.error);
+                       button_video_play_this_test.Sensitive = false;
+               }
        }
 
        /* ---------------------------------------------------------
@@ -4401,7 +4411,7 @@ public partial class ChronoJumpWindow
                        sensitiveGuiAutoExecuteOrWait (false);
                }
 
-               if(preferences.videoOn)
+               if(preferences.videoOn && webcam.Running)
                        webcamRecordEnd (Constants.TestTypes.JUMP, currentJump.UniqueID);
 
                //since 0.7.4.1 when test is done, treeview select it. action event button have to be shown
@@ -4699,7 +4709,7 @@ public partial class ChronoJumpWindow
                //delete the temp tables if exists
                Sqlite.DeleteTempEvents("tempJumpRj");
 
-               if(preferences.videoOn)
+               if(preferences.videoOn && webcam.Running)
                        webcamRecordEnd (Constants.TestTypes.JUMP_RJ, currentJumpRj.UniqueID);
 
                //since 0.7.4.1 when test is done, treeview select it. action event button have to be shown
diff --git a/src/gui/eventExecute.cs b/src/gui/eventExecute.cs
index b674cc32..9c163282 100644
--- a/src/gui/eventExecute.cs
+++ b/src/gui/eventExecute.cs
@@ -246,11 +246,6 @@ public partial class ChronoJumpWindow
        private ExecutingGraphData event_execute_prepareForTest () 
        {
                checkbutton_video.Sensitive = false;
-               if(preferences.videoOn) {
-                       //capturer.ClickRec();
-                       //label_video_feedback.Text = Catalog.GetString("Recording");
-                       label_video_feedback.Text = "Rec.";
-               }
 
                ExecutingGraphData executingGraphData = new ExecutingGraphData(
                                event_execute_button_cancel, event_execute_button_finish, 


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]