[longomatch] Add a new event to notify a new MediaFileSet is opened



commit 140b6e3bacea519e6f6f70a78020636ca2bb79c2
Author: Andoni Morales Alastruey <ylatuya gmail com>
Date:   Tue Mar 24 11:55:50 2015 +0100

    Add a new event to notify a new MediaFileSet is opened

 LongoMatch.Core/Handlers/Multimedia.cs           |    2 +-
 LongoMatch.Core/Interfaces/IPlayerController.cs  |    1 +
 LongoMatch.Services/Services/PlayerController.cs |    9 +++++++++
 3 files changed, 11 insertions(+), 1 deletions(-)
---
diff --git a/LongoMatch.Core/Handlers/Multimedia.cs b/LongoMatch.Core/Handlers/Multimedia.cs
index 143f7a3..9f1282d 100644
--- a/LongoMatch.Core/Handlers/Multimedia.cs
+++ b/LongoMatch.Core/Handlers/Multimedia.cs
@@ -36,7 +36,6 @@ namespace LongoMatch.Core.Handlers
        public delegate void DrawFrameHandler (TimelineEvent play,int drawingIndex,int cameraIndex,bool 
current);
        public delegate void EllpasedTimeHandler (Time ellapsedTime);
        public delegate void PlaybackRateChangedHandler (float rate);
-       public delegate void PrepareLoadEventHandler (MediaFileSet fileset);
        public delegate void SeekHandler (SeekType type,Time start,float rate);
 
        public delegate void DeviceChangeHandler (int deviceID);
@@ -52,4 +51,5 @@ namespace LongoMatch.Core.Handlers
        public delegate void LoadDrawingsHandler (FrameDrawing frameDrawing);
        public delegate void ElementLoadedHandler (object element,bool hasNext);
        public delegate void PARChangedHandler (IntPtr windowHandle,float par);
+       public delegate void MediaFileSetLoadedHandler (MediaFileSet fileset);
 }
diff --git a/LongoMatch.Core/Interfaces/IPlayerController.cs b/LongoMatch.Core/Interfaces/IPlayerController.cs
index 1639adb..2e43171 100644
--- a/LongoMatch.Core/Interfaces/IPlayerController.cs
+++ b/LongoMatch.Core/Interfaces/IPlayerController.cs
@@ -36,6 +36,7 @@ namespace LongoMatch.Core.Interfaces
                event VolumeChangedHandler VolumeChangedEvent;
                event ElementLoadedHandler ElementLoadedEvent;
                event PARChangedHandler PARChangedEvent;
+               event MediaFileSetLoadedHandler MediaFileSetLoadedEvent;
 
                /// <summary>
                /// The file set currently openned by the player.
diff --git a/LongoMatch.Services/Services/PlayerController.cs 
b/LongoMatch.Services/Services/PlayerController.cs
index 2f58099..300a60a 100644
--- a/LongoMatch.Services/Services/PlayerController.cs
+++ b/LongoMatch.Services/Services/PlayerController.cs
@@ -38,6 +38,7 @@ namespace LongoMatch.Services
                public event VolumeChangedHandler VolumeChangedEvent;
                public event ElementLoadedHandler ElementLoadedEvent;
                public event PARChangedHandler PARChangedEvent;
+               public event MediaFileSetLoadedHandler MediaFileSetLoadedEvent;
 
                const int TIMEOUT_MS = 20;
                const int SCALE_FPS = 25;
@@ -530,6 +531,13 @@ namespace LongoMatch.Services
                        }
                }
 
+               void EmitMediaFileSetLoaded (MediaFileSet fileSet)
+               {
+                       if (MediaFileSetLoadedEvent != null) {
+                               EmitMediaFileSetLoaded (fileSet);
+                       }
+               }
+
                #endregion
 
                #region Private Properties
@@ -595,6 +603,7 @@ namespace LongoMatch.Services
                void Open (MediaFileSet fileSet, bool seek, bool force = false, bool play = false)
                {
                        Reset ();
+                       EmitMediaFileSetLoaded (fileSet);
                        if (fileSet != this.FileSet || force) {
                                readyToSeek = false;
                                FileSet = fileSet;


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