[chronojump] video working for all contacts tests



commit a68ea66640f5ce682414d36743fd2d6ab9ad9ee2
Author: Xavier de Blas <xaviblas gmail com>
Date:   Thu Apr 18 13:20:06 2013 +0200

    video working for all contacts tests

 CesarPlayer/Gui/CapturerBin.cs                    |  32 ++-
 CesarPlayer/gtk-gui/LongoMatch.Gui.CapturerBin.cs |   8 +-
 glade/chronojump.glade                            | 278 ++++++++++++----------
 src/execute/event.cs                              |   3 +-
 src/gui/chronojump.cs                             |  95 ++++++--
 src/gui/eventExecute.cs                           |  62 ++---
 6 files changed, 277 insertions(+), 201 deletions(-)
---
diff --git a/CesarPlayer/Gui/CapturerBin.cs b/CesarPlayer/Gui/CapturerBin.cs
index d2b30c6..47f64b7 100644
--- a/CesarPlayer/Gui/CapturerBin.cs
+++ b/CesarPlayer/Gui/CapturerBin.cs
@@ -132,6 +132,7 @@ namespace LongoMatch.Gui
                                
                        recbutton.Visible = false;
                        pausebutton.Visible = false;
+                       //stopbutton.Visible = true;
                        stopbutton.Visible = false;
                        
                        capturer.Start();
@@ -157,6 +158,7 @@ namespace LongoMatch.Gui
                public void Stop() {
                        if (capturer != null){
                                capturing = false;
+                               captureStarted = false;
                                capturer.Stop();
                        }
                }
@@ -172,7 +174,8 @@ namespace LongoMatch.Gui
                        /* resetting common properties */
                        pausebutton.Visible = false;
                        stopbutton.Visible = false;
-                       recbutton.Visible = true;
+                       //recbutton.Visible = true;
+                       recbutton.Visible = false;
                        captureStarted = false;
                        capturing = false;
                        OnTick(0);
@@ -246,11 +249,13 @@ namespace LongoMatch.Gui
 
                private void SetButtonsVisibility() {
                        bool snapshot = capturerType == CapturerType.Snapshot;
-                       recbutton.Visible = !snapshot;
+                       //recbutton.Visible = !snapshot;
+                       recbutton.Visible = false;
                        pausebutton.Visible = false;
                        stopbutton.Visible = false;
                        snapshotbutton.Visible = snapshot;
-                       timelabel.Visible = !snapshot;
+                       //timelabel.Visible = !snapshot;
+                       timelabel.Visible = false;
                }
 
 
@@ -258,14 +263,22 @@ namespace LongoMatch.Gui
                public void ClickRec () {
                        if (capturer == null)
                                return;
-                       
+               
                        recbutton.Visible = false;
                        stopbutton.Visible = true;
 
                        Start();
                }
                public void ClickStop () {
-                       CaptureFinished(this, new EventArgs());
+                       //CaptureFinished(this, new EventArgs());
+                       
+                       //recbutton.Visible = true;
+                       recbutton.Visible = false;
+                       pausebutton.Visible = false;
+                       stopbutton.Visible = false;
+                       
+                       Stop();
+                       //Run();
                }
 
                
@@ -282,7 +295,7 @@ namespace LongoMatch.Gui
                                        return;
                                TogglePause();
                        }
-                       else
+                       else 
                                Start();        
                }
 
@@ -323,8 +336,13 @@ namespace LongoMatch.Gui
                        recbutton.Visible = true;
                        pausebutton.Visible = false;
                        stopbutton.Visible = false;
