Commit 593a3ffa authored by Xavier de Blas's avatar Xavier de Blas

label_video_feedback shows info when video file start growing

parent 63ef90da
......@@ -1863,6 +1863,12 @@
<placeholder/>
</child>
<child>
<placeholder/>
</child>
<child>
<placeholder/>
</child>
<child>
<widget class="GtkLabel" id="label_start_selector_jumps">
<property name="visible">True</property>
<property name="can_focus">False</property>
......@@ -20446,18 +20452,6 @@ Concentric</property>
<placeholder/>
</child>
<child>
<placeholder/>
</child>
<child>
<placeholder/>
</child>
<child>
<placeholder/>
</child>
<child>
<placeholder/>
</child>
<child>
<widget class="GtkCheckButton" id="checkbutton_force_sensor_ai_b">
<property name="width_request">30</property>
<property name="visible">True</property>
......@@ -20615,6 +20609,12 @@ Concentric</property>
<child>
<placeholder/>
</child>
<child>
<placeholder/>
</child>
<child>
<placeholder/>
</child>
</widget>
<packing>
<property name="expand">False</property>
......@@ -28961,6 +28961,12 @@ then click this button.</property>
<child>
<placeholder/>
</child>
<child>
<placeholder/>
</child>
<child>
<placeholder/>
</child>
</widget>
<packing>
<property name="expand">False</property>
......@@ -353,7 +353,21 @@ public class EventExecute
}
// <-------------------------- end of races specific
//camera stuff: show something when record really starts
if(webcamStarting)
{
if(! checkWebcamFileStarted)
{
if(WebcamManage.RecordingFileStarted ())
{
LogB.Information("WebcamManage.RecodingFileStarted");
UtilGtk.PrintLabelWithTooltip(egd.Label_video_feedback, "Recording video.");
checkWebcamFileStarted = true;
}
}
}
//check if it should finish by time
if(shouldFinishByTime()) {
finish = true;
......@@ -598,6 +612,12 @@ public class EventExecute
get { return eventDone; }
}
private bool webcamStarting = false;
private bool checkWebcamFileStarted = false;
public bool WebcamStarting {
set { webcamStarting = value; }
}
// multi Chronopic stuff
public int Chronopics { get { return chronopics; } }
......
......@@ -4288,12 +4288,12 @@ public partial class ChronoJumpWindow
if(ncams == 1 && webcamManage.RecordPrepare(preferences.videoDevice).success)
{
webcamManage.RecordStart(1);
label_video_feedback.Text = "Rec.";
label_video_feedback.Text = "Preparing camera";
}
else if(ncams == 2 && webcamManage.RecordPrepare(preferences.videoDevice, "/dev/video1").success)
{
webcamManage.RecordStart(2);
label_video_feedback.Text = "Rec.";
label_video_feedback.Text = "Preparing camera";
}
//TODO depending on errorMessage:
//new DialogMessage(Constants.MessageTypes.WARNING, result.error);
......@@ -4447,6 +4447,7 @@ public partial class ChronoJumpWindow
//UtilGtk.ChronopicColors(viewport_chronopics, label_chronopics, label_connected_chronopics, chronopicWin.Connected);
webcamStart (1);
currentEventExecute.WebcamStarting = (preferences.videoOn && webcamManage != null); //to show info on label_video_feedback
if (! canCaptureC)
currentEventExecute.SimulateInitValues(rand);
......@@ -4455,7 +4456,7 @@ public partial class ChronoJumpWindow
currentEventExecute.Manage();
else
currentEventExecute.ManageFall();
thisJumpIsSimple = true; //used by: on_event_execute_update_graph_in_progress_clicked
currentEventExecute.FakeButtonUpdateGraph.Clicked +=
new EventHandler(on_event_execute_update_graph_in_progress_clicked);
......@@ -4756,14 +4757,15 @@ public partial class ChronoJumpWindow
//webcamStart (2);
webcamStart (1);
currentEventExecute.WebcamStarting = (preferences.videoOn && webcamManage != null); //to show info on label_video_feedback
//suitable for limited by jump and time
//simulated always simulate limited by jumps
if(! canCaptureC)
currentEventExecute.SimulateInitValues(rand);
currentEventExecute.Manage();
thisJumpIsSimple = false; //used by: on_event_execute_update_graph_in_progress_clicked
currentEventExecute.FakeButtonUpdateGraph.Clicked +=
new EventHandler(on_event_execute_update_graph_in_progress_clicked);
......@@ -4903,6 +4905,7 @@ public partial class ChronoJumpWindow
);
webcamStart (1);
currentEventExecute.WebcamStarting = (preferences.videoOn && webcamManage != null); //to show info on label_video_feedback
if (! canCaptureC)
currentEventExecute.SimulateInitValues(rand);
......@@ -5037,6 +5040,7 @@ public partial class ChronoJumpWindow
);
webcamStart (1);
currentEventExecute.WebcamStarting = (preferences.videoOn && webcamManage != null); //to show info on label_video_feedback
//suitable for limited by tracks and time
if(! canCaptureC)
......@@ -5257,6 +5261,7 @@ public partial class ChronoJumpWindow
);
webcamStart (1);
currentEventExecute.WebcamStarting = (preferences.videoOn && webcamManage != null); //to show info on label_video_feedback
if (! canCaptureC)
currentEventExecute.SimulateInitValues(rand);
......@@ -5416,6 +5421,7 @@ public partial class ChronoJumpWindow
);
webcamStart (1);
currentEventExecute.WebcamStarting = (preferences.videoOn && webcamManage != null); //to show info on label_video_feedback
if(! canCaptureC)
currentEventExecute.SimulateInitValues(rand);
......@@ -5703,6 +5709,7 @@ public partial class ChronoJumpWindow
);
webcamStart (1);
currentEventExecute.WebcamStarting = (preferences.videoOn && webcamManage != null); //to show info on label_video_feedback
//mark to only get inside on_multi_chronopic_finished one time
multiFinishing = false;
......@@ -6114,7 +6121,7 @@ LogB.Debug("mc finished 5");
*/
//TODO: manage different playVideo. Playing is very different than capturing, separate it.
Webcam webcam;
Webcam webcamPlay;
private void on_button_video_preview_clicked (object o, EventArgs args)
{
......@@ -6123,8 +6130,8 @@ LogB.Debug("mc finished 5");
private void playPreview ()
{
//constructor for playpreview
webcam = new WebcamFfmpeg (Webcam.Action.PLAYPREVIEW, UtilAll.GetOSEnum(), preferences.videoDevice);
Webcam.Result result = webcam.PlayPreview ();
webcamPlay = new WebcamFfmpeg (Webcam.Action.PLAYPREVIEW, UtilAll.GetOSEnum(), preferences.videoDevice);
Webcam.Result result = webcamPlay.PlayPreview ();
}
private void on_button_video_debug_clicked (object o, EventArgs args)
......@@ -6142,8 +6149,8 @@ LogB.Debug("mc finished 5");
private void playVideo (string fileName)
{
//constructor for playpreview
webcam = new WebcamFfmpeg (Webcam.Action.PLAYFILE, UtilAll.GetOSEnum(), "");
Webcam.Result result = webcam.PlayFile (fileName);
webcamPlay = new WebcamFfmpeg (Webcam.Action.PLAYFILE, UtilAll.GetOSEnum(), "");
Webcam.Result result = webcamPlay.PlayFile (fileName);
/*
* TODO: reimplement this with ffmpeg
......
......@@ -251,6 +251,7 @@ public partial class ChronoJumpWindow
event_execute_button_cancel, event_execute_button_finish,
event_execute_label_message,
event_execute_label_event_value, event_execute_label_time_value,
label_video_feedback,
event_execute_progressbar_event, event_execute_progressbar_time);
return executingGraphData;
......
......@@ -31,6 +31,7 @@ public class ExecutingGraphData
public Gtk.Label Label_message;
public Gtk.Label Label_event_value;
public Gtk.Label Label_time_value;
public Gtk.Label Label_video_feedback;
public Gtk.ProgressBar Progressbar_event;
public Gtk.ProgressBar Progressbar_time;
......@@ -38,6 +39,7 @@ public class ExecutingGraphData
Gtk.Button Button_cancel, Gtk.Button Button_finish,
Gtk.Label Label_message,
Gtk.Label Label_event_value, Gtk.Label Label_time_value,
Gtk.Label Label_video_feedback,
Gtk.ProgressBar Progressbar_event, Gtk.ProgressBar Progressbar_time)
{
this.Button_cancel = Button_cancel;
......@@ -45,6 +47,7 @@ public class ExecutingGraphData
this.Label_message = Label_message;
this.Label_event_value = Label_event_value;
this.Label_time_value = Label_time_value;
this.Label_video_feedback = Label_video_feedback;
this.Progressbar_event = Progressbar_event;
this.Progressbar_time = Progressbar_time;
}
......
......@@ -271,4 +271,10 @@ public class WebcamManage
{
return webcam.ExitAndFinish (sessionID, testType, testID);
}
public static bool RecordingFileStarted ()
{
FileInfo file = new FileInfo(Util.GetVideoTempFileName());
return (file.Exists && file.Length > 0);
}
}
......@@ -131,6 +131,9 @@ public class WebcamFfmpeg : Webcam
public override Result VideoCaptureStart()
{
//Delete temp video if exists
deleteTempFiles();
process = new Process();
List<string> parameters = createParametersOnlyCapture();
//List<string> parameters = createParametersCaptureAndDelayedView();
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment