[longomatch] Handle secondary cam going out of scope in playing.



commit 6aa80f4fc93f9549e2f2cba5864bae7732668c4f
Author: Julien Moutte <julien fluendo com>
Date:   Fri Mar 13 19:43:40 2015 +0100

    Handle secondary cam going out of scope in playing.
    
    While playing the main camera the secondary cam can go out of scope.

 LongoMatch.GUI/Gui/Component/ProjectPeriods.cs |   23 +++++++++++++++++++----
 1 files changed, 19 insertions(+), 4 deletions(-)
---
diff --git a/LongoMatch.GUI/Gui/Component/ProjectPeriods.cs b/LongoMatch.GUI/Gui/Component/ProjectPeriods.cs
index 1fb2ce9..7c9ccab 100644
--- a/LongoMatch.GUI/Gui/Component/ProjectPeriods.cs
+++ b/LongoMatch.GUI/Gui/Component/ProjectPeriods.cs
@@ -255,6 +255,13 @@ namespace LongoMatch.Gui.Component
                {
                        timerule.CurrentTime = currentTime;
                        camerasTimeline.CurrentTime = currentTime;
+                       // Detect when secondary camera goes out of scope while main camera is playing.
+                       if (sec_cam_playerbin.Opened) {
+                               MediaFile mf = sec_cam_playerbin.MediaFileSet.First ();
+                               if (mf.Duration + mf.Offset < currentTime) {
+                                       HandleOutOfScope ();
+                               }
+                       }
                        QueueDraw ();
                }
 
@@ -282,6 +289,17 @@ namespace LongoMatch.Gui.Component
                        }
                }
 
+               /// <summary>
+               /// Handles the case where the secondary video gets out of scope compared to current time of 
main video.
+               /// </summary>
+               void HandleOutOfScope ()
+               {
+                       // Camera is out of scope, show didactic message
+                       sec_cam_vbox.Hide ();
+                       sec_cam_didactic_label.Text = Catalog.GetString ("Camera out of scope");
+                       sec_cam_didactic_label.Show ();
+               }
+
                void HandleCameraDragged (MediaFile mediafile, TimeNode timenode)
                {
                        // Start by pausing players
@@ -312,10 +330,7 @@ namespace LongoMatch.Gui.Component
                                // Seek to position 
                                sec_cam_playerbin.Seek (timerule.CurrentTime, true);
                        } else {
-                               // Camera is out of scope, show didactic message
-                               sec_cam_vbox.Hide ();
-                               sec_cam_didactic_label.Text = Catalog.GetString ("Camera out of scope");
-                               sec_cam_didactic_label.Show ();
+                               HandleOutOfScope ();
                        }
                }
 


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