-                       if (CaptureFinished != null)
+                       /*
+                       if (CaptureFinished != null) {
+                               Console.WriteLine("OnStopbuttonclicked 1");
                                CaptureFinished(this, new EventArgs());
+                       }
+                       */
+                       Stop();
                }                               
                
                protected virtual void OnTick (int ellapsedTime){
diff --git a/CesarPlayer/gtk-gui/LongoMatch.Gui.CapturerBin.cs 
b/CesarPlayer/gtk-gui/LongoMatch.Gui.CapturerBin.cs
index 8571138..73799f6 100644
--- a/CesarPlayer/gtk-gui/LongoMatch.Gui.CapturerBin.cs
+++ b/CesarPlayer/gtk-gui/LongoMatch.Gui.CapturerBin.cs
@@ -33,7 +33,7 @@ namespace LongoMatch.Gui
                        // Container child LongoMatch.Gui.CapturerBin.Gtk.Container+ContainerChild
                        this.vbox1 = new global::Gtk.VBox ();
                        this.vbox1.Name = "vbox1";
-                       this.vbox1.Spacing = 6;
+                       this.vbox1.Spacing = 0;
                        // Container child vbox1.Gtk.Box+BoxChild
                        this.capturerhbox = new global::Gtk.HBox ();
                        this.capturerhbox.Name = "capturerhbox";
@@ -67,7 +67,8 @@ namespace LongoMatch.Gui
                        w4.Spacing = 2;
                        // Container child GtkHBox.Gtk.Container+ContainerChild
                        global::Gtk.Image w5 = new global::Gtk.Image ();
-                       w5.Pixbuf = global::Stetic.IconLoader.LoadIcon (this, "gtk-media-record", 
global::Gtk.IconSize.Dialog);
+                       //w5.Pixbuf = global::Stetic.IconLoader.LoadIcon (this, "gtk-media-record", 
global::Gtk.IconSize.Dialog);
+                       w5.Pixbuf = global::Stetic.IconLoader.LoadIcon (this, "gtk-media-record", 
global::Gtk.IconSize.Button);
                        w4.Add (w5);
                        // Container child GtkHBox.Gtk.Container+ContainerChild
                        global::Gtk.Label w7 = new global::Gtk.Label ();
@@ -115,7 +116,8 @@ namespace LongoMatch.Gui
                        w22.Spacing = 2;
                        // Container child GtkHBox.Gtk.Container+ContainerChild
                        global::Gtk.Image w23 = new global::Gtk.Image ();
-                       w23.Pixbuf = global::Stetic.IconLoader.LoadIcon (this, "gtk-media-stop", 
global::Gtk.IconSize.Dialog);
+                       //w23.Pixbuf = global::Stetic.IconLoader.LoadIcon (this, "gtk-media-stop", 
global::Gtk.IconSize.Dialog);
+                       w23.Pixbuf = global::Stetic.IconLoader.LoadIcon (this, "gtk-media-stop", 
global::Gtk.IconSize.Button);
                        w22.Add (w23);
                        // Container child GtkHBox.Gtk.Container+ContainerChild
                        global::Gtk.Label w25 = new global::Gtk.Label ();
diff --git a/glade/chronojump.glade b/glade/chronojump.glade
index 056bf15..aacf889 100644
--- a/glade/chronojump.glade
+++ b/glade/chronojump.glade
@@ -5935,157 +5935,106 @@ Second Chronopic to platforms.</property>
                                                             <property name="can_focus">False</property>
                                                             <property name="spacing">2</property>
                                                             <child>
-                                                            <widget class="GtkHBox" id="hbox105">
+                                                            <widget class="GtkAlignment" id="alignment31">
                                                             <property name="visible">True</property>
                                                             <property name="can_focus">False</property>
-                                                            <property name="spacing">2</property>
+                                                            <property name="top_padding">12</property>
                                                             <child>
-                                                            <widget class="GtkCheckButton" 
id="checkbutton_video">
+                                                            <widget class="GtkButton" 
id="button_execute_test">
+                                                            <property name="height_request">60</property>
+                                                            <property name="visible">True</property>
                                                             <property name="can_focus">True</property>
-                                                            <property 
name="receives_default">False</property>
-                                                            <property name="tooltip" 
translatable="yes">Record video (on / off)</property>
+                                                            <property name="receives_default">True</property>
+                                                            <property name="has_tooltip">True</property>
+                                                            <property name="tooltip" translatable="yes">Or 
press 'space'</property>
                                                             <property 
name="use_action_appearance">False</property>
-                                                            <property name="relief">none</property>
-                                                            <property name="active">True</property>
-                                                            <property name="draw_indicator">False</property>
-                                                            <signal name="clicked" 
handler="on_checkbutton_video_clicked" swapped="no"/>
+                                                            <signal name="clicked" 
handler="on_button_execute_test_clicked" swapped="no"/>
+                                                            <accelerator key="space" signal="clicked"/>
                                                             <child>
-                                                            <widget class="GtkHBox" id="hbox106">
+                                                            <widget class="GtkVBox" id="vbox72">
                                                             <property name="visible">True</property>
                                                             <property name="can_focus">False</property>
