[longomatch] Adapt to last changes in Core to implement better MVC
- From: Andoni Morales Alastruey <amorales src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [longomatch] Adapt to last changes in Core to implement better MVC
- Date: Sun, 18 Dec 2011 21:42:05 +0000 (UTC)
commit d4dec374000d6c6ecf9faf86edd98bc5a0d2427f
Author: Andoni Morales Alastruey <ylatuya gmail com>
Date: Fri Dec 9 19:47:11 2011 +0100
Adapt to last changes in Core to implement better MVC
Remove dep in Gtk and Gdk
LongoMatch.Services/LongoMatch.Services.mdp | 7 +-
LongoMatch.Services/Services/Core.cs | 39 ++-
LongoMatch.Services/Services/DataBase.cs | 2 +-
LongoMatch.Services/Services/EventsManager.cs | 90 ++-----
LongoMatch.Services/Services/GameUnitsManager.cs | 8 +-
LongoMatch.Services/Services/HotKeysManager.cs | 6 +-
LongoMatch.Services/Services/PlaylistManager.cs | 80 ++----
LongoMatch.Services/Services/ProjectsManager.cs | 297 +++++---------------
.../Services/RenderingJobsManager.cs | 63 +----
LongoMatch.Services/Services/TemplatesService.cs | 47 ++--
.../Services/VideoDrawingsManager.cs | 39 ++--
11 files changed, 222 insertions(+), 456 deletions(-)
---
diff --git a/LongoMatch.Services/LongoMatch.Services.mdp b/LongoMatch.Services/LongoMatch.Services.mdp
index dd92d8c..138449b 100644
--- a/LongoMatch.Services/LongoMatch.Services.mdp
+++ b/LongoMatch.Services/LongoMatch.Services.mdp
@@ -29,14 +29,9 @@
<File subtype="Directory" buildaction="Compile" name="." />
</Contents>
<References>
- <ProjectReference type="Gac" localcopy="True" refto="gtk-sharp, Version=2.12.0.0, Culture=neutral, PublicKeyToken=35e10195dab3c99f" />
- <ProjectReference type="Project" localcopy="True" refto="LongoMatch.GUI" />
- <ProjectReference type="Gac" localcopy="True" refto="Db4objects.Db4o, Version=7.4.121.14026, Culture=neutral, PublicKeyToken=6199cd4f203aa8eb" />
- <ProjectReference type="Project" localcopy="True" refto="LongoMatch.Multimedia" />
- <ProjectReference type="Gac" localcopy="True" refto="gdk-sharp, Version=2.12.0.0, Culture=neutral, PublicKeyToken=35e10195dab3c99f" />
- <ProjectReference type="Project" localcopy="True" refto="LongoMatch.GUI.Multimedia" />
<ProjectReference type="Gac" localcopy="True" refto="System, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" />
<ProjectReference type="Gac" localcopy="True" refto="Mono.Posix, Version=4.0.0.0, Culture=neutral, PublicKeyToken=0738eb9f132ed756" />
<ProjectReference type="Project" localcopy="True" refto="LongoMatch.Core" />
+ <ProjectReference type="Gac" localcopy="True" refto="Db4objects.Db4o, Version=8.0.184.15484, Culture=neutral, PublicKeyToken=6199cd4f203aa8eb" />
</References>
</Project>
\ No newline at end of file
diff --git a/LongoMatch.Services/Services/Core.cs b/LongoMatch.Services/Services/Core.cs
index e93b4de..d3fd8b0 100644
--- a/LongoMatch.Services/Services/Core.cs
+++ b/LongoMatch.Services/Services/Core.cs
@@ -17,10 +17,10 @@
//
using System;
using System.IO;
-using Gtk;
using Mono.Unix;
-using LongoMatch.Gui;
+using LongoMatch.Interfaces.GUI;
+using LongoMatch.Interfaces.Multimedia;
using LongoMatch.DB;
using LongoMatch.Common;
using LongoMatch.Store;
@@ -34,7 +34,8 @@ namespace LongoMatch.Services
static EventsManager eManager;
static HotKeysManager hkManager;
static GameUnitsManager guManager;
- static MainWindow mainWindow;
+ static IMainWindow mainWindow;
+ static IGUIToolkit guiToolkit;
public static void Init()
{
@@ -46,20 +47,18 @@ namespace LongoMatch.Services
/* Init internationalization support */
Catalog.Init(Constants.SOFTWARE_NAME.ToLower(),Config.RelativeToPrefix("share/locale"));
- /* Init Gtk */
- Application.Init();
-
/* Check default folders */
CheckDirs();
}
- public static void Start(MainWindow mainWindow) {
- Core.mainWindow = mainWindow;
- StartServices(mainWindow);
- BindEvents(mainWindow);
+ public static void Start(IGUIToolkit guiToolkit, IMultimediaToolkit multimediaToolkit) {
+ Core.guiToolkit = guiToolkit;
+ Core.mainWindow = guiToolkit.MainWindow;
+ StartServices(guiToolkit, multimediaToolkit);
+ BindEvents(Core.mainWindow);
}
- public static void StartServices(MainWindow mainWindow){
+ public static void StartServices(IGUIToolkit guiToolkit, IMultimediaToolkit multimediaToolkit){
RenderingJobsManager videoRenderer;
ProjectsManager projectsManager;
@@ -70,25 +69,25 @@ namespace LongoMatch.Services
db = new DataBase(Path.Combine(Config.DBDir(),Constants.DB_FILE));
/* Start the events manager */
- eManager = new EventsManager(mainWindow);
+ eManager = new EventsManager(guiToolkit);
/* Start the hotkeys manager */
hkManager = new HotKeysManager();
hkManager.newMarkEvent += eManager.OnNewTag;
/* Start the rendering jobs manager */
- videoRenderer = new RenderingJobsManager(mainWindow.RenderingStateBar);
+ videoRenderer = new RenderingJobsManager(multimediaToolkit, guiToolkit);
mainWindow.RenderPlaylistEvent += (playlist) => {
- videoRenderer.AddJob(RenderingJobsManager.ConfigureRenderingJob(playlist, mainWindow));};
+ videoRenderer.AddJob(guiToolkit.ConfigureRenderingJob(playlist));};
/* Start Game Units manager */
guManager = new GameUnitsManager(mainWindow, mainWindow.Player);
- projectsManager = new ProjectsManager(mainWindow);
+ projectsManager = new ProjectsManager(guiToolkit, multimediaToolkit);
projectsManager.OpenedProjectChanged += OnOpenedProjectChanged;
}
- public static void BindEvents(MainWindow mainWindow) {
+ public static void BindEvents(IMainWindow mainWindow) {
/* Connect player events */
/* FIXME:
player.Prev += OnPrev;
@@ -127,12 +126,20 @@ namespace LongoMatch.Services
}
}
+ public static IGUIToolkit GUIToolkit {
+ get {
+ return guiToolkit;
+ }
+ }
+
private static void OnOpenedProjectChanged (Project project, ProjectType projectType) {
if (project != null) {
hkManager.Categories=project.Categories;
+#if HAVE_GTK
mainWindow.KeyPressEvent -= hkManager.KeyListener;
} else {
mainWindow.KeyPressEvent += hkManager.KeyListener;
+#endif
}
eManager.OpenedProject = project;
diff --git a/LongoMatch.Services/Services/DataBase.cs b/LongoMatch.Services/Services/DataBase.cs
index 1f6445f..2c6d0c4 100644
--- a/LongoMatch.Services/Services/DataBase.cs
+++ b/LongoMatch.Services/Services/DataBase.cs
@@ -23,7 +23,7 @@ using System.Collections.Generic;
using System.IO;
using Db4objects.Db4o;
using Db4objects.Db4o.Query;
-using Gtk;
+
using LongoMatch.Common;
using LongoMatch.Interfaces;
using LongoMatch.Store;
diff --git a/LongoMatch.Services/Services/EventsManager.cs b/LongoMatch.Services/Services/EventsManager.cs
index ba09be7..31aedcc 100644
--- a/LongoMatch.Services/Services/EventsManager.cs
+++ b/LongoMatch.Services/Services/EventsManager.cs
@@ -20,19 +20,11 @@
using System;
using System.Collections.Generic;
-using Gdk;
-using Gtk;
using LongoMatch.Common;
-using LongoMatch.Gui;
-using LongoMatch.Gui.Component;
-using LongoMatch.Gui.Dialog;
using LongoMatch.Handlers;
using LongoMatch.Interfaces;
+using LongoMatch.Interfaces.GUI;
using LongoMatch.Store;
-using LongoMatch.Video.Common;
-using LongoMatch.Video.Editor;
-using LongoMatch.Video.Utils;
-using LongoMatch.Multimedia.Interfaces;
using Mono.Unix;
namespace LongoMatch.Services
@@ -42,8 +34,6 @@ namespace LongoMatch.Services
public class EventsManager
{
- private FramesSeriesCapturer fsc;
- private FramesCaptureProgressDialog fcpd;
private VideoDrawingsManager drawingManager;
/* Current play loaded. null if no play is loaded */
@@ -53,16 +43,18 @@ namespace LongoMatch.Services
ProjectType projectType;
Time startTime;
- MainWindow mainWindow;
- PlayerBin player;
- CapturerBin capturer;
+ IGUIToolkit guiToolkit;
+ IMainWindow mainWindow;
+ IPlayer player;
+ ICapturer capturer;
- public EventsManager(MainWindow mainWindow)
+ public EventsManager(IGUIToolkit guiToolkit)
{
- this.mainWindow = mainWindow;
- this.player = mainWindow.Player;
- this.capturer = mainWindow.Capturer;
- this.drawingManager = new VideoDrawingsManager(player);
+ this.guiToolkit = guiToolkit;
+ mainWindow = guiToolkit.MainWindow;
+ player = mainWindow.Player;
+ capturer = mainWindow.Capturer;
+ drawingManager = new VideoDrawingsManager(player);
ConnectSignals();
}
@@ -129,16 +121,15 @@ namespace LongoMatch.Services
}
private void AddNewPlay(Time start, Time stop, Category category) {
- Pixbuf miniature;
+ Image miniature;
Log.Debug(String.Format("New play created start:{0} stop:{1} category:{2}",
start, stop, category));
/* Get the current frame and get a thumbnail from it */
if(projectType == ProjectType.CaptureProject) {
if(!capturer.Capturing) {
- MessagePopup.PopupMessage(capturer, MessageType.Info,
- Catalog.GetString("You can't create a new play if the capturer "+
- "is not recording."));
+ guiToolkit.InfoMessage(Catalog.GetString("You can't create a new play if the capturer "+
+ "is not recording."));
return;
}
miniature = capturer.CurrentMiniatureFrame;
@@ -187,9 +178,8 @@ namespace LongoMatch.Services
diff = stopTime.MSeconds - startTime.MSeconds;
if(diff < 0) {
- MessagePopup.PopupMessage(mainWindow, MessageType.Warning,
- Catalog.GetString("The stop time is smaller than the start time. "+
- "The play will not be added."));
+ guiToolkit.WarningMessage(Catalog.GetString("The stop time is smaller than the start time. "+
+ "The play will not be added."));
return;
}
if(diff < 500) {
@@ -203,11 +193,7 @@ namespace LongoMatch.Services
}
private void LaunchPlayTagger(Play play) {
- TaggerDialog tg = new TaggerDialog(play.Category, play.Tags, play.Players, play.Teams,
- openedProject.LocalTeamTemplate, openedProject.VisitorTeamTemplate);
- tg.TransientFor = mainWindow as Gtk.Window;
- tg.Run();
- tg.Destroy();
+ guiToolkit.TagPlay(play, openedProject.LocalTeamTemplate, openedProject.VisitorTeamTemplate);
}
protected virtual void OnPlaySelected(Play play)
@@ -255,33 +241,9 @@ namespace LongoMatch.Services
selectedTimeNode = null;
}
- protected virtual void OnSnapshotSeries(Play tNode) {
- SnapshotsDialog sd;
- uint interval;
- string seriesName;
- string outDir;
-
+ protected virtual void OnSnapshotSeries(Play play) {
player.Pause();
-
- sd= new SnapshotsDialog();
- sd.TransientFor= mainWindow as Gtk.Window;
- sd.Play = tNode.Name;
-
- if(sd.Run() == (int)ResponseType.Ok) {
- sd.Destroy();
- interval = sd.Interval;
- seriesName = sd.SeriesName;
- outDir = System.IO.Path.Combine(Config.SnapshotsDir(),seriesName);
- fsc = new FramesSeriesCapturer(openedProject.Description.File.FilePath,
- tNode.Start.MSeconds,tNode.Stop.MSeconds,
- interval,outDir);
- fcpd = new FramesCaptureProgressDialog(fsc);
- fcpd.TransientFor = mainWindow as Gtk.Window;
- fcpd.Run();
- fcpd.Destroy();
- }
- else
- sd.Destroy();
+ guiToolkit.ExportFrameSeries(openedProject, play, Config.SnapshotsDir());
}
protected virtual void OnPrev()
@@ -298,20 +260,10 @@ namespace LongoMatch.Services
}
protected virtual void OnDrawFrame(int time) {
- Pixbuf pixbuf=null;
- DrawingTool dialog = new DrawingTool();
-
+ Image pixbuf = null;
player.Pause();
pixbuf = player.CurrentFrame;
-
- dialog.Image = pixbuf;
- dialog.TransientFor = (Gtk.Window)player.Toplevel;
- if(selectedTimeNode != null)
- dialog.SetPlay((selectedTimeNode as Play),
- time);
- pixbuf.Dispose();
- dialog.Run();
- dialog.Destroy();
+ guiToolkit.DrawingTool(pixbuf, selectedTimeNode as Play, time);
}
protected virtual void OnTagPlay(Play play) {
diff --git a/LongoMatch.Services/Services/GameUnitsManager.cs b/LongoMatch.Services/Services/GameUnitsManager.cs
index ee2b56b..694fd21 100644
--- a/LongoMatch.Services/Services/GameUnitsManager.cs
+++ b/LongoMatch.Services/Services/GameUnitsManager.cs
@@ -19,21 +19,21 @@ using System;
using System.Collections.Generic;
using LongoMatch.Common;
-using LongoMatch.Gui;
+using LongoMatch.Interfaces.GUI;
using LongoMatch.Store;
namespace LongoMatch.Services
{
public class GameUnitsManager
{
- MainWindow mainWindow;
- PlayerBin player;
+ IMainWindow mainWindow;
+ IPlayer player;
Project openedProject;
Dictionary<GameUnit, Time> gameUnitsStarted;
ushort fps;
- public GameUnitsManager (MainWindow mainWindow, PlayerBin player)
+ public GameUnitsManager (IMainWindow mainWindow, IPlayer player)
{
this.mainWindow = mainWindow;
this.player = player;
diff --git a/LongoMatch.Services/Services/HotKeysManager.cs b/LongoMatch.Services/Services/HotKeysManager.cs
index 7d6228a..bdf0392 100644
--- a/LongoMatch.Services/Services/HotKeysManager.cs
+++ b/LongoMatch.Services/Services/HotKeysManager.cs
@@ -19,8 +19,6 @@
//
//
using System.Collections.Generic;
-using Gdk;
-using Gtk;
using LongoMatch.Store;
using LongoMatch.Store.Templates;
using LongoMatch.Handlers;
@@ -55,7 +53,7 @@ namespace LongoMatch.Services
// Listen to key press events and fire a newMarkEvent event if the key combination
// is associated to a Category
- public void KeyListener(object sender, KeyPressEventArgs args) {
+ /* public void KeyListener(object sender, KeyPressEventArgs args) {
Category cat = null;
HotKey hotkey = new HotKey();
@@ -66,6 +64,6 @@ namespace LongoMatch.Services
newMarkEvent(cat);
}
}
- }
+ }*/
}
}
diff --git a/LongoMatch.Services/Services/PlaylistManager.cs b/LongoMatch.Services/Services/PlaylistManager.cs
index f86c5fe..6fb0ccd 100644
--- a/LongoMatch.Services/Services/PlaylistManager.cs
+++ b/LongoMatch.Services/Services/PlaylistManager.cs
@@ -16,11 +16,10 @@
// Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA.
//
using System;
-using Gtk;
+using System.Threading;
-using LongoMatch.Gui.Component;
-using LongoMatch.Gui;
using LongoMatch.Interfaces;
+using LongoMatch.Interfaces.GUI;
using LongoMatch.Store;
using LongoMatch.Common;
using Mono.Unix;
@@ -30,21 +29,23 @@ namespace LongoMatch.Services
{
public class PlaylistManager
{
+ IGUIToolkit guiToolkit;
IPlaylistWidget playlistWidget;
IPlayList playlist;
- PlayerBin player;
+ IPlayer player;
/* FIXME */
Project openedProject;
TimeNode selectedTimeNode;
bool clockStarted;
- uint timeout;
+ Timer timeout;
- public PlaylistManager (MainWindow mainWindow)
+ public PlaylistManager (IGUIToolkit guiToolkit)
{
- playlistWidget = mainWindow.Playlist;
- player = mainWindow.Player;
- BindEvents(mainWindow, mainWindow.Player);
+ this.guiToolkit = guiToolkit;
+ playlistWidget = guiToolkit.MainWindow.Playlist;
+ player = guiToolkit.MainWindow.Player;
+ BindEvents(guiToolkit.MainWindow, guiToolkit.MainWindow.Player);
}
public void Stop() {
@@ -57,12 +58,12 @@ namespace LongoMatch.Services
playlistWidget.Load(playlist);
} catch (Exception e){
Log.Exception (e);
- MessagePopup.PopupMessage(playlistWidget as Gtk.Widget ,MessageType.Error,
- Catalog.GetString("The file you are trying to load is not a playlist or it's not compatible with the current version"));
+ guiToolkit.ErrorMessage(Catalog.GetString("The file you are trying to load " +
+ "is not a playlist or it's not compatible with the current version"));
}
}
- private void BindEvents(MainWindow mainWindow, PlayerBin player) {
+ private void BindEvents(IMainWindow mainWindow, IPlayer player) {
/* Track loaded element */
mainWindow.PlaySelectedEvent += (p) => {selectedTimeNode = p;};
player.SegmentClosedEvent += () => {selectedTimeNode = null;};
@@ -100,8 +101,7 @@ namespace LongoMatch.Services
private bool Next() {
if(openedProject != null) {
- MessagePopup.PopupMessage(playlistWidget as Gtk.Widget, MessageType.Error,
- Catalog.GetString("Please, close the opened project to play the playlist."));
+ guiToolkit.ErrorMessage(Catalog.GetString("Please, close the opened project to play the playlist."));
Stop();
return false;
}
@@ -139,31 +139,22 @@ namespace LongoMatch.Services
private void StartClock() {
if(player!=null && !clockStarted) {
- timeout = GLib.Timeout.Add(20,CheckStopTime);
+ timeout = new Timer(new TimerCallback(CheckStopTime), this, 20, 20);
clockStarted=true;
}
}
private void StopClock() {
if(clockStarted) {
- GLib.Source.Remove(timeout);
+ timeout.Dispose();
clockStarted = false;
}
}
- private bool CheckStopTime() {
+ private void CheckStopTime(object self) {
if(player.AccurateCurrentTime >= selectedTimeNode.Stop.MSeconds-200)
Next();
- return true;
- }
-
- private FileFilter FileFilter {
- get {
- FileFilter filter = new FileFilter();
- filter.Name = Catalog.GetString("LongoMatch playlist");
- filter.AddPattern("*" + Constants.PLAYLIST_EXT);
- return filter;
- }
+ return;
}
protected virtual void OnPlayListNodeAdded(Play play)
@@ -187,32 +178,25 @@ namespace LongoMatch.Services
protected virtual void OnOpenPlaylist()
{
- FileChooserDialog fChooser = new FileChooserDialog(Catalog.GetString("Open playlist"),
- (Gtk.Window)(playlistWidget as Gtk.Widget).Toplevel,
- FileChooserAction.Open,
- "gtk-cancel",ResponseType.Cancel,
- "gtk-open",ResponseType.Accept);
- fChooser.SetCurrentFolder(Config.PlayListDir());
- fChooser.AddFilter(FileFilter);
- fChooser.DoOverwriteConfirmation = true;
- if(fChooser.Run() == (int)ResponseType.Accept)
- Load(fChooser.Filename);
- fChooser.Destroy();
+ string filename;
+
+ filename = guiToolkit.OpenFile(Catalog.GetString("Open playlist"), null, Config.PlayListDir(),
+ Constants.PROJECT_NAME + Catalog.GetString("playlists"),
+ "*" + Constants.PLAYLIST_EXT);
+ if (filename != null)
+ Load(filename);
}
protected virtual void OnNewPlaylist()
{
- FileChooserDialog fChooser = new FileChooserDialog(Catalog.GetString("New playlist"),
- (Gtk.Window)(playlistWidget as Gtk.Widget).Toplevel,
- FileChooserAction.Save,
- "gtk-cancel",ResponseType.Cancel,
- "gtk-save",ResponseType.Accept);
- fChooser.SetCurrentFolder(Config.PlayListDir());
- fChooser.AddFilter(FileFilter);
+ string filename;
+
+ filename = guiToolkit.SaveFile(Catalog.GetString("New playlist"), null, Config.PlayListDir(),
+ Constants.PROJECT_NAME + Catalog.GetString("playlists"),
+ "*" + Constants.PLAYLIST_EXT);
- if(fChooser.Run() == (int)ResponseType.Accept)
- Load(fChooser.Filename);
- fChooser.Destroy();
+ if (filename != null)
+ Load(filename);
}
}
}
diff --git a/LongoMatch.Services/Services/ProjectsManager.cs b/LongoMatch.Services/Services/ProjectsManager.cs
index 97e8662..04fa2f5 100644
--- a/LongoMatch.Services/Services/ProjectsManager.cs
+++ b/LongoMatch.Services/Services/ProjectsManager.cs
@@ -19,20 +19,14 @@
using System;
using System.Collections.Generic;
using System.IO;
-using Gtk;
using Mono.Unix;
using LongoMatch.Common;
-using LongoMatch.Gui;
-using LongoMatch.Gui.Dialog;
using LongoMatch.Handlers;
+using LongoMatch.Interfaces.GUI;
+using LongoMatch.Interfaces.Multimedia;
using LongoMatch.Store;
using LongoMatch.Store.Templates;
-using LongoMatch.Video;
-using LongoMatch.Video.Utils;
-using LongoMatch.Video.Common;
-using LongoMatch.Multimedia.Utils;
-using LongoMatch.Multimedia.Interfaces;
namespace LongoMatch.Services
{
@@ -42,10 +36,14 @@ namespace LongoMatch.Services
{
public event OpenedProjectChangedHandler OpenedProjectChanged;
- MainWindow mainWindow;
+ IGUIToolkit guiToolkit;
+ IMultimediaToolkit multimediaToolkit;
+ IMainWindow mainWindow;
- public ProjectsManager(MainWindow mainWindow) {
- this.mainWindow = mainWindow;
+ public ProjectsManager(IGUIToolkit guiToolkit, IMultimediaToolkit multimediaToolkit) {
+ this.multimediaToolkit = multimediaToolkit;
+ this.guiToolkit = guiToolkit;
+ mainWindow = guiToolkit.MainWindow;
Player = mainWindow.Player;
Capturer = mainWindow.Capturer;
ConnectSignals();
@@ -73,12 +71,12 @@ namespace LongoMatch.Services
get;
}
- public CapturerBin Capturer {
+ public ICapturer Capturer {
set;
get;
}
- public PlayerBin Player {
+ public IPlayer Player {
get;
set;
}
@@ -89,19 +87,17 @@ namespace LongoMatch.Services
}
private void SaveCaptureProject(Project project) {
- MessageDialog md;
string filePath = project.Description.File.FilePath;
Log.Debug ("Saving capture project: " + project);
- md = new MessageDialog(mainWindow as Gtk.Window, DialogFlags.Modal,
- MessageType.Info, ButtonsType.None,
- Catalog.GetString("Loading newly created project..."));
- md.Show();
+
+ /* FIXME: Show message */
+ //guiToolkit.InfoMessage(Catalog.GetString("Loading newly created project..."));
/* scan the new file to build a new PreviewMediaFile with all the metadata */
try {
Log.Debug("Reloading saved file: " + filePath);
- project.Description.File = PreviewMediaFile.DiscoverFile(filePath);
+ project.Description.File = multimediaToolkit.DiscoverFile(filePath);
Core.DB.AddProject(project);
} catch(Exception ex) {
Log.Exception(ex);
@@ -109,81 +105,43 @@ namespace LongoMatch.Services
string projectFile = filePath + "-" + DateTime.Now;
projectFile = projectFile.Replace("-", "_").Replace(" ", "_").Replace(":", "_");
Project.Export(OpenedProject, projectFile);
- MessagePopup.PopupMessage(mainWindow, MessageType.Error,
- Catalog.GetString("An error occured saving the project:\n")+ex.Message+ "\n\n"+
- Catalog.GetString("The video file and a backup of the project has been "+
- "saved. Try to import it later:\n")+
- filePath+"\n"+projectFile);
+ guiToolkit.ErrorMessage(Catalog.GetString("An error occured saving the project:\n")+ex.Message+ "\n\n"+
+ Catalog.GetString("The video file and a backup of the project has been "+
+ "saved. Try to import it later:\n")+
+ filePath+"\n"+projectFile);
}
/* we need to set the opened project to null to avoid calling again CloseOpendProject() */
/* FIXME: */
//project = null;
SetProject(project, ProjectType.FileProject, new CaptureSettings());
- md.Destroy();
}
private void SaveFakeLiveProject(Project project) {
- int response;
- MessageDialog md;
- FileFilter filter;
- FileChooserDialog fChooser;
-
Log.Debug("Saving fake live project " + project);
- md = new MessageDialog(mainWindow, DialogFlags.Modal, MessageType.Info, ButtonsType.Ok,
- Catalog.GetString("The project will be saved to a file. " +
- "You can insert it later into the database using the "+
- "\"Import project\" function once you copied the video file " +
- "to your computer"));
- response = md.Run();
- md.Destroy();
- if(response == (int)ResponseType.Cancel)
- return;
-
- fChooser = new FileChooserDialog(Catalog.GetString("Save Project"),
- mainWindow, FileChooserAction.Save,
- "gtk-cancel",ResponseType.Cancel,
- "gtk-save",ResponseType.Accept);
- fChooser.SetCurrentFolder(Config.HomeDir());
- filter = new FileFilter();
- filter.Name = Constants.PROJECT_NAME;
- filter.AddPattern("*.lpr");
- fChooser.AddFilter(filter);
- if(fChooser.Run() == (int)ResponseType.Accept) {
- Project.Export(project, fChooser.Filename);
- MessagePopup.PopupMessage(mainWindow, MessageType.Info,
- Catalog.GetString("Project saved successfully."));
+ guiToolkit.InfoMessage(Catalog.GetString("The project will be saved to a file. " +
+ "You can insert it later into the database using the "+
+ "\"Import project\" function once you copied the video file " +
+ "to your computer"));
+
+ var filename = guiToolkit.SaveFile(Catalog.GetString("Save Project"), null, Config.HomeDir(),
+ Constants.PROJECT_NAME, "*.lpr");
+ if(filename != null) {
+ Project.Export(project, filename);
+ guiToolkit.InfoMessage(Catalog.GetString("Project saved successfully."));
}
- fChooser.Destroy();
}
private void ImportProject() {
Project project;
bool isFake, exists;
- int res;
string fileName;
- FileFilter filter;
- NewProjectDialog npd;
- FileChooserDialog fChooser;
Log.Debug("Importing project");
/* Show a file chooser dialog to select the file to import */
- fChooser = new FileChooserDialog(Catalog.GetString("Import Project"),
- mainWindow,
- FileChooserAction.Open,
- "gtk-cancel",ResponseType.Cancel,
- "gtk-open",ResponseType.Accept);
- fChooser.SetCurrentFolder(Config.HomeDir());
- filter = new FileFilter();
- filter.Name = Constants.PROJECT_NAME;
- filter.AddPattern("*.lpr");
- fChooser.AddFilter(filter);
-
-
- res = fChooser.Run();
- fileName = fChooser.Filename;
- fChooser.Destroy();
- /* return if the user cancelled */
- if(res != (int)ResponseType.Accept)
+ fileName = guiToolkit.OpenFile(Catalog.GetString("Import Project"), null,
+ Config.HomeDir(), Constants.PROJECT_NAME, "*lpr");
+
+ if(fileName == null)
return;
/* try to import the project and show a message error is the file
@@ -192,9 +150,8 @@ namespace LongoMatch.Services
project = Project.Import(fileName);
}
catch(Exception ex) {
- MessagePopup.PopupMessage(mainWindow, MessageType.Error,
- Catalog.GetString("Error importing project:")+
- "\n"+ex.Message);
+ guiToolkit.ErrorMessage(Catalog.GetString("Error importing project:") +
+ "\n"+ex.Message);
Log.Exception(ex);
return;
}
@@ -206,40 +163,15 @@ namespace LongoMatch.Services
if(isFake) {
Log.Debug ("Importing fake live project");
project.Description.File = null;
- npd = new NewProjectDialog();
- npd.TransientFor = mainWindow;
- npd.Use = ProjectType.EditProject;
- npd.Project = project;
- int response = npd.Run();
- while(true) {
- if(response != (int)ResponseType.Ok) {
- npd.Destroy();
- return;
- } else if(npd.Project == null) {
- MessagePopup.PopupMessage(mainWindow, MessageType.Info,
- Catalog.GetString("Please, select a video file."));
- response=npd.Run();
- } else {
- project = npd.Project;
- npd.Destroy();
- break;
- }
- }
+ project = guiToolkit.EditFakeProject(Core.DB, project, Core.TemplatesService);
}
/* If the project exists ask if we want to overwrite it */
if(Core.DB.Exists(project)) {
- MessageDialog md = new MessageDialog(mainWindow,
- DialogFlags.Modal,
- MessageType.Question,
- Gtk.ButtonsType.YesNo,
- Catalog.GetString("A project already exists for the file:")+
- project.Description.File.FilePath+ "\n" +
- Catalog.GetString("Do you want to overwrite it?"));
- md.Icon = Gtk.IconTheme.Default.LoadIcon("longomatch", 48, 0);
- res = md.Run();
- md.Destroy();
- if(res != (int)ResponseType.Yes)
+ var res = guiToolkit.QuestionMessage(Catalog.GetString("A project already exists for the file:") +
+ project.Description.File.FilePath+ "\n" +
+ Catalog.GetString("Do you want to overwrite it?"), null);
+ if(!res)
return;
exists = true;
} else
@@ -252,84 +184,9 @@ namespace LongoMatch.Services
else
Core.DB.AddProject(project);
-
- MessagePopup.PopupMessage(mainWindow, MessageType.Info,
- Catalog.GetString("Project successfully imported."));
- }
-
- private void CreateNewProject(out Project project, out ProjectType projectType,
- out CaptureSettings captureSettings) {
- ProjectSelectionDialog psd;
- NewProjectDialog npd;
- List<Device> devices = null;
- int response;
-
- Log.Debug("Creating new project");
- /* The out parameters must be set before leaving the method */
- project = null;
- projectType = ProjectType.None;
- captureSettings = new CaptureSettings();
-
- /* Show the project selection dialog */
- psd = new ProjectSelectionDialog();
- psd.TransientFor = mainWindow;
- response = psd.Run();
- psd.Destroy();
- if(response != (int)ResponseType.Ok)
- return;
- projectType = psd.ProjectType;
-
- if(projectType == ProjectType.CaptureProject) {
- devices = VideoDevice.ListVideoDevices();
- if(devices.Count == 0) {
- MessagePopup.PopupMessage(mainWindow, MessageType.Error,
- Catalog.GetString("No capture devices were found."));
- return;
- }
- }
-
- /* Show the new project dialog and wait to get a valid project
- * or quit if the user cancel it.*/
- npd = new NewProjectDialog();
- npd.TransientFor = mainWindow;
- npd.Use = projectType;
- npd.TemplatesService = Core.TemplatesService;
- if(projectType == ProjectType.CaptureProject)
- npd.Devices = devices;
- response = npd.Run();
-
- while(true) {
- /* User cancelled: quit */
- if(response != (int)ResponseType.Ok) {
- npd.Destroy();
- return;
- }
- /* No file chosen: display the dialog again */
- if(npd.Project == null)
- MessagePopup.PopupMessage(mainWindow, MessageType.Info,
- Catalog.GetString("Please, select a video file."));
- /* If a project with the same file path exists show a warning */
- else if(Core.DB.Exists(npd.Project))
- MessagePopup.PopupMessage(mainWindow, MessageType.Error,
- Catalog.GetString("This file is already used in another Project.")+"\n"+
- Catalog.GetString("Select a different one to continue."));
-
- else {
- /* We are now ready to create the new project */
- project = npd.Project;
- if(projectType == ProjectType.CaptureProject)
- captureSettings = npd.CaptureSettings;
- npd.Destroy();
- break;
- }
- response = npd.Run();
- }
- if(projectType == ProjectType.FileProject)
- /* We can safelly add the project since we already checked if
- * it can can added */
- Core.DB.AddProject(project);
+ guiToolkit.InfoMessage(Catalog.GetString("Project successfully imported."));
}
-
+
private bool SetProject(Project project, ProjectType projectType, CaptureSettings props)
{
if(OpenedProject != null)
@@ -338,18 +195,16 @@ namespace LongoMatch.Services
if(projectType == ProjectType.FileProject) {
// Check if the file associated to the project exists
if(!File.Exists(project.Description.File.FilePath)) {
- MessagePopup.PopupMessage(mainWindow, MessageType.Warning,
- Catalog.GetString("The file associated to this project doesn't exist.") + "\n"
- + Catalog.GetString("If the location of the file has changed try to edit it with the database manager."));
+ guiToolkit.WarningMessage(Catalog.GetString("The file associated to this project doesn't exist.") + "\n"
+ + Catalog.GetString("If the location of the file has changed try to edit it with the database manager."));
CloseOpenedProject(true);
return false;
}
try {
Player.Open(project.Description.File.FilePath);
}
- catch(GLib.GException ex) {
- MessagePopup.PopupMessage(mainWindow, MessageType.Error,
- Catalog.GetString("An error occurred opening this project:") + "\n" + ex.Message);
+ catch(Exception ex) {
+ guiToolkit.ErrorMessage(Catalog.GetString("An error occurred opening this project:") + "\n" + ex.Message);
CloseOpenedProject(true);
return false;
}
@@ -360,7 +215,7 @@ namespace LongoMatch.Services
try {
Capturer.Type = CapturerType.Live;
} catch(Exception ex) {
- MessagePopup.PopupMessage(mainWindow, MessageType.Error, ex.Message);
+ guiToolkit.ErrorMessage(ex.Message);
CloseOpenedProject(false);
return false;
}
@@ -404,19 +259,15 @@ namespace LongoMatch.Services
}*/
private void CreateThumbnails(Project project) {
- MultimediaFactory factory;
IFramesCapturer capturer;
- BusyDialog dialog;
+ IBusyDialog dialog;
- dialog = new BusyDialog();
- dialog.TransientFor = mainWindow;
- dialog.Message = Catalog.GetString("Creating video thumbnails. This can take a while.");
+ dialog = guiToolkit.BusyDialog(Catalog.GetString("Creating video thumbnails. This can take a while."));
dialog.Show();
dialog.Pulse();
/* Create all the thumbnails */
- factory = new MultimediaFactory();
- capturer = factory.getFramesCapturer();
+ capturer = multimediaToolkit.GetFramesCapturer();
capturer.Open(project.Description.File.FilePath);
foreach(Play play in project.AllPlays()) {
try {
@@ -471,22 +322,36 @@ namespace LongoMatch.Services
protected virtual void NewProject() {
Project project;
ProjectType projectType;
- CaptureSettings captureSettings;
+ CaptureSettings captureSettings = new CaptureSettings();
+
+ Log.Debug("Creating new project");
- CreateNewProject(out project, out projectType, out captureSettings);
- if(project != null)
+ /* Show the project selection dialog */
+ projectType = guiToolkit.SelectNewProjectType();
+
+ if(projectType == ProjectType.CaptureProject) {
+ List<Device> devices = multimediaToolkit.VideoDevices;
+ if(devices.Count == 0) {
+ guiToolkit.ErrorMessage(Catalog.GetString("No capture devices were found."));
+ return;
+ }
+ project = guiToolkit.NewCaptureProject(Core.DB, Core.TemplatesService, devices,
+ out captureSettings);
+ } else if (projectType == ProjectType.FakeCaptureProject) {
+ project = guiToolkit.NewFakeProject(Core.DB, Core.TemplatesService);
+ } else {
+ project = guiToolkit.NewFileProject(Core.DB, Core.TemplatesService);
+ Core.DB.AddProject(project);
+ }
+
+ if (project != null)
SetProject(project, projectType, captureSettings);
}
protected void OpenProject() {
- ProjectDescription project=null;
- OpenProjectDialog opd = new OpenProjectDialog();
+ ProjectDescription project = null;
- opd.Fill(Core.DB.GetAllProjects());
- opd.TransientFor = mainWindow;
- if(opd.Run() == (int)ResponseType.Ok)
- project = opd.SelectedProject;
- opd.Destroy();
+ project = guiToolkit.SelectProject(Core.DB.GetAllProjects());
if(project != null)
SetProject(Core.DB.GetProject(project.UUID), ProjectType.FileProject, new CaptureSettings());
}
@@ -499,25 +364,17 @@ namespace LongoMatch.Services
protected void OpenCategoriesTemplatesManager()
{
- var tManager = new TemplatesManager<Categories, Category>(Core.TemplatesService.CategoriesTemplateProvider,
- Core.TemplatesService.GetTemplateEditor<Categories, Category>());
- tManager.TransientFor = mainWindow;
- tManager.Show();
+ guiToolkit.OpenCategoriesTemplatesManager (Core.TemplatesService.CategoriesTemplateProvider);
}
protected void OpenTeamsTemplatesManager()
{
- var tManager = new TemplatesManager<TeamTemplate, Player>(Core.TemplatesService.TeamTemplateProvider,
- Core.TemplatesService.GetTemplateEditor<TeamTemplate, Player>());
- tManager.TransientFor = mainWindow;
- tManager.Show();
+ guiToolkit.OpenTeamsTemplatesManager (Core.TemplatesService.TeamTemplateProvider);
}
protected void OpenProjectsManager()
{
- Gui.Dialog.ProjectsManager pm = new Gui.Dialog.ProjectsManager(OpenedProject, Core.DB, Core.TemplatesService);
- pm.TransientFor = mainWindow;
- pm.Show();
+ guiToolkit.OpenProjectsManager(OpenedProject, Core.DB, Core.TemplatesService);
}
}
diff --git a/LongoMatch.Services/Services/RenderingJobsManager.cs b/LongoMatch.Services/Services/RenderingJobsManager.cs
index 044d227..4398f51 100644
--- a/LongoMatch.Services/Services/RenderingJobsManager.cs
+++ b/LongoMatch.Services/Services/RenderingJobsManager.cs
@@ -17,18 +17,13 @@
//
using System;
using System.Collections.Generic;
-using Gtk;
using Mono.Unix;
using LongoMatch.Common;
using LongoMatch.Interfaces;
-using LongoMatch.Gui.Component;
-using LongoMatch.Multimedia.Interfaces;
-using LongoMatch.Video;
+using LongoMatch.Interfaces.GUI;
+using LongoMatch.Interfaces.Multimedia;
using LongoMatch.Store;
-using LongoMatch.Video.Editor;
-using LongoMatch.Gui;
-using LongoMatch.Gui.Dialog;
namespace LongoMatch.Services
{
@@ -37,26 +32,25 @@ namespace LongoMatch.Services
/* List of pending jobs */
List<Job> jobs, pendingJobs;
IVideoEditor videoEditor;
- MultimediaFactory factory;
Job currentJob;
- RenderingStateBar stateBar;
+ IRenderingStateBar stateBar;
+ IMultimediaToolkit multimediaToolkit;
+ IGUIToolkit guiToolkit;
- public RenderingJobsManager (RenderingStateBar stateBar)
+ public RenderingJobsManager (IMultimediaToolkit multimediaToolkit, IGUIToolkit guiToolkit)
{
+ this.guiToolkit = guiToolkit;
+ this.multimediaToolkit = multimediaToolkit;
+ this.stateBar = guiToolkit.MainWindow.RenderingStateBar;
jobs = new List<Job>();
pendingJobs = new List<Job>();
- factory = new MultimediaFactory();
- this.stateBar = stateBar;
stateBar.Cancel += (sender, e) => CancelCurrentJob();
stateBar.ManageJobs += (sender, e) => ManageJobs();
}
- public TreeStore Model {
+ public List<Job> Jobs {
get {
- TreeStore model = new TreeStore(typeof(Job));
- foreach (Job job in jobs)
- model.AppendValues(job);
- return model;
+ return jobs;
}
}
@@ -127,30 +121,7 @@ namespace LongoMatch.Services
}
protected void ManageJobs() {
- RenderingJobsDialog dialog = new RenderingJobsDialog(this);
- dialog.TransientFor = (stateBar.Toplevel as Gtk.Window);
- dialog.Run();
- dialog.Destroy();
- }
-
- public static Job ConfigureRenderingJob (IPlayList playlist, Gtk.Widget parent)
- {
- VideoEditionProperties vep;
- Job job = null;
- int response;
-
- vep = new VideoEditionProperties();
- vep.TransientFor = (Gtk.Window)parent.Toplevel;
- response = vep.Run();
- while(response == (int)ResponseType.Ok && vep.EncodingSettings.OutputFile == "") {
- MessagePopup.PopupMessage(parent, MessageType.Warning,
- Catalog.GetString("Please, select a video file."));
- response=vep.Run();
- }
- if(response ==(int)ResponseType.Ok)
- job = new Job(playlist, vep.EncodingSettings, vep.EnableAudio, vep.TitleOverlay);
- vep.Destroy();
- return job;
+ guiToolkit.ManageJobs(this);
}
private void LoadJob(Job job) {
@@ -182,7 +153,7 @@ namespace LongoMatch.Services
return;
}
- videoEditor = factory.getVideoEditor();
+ videoEditor = multimediaToolkit.GetVideoEditor();
videoEditor.Progress += OnProgress;
currentJob = pendingJobs[0];
LoadJob(currentJob);
@@ -246,8 +217,7 @@ namespace LongoMatch.Services
else if(progress == (float)EditorState.ERROR) {
Log.Debug ("Job finished with errors");
- MessagePopup.PopupMessage(stateBar, MessageType.Error,
- Catalog.GetString("An error has occurred in the video editor.")
+ guiToolkit.ErrorMessage(Catalog.GetString("An error has occurred in the video editor.")
+Catalog.GetString("Please, try again."));
currentJob.State = JobState.Error;
CloseAndNext();
@@ -256,10 +226,7 @@ namespace LongoMatch.Services
protected void OnProgress(float progress)
{
- /* FIXME: Check if this is really sent from a gstreamer thread */
- Application.Invoke(delegate {
- MainLoopOnProgress (progress);
- });
+ MainLoopOnProgress (progress);
}
}
}
diff --git a/LongoMatch.Services/Services/TemplatesService.cs b/LongoMatch.Services/Services/TemplatesService.cs
index 34e21a5..d01d1c4 100644
--- a/LongoMatch.Services/Services/TemplatesService.cs
+++ b/LongoMatch.Services/Services/TemplatesService.cs
@@ -22,7 +22,6 @@ using System.Reflection;
using Mono.Unix;
using LongoMatch.Common;
-using LongoMatch.Gui.Component;
using LongoMatch.Interfaces;
using LongoMatch.Store;
using LongoMatch.Store.Templates;
@@ -43,12 +42,8 @@ namespace LongoMatch.Services
dict.Add(typeof(SubCategoryTemplate),
new TemplatesProvider<SubCategoryTemplate, string> (basePath,
Constants.SUBCAT_TEMPLATE_EXT));
- dict.Add(typeof(TeamTemplate),
- new TemplatesProvider<TeamTemplate, Player> (basePath,
- Constants.TEAMS_TEMPLATE_EXT));
- dict.Add(typeof(Categories),
- new TemplatesProvider<Categories, Category> (basePath,
- Constants.CAT_TEMPLATE_EXT));
+ dict.Add(typeof(TeamTemplate), new TeamTemplatesProvider(basePath));
+ dict.Add(typeof(Categories), new CategoriesTemplatesProvider (basePath));
CheckDefaultTemplates();
CreateDefaultPlayerSubCategories();
CreateDefaultTeamSubCategories();
@@ -95,29 +90,21 @@ namespace LongoMatch.Services
return null;
}
- public ITemplateWidget<T, U> GetTemplateEditor<T, U>() where T: ITemplate<U>{
- if (typeof(T) == typeof(Categories))
- return (ITemplateWidget<T, U>) new CategoriesTemplateEditorWidget (CategoriesTemplateProvider);
- if (typeof(T) == typeof(TeamTemplate))
- return (ITemplateWidget<T, U>) new TeamTemplateEditorWidget(TeamTemplateProvider);
- return null;
- }
-
- public ITemplateProvider<SubCategoryTemplate, string> SubCategoriesTemplateProvider {
+ public ISubcategoriesTemplatesProvider SubCategoriesTemplateProvider {
get {
- return (ITemplateProvider<SubCategoryTemplate, string>) dict[typeof(SubCategoryTemplate)];
+ return (ISubcategoriesTemplatesProvider) dict[typeof(SubCategoryTemplate)];
}
}
- public ITemplateProvider<TeamTemplate, Player> TeamTemplateProvider {
+ public ITeamTemplatesProvider TeamTemplateProvider {
get {
- return (ITemplateProvider<TeamTemplate, Player>) dict[typeof(TeamTemplate)];
+ return (ITeamTemplatesProvider) dict[typeof(TeamTemplate)];
}
}
- public ITemplateProvider<Categories, Category> CategoriesTemplateProvider {
+ public ICategoriesTemplatesProvider CategoriesTemplateProvider {
get {
- return (ITemplateProvider<Categories, Category>) dict[typeof(Categories)];
+ return (ICategoriesTemplatesProvider) dict[typeof(Categories)];
}
}
@@ -250,4 +237,22 @@ namespace LongoMatch.Services
Save(t);
}
}
+
+ public class TeamTemplatesProvider: TemplatesProvider<TeamTemplate, Player>, ITeamTemplatesProvider
+ {
+ public TeamTemplatesProvider (string basePath): base (basePath, Constants.TEAMS_TEMPLATE_EXT) {}
+
+ }
+
+ public class CategoriesTemplatesProvider : TemplatesProvider<Categories, Category>, ICategoriesTemplatesProvider
+ {
+ public CategoriesTemplatesProvider (string basePath): base (basePath, Constants.CAT_TEMPLATE_EXT) {}
+
+ }
+
+ public class SubCategoriesTemplatesProvider : TemplatesProvider<SubCategoryTemplate, string>, ISubcategoriesTemplatesProvider
+ {
+ public SubCategoriesTemplatesProvider (string basePath): base (basePath, Constants.SUBCAT_TEMPLATE_EXT) {}
+
+ }
}
diff --git a/LongoMatch.Services/Services/VideoDrawingsManager.cs b/LongoMatch.Services/Services/VideoDrawingsManager.cs
index 87da99b..cb7a4da 100644
--- a/LongoMatch.Services/Services/VideoDrawingsManager.cs
+++ b/LongoMatch.Services/Services/VideoDrawingsManager.cs
@@ -18,11 +18,12 @@
using System;
using System.Collections.Generic;
-using Gdk;
+using System.Threading;
+
+using LongoMatch.Common;
+using LongoMatch.Handlers;
+using LongoMatch.Interfaces.GUI;
using LongoMatch.Store;
-using LongoMatch.Gui;
-using LongoMatch.Video.Common;
-using LongoMatch.Multimedia.Interfaces;
namespace LongoMatch.Services
{
@@ -30,16 +31,15 @@ namespace LongoMatch.Services
public class VideoDrawingsManager
{
- PlayerBin player;
- uint timeout;
+ IPlayer player;
+ Timer timeout;
bool inKeyFrame;
bool canStop;
Play loadedPlay;
- public VideoDrawingsManager(PlayerBin player)
+ public VideoDrawingsManager(IPlayer player)
{
this.player = player;
- timeout = 0;
}
~ VideoDrawingsManager() {
@@ -64,14 +64,15 @@ namespace LongoMatch.Services
}
private void StartClock() {
- if(timeout ==0)
- timeout = GLib.Timeout.Add(20,CheckStopTime);
+ if(timeout == null)
+ timeout = new Timer(new TimerCallback(CheckStopTime),
+ this, 20, 20);
}
private void StopClock() {
- if(timeout != 0) {
- GLib.Source.Remove(timeout);
- timeout = 0;
+ if(timeout != null) {
+ timeout.Dispose();
+ timeout = null;
}
}
@@ -92,8 +93,8 @@ namespace LongoMatch.Services
}
private void PrintDrawing() {
- Pixbuf frame = null;
- Pixbuf drawing = null;
+ Image frame = null;
+ Image drawing = null;
player.Pause();
player.SeekInSegment(Drawing.RenderTime);
@@ -115,19 +116,19 @@ namespace LongoMatch.Services
player.SetLogo(System.IO.Path.Combine(Config.ImagesDir(),"background.png"));
}
- private bool CheckStopTime() {
+ private void CheckStopTime(object self) {
int currentTime = (int)player.AccurateCurrentTime;
if(Drawing == null || !canStop)
- return true;
+ return;
if((currentTime)>NextStopTime()) {
StopClock();
PrintDrawing();
}
- return true;
+ return;
}
- protected virtual void OnStateChanged(object sender, StateChangeArgs args) {
+ protected virtual void OnStateChanged(object sender, bool playing) {
//Check if we are currently paused displaying the key frame waiting for the user to
//go in to Play. If so we can stop
if(inKeyFrame) {
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]