[longomatch] Add more fixes for the api



commit 987f2ca88bc97fd2cf40e04c2e90b649ac5bedb5
Author: Andoni Morales Alastruey <ylatuya gmail com>
Date:   Mon Mar 23 10:59:05 2015 +0100

    Add more fixes for the api

 LongoMatch.Services/Services/EventsManager.cs   |    9 ++++++---
 LongoMatch.Services/Services/ProjectsManager.cs |   12 ++++--------
 2 files changed, 10 insertions(+), 11 deletions(-)
---
diff --git a/LongoMatch.Services/Services/EventsManager.cs b/LongoMatch.Services/Services/EventsManager.cs
index b6172ef..0de5586 100644
--- a/LongoMatch.Services/Services/EventsManager.cs
+++ b/LongoMatch.Services/Services/EventsManager.cs
@@ -267,9 +267,12 @@ namespace LongoMatch.Services
                        play.Start.MSeconds = Math.Max (0, play.Start.MSeconds);
                        if (projectType == ProjectType.FileProject) {
                                play.Stop.MSeconds = Math.Min (player.StreamLength.MSeconds, 
play.Stop.MSeconds);
+                               play.CamerasLayout = player.CamerasLayout;
+                               play.CamerasVisible = player.CamerasVisible;
+                       } else {
+                               play.CamerasLayout = null;
+                               play.CamerasVisible = new List<int> { 0 };
                        }
-                       play.CamerasLayout = player.CamerasLayout;
-                       play.CamerasVisible = player.CamerasVisible;
 
                        filter.Update ();
                        analysisWindow.AddPlay (play);
@@ -330,7 +333,7 @@ namespace LongoMatch.Services
                        }
 
                        if (!openedProject.Dashboard.DisablePopupWindow) {
-                               if (player != null) {
+                               if (projectType == ProjectType.FileProject) {
                                        bool playing = player.Playing;
                                        player.Pause ();
                                        Config.GUIToolkit.EditPlay (play, openedProject, true, true, true, 
true);
diff --git a/LongoMatch.Services/Services/ProjectsManager.cs b/LongoMatch.Services/Services/ProjectsManager.cs
index 677ab5a..0ecb7df 100644
--- a/LongoMatch.Services/Services/ProjectsManager.cs
+++ b/LongoMatch.Services/Services/ProjectsManager.cs
@@ -170,14 +170,9 @@ namespace LongoMatch.Services
                                
                        PlaysFilter = new EventsFilter (project);
                        project.CleanupTimers ();
-                       /* FIXME: the controller is created here and passed to the view
-                        * Player = new PlayerController ();
-                        * analysisWindow.Player = Player;
-                       */
                        guiToolkit.OpenProject (project, projectType, props, PlaysFilter,
                                out analysisWindow);
                        Player = analysisWindow.Player;
-                       /* FIXME: CapturerBin should be also split into controller + view */
                        Capturer = analysisWindow.Capturer;
                        OpenedProject = project;
                        OpenedProjectType = projectType;
@@ -282,10 +277,11 @@ namespace LongoMatch.Services
                                return;
                                
                        Log.Debug ("Closing project " + OpenedProject.ID);
-                       if (OpenedProjectType != ProjectType.FileProject) {
+                       if (Capturer != null) {
                                Capturer.Close ();
-                       } else {
-                               Player.Close ();
+                       }
+                       if (Player != null) {
+                               Player.Dispose ();
                        }
 
                        if (save)


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