-                                                            <property name="spacing">2</property>
                                                             <child>
-                                                            <widget class="GtkImage" id="image_video_yes">
-                                                            <property name="width_request">16</property>
-                                                            <property name="height_request">16</property>
+                                                            <widget class="GtkImage" id="image17">
                                                             <property name="visible">True</property>
                                                             <property name="can_focus">False</property>
-                                                            <property 
name="stock">gtk-media-record</property>
-                                                            <property name="icon-size">1</property>
+                                                            <property name="stock">gtk-apply</property>
                                                             </widget>
                                                             <packing>
-                                                            <property name="expand">False</property>
-                                                            <property name="fill">False</property>
+                                                            <property name="expand">True</property>
+                                                            <property name="fill">True</property>
                                                             <property name="position">0</property>
                                                             </packing>
                                                             </child>
                                                             <child>
-                                                            <widget class="GtkImage" id="image_video_no">
-                                                            <property name="width_request">16</property>
-                                                            <property name="height_request">16</property>
+                                                            <widget class="GtkLabel" id="label41">
                                                             <property name="visible">True</property>
                                                             <property name="can_focus">False</property>
-                                                            <property name="stock">gtk-no</property>
-                                                            <property name="icon-size">1</property>
+                                                            <property name="label" 
translatable="yes">Execute test</property>
                                                             </widget>
                                                             <packing>
-                                                            <property name="expand">False</property>
-                                                            <property name="fill">False</property>
+                                                            <property name="expand">True</property>
+                                                            <property name="fill">True</property>
                                                             <property name="position">1</property>
                                                             </packing>
                                                             </child>
                                                             </widget>
                                                             </child>
                                                             </widget>
+                                                            </child>
+                                                            </widget>
                                                             <packing>
-                                                            <property name="expand">False</property>
-                                                            <property name="fill">False</property>
-                                                            <property name="pack_type">end</property>
+                                                            <property name="expand">True</property>
+                                                            <property name="fill">True</property>
                                                             <property name="position">0</property>
                                                             </packing>
                                                             </child>
                                                             <child>
-                                                            <widget class="GtkCheckButton" 
id="checkbutton_volume">
-                                                            <property name="can_focus">True</property>
-                                                            <property 
name="receives_default">False</property>
-                                                            <property name="tooltip" translatable="yes">Play 
sound (on / off)</property>
-                                                            <property 
name="use_action_appearance">False</property>
-                                                            <property name="relief">none</property>
-                                                            <property name="active">True</property>
-                                                            <property name="draw_indicator">False</property>
-                                                            <signal name="clicked" 
handler="on_checkbutton_volume_clicked" swapped="no"/>
-                                                            <child>
-                                                            <widget class="GtkAlignment" id="alignment68">
+                                                            <widget class="GtkHBox" id="hbox88">
                                                             <property name="visible">True</property>
                                                             <property name="can_focus">False</property>
-                                                            <property name="xscale">0</property>
-                                                            <property name="yscale">0</property>
                                                             <child>
-                                                            <widget class="GtkHBox" id="hbox144">
+                                                            <widget class="GtkButton" 
id="event_execute_button_cancel">
                                                             <property name="visible">True</property>
-                                                            <property name="can_focus">False</property>
-                                                            <property name="spacing">2</property>
+                                                            <property name="can_focus">True</property>
+                                                            <property name="can_default">True</property>
+                                                            <property name="receives_default">True</property>
+                                                            <property name="has_tooltip">True</property>
+                                                            <property name="tooltip" 
translatable="yes">Cancel test</property>
+                                                            <property 
name="use_action_appearance">False</property>
+                                                            <signal name="clicked" 
handler="on_event_execute_button_cancel_clicked" swapped="no"/>
                                                             <child>
-                                                            <widget class="GtkImage" id="image_volume">
-                                                            <property name="width_request">16</property>
-                                                            <property name="height_request">16</property>
+                                                            <widget class="GtkImage" id="image30">
                                                             <property name="visible">True</property>
                                                             <property name="can_focus">False</property>
-                                                            <property 
name="yalign">0.49000000953674316</property>
-                                                            <property name="icon-size">1</property>
-                                                            </widget>
-                                                            <packing>
-                                                            <property name="expand">False</property>
-                                                            <property name="fill">False</property>
-                                                            <property name="position">0</property>
-                                                            </packing>
-                                                            </child>
-                                                            </widget>
-                                                            </child>
+                                                            <property name="stock">gtk-cancel</property>
                                                             </widget>
                                                             </child>
                                                             </widget>
                                                             <packing>
