[longomatch] Add an indicator in live with the last tagged event
- From: Andoni Morales Alastruey <amorales src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [longomatch] Add an indicator in live with the last tagged event
- Date: Sun, 30 Nov 2014 18:39:02 +0000 (UTC)
commit 8da85544bd66dcea22471aaf0824b2679848b635
Author: Andoni Morales Alastruey <ylatuya gmail com>
Date: Sun Nov 30 19:38:32 2014 +0100
Add an indicator in live with the last tagged event
LongoMatch.Core/Common/EventsBroker.cs | 8 ++
LongoMatch.Core/Handlers/Handlers.cs | 2 +
LongoMatch.GUI.Multimedia/Gui/CapturerBin.cs | 40 ++++++++++
.../gtk-gui/LongoMatch.Gui.CapturerBin.cs | 78 +++++++++++++++++--
LongoMatch.GUI.Multimedia/gtk-gui/gui.stetic | 83 +++++++++++++++++++-
LongoMatch.Services/Services/EventsManager.cs | 1 +
data/icons/Makefile.am | 1 +
.../hicolor/scalable/actions/longomatch-delete.svg | 53 +++++++++++++
8 files changed, 256 insertions(+), 10 deletions(-)
---
diff --git a/LongoMatch.Core/Common/EventsBroker.cs b/LongoMatch.Core/Common/EventsBroker.cs
index bfb0184..28b39c5 100644
--- a/LongoMatch.Core/Common/EventsBroker.cs
+++ b/LongoMatch.Core/Common/EventsBroker.cs
@@ -31,6 +31,7 @@ namespace LongoMatch.Core.Common
public event NewEventHandler NewTagEvent;
public event NewTimelineEventHandler NewTimelineEventEvent;
+ public event EventCreatedHandler EventCreatedEvent;
public event DeleteEventsHandler EventsDeletedEvent;
public event LoadEventHandler LoadEventEvent;
public event EventLoadedHandler EventLoadedEvent;
@@ -421,6 +422,13 @@ namespace LongoMatch.Core.Common
TimerNodeAddedEvent (timer, node);
}
}
+
+ public void EmitEventCreated (TimelineEvent evt)
+ {
+ if (EventCreatedEvent != null) {
+ EventCreatedEvent (evt);
+ }
+ }
}
}
diff --git a/LongoMatch.Core/Handlers/Handlers.cs b/LongoMatch.Core/Handlers/Handlers.cs
index 11074ae..2af3987 100644
--- a/LongoMatch.Core/Handlers/Handlers.cs
+++ b/LongoMatch.Core/Handlers/Handlers.cs
@@ -33,6 +33,8 @@ namespace LongoMatch.Core.Handlers
public delegate void LoadEventHandler (TimelineEvent evt);
/* An event was loaded */
public delegate void EventLoadedHandler (TimelineEvent evt);
+ /* An event has been created */
+ public delegate void EventCreatedHandler (TimelineEvent evt);
/* A new play needs to be create for a specific category at the current play time */
public delegate void NewEventHandler (EventType eventType,List<Player> players, Team team,
List<Tag> tags,Time start,Time stop, Time EventTime,
diff --git a/LongoMatch.GUI.Multimedia/Gui/CapturerBin.cs b/LongoMatch.GUI.Multimedia/Gui/CapturerBin.cs
index 9031373..be4daf2 100644
--- a/LongoMatch.GUI.Multimedia/Gui/CapturerBin.cs
+++ b/LongoMatch.GUI.Multimedia/Gui/CapturerBin.cs
@@ -46,6 +46,7 @@ namespace LongoMatch.Gui
Time accumTime;
DateTime currentPeriodStart;
List<string> gamePeriods;
+ TimelineEvent lastevent;
public CapturerBin ()
{
@@ -72,9 +73,18 @@ namespace LongoMatch.Gui
StyleConf.PlayerCapturerIconSize);
cancelimage.Pixbuf = Misc.LoadIcon ("longomatch-cancel-rec",
StyleConf.PlayerCapturerIconSize);
+ deletelastimage.Pixbuf = Misc.LoadIcon ("longomatch-delete",
+ StyleConf.PlayerCapturerIconSize);
+ playlastimage.Pixbuf = Misc.LoadIcon ("longomatch-control-play",
+ StyleConf.PlayerCapturerIconSize);
+ lasteventbox.Visible = false;
+ deletelastbutton.Clicked += HandleDeleteLast;
+ playlastbutton.Clicked += HandlePlayLast;
Periods = new List<Period> ();
Reset ();
Mode = CapturerType.Live;
+ Config.EventsBroker.EventCreatedEvent += HandleEventCreated;
+ lastlabel.ModifyFont (Pango.FontDescription.FromString (Config.Style.Font + " 8px"));
}
protected override void OnDestroyed ()
@@ -82,6 +92,7 @@ namespace LongoMatch.Gui
if (timeoutID != 0) {
GLib.Source.Remove (timeoutID);
}
+ Config.EventsBroker.EventCreatedEvent -= HandleEventCreated;
base.OnDestroyed ();
}
@@ -91,7 +102,9 @@ namespace LongoMatch.Gui
videowindow.Visible = value == CapturerType.Live;
if (type == CapturerType.Fake) {
SetStyle (StyleConf.PlayerCapturerControlsHeight * 2, 24 * 2, 40 * 2);
+ playlastbutton.Visible = false;
} else {
+ playlastbutton.Visible = true;
SetStyle (StyleConf.PlayerCapturerControlsHeight, 24, 40);
}
}
@@ -361,6 +374,7 @@ namespace LongoMatch.Gui
savebutton.Visible = false;
cancelbutton.Visible = true;
resumebutton.Visible = false;
+ lasteventbox.Visible = false;
}
void Configure ()
@@ -428,5 +442,31 @@ namespace LongoMatch.Gui
Capturer.Expose ();
}
}
+
+ void HandleEventCreated (TimelineEvent evt)
+ {
+ lasteventbox.Visible = true;
+ lastlabel.Text = evt.Name;
+ lastlabel.ModifyFg (StateType.Normal, Misc.ToGdkColor (evt.Color));
+ lastevent = evt;
+ }
+
+ void HandlePlayLast (object sender, EventArgs e)
+ {
+ if (lastevent != null) {
+ Config.EventsBroker.EmitLoadEvent (lastevent);
+ }
+ }
+
+ void HandleDeleteLast (object sender, EventArgs e)
+ {
+ if (lastevent != null) {
+ Config.EventsBroker.EmitEventsDeleted (new List<TimelineEvent> {lastevent});
+ lastevent = null;
+ lasteventbox.Visible = false;
+ }
+
+ }
+
}
}
diff --git a/LongoMatch.GUI.Multimedia/gtk-gui/LongoMatch.Gui.CapturerBin.cs
b/LongoMatch.GUI.Multimedia/gtk-gui/LongoMatch.Gui.CapturerBin.cs
index 027fe4c..a9fcd6f 100644
--- a/LongoMatch.GUI.Multimedia/gtk-gui/LongoMatch.Gui.CapturerBin.cs
+++ b/LongoMatch.GUI.Multimedia/gtk-gui/LongoMatch.Gui.CapturerBin.cs
@@ -30,6 +30,13 @@ namespace LongoMatch.Gui
private global::Gtk.Image saveimage;
private global::Gtk.Button cancelbutton;
private global::Gtk.Image cancelimage;
+ private global::Gtk.VSeparator vseparator2;
+ private global::Gtk.HBox lasteventbox;
+ private global::Gtk.Label lastlabel;
+ private global::Gtk.Button deletelastbutton;
+ private global::Gtk.Image deletelastimage;
+ private global::Gtk.Button playlastbutton;
+ private global::Gtk.Image playlastimage;
protected virtual void Build ()
{
@@ -50,7 +57,7 @@ namespace LongoMatch.Gui
global::Gtk.Box.BoxChild w1 = ((global::Gtk.Box.BoxChild)(this.vbox1
[this.videowindow]));
w1.Position = 0;
// Container child vbox1.Gtk.Box+BoxChild
- this.alignment1 = new global::Gtk.Alignment (0.5F, 0.5F, 0F, 1F);
+ this.alignment1 = new global::Gtk.Alignment (0.5F, 0.5F, 1F, 1F);
this.alignment1.Name = "alignment1";
// Container child alignment1.Gtk.Container+ContainerChild
this.controllerbox = new global::Gtk.HBox ();
@@ -128,12 +135,10 @@ namespace LongoMatch.Gui
w10.Fill = false;
// Container child controllerbox.Gtk.Box+BoxChild
this.vseparator1 = new global::Gtk.VSeparator ();
- this.vseparator1.WidthRequest = 60;
this.vseparator1.Name = "vseparator1";
this.controllerbox.Add (this.vseparator1);
global::Gtk.Box.BoxChild w11 = ((global::Gtk.Box.BoxChild)(this.controllerbox
[this.vseparator1]));
w11.Position = 6;
- w11.Expand = false;
// Container child controllerbox.Gtk.Box+BoxChild
this.recbutton = new global::Gtk.Button ();
this.recbutton.TooltipMarkup = "Start recording period";
@@ -242,11 +247,72 @@ namespace LongoMatch.Gui
w23.Position = 12;
w23.Expand = false;
w23.Fill = false;
+ // Container child controllerbox.Gtk.Box+BoxChild
+ this.vseparator2 = new global::Gtk.VSeparator ();
+ this.vseparator2.Name = "vseparator2";
+ this.controllerbox.Add (this.vseparator2);
+ global::Gtk.Box.BoxChild w24 = ((global::Gtk.Box.BoxChild)(this.controllerbox
[this.vseparator2]));
+ w24.Position = 13;
+ // Container child controllerbox.Gtk.Box+BoxChild
+ this.lasteventbox = new global::Gtk.HBox ();
+ this.lasteventbox.Name = "lasteventbox";
+ this.lasteventbox.Spacing = 6;
+ // Container child lasteventbox.Gtk.Box+BoxChild
+ this.lastlabel = new global::Gtk.Label ();
+ this.lastlabel.Name = "lastlabel";
+ this.lastlabel.Ellipsize = ((global::Pango.EllipsizeMode)(3));
+ this.lastlabel.MaxWidthChars = 15;
+ this.lasteventbox.Add (this.lastlabel);
+ global::Gtk.Box.BoxChild w25 = ((global::Gtk.Box.BoxChild)(this.lasteventbox
[this.lastlabel]));
+ w25.Position = 0;
+ w25.Fill = false;
+ // Container child lasteventbox.Gtk.Box+BoxChild
+ this.deletelastbutton = new global::Gtk.Button ();
+ this.deletelastbutton.TooltipMarkup = "Delete event";
+ this.deletelastbutton.CanFocus = true;
+ this.deletelastbutton.Name = "deletelastbutton";
+ this.deletelastbutton.Relief = ((global::Gtk.ReliefStyle)(2));
+ // Container child deletelastbutton.Gtk.Container+ContainerChild
+ this.deletelastimage = new global::Gtk.Image ();
+ this.deletelastimage.Name = "deletelastimage";
+ this.deletelastimage.Xpad = 5;
+ this.deletelastimage.Ypad = 5;
+ this.deletelastbutton.Add (this.deletelastimage);
+ this.deletelastbutton.Label = null;
+ this.lasteventbox.Add (this.deletelastbutton);
+ global::Gtk.Box.BoxChild w27 = ((global::Gtk.Box.BoxChild)(this.lasteventbox
[this.deletelastbutton]));
+ w27.Position = 1;
+ w27.Expand = false;
+ w27.Fill = false;
+ // Container child lasteventbox.Gtk.Box+BoxChild
+ this.playlastbutton = new global::Gtk.Button ();
+ this.playlastbutton.TooltipMarkup = "Replay event";
+ this.playlastbutton.CanFocus = true;
+ this.playlastbutton.Name = "playlastbutton";
+ this.playlastbutton.Relief = ((global::Gtk.ReliefStyle)(2));
+ // Container child playlastbutton.Gtk.Container+ContainerChild
+ this.playlastimage = new global::Gtk.Image ();
+ this.playlastimage.Name = "playlastimage";
+ this.playlastimage.Xpad = 5;
+ this.playlastimage.Ypad = 5;
+ this.playlastbutton.Add (this.playlastimage);
+ this.playlastbutton.Label = null;
+ this.lasteventbox.Add (this.playlastbutton);
+ global::Gtk.Box.BoxChild w29 = ((global::Gtk.Box.BoxChild)(this.lasteventbox
[this.playlastbutton]));
+ w29.Position = 2;
+ w29.Expand = false;
+ w29.Fill = false;
+ this.controllerbox.Add (this.lasteventbox);
+ global::Gtk.Box.BoxChild w30 = ((global::Gtk.Box.BoxChild)(this.controllerbox
[this.lasteventbox]));
+ w30.PackType = ((global::Gtk.PackType)(1));
+ w30.Position = 14;
+ w30.Expand = false;
+ w30.Fill = false;
this.alignment1.Add (this.controllerbox);
this.vbox1.Add (this.alignment1);
- global::Gtk.Box.BoxChild w25 = ((global::Gtk.Box.BoxChild)(this.vbox1
[this.alignment1]));
- w25.Position = 1;
- w25.Expand = false;
+ global::Gtk.Box.BoxChild w32 = ((global::Gtk.Box.BoxChild)(this.vbox1
[this.alignment1]));
+ w32.Position = 1;
+ w32.Expand = false;
this.Add (this.vbox1);
if ((this.Child != null)) {
this.Child.ShowAll ();
diff --git a/LongoMatch.GUI.Multimedia/gtk-gui/gui.stetic b/LongoMatch.GUI.Multimedia/gtk-gui/gui.stetic
index 7c9bbf9..9648967 100644
--- a/LongoMatch.GUI.Multimedia/gtk-gui/gui.stetic
+++ b/LongoMatch.GUI.Multimedia/gtk-gui/gui.stetic
@@ -446,7 +446,7 @@
</widget>
</child>
</widget>
- <widget class="Gtk.Bin" id="LongoMatch.Gui.CapturerBin" design-size="983 403">
+ <widget class="Gtk.Bin" id="LongoMatch.Gui.CapturerBin" design-size="1092 445">
<property name="MemberName" />
<child>
<widget class="Gtk.VBox" id="vbox1">
@@ -467,7 +467,6 @@
<child>
<widget class="Gtk.Alignment" id="alignment1">
<property name="MemberName" />
- <property name="Xscale">0</property>
<child>
<widget class="Gtk.HBox" id="controllerbox">
<property name="MemberName" />
@@ -566,12 +565,10 @@
<child>
<widget class="Gtk.VSeparator" id="vseparator1">
<property name="MemberName" />
- <property name="WidthRequest">60</property>
</widget>
<packing>
<property name="Position">6</property>
<property name="AutoSize">False</property>
- <property name="Expand">False</property>
</packing>
</child>
<child>
@@ -706,6 +703,84 @@
<property name="Fill">False</property>
</packing>
</child>
+ <child>
+ <widget class="Gtk.VSeparator" id="vseparator2">
+ <property name="MemberName" />
+ </widget>
+ <packing>
+ <property name="Position">13</property>
+ <property name="AutoSize">False</property>
+ </packing>
+ </child>
+ <child>
+ <widget class="Gtk.HBox" id="lasteventbox">
+ <property name="MemberName" />
+ <property name="Spacing">6</property>
+ <child>
+ <widget class="Gtk.Label" id="lastlabel">
+ <property name="MemberName" />
+ <property name="Ellipsize">End</property>
+ <property name="MaxWidthChars">15</property>
+ </widget>
+ <packing>
+ <property name="Position">0</property>
+ <property name="AutoSize">False</property>
+ <property name="Fill">False</property>
+ </packing>
+ </child>
+ <child>
+ <widget class="Gtk.Button" id="deletelastbutton">
+ <property name="MemberName" />
+ <property name="Tooltip" translatable="yes">Delete event</property>
+ <property name="CanFocus">True</property>
+ <property name="Type">Custom</property>
+ <property name="Relief">None</property>
+ <child>
+ <widget class="Gtk.Image" id="deletelastimage">
+ <property name="MemberName" />
+ <property name="Xpad">5</property>
+ <property name="Ypad">5</property>
+ </widget>
+ </child>
+ </widget>
+ <packing>
+ <property name="Position">1</property>
+ <property name="AutoSize">True</property>
+ <property name="Expand">False</property>
+ <property name="Fill">False</property>
+ </packing>
+ </child>
+ <child>
+ <widget class="Gtk.Button" id="playlastbutton">
+ <property name="MemberName" />
+ <property name="Tooltip" translatable="yes">Replay event</property>
+ <property name="CanFocus">True</property>
+ <property name="Type">Custom</property>
+ <property name="Relief">None</property>
+ <child>
+ <widget class="Gtk.Image" id="playlastimage">
+ <property name="MemberName" />
+ <property name="Xpad">5</property>
+ <property name="Ypad">5</property>
+ </widget>
+ </child>
+ </widget>
+ <packing>
+ <property name="Position">2</property>
+ <property name="AutoSize">True</property>
+ <property name="Expand">False</property>
+ <property name="Fill">False</property>
+ </packing>
+ </child>
+ </widget>
+ <packing>
+ <property name="PackType">End</property>
+ <property name="Position">14</property>
+ <property name="AutoSize">False</property>
+ <property name="Expand">False</property>
+ <property name="Fill">False</property>
+ </packing>
+ </child>
</widget>
</child>
</widget>
diff --git a/LongoMatch.Services/Services/EventsManager.cs b/LongoMatch.Services/Services/EventsManager.cs
index 1524772..4dac415 100644
--- a/LongoMatch.Services/Services/EventsManager.cs
+++ b/LongoMatch.Services/Services/EventsManager.cs
@@ -267,6 +267,7 @@ namespace LongoMatch.Services
filter.Update ();
analysisWindow.AddPlay (play);
+ Config.EventsBroker.EmitEventCreated (play);
if (projectType == ProjectType.FileProject) {
player.Play ();
}
diff --git a/data/icons/Makefile.am b/data/icons/Makefile.am
index 591629d..ad8661b 100644
--- a/data/icons/Makefile.am
+++ b/data/icons/Makefile.am
@@ -35,6 +35,7 @@ nobase_dist_icons_DATA = Makefile.am \
hicolor/scalable/actions/longomatch-dash-fill.svg \
hicolor/scalable/actions/longomatch-dash-fit.svg \
hicolor/scalable/actions/longomatch-default-shield.svg \
+ hicolor/scalable/actions/longomatch-delete.svg \
hicolor/scalable/actions/longomatch-eraser.svg \
hicolor/scalable/actions/longomatch-eye.svg \
hicolor/scalable/actions/longomatch-field-full.svg \
diff --git a/data/icons/hicolor/scalable/actions/longomatch-delete.svg
b/data/icons/hicolor/scalable/actions/longomatch-delete.svg
new file mode 100644
index 0000000..169190b
--- /dev/null
+++ b/data/icons/hicolor/scalable/actions/longomatch-delete.svg
@@ -0,0 +1,53 @@
+<?xml version="1.0" encoding="UTF-8" standalone="no"?>
+<!-- Generator: Adobe Illustrator 15.1.0, SVG Export Plug-In . SVG Version: 6.00 Build 0) -->
+
+<svg
+ xmlns:dc="http://purl.org/dc/elements/1.1/"
+ xmlns:cc="http://creativecommons.org/ns#"
+ xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
+ xmlns:svg="http://www.w3.org/2000/svg"
+ xmlns="http://www.w3.org/2000/svg"
+ xmlns:sodipodi="http://sodipodi.sourceforge.net/DTD/sodipodi-0.dtd"
+ xmlns:inkscape="http://www.inkscape.org/namespaces/inkscape"
+ version="1.1"
+ id="Layer_1"
+ x="0px"
+ y="0px"
+ width="24"
+ height="24"
+ viewBox="13.49 0 24 24"
+ enable-background="new 13.49 0 36 36"
+ xml:space="preserve"
+ inkscape:version="0.48.4 r9939"
+ sodipodi:docname="longomatch-player-delete.svg"><metadata
+ id="metadata10"><rdf:RDF><cc:Work
+ rdf:about=""><dc:format>image/svg+xml</dc:format><dc:type
+ rdf:resource="http://purl.org/dc/dcmitype/StillImage"
/><dc:title></dc:title></cc:Work></rdf:RDF></metadata><defs
+ id="defs8" /><sodipodi:namedview
+ pagecolor="#ffffff"
+ bordercolor="#666666"
+ borderopacity="1"
+ objecttolerance="10"
+ gridtolerance="10"
+ guidetolerance="10"
+ inkscape:pageopacity="0"
+ inkscape:pageshadow="2"
+ inkscape:window-width="996"
+ inkscape:window-height="523"
+ id="namedview6"
+ showgrid="false"
+ fit-margin-top="0"
+ fit-margin-left="0"
+ fit-margin-right="0"
+ fit-margin-bottom="0"
+ inkscape:zoom="9.5516493"
+ inkscape:cx="4.424"
+ inkscape:cy="17.014"
+ inkscape:window-x="0"
+ inkscape:window-y="27"
+ inkscape:window-maximized="0"
+ inkscape:current-layer="Layer_1" /><path
+ id="delete_2_"
+ d="M 36.74147,3 H 22.490273 c -0.199457,0 -0.391065,0.079562 -0.532261,0.2185149 l -8.249516,8.2508841
c -0.291328,0.294722 -0.291328,0.768727 0,1.061202 l 8.249516,8.250884 C 22.099208,20.921556 22.290816,21
22.490273,21 H 36.742592 C 37.156074,21 37.49,20.662702 37.49,20.248089 V 3.7485523 C 37.488879,3.3361759
37.156074,3 36.74147,3 z m -2.49323,13.605059 -1.15193,1.149719 c -0.315994,0.319365 -0.829208,0.319365
-1.150807,0 l -3.454661,-3.453652 -3.455788,3.455888 c -0.318237,0.319376 -0.832574,0.319376 -1.153052,0 l
-1.150807,-1.151955 c -0.319358,-0.320494 -0.314876,-0.83372 0,-1.14973 l 3.459145,-3.457007
-3.46138,-3.45478 c -0.317123,-0.3193648 -0.317123,-0.8370742 0,-1.1519563 l 1.151921,-1.1508473 c
0.321599,-0.318246 0.833691,-0.318246 1.149693,0 L 28.490842,9.69439 31.945503,6.2407384 c 0.319359,-0.318246
0.834813,-0.318246 1.150807,0 l 1.15193,1.1508473 c 0.319358,0.3148821 0.319358,0.8314736 0,1.1519563 l
-3.455784,3.45478 3.455784,3.453652 c 0.320476,0.318
247 0.320476,0.832591 0,1.153085 z"
+ inkscape:connector-curvature="0"
+ style="fill:#c42527" /></svg>
\ No newline at end of file
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]