[longomatch] Add a new widget to sync periods



commit a86ee092e4a7866ebf03972cd54839fe2c3a39dd
Author: Andoni Morales Alastruey <ylatuya gmail com>
Date:   Tue Jun 3 19:11:17 2014 +0200

    Add a new widget to sync periods

 LongoMatch.GUI.Multimedia/gtk-gui/objects.xml      |   54 ++++++
 LongoMatch.GUI/Gui/Component/ProjectPeriods.cs     |   95 ++++++++++
 LongoMatch.GUI/Gui/Component/Timeline.cs           |    5 +-
 LongoMatch.GUI/Gui/Panel/NewProjectPanel.cs        |  189 +++++++++++---------
 LongoMatch.GUI/LongoMatch.GUI.mdp                  |    2 +
 .../LongoMatch.Gui.Component.ProjectPeriods.cs     |   61 +++++++
 .../LongoMatch.Gui.Panel.NewProjectPanel.cs        |  123 +++++++------
 LongoMatch.GUI/gtk-gui/gui.stetic                  |   72 ++++++++-
 LongoMatch.GUI/gtk-gui/objects.xml                 |    4 +
 LongoMatch.Services/Services/PlaylistManager.cs    |    2 +
 10 files changed, 467 insertions(+), 140 deletions(-)
---
diff --git a/LongoMatch.GUI.Multimedia/gtk-gui/objects.xml b/LongoMatch.GUI.Multimedia/gtk-gui/objects.xml
index 2c33b19..838558d 100644
--- a/LongoMatch.GUI.Multimedia/gtk-gui/objects.xml
+++ b/LongoMatch.GUI.Multimedia/gtk-gui/objects.xml
@@ -1,2 +1,56 @@
 <objects attr-sync="on">
+  <object type="LongoMatch.Gui.CapturerBin" palette-category="General" allow-children="false" 
base-type="Gtk.Bin">
+    <itemgroups />
+    <signals>
+      <itemgroup label="ICapturerBin Signals">
+        <signal name="CaptureFinished" />
+        <signal name="Error" />
+      </itemgroup>
+    </signals>
+  </object>
+  <object type="LongoMatch.Gui.PlayerBin" palette-category="General" allow-children="false" 
base-type="Gtk.Bin">
+    <itemgroups>
+      <itemgroup label="IPlayerBin Properties">
+        <property name="Detached" />
+        <property name="Sensitive" />
+      </itemgroup>
+    </itemgroups>
+    <signals>
+      <itemgroup label="IPlayerBin Signals">
+        <signal name="SegmentClosedEvent" />
+        <signal name="Tick" />
+        <signal name="Error" />
+        <signal name="PlayStateChanged" />
+        <signal name="Next" />
+        <signal name="Prev" />
+        <signal name="DrawFrame" />
+        <signal name="SeekEvent" />
+        <signal name="Detach" />
+        <signal name="PlaybackRateChanged" />
+      </itemgroup>
+    </signals>
+  </object>
+  <object type="LongoMatch.Gui.PlayerCapturerBin" palette-category="General" allow-children="false" 
base-type="Gtk.Bin">
+    <itemgroups>
+      <itemgroup label="IPlayerBin Properties">
+        <property name="Detached" />
+        <property name="Sensitive" />
+      </itemgroup>
+    </itemgroups>
+    <signals>
+      <itemgroup label="ICapturerBin Signals">
+        <signal name="Error" />
+        <signal name="CaptureFinished" />
+        <signal name="SegmentClosedEvent" />
+        <signal name="Tick" />
+        <signal name="PlayStateChanged" />
+        <signal name="Next" />
+        <signal name="Prev" />
+        <signal name="DrawFrame" />
+        <signal name="SeekEvent" />
+        <signal name="Detach" />
+        <signal name="PlaybackRateChanged" />
+      </itemgroup>
+    </signals>
+  </object>
 </objects>