-                                                            <property name="expand">False</property>
-                                                            <property name="fill">False</property>
-                                                            <property name="pack_type">end</property>
-                                                            <property name="position">1</property>
-                                                            </packing>
-                                                            </child>
-                                                            </widget>
-                                                            <packing>
-                                                            <property name="expand">False</property>
-                                                            <property name="fill">False</property>
+                                                            <property name="expand">True</property>
+                                                            <property name="fill">True</property>
                                                             <property name="position">0</property>
                                                             </packing>
                                                             </child>
                                                             <child>
-                                                            <widget class="GtkAlignment" id="alignment31">
-                                                            <property name="visible">True</property>
-                                                            <property name="can_focus">False</property>
-                                                            <property name="top_padding">12</property>
-                                                            <child>
-                                                            <widget class="GtkButton" 
id="button_execute_test">
-                                                            <property name="height_request">60</property>
+                                                            <widget class="GtkButton" 
id="event_execute_button_finish">
                                                             <property name="visible">True</property>
                                                             <property name="can_focus">True</property>
+                                                            <property name="can_default">True</property>
                                                             <property name="receives_default">True</property>
                                                             <property name="has_tooltip">True</property>
-                                                            <property name="tooltip" translatable="yes">Or 
press 'space'</property>
+                                                            <property name="tooltip" 
translatable="yes">Finish test (save test until this moment)</property>
                                                             <property 
name="use_action_appearance">False</property>
-                                                            <signal name="clicked" 
handler="on_button_execute_test_clicked" swapped="no"/>
-                                                            <accelerator key="space" signal="clicked"/>
-                                                            <child>
-                                                            <widget class="GtkVBox" id="vbox72">
-                                                            <property name="visible">True</property>
-                                                            <property name="can_focus">False</property>
+                                                            <property name="use_underline">True</property>
+                                                            <signal name="clicked" 
handler="on_event_execute_finish_clicked" swapped="no"/>
                                                             <child>
-                                                            <widget class="GtkImage" id="image17">
+                                                            <widget class="GtkImage" id="image29">
                                                             <property name="visible">True</property>
                                                             <property name="can_focus">False</property>
-                                                            <property name="stock">gtk-apply</property>
+                                                            <property name="stock">gtk-goto-last</property>
                                                             </widget>
-                                                            <packing>
-                                                            <property name="expand">True</property>
-                                                            <property name="fill">True</property>
-                                                            <property name="position">0</property>
-                                                            </packing>
                                                             </child>
-                                                            <child>
-                                                            <widget class="GtkLabel" id="label41">
-                                                            <property name="visible">True</property>
-                                                            <property name="can_focus">False</property>
-                                                            <property name="label" 
translatable="yes">Execute test</property>
                                                             </widget>
                                                             <packing>
                                                             <property name="expand">True</property>
@@ -6094,10 +6043,6 @@ Second Chronopic to platforms.</property>
                                                             </packing>
                                                             </child>
                                                             </widget>
-                                                            </child>
-                                                            </widget>
-                                                            </child>
-                                                            </widget>
                                                             <packing>
                                                             <property name="expand">True</property>
                                                             <property name="fill">True</property>
@@ -6144,16 +6089,22 @@ Second Chronopic to platforms.</property>
                                                             </packing>
                                                             </child>
                                                             <child>
+                                                            <widget class="GtkAlignment" id="alignment21">
+                                                            <property name="visible">True</property>
+                                                            <property name="can_focus">False</property>
+                                                            <property name="top_padding">12</property>
+                                                            <child>
                                                             <widget class="GtkLabel" 
id="event_execute_label_event_value">
                                                             <property name="visible">True</property>
                                                             <property name="can_focus">False</property>
                                                             <property name="xalign">0</property>
                                                             <property name="width_chars">6</property>
                                                             </widget>
+                                                            </child>
+                                                            </widget>
                                                             <packing>
                                                             <property name="expand">False</property>
                                                             <property name="fill">True</property>
-                                                            <property name="pack_type">end</property>
                                                             <property name="position">1</property>
                                                             </packing>
                                                             </child>
@@ -6256,44 +6207,94 @@ Second Chronopic to platforms.</property>
                                                             <property name="can_focus">False</property>
                                                             <property name="spacing">6</property>
                                                             <child>
