[longomatch] Don't take snapshots for plays



commit 58a9f1943cd1213193cc52e414e4cba21a46aeb1
Author: Andoni Morales Alastruey <ylatuya gmail com>
Date:   Tue Oct 7 13:20:01 2014 +0200

    Don't take snapshots for plays
    
    Snapshots are not very useful and they take resources
    and space in the DB, instead we can draw more useful
    info the list, like the overlay drawings or the players
    tagged

 LongoMatch.Core/Common/EventsBroker.cs        |    7 ------
 LongoMatch.GUI/Gui/Panel/NewProjectPanel.cs   |    1 -
 LongoMatch.Services/Services/EventsManager.cs |    5 +---
 LongoMatch.Services/Services/ToolsManager.cs  |   28 -------------------------
 4 files changed, 1 insertions(+), 40 deletions(-)
---
diff --git a/LongoMatch.Core/Common/EventsBroker.cs b/LongoMatch.Core/Common/EventsBroker.cs
index 0e6827a..627aeba 100644
--- a/LongoMatch.Core/Common/EventsBroker.cs
+++ b/LongoMatch.Core/Common/EventsBroker.cs
@@ -78,7 +78,6 @@ namespace LongoMatch.Core.Common
                public event ConvertVideoFilesHandler ConvertVideoFilesEvent;
                
                public event OpenedProjectChangedHandler OpenedProjectChanged;
-               public event CreateThumbnailsHandler CreateThumbnailsEvent;
                
                /* Player and Capturer */
                public event TickHandler PlayerTick;
@@ -367,12 +366,6 @@ namespace LongoMatch.Core.Common
                        }
                }
                
-               public void EmitCreateThumbnails (Project project) {
-                       if (CreateThumbnailsEvent != null) {
-                               CreateThumbnailsEvent (project);
-                       }
-               }
-               
                public void EmitPlaylistsChanged (object sender) {
                        if (PlaylistsChangedEvent != null)
                                PlaylistsChangedEvent (sender);
diff --git a/LongoMatch.GUI/Gui/Panel/NewProjectPanel.cs b/LongoMatch.GUI/Gui/Panel/NewProjectPanel.cs
index 2897996..b849dd1 100644
--- a/LongoMatch.GUI/Gui/Panel/NewProjectPanel.cs
+++ b/LongoMatch.GUI/Gui/Panel/NewProjectPanel.cs
@@ -376,7 +376,6 @@ namespace LongoMatch.Gui.Panel
                        if (CreateProject ()) {
                                if (projectType == ProjectType.EditProject) {
                                        projectType = ProjectType.FileProject;
-                                       Config.EventsBroker.EmitCreateThumbnails (project);
                                } else {
                                        project.CreateLineupEvent ();
                                }
diff --git a/LongoMatch.Services/Services/EventsManager.cs b/LongoMatch.Services/Services/EventsManager.cs
index 4c7c371..23d95bb 100644
--- a/LongoMatch.Services/Services/EventsManager.cs
+++ b/LongoMatch.Services/Services/EventsManager.cs
@@ -256,8 +256,6 @@ namespace LongoMatch.Services
                public void OnNewTag (EventType evType, List<Player> players, List<Tag> tags,
                                      Time start, Time stop, Time eventTime, Score score, PenaltyCard card)
                {
-                       Image frame;
-
                        if (player == null || openedProject == null)
                                return;
 
@@ -268,12 +266,11 @@ namespace LongoMatch.Services
                                        return;
                                }
                        }
-                       frame = CaptureFrame (start);
                        Log.Debug (String.Format ("New play created start:{0} stop:{1} category:{2}",
                                                  start.ToMSecondsString(), stop.ToMSecondsString(),
                                                  evType.Name));
                        /* Add the new created play to the project and update the GUI*/
-                       var play = openedProject.AddEvent (evType, start, stop, eventTime, frame, score, 
card);
+                       var play = openedProject.AddEvent (evType, start, stop, eventTime, null, score, card);
                        if (players != null) {
                                play.Players = players;
                        }
diff --git a/LongoMatch.Services/Services/ToolsManager.cs b/LongoMatch.Services/Services/ToolsManager.cs
index dab8ba1..0fa61d4 100644
--- a/LongoMatch.Services/Services/ToolsManager.cs
+++ b/LongoMatch.Services/Services/ToolsManager.cs
@@ -71,7 +71,6 @@ namespace LongoMatch.Services
                        
                        Config.EventsBroker.ExportProjectEvent += ExportProject;
                        Config.EventsBroker.ImportProjectEvent += ImportProject;
-                       Config.EventsBroker.CreateThumbnailsEvent += CreateThumbnails;
                }
 
                public void RegisterImporter (Func<string, Project> importFunction,
@@ -87,33 +86,6 @@ namespace LongoMatch.Services
                        ProjectImporters.Add (importer);
                }
 
-               public static void CreateThumbnails (Project project)
-               {
-                       IBusyDialog dialog;
-                       IFramesCapturer capturer;
-
-                       dialog = Config.GUIToolkit.BusyDialog (Catalog.GetString ("Creating video thumbnails. 
This can take a while."));
-                       dialog.Show ();
-                       dialog.Pulse ();
-
-                       /* Create all the thumbnails */
-                       capturer = Config.MultimediaToolkit.GetFramesCapturer ();
-                       capturer.Open (project.Description.FileSet.GetAngle (MediaFileAngle.Angle1).FilePath);
-                       foreach (TimelineEvent play in project.Timeline) {
-                               try {
-                                       play.Miniature = capturer.GetFrame (play.Start + ((play.Stop - 
play.Start) / 2),
-                                                                           true, 
Constants.MAX_THUMBNAIL_SIZE,
-                                                                           Constants.MAX_THUMBNAIL_SIZE);
-                                       dialog.Pulse ();
-
-                               } catch (Exception ex) {
-                                       Log.Exception (ex);
-                               }
-                       }
-                       capturer.Dispose ();
-                       dialog.Destroy ();
-               }
-
                List<ProjectImporter> ProjectImporters {
                        get;
                        set;


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