[longomatch/livecapturemerged: 60/84] Integrate the capturer in the main window



commit c7fad70221319130e758d3e151c48cc0aea1cbe3
Author: Andoni Morales Alastruey <ylatuya gmail com>
Date:   Mon Apr 26 22:21:44 2010 +0200

    Integrate the capturer in the main window

 LongoMatch/Gui/MainWindow.cs                    |   28 ++++---
 LongoMatch/Handlers/EventsManager.cs            |   14 +--
 LongoMatch/gtk-gui/LongoMatch.Gui.MainWindow.cs |   97 ++++++++++++----------
 LongoMatch/gtk-gui/gui.stetic                   |   17 +++-
 4 files changed, 86 insertions(+), 70 deletions(-)
---
diff --git a/LongoMatch/Gui/MainWindow.cs b/LongoMatch/Gui/MainWindow.cs
index d9b73cf..1054d48 100644
--- a/LongoMatch/Gui/MainWindow.cs
+++ b/LongoMatch/Gui/MainWindow.cs
@@ -56,7 +56,6 @@ namespace LongoMatch.Gui
 		private HotKeysManager hkManager;
 		private KeyPressEventHandler hotkeysListener;
 		
-		private CapturerBin capturerBin;		
 		
 		#region Constructors
 		public MainWindow() :
@@ -84,7 +83,8 @@ namespace LongoMatch.Gui
 			                             playerbin1,
 			                             timelinewidget1,
 			                             videoprogressbar,
-			                             noteswidget1);
+			                             noteswidget1,
+			                             capturerBin);
 
 			hkManager = new HotKeysManager();
 			// Listenning only when a project is loaded
@@ -99,6 +99,8 @@ namespace LongoMatch.Gui
 			playerbin1.SetLogo(System.IO.Path.Combine(MainClass.ImagesDir(),"background.png"));
 			playerbin1.LogoMode = true;
 			
+			capturerBin.Visible = false;
+			
 			buttonswidget1.Mode = TagMode.Predifined;
 
 			playlistwidget2.SetPlayer(playerbin1);
@@ -149,15 +151,18 @@ namespace LongoMatch.Gui
 					} 
 				}else {
 					Title = "LongoMatch";
-					playerbin1.Visible = false;					
-					capturerBin = new CapturerBin();
-					capturerBin.Logo = System.IO.Path.Combine(MainClass.ImagesDir(),"background.png");
 					capturerBin.CaptureFinished += delegate {
 						CloseOpenedProject(true);	
 					};
-					eManager.Capturer = capturerBin;
-					hbox2.Add(capturerBin);
-					(capturerBin).Show();	
+					if (projectType == ProjectType.CaptureProject){
+						capturerBin.OutputFile = project.File.FilePath;
+						capturerBin.CaptureProperties = props;
+						capturerBin.Type = CapturerType.DVCAM;
+					} else 
+						capturerBin.Type = CapturerType.FAKE;
+					playerbin1.Visible = false;
+					capturerBin.Visible = true;
+					capturerBin.Run ();
 					treewidget1.ProjectIsLive = true;
 					localplayerslisttreewidget.ProjectIsLive = true;
 					visitorplayerslisttreewidget.ProjectIsLive = true;
@@ -186,9 +191,8 @@ namespace LongoMatch.Gui
 			
 			if (projectType != ProjectType.FileProject){
 				playerbin1.Visible = true;
-				eManager.Capturer = null;
-				if (capturerBin != null)
-					capturerBin.Destroy();
+				capturerBin.Close();
+				capturerBin.Visible = false;
 			} else {
 				playerbin1.Close();
 				playerbin1.LogoMode = true;
@@ -543,4 +547,4 @@ namespace LongoMatch.Gui
 
 		#endregion			}
 	}
-}
\ No newline at end of file
+}
diff --git a/LongoMatch/Handlers/EventsManager.cs b/LongoMatch/Handlers/EventsManager.cs
index 5dcfde9..6353452 100644
--- a/LongoMatch/Handlers/EventsManager.cs
+++ b/LongoMatch/Handlers/EventsManager.cs
@@ -1,4 +1,4 @@
-// EventsManager.cs
+// EventsManager.cs
 //
 //  Copyright (C2007-2009 Andoni Morales Alastruey
 //