-                                                            <widget class="GtkButton" 
id="event_execute_button_cancel">
-                                                            <property name="label">gtk-cancel</property>
+                                                            <widget class="GtkHBox" id="hbox105">
                                                             <property name="visible">True</property>
+                                                            <property name="can_focus">False</property>
+                                                            <property name="spacing">2</property>
+                                                            <child>
+                                                            <widget class="GtkCheckButton" 
id="checkbutton_volume">
                                                             <property name="can_focus">True</property>
-                                                            <property name="can_default">True</property>
-                                                            <property name="receives_default">True</property>
+                                                            <property 
name="receives_default">False</property>
                                                             <property name="has_tooltip">True</property>
-                                                            <property name="tooltip" 
translatable="yes">Cancel test</property>
+                                                            <property name="tooltip" translatable="yes">Play 
sound (on / off)</property>
                                                             <property 
name="use_action_appearance">False</property>
-                                                            <property name="use_stock">True</property>
-                                                            <signal name="clicked" 
handler="on_event_execute_button_cancel_clicked" swapped="no"/>
+                                                            <property name="relief">none</property>
+                                                            <property name="active">True</property>
+                                                            <property name="draw_indicator">True</property>
+                                                            <signal name="clicked" 
handler="on_checkbutton_volume_clicked" swapped="no"/>
+                                                            <child>
+                                                            <widget class="GtkAlignment" id="alignment68">
+                                                            <property name="visible">True</property>
+                                                            <property name="can_focus">False</property>
+                                                            <property name="xscale">0</property>
+                                                            <property name="yscale">0</property>
+                                                            <child>
+                                                            <widget class="GtkHBox" id="hbox144">
+                                                            <property name="visible">True</property>
+                                                            <property name="can_focus">False</property>
+                                                            <property name="spacing">2</property>
+                                                            <child>
+                                                            <widget class="GtkImage" id="image_volume">
+                                                            <property name="width_request">16</property>
+                                                            <property name="height_request">16</property>
+                                                            <property name="visible">True</property>
+                                                            <property name="can_focus">False</property>
+                                                            <property 
name="yalign">0.49000000953674316</property>
+                                                            <property name="icon-size">1</property>
+                                                            </widget>
+                                                            <packing>
+                                                            <property name="expand">False</property>
+                                                            <property name="fill">False</property>
+                                                            <property name="position">0</property>
+                                                            </packing>
+                                                            </child>
+                                                            </widget>
+                                                            </child>
+                                                            </widget>
+                                                            </child>
+                                                            </widget>
+                                                            <packing>
+                                                            <property name="expand">False</property>
+                                                            <property name="fill">False</property>
+                                                            <property name="position">0</property>
+                                                            </packing>
+                                                            </child>
+                                                            <child>
+                                                            <widget class="GtkLabel" 
id="label_video_feedback">
+                                                            <property name="visible">True</property>
+                                                            <property name="can_focus">False</property>
                                                             </widget>
                                                             <packing>
                                                             <property name="expand">True</property>
                                                             <property name="fill">True</property>
-                                                            <property name="position">0</property>
+                                                            <property name="position">1</property>
                                                             </packing>
                                                             </child>
                                                             <child>
-                                                            <widget class="GtkButton" 
id="event_execute_button_finish">
+                                                            <widget class="GtkCheckButton" 
id="checkbutton_video">
                                                             <property name="visible">True</property>
                                                             <property name="can_focus">True</property>
-                                                            <property name="can_default">True</property>
-                                                            <property name="receives_default">True</property>
+                                                            <property 
name="receives_default">False</property>
                                                             <property name="has_tooltip">True</property>
-                                                            <property name="tooltip" 
translatable="yes">Finish test (save test until this moment)</property>
+                                                            <property name="tooltip" 
translatable="yes">Record video (on / off)</property>
                                                             <property 
name="use_action_appearance">False</property>
-                                                            <property name="use_underline">True</property>
-                                                            <signal name="clicked" 
handler="on_event_execute_finish_clicked" swapped="no"/>
+                                                            <property name="relief">none</property>
+                                                            <property name="active">True</property>
+                                                            <property name="draw_indicator">True</property>
+                                                            <signal name="clicked" 
handler="on_checkbutton_video_clicked" swapped="no"/>
                                                             <child>