\ No newline at end of file
diff --git a/LongoMatch.GUI/Gui/Component/ProjectPeriods.cs b/LongoMatch.GUI/Gui/Component/ProjectPeriods.cs
new file mode 100644
index 0000000..b7a94e2
--- /dev/null
+++ b/LongoMatch.GUI/Gui/Component/ProjectPeriods.cs
@@ -0,0 +1,95 @@
+//
+//  Copyright (C) 2014 Andoni Morales Alastruey
+//
+//  This program is free software; you can redistribute it and/or modify
+//  it under the terms of the GNU General Public License as published by
+//  the Free Software Foundation; either version 2 of the License, or
+//  (at your option) any later version.
+//
+//  This program is distributed in the hope that it will be useful,
+//  but WITHOUT ANY WARRANTY; without even the implied warranty of
+//  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+//  GNU General Public License for more details.
+//
+//  You should have received a copy of the GNU General Public License
+//  along with this program; if not, write to the Free Software
+//  Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA.
+//
+using System;
+using LongoMatch.Store;
+using System.Collections.Generic;
+using LongoMatch.Drawing.Widgets;
+using LongoMatch.Drawing.Cairo;
+using Mono.Unix;
+
+namespace LongoMatch.Gui.Component
+{
+       [System.ComponentModel.ToolboxItem(true)]
+       public partial class ProjectPeriods : Gtk.Bin
+       {
+               TimersTimeline timersTimenline;
+               Timerule timerule;
+               
+               
+               public ProjectPeriods ()
+               {
+                       this.Build ();
+                       playerbin2.Tick += HandleTick;
+                       playerbin2.ShowControls = false;
+                       timerule = new Timerule (new WidgetWrapper (drawingarea1));
+                       timersTimenline = new TimersTimeline (new WidgetWrapper (drawingarea2));
+                       drawingarea1.HeightRequest = LongoMatch.Drawing.Common.TIMERULE_HEIGHT;
+                       drawingarea2.HeightRequest = LongoMatch.Drawing.Common.TIMER_HEIGHT;
+                       timersTimenline.TimeNodeChanged += HandleTimeNodeChanged;
+                       synclabel.Markup = String.Format ("{0} {1} {2}", "<b>⬆  ",
+                                                       Catalog.GetString ("Synchronize the game periods"),
+                                                       "  ⬆</b>");
+               }
+
+               public Project Project {
+                       set {
+                               Time start, duration, pDuration;
+                               List<string> gamePeriods;
+                               
+                               playerbin2.ShowControls = false;
+                               
+                               gamePeriods = value.Categories.GamePeriods;
+
+                               start = new Time (0);
+                               duration = value.Description.File.Duration;
+                               pDuration = new Time (duration.MSeconds / gamePeriods.Count);
+                               List<Timer> timers = new List<Timer> ();
+                               gamePeriods = value.Categories.GamePeriods;
+                               
+                               timerule.Duration = duration;
+                               playerbin2.Open (value.Description.File.FilePath);
+
+                               foreach (string s in gamePeriods) {
+                                       Timer timer = new Timer {Name = s};
+                                       timer.Start (start);
+                                       timer.Stop (start + pDuration);
+                                       timers.Add (timer);
+                                       start += pDuration;
+                               }
+                               timersTimenline.LoadTimers (timers, duration, false);
+                       }
+               }
+               
+               void HandleTick (Time currentTime, Time streamLength, double currentPosition)
+               {
+                       timerule.CurrentTime = currentTime;
+                       timersTimenline.CurrentTime = currentTime;
+                       drawingarea1.QueueDraw ();
+                       drawingarea2.QueueDraw ();
+               }
+
+               void HandleTimeNodeChanged (TimeNode tNode, object val)
+               {
+                       Time time = val as Time;
+                       playerbin2.Pause ();
+                       playerbin2.Seek (time, true);
+               }
+
+       }
+}
+
diff --git a/LongoMatch.GUI/Gui/Component/Timeline.cs b/LongoMatch.GUI/Gui/Component/Timeline.cs
index 82b94a4..1d712b4 100644
--- a/LongoMatch.GUI/Gui/Component/Timeline.cs
+++ b/LongoMatch.GUI/Gui/Component/Timeline.cs
@@ -41,7 +41,6 @@ namespace LongoMatch.Gui.Component
                public event TagPlayHandler TagPlay;
                public event RenderPlaylistHandler RenderPlaylist;
                
-               const int TIMERULE_HEIGHT = 30;
                const uint TIMEOUT_MS = 100;
                
                PlaysTimeline timeline;
@@ -64,9 +63,9 @@ namespace LongoMatch.Gui.Component
                        focusscale.Adjustment.Lower = 0;
                        focusscale.Adjustment.Upper = 12;
                        focusscale.ValueChanged += HandleValueChanged;
-                       timerulearea.HeightRequest = TIMERULE_HEIGHT;
+                       timerulearea.HeightRequest = LongoMatch.Drawing.Common.TIMERULE_HEIGHT;
                        labelsarea.WidthRequest = LongoMatch.Drawing.Common.CATEGORY_WIDTH;
-                       hbox1.HeightRequest = TIMERULE_HEIGHT;
+                       hbox1.HeightRequest = LongoMatch.Drawing.Common.TIMERULE_HEIGHT;
                        scrolledwindow1.Vadjustment.ValueChanged += HandleScrollEvent;
                        scrolledwindow1.Hadjustment.ValueChanged += HandleScrollEvent;
                        timeoutID = 0;
diff --git a/LongoMatch.GUI/Gui/Panel/NewProjectPanel.cs b/LongoMatch.GUI/Gui/Panel/NewProjectPanel.cs
index 9747e7e..0e04989 100644
--- a/LongoMatch.GUI/Gui/Panel/NewProjectPanel.cs
+++ b/LongoMatch.GUI/Gui/Panel/NewProjectPanel.cs
@@ -50,9 +50,12 @@ namespace LongoMatch.Gui.Panel
                
                const int PROJECT_TYPE = 0;
                const int PROJECT_DETAILS = 1;
+               const int PROJECT_PERIODS = 2;
                
                Project project;
                ProjectType projectType;
+               CaptureSettings captureSettings;
+               EncodingSettings encSettings;
                List<Device> videoDevices;
                ListStore teams, videoStandardList, encProfileList, qualList;
                MediaFile mediaFile;
@@ -76,15 +79,14 @@ namespace LongoMatch.Gui.Panel
                        backbutton.Clicked += HandleBackClicked;
                        if (project == null) {
                                notebook1.Page = 0;
-                               this.project = new Project {Description = new ProjectDescription ()};
-                               this.project.Description.MatchDate = DateTime.Now;
+                               datelabel.Text = DateTime.Now.ToShortDateString();
                        } else {
                                notebook1.Page = 1;
+                               FillProjectDetails ();
                                this.project = project;
                        }
                        
                        ConnectSignals ();