@@ -66,7 +66,8 @@ namespace LongoMatch
 		public EventsManager(PlaysListTreeWidget treewidget, PlayersListTreeWidget localPlayersList, 
 		                     PlayersListTreeWidget visitorPlayersList, TagsTreeWidget tagsTreeWidget,
 		                     ButtonsWidget buttonswidget, PlayListWidget playlist, PlayerBin player, 
-		                     TimeLineWidget timeline, ProgressBar videoprogressbar,NotesWidget notes)
+		                     TimeLineWidget timeline, ProgressBar videoprogressbar,NotesWidget notes,
+		                     CapturerBin capturer)
 		{
 			this.treewidget = treewidget;
 			this.localPlayersList = localPlayersList;
@@ -78,6 +79,7 @@ namespace LongoMatch
 			this.timeline = timeline;
 			this.videoprogressbar = videoprogressbar;
 			this.notes = notes;
+			this.capturer = capturer;
 			this.drawingManager = new VideoDrawingsManager(player);
 
 			ConnectSignals();
@@ -94,12 +96,6 @@ namespace LongoMatch
 				projectType = value;
 			}
 		}
-		
-		public CapturerBin Capturer{
-			set {
-				capturer = value;
-			}
-		}
 
 		private void ConnectSignals() {
 			//Adding Handlers for each event
@@ -139,7 +135,7 @@ namespace LongoMatch
 			treewidget.SnapshotSeriesEvent += OnSnapshotSeries;
 			localPlayersList.SnapshotSeriesEvent += OnSnapshotSeries;
 			visitorPlayersList.SnapshotSeriesEvent += OnSnapshotSeries;
-			tagsTreeWidget.SnapshotSeriesEvent += OnSnapshotSeries;;
+			tagsTreeWidget.SnapshotSeriesEvent += OnSnapshotSeries;
 
 			timeline.NewMarkEvent += OnNewMarkAtFrame;
 
diff --git a/LongoMatch/gtk-gui/LongoMatch.Gui.MainWindow.cs b/LongoMatch/gtk-gui/LongoMatch.Gui.MainWindow.cs
index 476f8ae..4434977 100644
--- a/LongoMatch/gtk-gui/LongoMatch.Gui.MainWindow.cs
+++ b/LongoMatch/gtk-gui/LongoMatch.Gui.MainWindow.cs
@@ -93,12 +93,14 @@ namespace LongoMatch.Gui {
         
         private Gtk.VBox vbox5;
         
-        private Gtk.HBox hbox2;
+        private Gtk.HBox videowidgetsbox;
         
         private LongoMatch.Gui.Component.DrawingToolBox drawingtoolbox1;
         
         private LongoMatch.Gui.PlayerBin playerbin1;
         
+        private LongoMatch.Gui.CapturerBin capturerBin;
+        
         private LongoMatch.Gui.Component.TimeLineWidget timelinewidget1;
         
         private LongoMatch.Gui.Component.ButtonsWidget buttonswidget1;
@@ -193,7 +195,7 @@ namespace LongoMatch.Gui {
             this.ImportProjectAction.ShortLabel = Mono.Unix.Catalog.GetString("_Import Project");
             w1.Add(this.ImportProjectAction, "<Control>i");
             this.FreeCaptureModeAction = new Gtk.RadioAction("FreeCaptureModeAction", Mono.Unix.Catalog.GetString("Free Capture Mode"), null, null, 0);
-            this.FreeCaptureModeAction.Group = this.CaptureModeAction.Group;
+            this.FreeCaptureModeAction.Group = this.AnalyzeModeAction.Group;
             this.FreeCaptureModeAction.Sensitive = false;
             this.FreeCaptureModeAction.ShortLabel = Mono.Unix.Catalog.GetString("Free Capture Mode");
             w1.Add(this.FreeCaptureModeAction, null);
@@ -230,7 +232,7 @@ namespace LongoMatch.Gui {
             this.hpaned = new Gtk.HPaned();
             this.hpaned.CanFocus = true;
             this.hpaned.Name = "hpaned";
-            this.hpaned.Position = 335;
+            this.hpaned.Position = 257;
             // Container child hpaned.Gtk.Paned+PanedChild
             this.leftbox = new Gtk.VBox();
             this.leftbox.Name = "leftbox";
@@ -301,36 +303,43 @@ namespace LongoMatch.Gui {
             this.hpaned1 = new Gtk.HPaned();
             this.hpaned1.CanFocus = true;
             this.hpaned1.Name = "hpaned1";
-            this.hpaned1.Position = 770;
+            this.hpaned1.Position = 881;
             // Container child hpaned1.Gtk.Paned+PanedChild
             this.vbox5 = new Gtk.VBox();
             this.vbox5.Name = "vbox5";
             this.vbox5.Spacing = 6;
             // Container child vbox5.Gtk.Box+BoxChild
-            this.hbox2 = new Gtk.HBox();
-            this.hbox2.Name = "hbox2";
-            this.hbox2.Spacing = 6;
-            // Container child hbox2.Gtk.Box+BoxChild
+            this.videowidgetsbox = new Gtk.HBox();
+            this.videowidgetsbox.Name = "videowidgetsbox";
+            this.videowidgetsbox.Spacing = 6;
+            // Container child videowidgetsbox.Gtk.Box+BoxChild
             this.drawingtoolbox1 = new LongoMatch.Gui.Component.DrawingToolBox();
             this.drawingtoolbox1.Events = ((Gdk.EventMask)(256));
             this.drawingtoolbox1.Name = "drawingtoolbox1";
-            this.hbox2.Add(this.drawingtoolbox1);
-            Gtk.Box.BoxChild w10 = ((Gtk.Box.BoxChild)(this.hbox2[this.drawingtoolbox1]));
+            this.videowidgetsbox.Add(this.drawingtoolbox1);
+            Gtk.Box.BoxChild w10 = ((Gtk.Box.BoxChild)(this.videowidgetsbox[this.drawingtoolbox1]));
             w10.Position = 0;
             w10.Expand = false;
             w10.Fill = false;
-            // Container child hbox2.Gtk.Box+BoxChild
+            // Container child videowidgetsbox.Gtk.Box+BoxChild
             this.playerbin1 = new LongoMatch.Gui.PlayerBin();
             this.playerbin1.Events = ((Gdk.EventMask)(256));
             this.playerbin1.Name = "playerbin1";
             this.playerbin1.Rate = 1F;
             this.playerbin1.ExpandLogo = true;
-            this.hbox2.Add(this.playerbin1);
-            Gtk.Box.BoxChild w11 = ((Gtk.Box.BoxChild)(this.hbox2[this.playerbin1]));
+            this.videowidgetsbox.Add(this.playerbin1);
+            Gtk.Box.BoxChild w11 = ((Gtk.Box.BoxChild)(this.videowidgetsbox[this.playerbin1]));
             w11.Position = 1;
-            this.vbox5.Add(this.hbox2);
-            Gtk.Box.BoxChild w12 = ((Gtk.Box.BoxChild)(this.vbox5[this.hbox2]));
-            w12.Position = 0;
+            // Container child videowidgetsbox.Gtk.Box+BoxChild
+            this.capturerBin = new LongoMatch.Gui.CapturerBin();
+            this.capturerBin.Events = ((Gdk.EventMask)(256));
+            this.capturerBin.Name = "capturerBin";
+            this.videowidgetsbox.Add(this.capturerBin);
+            Gtk.Box.BoxChild w12 = ((Gtk.Box.BoxChild)(this.videowidgetsbox[this.capturerBin]));
+            w12.Position = 2;
+            this.vbox5.Add(this.videowidgetsbox);
+            Gtk.Box.BoxChild w13 = ((Gtk.Box.BoxChild)(this.vbox5[this.videowidgetsbox]));
+            w13.Position = 0;
             // Container child vbox5.Gtk.Box+BoxChild
             this.timelinewidget1 = new LongoMatch.Gui.Component.TimeLineWidget();
             this.timelinewidget1.HeightRequest = 200;
@@ -338,21 +347,21 @@ namespace LongoMatch.Gui {
             this.timelinewidget1.Name = "timelinewidget1";
             this.timelinewidget1.CurrentFrame = ((uint)(0));
             this.vbox5.Add(this.timelinewidget1);
-            Gtk.Box.BoxChild w13 = ((Gtk.Box.BoxChild)(this.vbox5[this.timelinewidget1]));
-            w13.Position = 1;
-            w13.Expand = false;
+            Gtk.Box.BoxChild w14 = ((Gtk.Box.BoxChild)(this.vbox5[this.timelinewidget1]));
+            w14.Position = 1;
+            w14.Expand = false;
             // Container child vbox5.Gtk.Box+BoxChild
             this.buttonswidget1 = new LongoMatch.Gui.Component.ButtonsWidget();
             this.buttonswidget1.Events = ((Gdk.EventMask)(256));
             this.buttonswidget1.Name = "buttonswidget1";
             this.vbox5.Add(this.buttonswidget1);
-            Gtk.Box.BoxChild w14 = ((Gtk.Box.BoxChild)(this.vbox5[this.buttonswidget1]));
-            w14.Position = 2;
-            w14.Expand = false;
+            Gtk.Box.BoxChild w15 = ((Gtk.Box.BoxChild)(this.vbox5[this.buttonswidget1]));
+            w15.Position = 2;
+            w15.Expand = false;
             this.hpaned1.Add(this.vbox5);
-            Gtk.Paned.PanedChild w15 = ((Gtk.Paned.PanedChild)(this.hpaned1[this.vbox5]));
-            w15.Resize = false;
-            w15.Shrink = false;
+            Gtk.Paned.PanedChild w16 = ((Gtk.Paned.PanedChild)(this.hpaned1[this.vbox5]));
+            w16.Resize = false;
+            w16.Shrink = false;
             // Container child hpaned1.Gtk.Paned+PanedChild
             this.rightvbox = new Gtk.VBox();
             this.rightvbox.WidthRequest = 100;
@@ -363,27 +372,27 @@ namespace LongoMatch.Gui {
             this.noteswidget1.Events = ((Gdk.EventMask)(256));
             this.noteswidget1.Name = "noteswidget1";
             this.rightvbox.Add(this.noteswidget1);
-            Gtk.Box.BoxChild w16 = ((Gtk.Box.BoxChild)(this.rightvbox[this.noteswidget1]));
-            w16.Position = 1;
+            Gtk.Box.BoxChild w17 = ((Gtk.Box.BoxChild)(this.rightvbox[this.noteswidget1]));
+            w17.Position = 1;
             // Container child rightvbox.Gtk.Box+BoxChild
             this.playlistwidget2 = new LongoMatch.Gui.Component.PlayListWidget();
             this.playlistwidget2.WidthRequest = 100;
             this.playlistwidget2.Events = ((Gdk.EventMask)(256));
             this.playlistwidget2.Name = "playlistwidget2";
             this.rightvbox.Add(this.playlistwidget2);
-            Gtk.Box.BoxChild w17 = ((Gtk.Box.BoxChild)(this.rightvbox[this.playlistwidget2]));
-            w17.Position = 2;
+            Gtk.Box.BoxChild w18 = ((Gtk.Box.BoxChild)(this.rightvbox[this.playlistwidget2]));
+            w18.Position = 2;
             this.hpaned1.Add(this.rightvbox);
-            Gtk.Paned.PanedChild w18 = ((Gtk.Paned.PanedChild)(this.hpaned1[this.rightvbox]));
-            w18.Resize = false;
-            w18.Shrink = false;
-            this.hpaned.Add(this.hpaned1);
-            Gtk.Paned.PanedChild w19 = ((Gtk.Paned.PanedChild)(this.hpaned[this.hpaned1]));
+            Gtk.Paned.PanedChild w19 = ((Gtk.Paned.PanedChild)(this.hpaned1[this.rightvbox]));
             w19.Resize = false;
             w19.Shrink = false;
+            this.hpaned.Add(this.hpaned1);
+            Gtk.Paned.PanedChild w20 = ((Gtk.Paned.PanedChild)(this.hpaned[this.hpaned1]));
+            w20.Resize = false;
+            w20.Shrink = false;
             this.vbox1.Add(this.hpaned);
-            Gtk.Box.BoxChild w20 = ((Gtk.Box.BoxChild)(this.vbox1[this.hpaned]));
-            w20.Position = 1;
+            Gtk.Box.BoxChild w21 = ((Gtk.Box.BoxChild)(this.vbox1[this.hpaned]));
+            w21.Position = 1;
             // Container child vbox1.Gtk.Box+BoxChild
             this.statusbar1 = new Gtk.Statusbar();
             this.statusbar1.Name = "statusbar1";
@@ -393,21 +402,21 @@ namespace LongoMatch.Gui {
             this.videoprogressbar.Name = "videoprogressbar";
             this.videoprogressbar.Text = Mono.Unix.Catalog.GetString("Creating video...");
             this.statusbar1.Add(this.videoprogressbar);
-            Gtk.Box.BoxChild w21 = ((Gtk.Box.BoxChild)(this.statusbar1[this.videoprogressbar]));
-            w21.Position = 3;
-            w21.Expand = false;
-            w21.Fill = false;
-            this.vbox1.Add(this.statusbar1);
-            Gtk.Box.BoxChild w22 = ((Gtk.Box.BoxChild)(this.vbox1[this.statusbar1]));
-            w22.Position = 2;
+            Gtk.Box.BoxChild w22 = ((Gtk.Box.BoxChild)(this.statusbar1[this.videoprogressbar]));
+            w22.Position = 3;
             w22.Expand = false;
             w22.Fill = false;
+            this.vbox1.Add(this.statusbar1);
+            Gtk.Box.BoxChild w23 = ((Gtk.Box.BoxChild)(this.vbox1[this.statusbar1]));
+            w23.Position = 2;
+            w23.Expand = false;
+            w23.Fill = false;
             this.Add(this.vbox1);
             if ((this.Child != null)) {
                 this.Child.ShowAll();
             }
             this.DefaultWidth = 1259;
-            this.DefaultHeight = 817;
+            this.DefaultHeight = 848;
             this.leftbox.Hide();
             this.drawingtoolbox1.Hide();
             this.timelinewidget1.Hide();
diff --git a/LongoMatch/gtk-gui/gui.stetic b/LongoMatch/gtk-gui/gui.stetic
index b13f4d0..a649bfe 100644
--- a/LongoMatch/gtk-gui/gui.stetic
+++ b/LongoMatch/gtk-gui/gui.stetic
@@ -1765,7 +1765,7 @@
       </widget>
     </child>
   </widget>
-  <widget class="Gtk.Window" id="LongoMatch.Gui.MainWindow" design-size="1259 817">
+  <widget class="Gtk.Window" id="LongoMatch.Gui.MainWindow" design-size="1259 848">
     <action-group name="Default">
       <action id="FileAction">
         <property name="Type">Action</property>
@@ -2010,7 +2010,7 @@
           <widget class="Gtk.HPaned" id="hpaned">
             <property name="MemberName" />
             <property name="CanFocus">True</property>
-            <property name="Position">335</property>
+            <property name="Position">257</property>
             <child>
               <widget class="Gtk.VBox" id="leftbox">
                 <property name="MemberName" />
@@ -2107,13 +2107,13 @@
               <widget class="Gtk.HPaned" id="hpaned1">
                 <property name="MemberName" />
                 <property name="CanFocus">True</property>
-                <property name="Position">770</property>
+                <property name="Position">881</property>
                 <child>
                   <widget class="Gtk.VBox" id="vbox5">
                     <property name="MemberName" />
                     <property name="Spacing">6</property>
                     <child>
-                      <widget class="Gtk.HBox" id="hbox2">
+                      <widget class="Gtk.HBox" id="videowidgetsbox">
                         <property name="MemberName" />
                         <property name="Spacing">6</property>
                         <child>
@@ -2144,7 +2144,14 @@
                           </packing>
                         </child>
                         <child>
-                          <placeholder />
+                          <widget class="LongoMatch.Gui.CapturerBin" id="capturerBin">
+                            <property name="MemberName" />
+                            <property name="Events">ButtonPressMask</property>
+                          </widget>
+                          <packing>
+                            <property name="Position">2</property>
+                            <property name="AutoSize">False</property>
+                          </packing>
                         </child>
                       </widget>
                       <packing>



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