-                                                            <widget class="GtkHBox" id="hbox107">
+                                                            <widget class="GtkHBox" id="hbox106">
                                                             <property name="visible">True</property>
                                                             <property name="can_focus">False</property>
+                                                            <property name="spacing">2</property>
                                                             <child>
-                                                            <widget class="GtkImage" id="image29">
+                                                            <widget class="GtkImage" id="image_video_yes">
+                                                            <property name="width_request">16</property>
+                                                            <property name="height_request">16</property>
                                                             <property name="visible">True</property>
                                                             <property name="can_focus">False</property>
-                                                            <property name="stock">gtk-goto-last</property>
+                                                            <property 
name="stock">gtk-media-record</property>
+                                                            <property name="icon-size">1</property>
                                                             </widget>
                                                             <packing>
                                                             <property name="expand">False</property>
@@ -6302,14 +6303,17 @@ Second Chronopic to platforms.</property>
                                                             </packing>
                                                             </child>
                                                             <child>
-                                                            <widget class="GtkLabel" id="label108">
+                                                            <widget class="GtkImage" id="image_video_no">
+                                                            <property name="width_request">16</property>
+                                                            <property name="height_request">16</property>
                                                             <property name="visible">True</property>
                                                             <property name="can_focus">False</property>
-                                                            <property name="label" 
translatable="yes">Finish</property>
+                                                            <property name="stock">gtk-no</property>
+                                                            <property name="icon-size">1</property>
                                                             </widget>
                                                             <packing>
-                                                            <property name="expand">True</property>
-                                                            <property name="fill">True</property>
+                                                            <property name="expand">False</property>
+                                                            <property name="fill">False</property>
                                                             <property name="position">1</property>
                                                             </packing>
                                                             </child>
@@ -6317,15 +6321,40 @@ Second Chronopic to platforms.</property>
                                                             </child>
                                                             </widget>
                                                             <packing>
-                                                            <property name="expand">True</property>
+                                                            <property name="expand">False</property>
+                                                            <property name="fill">False</property>
+                                                            <property name="pack_type">end</property>
+                                                            <property name="position">2</property>
+                                                            </packing>
+                                                            </child>
+                                                            </widget>
+                                                            <packing>
+                                                            <property name="expand">False</property>
+                                                            <property name="fill">False</property>
+                                                            <property name="position">0</property>
+                                                            </packing>
+                                                            </child>
+                                                            <child>
+                                                            <widget class="GtkHBox" id="hbox_video_capture">
+                                                            <property name="width_request">125</property>
+                                                            <property name="height_request">100</property>
+                                                            <property name="visible">True</property>
+                                                            <property name="can_focus">False</property>
+                                                            <child>
+                                                            <placeholder/>
+                                                            </child>
+                                                            </widget>
+                                                            <packing>
+                                                            <property name="expand">False</property>
                                                             <property name="fill">True</property>
+                                                            <property name="pack_type">end</property>
                                                             <property name="position">1</property>
                                                             </packing>
                                                             </child>
                                                           </widget>
                                                           <packing>
                                                             <property name="expand">False</property>
-                                                            <property name="fill">False</property>
+                                                            <property name="fill">True</property>
                                                             <property name="position">2</property>
                                                           </packing>
                                                         </child>
@@ -6359,6 +6388,9 @@ Second Chronopic to platforms.</property>
                                                   </packing>
                                                 </child>
                                                 <child>
+                                                  <placeholder/>
+                                                </child>
+                                                <child>
                                                   <widget class="GtkAlignment" id="event_execute_alignment">
                                                     <property name="visible">True</property>
                                                     <property name="can_focus">False</property>
@@ -8466,7 +8498,7 @@ Second Chronopic to platforms.</property>
                                                   <packing>
                                                     <property name="expand">True</property>
                                                     <property name="fill">True</property>
-                                                    <property name="position">1</property>
+                                                    <property name="position">2</property>
                                                   </packing>
                                                 </child>
                                               </widget>
diff --git a/src/execute/event.cs b/src/execute/event.cs
index c9bfd3b..caed320 100644
--- a/src/execute/event.cs
+++ b/src/execute/event.cs
@@ -22,7 +22,6 @@ using System;
 using System.Data;
 using System.Text; //StringBuilder
 using Gtk;
-
 using System.Threading;
 using System.IO.Ports;
 using Mono.Unix;