-                       FillProjectDetails ();
                        FillCategories ();
                        FillFormats ();
                        FillDevices (mtoolkit.VideoDevices);
@@ -232,6 +234,88 @@ namespace LongoMatch.Gui.Panel
                        }
                }
                
+               bool CreateProject () {
+                       TreeIter iter;
+                       
+                       if (project != null) {
+                               return true;
+                       }
+                       
+                       if (projectType == ProjectType.FileProject) {
+                               if (fileEntry.Text == "") {
+                                       gtoolkit.WarningMessage (Catalog.GetString ("No input video file"));
+                                       return false;
+                               }
+                       }
+                       if (projectType == ProjectType.CaptureProject ||
+                           projectType == ProjectType.URICaptureProject) {
+                               if (outfileEntry.Text == "") {
+                                       gtoolkit.WarningMessage (Catalog.GetString ("No output video file"));
+                                       return false;
+                               }
+                       }
+                       if (projectType == ProjectType.URICaptureProject) {
+                               if (urientry.Text == "") {
+                                       gtoolkit.WarningMessage (Catalog.GetString ("No input URI"));
+                                       return false;
+                               }
+                       }
+                       project = new Project ();
+                       project.Categories = analysisTemplate;
+                       project.LocalTeamTemplate = hometemplate;
+                       project.VisitorTeamTemplate = awaytemplate;
+                       project.Description = new ProjectDescription ();
+                       project.Description.Competition = competitionentry.Text;
+                       project.Description.File = mediaFile;
+                       project.Description.LocalGoals = (int) localSpinButton.Value;
+                       project.Description.VisitorGoals = (int) visitorSpinButton.Value;
+                       project.Description.MatchDate = DateTime.Parse (datelabel.Text);
+                       project.Description.Season = seasonentry.Text;
+                       project.Description.LocalName = project.LocalTeamTemplate.TeamName;
+                       project.Description.VisitorName = project.VisitorTeamTemplate.TeamName;
+                       
+                       encSettings = new EncodingSettings();
+                       captureSettings = new CaptureSettings();
+                               
+                       encSettings.OutputFile = outfileEntry.Text;
+                       
+                       if (project.Description.File == null) {
+                               project.Description.File = new MediaFile ();
+                               project.Description.File.Fps = (ushort) (Config.FPS_N / Config.FPS_D);
+                               project.Description.File.FilePath = outfileEntry.Text;
+                       }
+                       if (projectType == ProjectType.CaptureProject) {
+                               Device device = videoDevices[devicecombobox.Active];
+                               captureSettings.CaptureSourceType = device.DeviceType;
+                               captureSettings.DeviceID = device.ID;
+                               captureSettings.SourceElement = device.SourceElement;
+                       } else if (projectType == ProjectType.URICaptureProject) {
+                               captureSettings.CaptureSourceType = CaptureSourceType.URI;
+                               captureSettings.DeviceID = urientry.Text;
+                       }else if (projectType == ProjectType.FakeCaptureProject) {
+                               captureSettings.CaptureSourceType = CaptureSourceType.None;
+                               project.Description.File.FilePath = Constants.FAKE_PROJECT;
+                       }
+                               
+                       /* Get quality info */
+                       qualitycombobox.GetActiveIter(out iter);
+                       encSettings.EncodingQuality = (EncodingQuality) qualList.GetValue(iter, 1);
+                       
+                       /* Get size info */
+                       imagecombobox.GetActiveIter(out iter);
+                       encSettings.VideoStandard = (VideoStandard) videoStandardList.GetValue(iter, 1);
+                       
+                       /* Get encoding profile info */
+                       encodingcombobox.GetActiveIter(out iter);
+                       encSettings.EncodingProfile = (EncodingProfile) encProfileList.GetValue(iter, 1);
+                       
+                       encSettings.Framerate_n = Config.FPS_N;
+                       encSettings.Framerate_d = Config.FPS_D;
+                       
+                       captureSettings.EncodingSettings = encSettings;
+                       return true;
+               }
+               
                void HandleCalendarbuttonClicked(object sender, System.EventArgs e)
                {
                        datelabel.Text = Config.GUIToolkit.SelectDate (project.Description.MatchDate, 
this).ToShortDateString ();
@@ -287,87 +371,11 @@ namespace LongoMatch.Gui.Panel
 
                void HandleCreateProject (object sender, EventArgs e)
                {
-                       CaptureSettings captureSettings;
-                       EncodingSettings encSettings;
-                       TreeIter iter;
-                       Project p;
-                       
-                       if (projectType == ProjectType.FileProject) {
-                               if (fileEntry.Text == "") {
-                                       gtoolkit.WarningMessage (Catalog.GetString ("No input video file"));
-                                       return;
-                               }
-                       }
-                       if (projectType == ProjectType.CaptureProject ||
-                           projectType == ProjectType.URICaptureProject) {
-                               if (outfileEntry.Text == "") {
-                                       gtoolkit.WarningMessage (Catalog.GetString ("No output video file"));
-                                       return;
-                               }
-                       }
-                       if (projectType == ProjectType.URICaptureProject) {
-                               if (urientry.Text == "") {
-                                       gtoolkit.WarningMessage (Catalog.GetString ("No input URI"));
-                                       return;
+                       if (CreateProject ()) {
+                               if (OpenNewProjectEvent != null) {
+                                       OpenNewProjectEvent (project , projectType, captureSettings);
                                }
                        }
-                       p = new Project ();
-                       p.Categories = analysisTemplate;
-                       p.LocalTeamTemplate = hometemplate;
-                       p.VisitorTeamTemplate = awaytemplate;
-                       p.Description = new ProjectDescription ();
-                       p.Description.Competition = competitionentry.Text;
-                       p.Description.File = mediaFile;
-                       p.Description.LocalGoals = (int) localSpinButton.Value;
-                       p.Description.VisitorGoals = (int) visitorSpinButton.Value;
-                       p.Description.MatchDate = DateTime.Parse (datelabel.Text);
-                       p.Description.Season = seasonentry.Text;
-                       p.Description.LocalName = p.LocalTeamTemplate.TeamName;
-                       p.Description.VisitorName = p.VisitorTeamTemplate.TeamName;
-                       
-                       encSettings = new EncodingSettings();
-                       captureSettings = new CaptureSettings();
-                               
-                       encSettings.OutputFile = outfileEntry.Text;
-                       
-                       if (p.Description.File == null) {
-                               p.Description.File = new MediaFile ();
-                               p.Description.File.Fps = (ushort) (Config.FPS_N / Config.FPS_D);
-                               p.Description.File.FilePath = outfileEntry.Text;
-                       }
-                       if (projectType == ProjectType.CaptureProject) {
-                               Device device = videoDevices[devicecombobox.Active];
-                               captureSettings.CaptureSourceType = device.DeviceType;
-                               captureSettings.DeviceID = device.ID;
-                               captureSettings.SourceElement = device.SourceElement;
-                       } else if (projectType == ProjectType.URICaptureProject) {
-                               captureSettings.CaptureSourceType = CaptureSourceType.URI;
-                               captureSettings.DeviceID = urientry.Text;
-                       }else if (projectType == ProjectType.FakeCaptureProject) {
-                               captureSettings.CaptureSourceType = CaptureSourceType.None;
-                               p.Description.File.FilePath = Constants.FAKE_PROJECT;
-                       }
-                               
-                       /* Get quality info */
-                       qualitycombobox.GetActiveIter(out iter);
-                       encSettings.EncodingQuality = (EncodingQuality) qualList.GetValue(iter, 1);
-                       
-                       /* Get size info */
-                       imagecombobox.GetActiveIter(out iter);
-                       encSettings.VideoStandard = (VideoStandard) videoStandardList.GetValue(iter, 1);
-                       
-                       /* Get encoding profile info */
-                       encodingcombobox.GetActiveIter(out iter);
-                       encSettings.EncodingProfile = (EncodingProfile) encProfileList.GetValue(iter, 1);
-                       
-                       encSettings.Framerate_n = Config.FPS_N;
-                       encSettings.Framerate_d = Config.FPS_D;
-                       
-                       captureSettings.EncodingSettings = encSettings;
-                               
-                       if (OpenNewProjectEvent != null) {
-                               OpenNewProjectEvent (p, projectType, captureSettings);
-                       }
                }
 
                void HandleBackClicked (object sender, EventArgs e)
@@ -388,8 +396,25 @@ namespace LongoMatch.Gui.Panel
                        if (notebook1.Page == PROJECT_TYPE) {
                                SetProjectType ();      
                        }
+                       if (notebook1.Page == PROJECT_DETAILS) {
+                               if (!CreateProject ()) {
+                                       return;
+                               }
+                       }
+
                        notebook1.Page ++;
+
                        if (notebook1.Page == PROJECT_DETAILS) {
+                               switch (projectType) {
+                               case ProjectType.CaptureProject:
+                               case ProjectType.FakeCaptureProject:
+                               case ProjectType.URICaptureProject:
+                                       nextbutton.Visible = false;
+                                       createbutton.Visible = true;
+                                       break;
+                               }
+                       } else if (notebook1.Page == PROJECT_PERIODS) {
+                               projectperiods1.Project = project;
                                nextbutton.Visible = false;
                                createbutton.Visible = true;
                        }
diff --git a/LongoMatch.GUI/LongoMatch.GUI.mdp b/LongoMatch.GUI/LongoMatch.GUI.mdp
index f01a39b..618dfdd 100644
--- a/LongoMatch.GUI/LongoMatch.GUI.mdp
+++ b/LongoMatch.GUI/LongoMatch.GUI.mdp
@@ -186,6 +186,8 @@
     <File subtype="Code" buildaction="Compile" name="gtk-gui/LongoMatch.Gui.Component.Timeline.cs" />
     <File subtype="Code" buildaction="Compile" name="Gui/Component/CodingWidget.cs" />
     <File subtype="Code" buildaction="Compile" name="gtk-gui/LongoMatch.Gui.Component.CodingWidget.cs" />
+    <File subtype="Code" buildaction="Compile" name="Gui/Component/ProjectPeriods.cs" />
+    <File subtype="Code" buildaction="Compile" name="gtk-gui/LongoMatch.Gui.Component.ProjectPeriods.cs" />
   </Contents>
   <References>
     <ProjectReference type="Package" localcopy="True" refto="atk-sharp, Version=2.12.0.0, Culture=neutral, 
PublicKeyToken=35e10195dab3c99f" />
diff --git a/LongoMatch.GUI/gtk-gui/LongoMatch.Gui.Component.ProjectPeriods.cs 
b/LongoMatch.GUI/gtk-gui/LongoMatch.Gui.Component.ProjectPeriods.cs
new file mode 100644
index 0000000..f44a87a
--- /dev/null
+++ b/LongoMatch.GUI/gtk-gui/LongoMatch.Gui.Component.ProjectPeriods.cs
@@ -0,0 +1,61 @@
+
+// This file has been generated by the GUI designer. Do not modify.
+namespace LongoMatch.Gui.Component
+{
+       public partial class ProjectPeriods
+       {
+               private global::Gtk.VBox vbox2;
+               private global::LongoMatch.Gui.PlayerBin playerbin2;
+               private global::Gtk.DrawingArea drawingarea1;
+               private global::Gtk.DrawingArea drawingarea2;
+               private global::Gtk.Label synclabel;
+
+               protected virtual void Build ()
+               {
+                       global::Stetic.Gui.Initialize (this);
+                       // Widget LongoMatch.Gui.Component.ProjectPeriods
+                       global::Stetic.BinContainer.Attach (this);
+                       this.Name = "LongoMatch.Gui.Component.ProjectPeriods";
+                       // Container child 
LongoMatch.Gui.Component.ProjectPeriods.Gtk.Container+ContainerChild
+                       this.vbox2 = new global::Gtk.VBox ();
+                       this.vbox2.Name = "vbox2";
+                       // Container child vbox2.Gtk.Box+BoxChild
+                       this.playerbin2 = new global::LongoMatch.Gui.PlayerBin ();
+                       this.playerbin2.Events = ((global::Gdk.EventMask)(256));
+                       this.playerbin2.Name = "playerbin2";
+                       this.playerbin2.Detached = false;
+                       this.vbox2.Add (this.playerbin2);
+                       global::Gtk.Box.BoxChild w1 = ((global::Gtk.Box.BoxChild)(this.vbox2 
[this.playerbin2]));
+                       w1.Position = 0;
+                       // Container child vbox2.Gtk.Box+BoxChild
+                       this.drawingarea1 = new global::Gtk.DrawingArea ();
+                       this.drawingarea1.Name = "drawingarea1";
+                       this.vbox2.Add (this.drawingarea1);
+                       global::Gtk.Box.BoxChild w2 = ((global::Gtk.Box.BoxChild)(this.vbox2 
[this.drawingarea1]));
+                       w2.Position = 1;
+                       w2.Expand = false;
+                       // Container child vbox2.Gtk.Box+BoxChild
+                       this.drawingarea2 = new global::Gtk.DrawingArea ();
+                       this.drawingarea2.Name = "drawingarea2";
+                       this.vbox2.Add (this.drawingarea2);
+                       global::Gtk.Box.BoxChild w3 = ((global::Gtk.Box.BoxChild)(this.vbox2 
[this.drawingarea2]));
+                       w3.Position = 2;
+                       w3.Expand = false;
+                       // Container child vbox2.Gtk.Box+BoxChild
+                       this.synclabel = new global::Gtk.Label ();
+                       this.synclabel.Name = "synclabel";
+                       this.synclabel.UseMarkup = true;
+                       this.vbox2.Add (this.synclabel);
+                       global::Gtk.Box.BoxChild w4 = ((global::Gtk.Box.BoxChild)(this.vbox2 
[this.synclabel]));
+                       w4.PackType = ((global::Gtk.PackType)(1));
+                       w4.Position = 3;
+                       w4.Expand = false;
+                       w4.Fill = false;
+                       this.Add (this.vbox2);
+                       if ((this.Child != null)) {
+                               this.Child.ShowAll ();
+                       }
+                       this.Hide ();
+               }
+       }
+}
diff --git a/LongoMatch.GUI/gtk-gui/LongoMatch.Gui.Panel.NewProjectPanel.cs 
b/LongoMatch.GUI/gtk-gui/LongoMatch.Gui.Panel.NewProjectPanel.cs
index 886d035..7fe1ffd 100644
--- a/LongoMatch.GUI/gtk-gui/LongoMatch.Gui.Panel.NewProjectPanel.cs
+++ b/LongoMatch.GUI/gtk-gui/LongoMatch.Gui.Panel.NewProjectPanel.cs
@@ -77,6 +77,8 @@ namespace LongoMatch.Gui.Panel
                private global::Gtk.Image awayshieldimage;
                private global::Gtk.DrawingArea drawingarea1;
                private global::Gtk.Label label3;
+               private global::LongoMatch.Gui.Component.ProjectPeriods projectperiods1;
+               private global::Gtk.Label label7;
                private global::Gtk.HButtonBox hbuttonbox2;
                private global::Gtk.Button backbutton;
                private global::Gtk.Button nextbutton;
@@ -766,12 +768,25 @@ namespace LongoMatch.Gui.Panel
                        this.label3.LabelProp = global::Mono.Unix.Catalog.GetString ("page2");
                        this.notebook1.SetTabLabel (this.vbox4, this.label3);
                        this.label3.ShowAll ();
+                       // Container child notebook1.Gtk.Notebook+NotebookChild
+                       this.projectperiods1 = new global::LongoMatch.Gui.Component.ProjectPeriods ();
+                       this.projectperiods1.Events = ((global::Gdk.EventMask)(256));
+                       this.projectperiods1.Name = "projectperiods1";
+                       this.notebook1.Add (this.projectperiods1);
+                       global::Gtk.Notebook.NotebookChild w93 = 
((global::Gtk.Notebook.NotebookChild)(this.notebook1 [this.projectperiods1]));
+                       w93.Position = 2;
+                       // Notebook tab
+                       this.label7 = new global::Gtk.Label ();
+                       this.label7.Name = "label7";
+                       this.label7.LabelProp = global::Mono.Unix.Catalog.GetString ("page3");
+                       this.notebook1.SetTabLabel (this.projectperiods1, this.label7);
+                       this.label7.ShowAll ();
                        this.hbox3.Add (this.notebook1);
-                       global::Gtk.Box.BoxChild w93 = ((global::Gtk.Box.BoxChild)(this.hbox3 
[this.notebook1]));
-                       w93.Position = 1;
+                       global::Gtk.Box.BoxChild w94 = ((global::Gtk.Box.BoxChild)(this.hbox3 
[this.notebook1]));
+                       w94.Position = 1;
                        this.vbox2.Add (this.hbox3);
-                       global::Gtk.Box.BoxChild w94 = ((global::Gtk.Box.BoxChild)(this.vbox2 [this.hbox3]));
-                       w94.Position = 0;
+                       global::Gtk.Box.BoxChild w95 = ((global::Gtk.Box.BoxChild)(this.vbox2 [this.hbox3]));
+                       w95.Position = 0;
                        // Container child vbox2.Gtk.Box+BoxChild
                        this.hbuttonbox2 = new global::Gtk.HButtonBox ();
                        this.hbuttonbox2.Name = "hbuttonbox2";
@@ -782,81 +797,81 @@ namespace LongoMatch.Gui.Panel
                        this.backbutton.Name = "backbutton";
                        this.backbutton.UseUnderline = true;
                        // Container child backbutton.Gtk.Container+ContainerChild
-                       global::Gtk.Alignment w95 = new global::Gtk.Alignment (0.5F, 0.5F, 0F, 0F);
+                       global::Gtk.Alignment w96 = new global::Gtk.Alignment (0.5F, 0.5F, 0F, 0F);
                        // Container child GtkAlignment.Gtk.Container+ContainerChild
-                       global::Gtk.HBox w96 = new global::Gtk.HBox ();
-                       w96.Spacing = 2;
+                       global::Gtk.HBox w97 = new global::Gtk.HBox ();
+                       w97.Spacing = 2;
                        // Container child GtkHBox.Gtk.Container+ContainerChild
-                       global::Gtk.Image w97 = new global::Gtk.Image ();
-                       w97.Pixbuf = global::Stetic.IconLoader.LoadIcon (this, "gtk-go-back", 
global::Gtk.IconSize.Dialog);
-                       w96.Add (w97);
+                       global::Gtk.Image w98 = new global::Gtk.Image ();
+                       w98.Pixbuf = global::Stetic.IconLoader.LoadIcon (this, "gtk-go-back", 
global::Gtk.IconSize.Dialog);
+                       w97.Add (w98);
                        // Container child GtkHBox.Gtk.Container+ContainerChild
-                       global::Gtk.Label w99 = new global::Gtk.Label ();
-                       w99.LabelProp = global::Mono.Unix.Catalog.GetString ("_Back");
-                       w99.UseUnderline = true;
-                       w96.Add (w99);
-                       w95.Add (w96);
-                       this.backbutton.Add (w95);
+                       global::Gtk.Label w100 = new global::Gtk.Label ();
+                       w100.LabelProp = global::Mono.Unix.Catalog.GetString ("_Back");
+                       w100.UseUnderline = true;
+                       w97.Add (w100);
+                       w96.Add (w97);
+                       this.backbutton.Add (w96);
                        this.hbuttonbox2.Add (this.backbutton);
-                       global::Gtk.ButtonBox.ButtonBoxChild w103 = 
((global::Gtk.ButtonBox.ButtonBoxChild)(this.hbuttonbox2 [this.backbutton]));
-                       w103.Expand = false;
-                       w103.Fill = false;
+                       global::Gtk.ButtonBox.ButtonBoxChild w104 = 
((global::Gtk.ButtonBox.ButtonBoxChild)(this.hbuttonbox2 [this.backbutton]));
+                       w104.Expand = false;
+                       w104.Fill = false;
                        // Container child hbuttonbox2.Gtk.ButtonBox+ButtonBoxChild
                        this.nextbutton = new global::Gtk.Button ();
                        this.nextbutton.CanFocus = true;
                        this.nextbutton.Name = "nextbutton";
                        this.nextbutton.UseUnderline = true;
                        // Container child nextbutton.Gtk.Container+ContainerChild
-                       global::Gtk.Alignment w104 = new global::Gtk.Alignment (0.5F, 0.5F, 0F, 0F);
+                       global::Gtk.Alignment w105 = new global::Gtk.Alignment (0.5F, 0.5F, 0F, 0F);
                        // Container child GtkAlignment.Gtk.Container+ContainerChild
-                       global::Gtk.HBox w105 = new global::Gtk.HBox ();
-                       w105.Spacing = 2;
+                       global::Gtk.HBox w106 = new global::Gtk.HBox ();
+                       w106.Spacing = 2;
                        // Container child GtkHBox.Gtk.Container+ContainerChild
-                       global::Gtk.Image w106 = new global::Gtk.Image ();
-                       w106.Pixbuf = global::Stetic.IconLoader.LoadIcon (this, "gtk-go-forward", 
global::Gtk.IconSize.Dialog);
-                       w105.Add (w106);
+                       global::Gtk.Image w107 = new global::Gtk.Image ();
+                       w107.Pixbuf = global::Stetic.IconLoader.LoadIcon (this, "gtk-go-forward", 
global::Gtk.IconSize.Dialog);
+                       w106.Add (w107);
                        // Container child GtkHBox.Gtk.Container+ContainerChild
-                       global::Gtk.Label w108 = new global::Gtk.Label ();
-                       w108.LabelProp = global::Mono.Unix.Catalog.GetString ("_Next");
-                       w108.UseUnderline = true;
-                       w105.Add (w108);
-                       w104.Add (w105);
-                       this.nextbutton.Add (w104);
+                       global::Gtk.Label w109 = new global::Gtk.Label ();
+                       w109.LabelProp = global::Mono.Unix.Catalog.GetString ("_Next");
+                       w109.UseUnderline = true;
+                       w106.Add (w109);
+                       w105.Add (w106);
+                       this.nextbutton.Add (w105);
                        this.hbuttonbox2.Add (this.nextbutton);
-                       global::Gtk.ButtonBox.ButtonBoxChild w112 = 
((global::Gtk.ButtonBox.ButtonBoxChild)(this.hbuttonbox2 [this.nextbutton]));
-                       w112.Position = 1;
-                       w112.Expand = false;
-                       w112.Fill = false;
+                       global::Gtk.ButtonBox.ButtonBoxChild w113 = 
((global::Gtk.ButtonBox.ButtonBoxChild)(this.hbuttonbox2 [this.nextbutton]));
+                       w113.Position = 1;
+                       w113.Expand = false;
+                       w113.Fill = false;
                        // Container child hbuttonbox2.Gtk.ButtonBox+ButtonBoxChild
                        this.createbutton = new global::Gtk.Button ();
                        this.createbutton.CanFocus = true;
                        this.createbutton.Name = "createbutton";
                        this.createbutton.UseUnderline = true;
                        // Container child createbutton.Gtk.Container+ContainerChild
-                       global::Gtk.Alignment w113 = new global::Gtk.Alignment (0.5F, 0.5F, 0F, 0F);
+                       global::Gtk.Alignment w114 = new global::Gtk.Alignment (0.5F, 0.5F, 0F, 0F);
                        // Container child GtkAlignment.Gtk.Container+ContainerChild
-                       global::Gtk.HBox w114 = new global::Gtk.HBox ();
-                       w114.Spacing = 2;
+                       global::Gtk.HBox w115 = new global::Gtk.HBox ();
+                       w115.Spacing = 2;
                        // Container child GtkHBox.Gtk.Container+ContainerChild
-                       global::Gtk.Image w115 = new global::Gtk.Image ();
-                       w115.Pixbuf = global::Stetic.IconLoader.LoadIcon (this, "gtk-new", 
global::Gtk.IconSize.Dialog);
-                       w114.Add (w115);
+                       global::Gtk.Image w116 = new global::Gtk.Image ();
+                       w116.Pixbuf = global::Stetic.IconLoader.LoadIcon (this, "gtk-new", 
global::Gtk.IconSize.Dialog);
+                       w115.Add (w116);
                        // Container child GtkHBox.Gtk.Container+ContainerChild
-                       global::Gtk.Label w117 = new global::Gtk.Label ();
-                       w117.LabelProp = global::Mono.Unix.Catalog.GetString ("Create project");
-                       w117.UseUnderline = true;
-                       w114.Add (w117);
-                       w113.Add (w114);
-                       this.createbutton.Add (w113);
+                       global::Gtk.Label w118 = new global::Gtk.Label ();
+                       w118.LabelProp = global::Mono.Unix.Catalog.GetString ("Create project");
+                       w118.UseUnderline = true;
+                       w115.Add (w118);
+                       w114.Add (w115);
+                       this.createbutton.Add (w114);
                        this.hbuttonbox2.Add (this.createbutton);
-                       global::Gtk.ButtonBox.ButtonBoxChild w121 = 
((global::Gtk.ButtonBox.ButtonBoxChild)(this.hbuttonbox2 [this.createbutton]));
-                       w121.Position = 2;
-                       w121.Expand = false;
-                       w121.Fill = false;
-                       this.vbox2.Add (this.hbuttonbox2);
-                       global::Gtk.Box.BoxChild w122 = ((global::Gtk.Box.BoxChild)(this.vbox2 
[this.hbuttonbox2]));
-                       w122.Position = 1;
+                       global::Gtk.ButtonBox.ButtonBoxChild w122 = 
((global::Gtk.ButtonBox.ButtonBoxChild)(this.hbuttonbox2 [this.createbutton]));
+                       w122.Position = 2;
                        w122.Expand = false;
+                       w122.Fill = false;
+                       this.vbox2.Add (this.hbuttonbox2);
+                       global::Gtk.Box.BoxChild w123 = ((global::Gtk.Box.BoxChild)(this.vbox2 
[this.hbuttonbox2]));
+                       w123.Position = 1;
+                       w123.Expand = false;
                        this.Add (this.vbox2);
                        if ((this.Child != null)) {
                                this.Child.ShowAll ();
diff --git a/LongoMatch.GUI/gtk-gui/gui.stetic b/LongoMatch.GUI/gtk-gui/gui.stetic
index 4330f63..8db69ef 100644
--- a/LongoMatch.GUI/gtk-gui/gui.stetic
+++ b/LongoMatch.GUI/gtk-gui/gui.stetic
@@ -7096,7 +7096,6 @@ Defining &lt;b&gt; Game Units &lt;/b&gt; will help you during the analysis to in
                             <property name="MemberName" />
                             <property name="CanFocus">True</property>
                             <property name="Label" translatable="yes">New project using a video 
file</property>
-                            <property name="Active">True</property>
                             <property name="DrawIndicator">True</property>
                             <property name="HasLabel">True</property>
                             <property name="UseUnderline">True</property>
@@ -8077,6 +8076,24 @@ Defining &lt;b&gt; Game Units &lt;/b&gt; will help you during the analysis to in
                     <property name="type">tab</property>
                   </packing>
                 </child>
+                <child>
+                  <widget class="LongoMatch.Gui.Component.ProjectPeriods" id="projectperiods1">
+                    <property name="MemberName" />
+                    <property name="Events">ButtonPressMask</property>
+                  </widget>
+                  <packing>
+                    <property name="Position">2</property>
+                  </packing>
+                </child>
+                <child>
+                  <widget class="Gtk.Label" id="label7">
+                    <property name="MemberName" />
+                    <property name="LabelProp" translatable="yes">page3</property>
+                  </widget>
+                  <packing>
+                    <property name="type">tab</property>
+                  </packing>
+                </child>
               </widget>
               <packing>
                 <property name="Position">1</property>
@@ -10387,4 +10404,57 @@ Click 2 players to swap them</property>
       </widget>
     </child>
   </widget>
+  <widget class="Gtk.Bin" id="LongoMatch.Gui.Component.ProjectPeriods" design-size="821 557">
+    <property name="MemberName" />
+    <property name="Visible">False</property>
+    <child>
+      <widget class="Gtk.VBox" id="vbox2">
+        <property name="MemberName" />
+        <child>
+          <widget class="LongoMatch.Gui.PlayerBin" id="playerbin2">
+            <property name="MemberName" />
+            <property name="Events">ButtonPressMask</property>
+            <property name="Detached">False</property>
+          </widget>
+          <packing>
+            <property name="Position">0</property>
+            <property name="AutoSize">True</property>
+          </packing>
+        </child>
+        <child>
+          <widget class="Gtk.DrawingArea" id="drawingarea1">
+            <property name="MemberName" />
+          </widget>
+          <packing>
+            <property name="Position">1</property>
+            <property name="AutoSize">False</property>
+            <property name="Expand">False</property>
+          </packing>
+        </child>
+        <child>
+          <widget class="Gtk.DrawingArea" id="drawingarea2">
+            <property name="MemberName" />
+          </widget>
+          <packing>
+            <property name="Position">2</property>
+            <property name="AutoSize">False</property>
+            <property name="Expand">False</property>
+          </packing>
+        </child>
+        <child>
+          <widget class="Gtk.Label" id="synclabel">
+            <property name="MemberName" />
+            <property name="UseMarkup">True</property>
+          </widget>
+          <packing>
+            <property name="PackType">End</property>
+            <property name="Position">3</property>
+            <property name="AutoSize">True</property>
+            <property name="Expand">False</property>
+            <property name="Fill">False</property>
+          </packing>
+        </child>
+      </widget>
+    </child>
+  </widget>
 </stetic-interface>
\ No newline at end of file
diff --git a/LongoMatch.GUI/gtk-gui/objects.xml b/LongoMatch.GUI/gtk-gui/objects.xml
index 5a9e210..9eecf8a 100644
--- a/LongoMatch.GUI/gtk-gui/objects.xml
+++ b/LongoMatch.GUI/gtk-gui/objects.xml
@@ -482,4 +482,8 @@
       </itemgroup>
     </signals>
   </object>
+  <object type="LongoMatch.Gui.Component.ProjectPeriods" palette-category="General" allow-children="false" 
base-type="Gtk.Bin">
+    <itemgroups />
+    <signals />
+  </object>
 </objects>
\ No newline at end of file
diff --git a/LongoMatch.Services/Services/PlaylistManager.cs b/LongoMatch.Services/Services/PlaylistManager.cs
index 2441d78..672c197 100644
--- a/LongoMatch.Services/Services/PlaylistManager.cs
+++ b/LongoMatch.Services/Services/PlaylistManager.cs
@@ -25,6 +25,8 @@ using LongoMatch.Store;
 using LongoMatch.Common;
 using Mono.Unix;
 
+using Timer = System.Threading.Timer;
+
 
 namespace LongoMatch.Services
 {


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