[longomatch] Update the play's framerate when we change the project file



commit f3b33bff0ad45bc77f4c24e444ae90453ce7c295
Author: Andoni Morales Alastruey <ylatuya gmail com>
Date:   Wed Mar 20 03:37:08 2013 +0100

    Update the play's framerate when we change the project file

 .../Gui/Component/ProjectDetailsWidget.cs          |    7 +++++++
 LongoMatch.Services/Services/ProjectsManager.cs    |    3 +++
 2 files changed, 10 insertions(+), 0 deletions(-)
---
diff --git a/LongoMatch.GUI/Gui/Component/ProjectDetailsWidget.cs 
b/LongoMatch.GUI/Gui/Component/ProjectDetailsWidget.cs
index f7ff0dc..067794a 100644
--- a/LongoMatch.GUI/Gui/Component/ProjectDetailsWidget.cs
+++ b/LongoMatch.GUI/Gui/Component/ProjectDetailsWidget.cs
@@ -287,6 +287,13 @@ namespace LongoMatch.Gui.Component
 
                public void UpdateProject() {
                        var desc = project.Description;
+                       /* In case the framerate changed, update each play with the new
+                        * framerate */
+                       if (desc.File.Fps != mFile.Fps) {
+                               foreach (Play play in project.AllPlays ()) {
+                                       play.Fps = mFile.Fps;
+                               }
+                       }
                        desc.File= mFile;
                        desc.LocalGoals = (int)localSpinButton.Value;
                        desc.VisitorGoals = (int)visitorSpinButton.Value;
diff --git a/LongoMatch.Services/Services/ProjectsManager.cs b/LongoMatch.Services/Services/ProjectsManager.cs
index 509212c..4a12b8f 100644
--- a/LongoMatch.Services/Services/ProjectsManager.cs
+++ b/LongoMatch.Services/Services/ProjectsManager.cs
@@ -98,6 +98,9 @@ namespace LongoMatch.Services
                        try {
                                Log.Debug("Reloading saved file: " + filePath);
                                project.Description.File = multimediaToolkit.DiscoverFile(filePath);
+                               foreach (Play play in project.AllPlays ()) {
+                                       play.Fps = project.Description.File.Fps;
+                               }
                                Core.DB.AddProject(project);
                        } catch(Exception ex) {
                                Log.Exception(ex);


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