@@ -231,6 +230,7 @@ public class EventExecute
 
                if ( ! thread.IsAlive || cancel) {
                        Log.Write("dying");
+
                        return false;
                }
        
@@ -239,6 +239,7 @@ public class EventExecute
                return true;
        }
 
+
        public void StopThread() {
                /*
                Log.WriteLine("----------ABORTING----------");
diff --git a/src/gui/chronojump.cs b/src/gui/chronojump.cs
index 283d43c..5db43bd 100644
--- a/src/gui/chronojump.cs
+++ b/src/gui/chronojump.cs
@@ -254,6 +254,9 @@ public partial class ChronoJumpWindow
        [Widget] Gtk.Image image_encoder_analyze_stats;
        [Widget] Gtk.Image image_encoder_signal_delete;
 
+       [Widget] Gtk.HBox hbox_video_capture;
+       [Widget] Gtk.Label label_video_feedback;
+
        Random rand;
        bool volumeOn; //TODO: always true now because it's hidden from GUI until videoOn is working
        bool videoOn; //TODO: now always false because it crashes on windows
@@ -516,9 +519,12 @@ public partial class ChronoJumpWindow
                encoderInitializeStuff();       
 
                //presentationInit();
+
+               videoCaptureInitialize();       
        }
        
 
+
 /*
        private void chronopicAtStart(object o, EventArgs args) {
                //make active menuitem chronopic, and this
@@ -844,16 +850,18 @@ public partial class ChronoJumpWindow
                UtilGtk.ColorsCheckOnlyPrelight(checkbutton_volume);
                changeVolumeButton(volumeOn);
 
-               /*
                if ( SqlitePreferences.Select("videoOn") == "True" ) 
                        videoOn = true;
                else 
                        videoOn = false;
-                       */
-               videoOn = false;
-
 
                UtilGtk.ColorsCheckOnlyPrelight(checkbutton_video);
+               
+               //don't raise the signal        
+               checkbutton_video.Clicked -= new EventHandler(on_checkbutton_video_clicked);
+               checkbutton_video.Active = videoOn;
+               checkbutton_video.Clicked += new EventHandler(on_checkbutton_video_clicked);
+               
                changeVideoButton(videoOn);
 
 
@@ -2723,7 +2731,63 @@ public partial class ChronoJumpWindow
                {
                }
        }
+
+       /*
+        * videoOn and volumeOn
+        */
+
+       CapturerBin capturer;
+       //Gtk.Window capturerWindow;
+       private void videoCaptureInitialize() 
+       {
+               capturer = new CapturerBin();
+       
+               hbox_video_capture.PackStart(capturer, true, true, 0);
+
+               videoCapturePrepare();
+       }
        
+
+       private void videoCapturePrepare() {
+               CapturePropertiesStruct s = new CapturePropertiesStruct();
+
+               s.OutputFile = Util.GetVideoTempFileName();
+
+               s.VideoBitrate =  1000;
+               s.AudioBitrate =  128;
+               s.CaptureSourceType = CaptureSourceType.Raw;
+               s.Width = 360;
+               s.Height = 288;
+
+               capturer.CaptureProperties = s;
+               if(checkbutton_video.Active)
+                       capturer.Type = CapturerType.Live;
+               else
+                       capturer.Type = CapturerType.Fake;
+               capturer.Visible=true;
+       
+               capturer.Run();
+       }
+       
+       private void changeVideoButton(bool myVideo) {
+               image_video_yes.Visible = myVideo;
+               image_video_no.Visible = ! myVideo;
+       }
+       
+       private void on_checkbutton_video_clicked(object o, EventArgs args) {
+               if(checkbutton_video.Active) {
+                       videoOn = true;
+                       SqlitePreferences.Update("videoOn", "True", false);
+               } else {
+                       videoOn = false;
+                       SqlitePreferences.Update("videoOn", "False", false);
+               }
+               changeVideoButton(videoOn);
+               
+               videoCapturePrepare();
+       }
+
+
        private void changeVolumeButton(bool myVolume) {
                Pixbuf pixbuf;
                if(myVolume) 
@@ -2745,25 +2809,10 @@ public partial class ChronoJumpWindow
                changeVolumeButton(checkbutton_volume.Active);
        }
 
