[longomatch] Fix selection of active element in playlists



commit 829b2ab2bde070395be7c746af90abe37fb81d4e
Author: Andoni Morales Alastruey <ylatuya gmail com>
Date:   Fri Nov 9 02:30:14 2012 +0100

    Fix selection of active element in playlists

 LongoMatch.Core/Common/PlayList.cs              |    4 ++++
 LongoMatch.Core/Interfaces/IPlayList.cs         |    2 ++
 LongoMatch.GUI.Multimedia/Gui/PlayerBin.cs      |    5 ++++-
 LongoMatch.Services/Services/PlaylistManager.cs |    5 ++---
 4 files changed, 12 insertions(+), 4 deletions(-)
---
diff --git a/LongoMatch.Core/Common/PlayList.cs b/LongoMatch.Core/Common/PlayList.cs
index 53db7e5..228f9e6 100644
--- a/LongoMatch.Core/Common/PlayList.cs
+++ b/LongoMatch.Core/Common/PlayList.cs
@@ -125,6 +125,10 @@ namespace LongoMatch.Common
 			return this[index];
 		}
 
+		public void SetActive (PlayListPlay play) {
+			indexSelection = IndexOf(play);
+		}
+		
 		public bool HasNext() {
 			return indexSelection < Count-1;
 		}
diff --git a/LongoMatch.Core/Interfaces/IPlayList.cs b/LongoMatch.Core/Interfaces/IPlayList.cs
index 0630420..d89f30f 100644
--- a/LongoMatch.Core/Interfaces/IPlayList.cs
+++ b/LongoMatch.Core/Interfaces/IPlayList.cs
@@ -43,6 +43,8 @@ namespace LongoMatch.Interfaces {
 		PlayListPlay Prev();
 
 		PlayListPlay Select(int index);
+		
+		void SetActive(PlayListPlay play);
 
 		void Reorder(int indexIn, int indexOut);
 
diff --git a/LongoMatch.GUI.Multimedia/Gui/PlayerBin.cs b/LongoMatch.GUI.Multimedia/Gui/PlayerBin.cs
index 7cb63a9..3b56181 100644
--- a/LongoMatch.GUI.Multimedia/Gui/PlayerBin.cs
+++ b/LongoMatch.GUI.Multimedia/Gui/PlayerBin.cs
@@ -256,7 +256,10 @@ namespace LongoMatch.Gui
 				//Wait until the pipeline is prerolled and ready to seek
 				pendingSeek = new object[3] {start,stop,rate};
 			}
-			else player.SegmentSeek(start,stop,rate);
+			else {
+			 player.SegmentSeek(start,stop,rate);
+			 player.Play();
+			}
 
 			segmentStartTime = start;
 			segmentStopTime = stop;
diff --git a/LongoMatch.Services/Services/PlaylistManager.cs b/LongoMatch.Services/Services/PlaylistManager.cs
index 5952274..bcd34f9 100644
--- a/LongoMatch.Services/Services/PlaylistManager.cs
+++ b/LongoMatch.Services/Services/PlaylistManager.cs
@@ -111,6 +111,8 @@ namespace LongoMatch.Services
 			player.SetPlayListElement(play.MediaFile.FilePath, play.Start.MSeconds,
 			                          play.Stop.MSeconds, play.Rate, playlist.HasNext());
 			selectedTimeNode = play;
+			playlist.SetActive (play);
+			playlistWidget.SetActivePlay(play, playlist.GetCurrentIndex());
 		}
 		
 		private bool Next() {
@@ -120,7 +122,6 @@ namespace LongoMatch.Services
 			}
 			
 			var plNode = playlist.Next();
-			playlistWidget.SetActivePlay(plNode, playlist.GetCurrentIndex());
 			
 			if (!plNode.Valid)
 				return Next();
@@ -134,8 +135,6 @@ namespace LongoMatch.Services
 			if ((player.AccurateCurrentTime - selectedTimeNode.Start.MSeconds) < 500) {
 				if (playlist.HasPrev()) {
 					var play = playlist.Prev();
-					playlistWidget.SetActivePlay(selectedTimeNode as PlayListPlay,
-					                             playlist.GetCurrentIndex());
 					LoadPlaylistPlay(play);
 				}
 			} else {



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