[longomatch] Add support for detaching the video player
- From: Andoni Morales Alastruey <amorales src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [longomatch] Add support for detaching the video player
- Date: Fri, 27 Jan 2012 22:08:10 +0000 (UTC)
commit 2fcc9970f57ef415182ddc2b62a655afb2b8fecb
Author: Andoni Morales Alastruey <ylatuya gmail com>
Date: Thu Jan 26 09:28:21 2012 +0100
Add support for detaching the video player
LongoMatch.GUI.Multimedia/Gui/PlayerBin.cs | 6 ++++
LongoMatch.GUI.Multimedia/gtk-gui/objects.xml | 1 +
LongoMatch.GUI/Gui/MainWindow.cs | 41 +++++++++++++++++++++++++
3 files changed, 48 insertions(+), 0 deletions(-)
---
diff --git a/LongoMatch.GUI.Multimedia/Gui/PlayerBin.cs b/LongoMatch.GUI.Multimedia/Gui/PlayerBin.cs
index 8fc7d2a..281881a 100644
--- a/LongoMatch.GUI.Multimedia/Gui/PlayerBin.cs
+++ b/LongoMatch.GUI.Multimedia/Gui/PlayerBin.cs
@@ -48,6 +48,7 @@ namespace LongoMatch.Gui
public event PrevButtonClickedHandler Prev;
public event LongoMatch.Handlers.DrawFrameHandler DrawFrame;
public event SeekEventHandler SeekEvent;
+ public event EventHandler Detach;
private const int THUMBNAIL_MAX_WIDTH = 100;
private LongoMatch.Video.Common.TickHandler tickHandler;
@@ -422,6 +423,11 @@ namespace LongoMatch.Gui
}
}
+ void EmitDetach () {
+ if (Detach != null)
+ Detach(this, new EventArgs());
+ }
+
#endregion
#region Callbacks
diff --git a/LongoMatch.GUI.Multimedia/gtk-gui/objects.xml b/LongoMatch.GUI.Multimedia/gtk-gui/objects.xml
index 7556235..ba22494 100644
--- a/LongoMatch.GUI.Multimedia/gtk-gui/objects.xml
+++ b/LongoMatch.GUI.Multimedia/gtk-gui/objects.xml
@@ -25,6 +25,7 @@
<signal name="Prev" />
<signal name="DrawFrame" />
<signal name="SeekEvent" />
+ <signal name="Detach" />
</itemgroup>
</signals>
</object>
diff --git a/LongoMatch.GUI/Gui/MainWindow.cs b/LongoMatch.GUI/Gui/MainWindow.cs
index 1e5da7c..2030459 100644
--- a/LongoMatch.GUI/Gui/MainWindow.cs
+++ b/LongoMatch.GUI/Gui/MainWindow.cs
@@ -97,6 +97,8 @@ namespace LongoMatch.Gui
bool gameUnitsActionVisible;
GameUnitsTimelineWidget guTimeline;
IGUIToolkit guiToolKit;
+ Gtk.Window playerWindow;
+ bool detachedPlayer;
#region Constructors
public MainWindow(IGUIToolkit guiToolkit) :
@@ -117,6 +119,7 @@ namespace LongoMatch.Gui
player.SetLogo(System.IO.Path.Combine(Config.ImagesDir(),"background.png"));
player.LogoMode = true;
player.Tick += OnTick;
+ player.Detach += (sender, e) => DetachPlayer(true);
capturer.Visible = false;
capturer.Logo = System.IO.Path.Combine(Config.ImagesDir(),"background.png");
@@ -131,6 +134,7 @@ namespace LongoMatch.Gui
if (!Config.useGameUnits)
GameUnitsViewAction.Visible = false;
+
}
#endregion
@@ -295,6 +299,43 @@ namespace LongoMatch.Gui
localPlayersList.SetTeam(openedProject.LocalTeamTemplate, openedProject.AllPlays());
visitorPlayersList.SetTeam(openedProject.VisitorTeamTemplate, openedProject.AllPlays());
}
+
+ void DetachPlayer (bool detach) {
+ if (detach == detachedPlayer)
+ return;
+
+ if (detach) {
+ Log.Debug("Detaching player");
+ playerWindow = new Gtk.Window(Constants.SOFTWARE_NAME);
+ playerWindow.Icon = Stetic.IconLoader.LoadIcon(this, "longomatch", IconSize.Button);
+ playerWindow.DeleteEvent += (o, args) => DetachPlayer(false);
+ playerWindow.Show();
+ this.player.Reparent(playerWindow);
+ detachedPlayer = true;
+ buttonswidget.Visible = true;
+ timeline.Visible = true;
+ if (Config.useGameUnits) {
+ guTimeline.Visible = true;
+ gameunitstaggerwidget1.Visible = true;
+ }
+ } else {
+ ToggleAction action;
+
+ Log.Debug("Attaching player again");
+ this.player.Reparent(this.videowidgetsbox);
+ detachedPlayer = false;
+
+ if (ManualTaggingViewAction.Active)
+ action = ManualTaggingViewAction;
+ else if (TimelineViewAction.Active)
+ action = TimelineViewAction;
+ else if (GameUnitsViewAction.Active)
+ action = GameUnitsViewAction;
+ else
+ action = TaggingViewAction;
+ OnViewToggled(action, new EventArgs());
+ }
+ }
public void SetProject(Project project, ProjectType projectType, CaptureSettings props)
{
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]