-       
-       private void changeVideoButton(bool myVideo) {
-               image_video_yes.Visible = myVideo;
-               image_video_no.Visible = ! myVideo;
-       }
-       
-       private void on_checkbutton_video_clicked(object o, EventArgs args) {
-               /*
-               if(checkbutton_video.Active) {
-                       videoOn = true;
-                       SqlitePreferences.Update("videoOn", "True", false);
-               } else {
-                       videoOn = false;
-                       SqlitePreferences.Update("videoOn", "False", false);
-               }
-               changeVideoButton(checkbutton_video.Active);
-               */
-       }
-       
+       /*
+        * cancel and finish
+        */
+
 
        private void on_cancel_clicked (object o, EventArgs args) 
        {
diff --git a/src/gui/eventExecute.cs b/src/gui/eventExecute.cs
index 32855fc..83df50a 100644
--- a/src/gui/eventExecute.cs
+++ b/src/gui/eventExecute.cs
@@ -156,8 +156,6 @@ public partial class ChronoJumpWindow
        //static Gdk.Pixmap event_execute_pixmap = null;
        Gdk.Pixmap event_execute_pixmap = null;
        
-       //[Widget] Gtk.HBox hbox_capture;
-
 
        int event_execute_personID;     
        //int sessionID;
@@ -267,15 +265,19 @@ public partial class ChronoJumpWindow
                layout.FontDescription = Pango.FontDescription.FromString ("Courier 7");
        
                eventHasEnded = false;
-       
-               if(videoOn)
-                       cameraRecordInitiate();
-               
+
+               checkbutton_video.Sensitive = false;
+               if(videoOn) {
+                       capturer.ClickRec();
+                       label_video_feedback.Text = Catalog.GetString("Recording");
+               }
+
                ExecutingGraphData executingGraphData = new ExecutingGraphData(
                                event_execute_button_cancel, event_execute_button_finish, 
                                event_execute_label_message,  
                                event_execute_label_event_value,  event_execute_label_time_value,
                                event_execute_progressbar_event,  event_execute_progressbar_time);
+               
                return executingGraphData;
        }
        
@@ -534,36 +536,6 @@ public partial class ChronoJumpWindow
                allocationXOld = allocation.Width;
        }
 
-
-       CapturerBin capturer;
-       //Gtk.Window capturerWindow;
-       private void cameraRecordInitiate() 
-       {
-               capturer = new CapturerBin();
-               CapturePropertiesStruct s = new CapturePropertiesStruct();
-
-               s.OutputFile = Util.GetVideoTempFileName();
-
-               s.VideoBitrate =  1000;
-               s.CaptureSourceType = CaptureSourceType.Raw;
-               s.Width = 360;
-               s.Height = 288;
-
-               capturer.CaptureProperties = s;
-               capturer.Type = CapturerType.Live;
-               capturer.Visible=true;
-               
-               //capturerWindow = new Gtk.Window("Capturer");
-               //capturerWindow.Add(capturer);
-               //capturerWindow.ShowAll();
-               //capturerWindow.DeleteEvent += delegate(object sender, DeleteEventArgs e) {capturer.Close(); 
capturer.Dispose();};
-               //hbox_capture.PackStart(capturer, true, true, 0);
-               //hbox_capture.ShowAll();
-
-               capturer.Run();
-               capturer.ClickRec();
-       }
-       
        
 
        // simple and DJ jump   
@@ -1856,11 +1828,12 @@ Log.WriteLine("Preparing reactive A");
        private void on_event_execute_EventEnded(object o, EventArgs args) {
                hideButtons();
                eventHasEnded = true;
-       
+
+               checkbutton_video.Sensitive = true;
                if(videoOn) {   
-                       capturer.Stop();
-                       capturer.Close();
-                       capturer.Dispose();
+                       label_video_feedback.Text = "";
+                       capturer.ClickStop();
+                       videoCapturePrepare();
                }
        }
        
@@ -1982,11 +1955,12 @@ Log.WriteLine("Preparing reactive A");
        {
                hideButtons();
                
+               checkbutton_video.Sensitive = true;
                if(videoOn) {
-                       capturer.Stop();
-                       capturer.Close();
-                       capturer.Dispose();
-                       //it will lbe recorded on temp, but chronojump will not move it to 
chronojump/multimedia folders
+                       //it will be recorded on temp, but chronojump will move it to chronojump/multimedia 
folders
+                       label_video_feedback.Text = "";
+                       capturer.ClickStop();
+                       videoCapturePrepare();
                }
        }
        


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