[longomatch] Allow frame stepping on seeks with mouse scrolls over the video widget



commit 98ea9bcdfd0fd1b0de3608da0fd7ed9a83b651e2
Author: Andoni Morales Alastruey <ylatuya gmail com>
Date:   Tue Sep 21 13:28:02 2010 +0200

    Allow frame stepping on seeks with mouse scrolls over the video widget

 CesarPlayer/Gui/PlayerBin.cs |   21 ++++++++++++++++++++-
 1 files changed, 20 insertions(+), 1 deletions(-)
---
diff --git a/CesarPlayer/Gui/PlayerBin.cs b/CesarPlayer/Gui/PlayerBin.cs
index d28981e..411fe89 100644
--- a/CesarPlayer/Gui/PlayerBin.cs
+++ b/CesarPlayer/Gui/PlayerBin.cs
@@ -356,7 +356,8 @@ namespace LongoMatch.Gui
 			player.ReadyToSeek += new EventHandler(OnReadyToSeek);
 			
 			playerWidget = (Widget)player;
-			playerWidget.ButtonPressEvent += new ButtonPressEventHandler(OnVideoboxButtonPressEvent);
+			playerWidget.ButtonPressEvent += OnVideoboxButtonPressEvent;
+			playerWidget.ScrollEvent += OnVideoboxScrollEvent;
 			playerWidget.Show();
 			videobox.Add(playerWidget);	
 				
@@ -573,6 +574,24 @@ namespace LongoMatch.Gui
 				Pause();		
 		}
 		
+		protected virtual void OnVideoboxScrollEvent (object o, Gtk.ScrollEventArgs args)
+		{
+			switch (args.Event.Direction){
+				case ScrollDirection.Down:
+					SeekToPreviousFrame(InSegment());
+					break;
+				case ScrollDirection.Up:
+					SeekToNextFrame(InSegment());
+					break;
+				case ScrollDirection.Left:
+					StepBackward();
+					break;
+				case ScrollDirection.Right:
+					StepForward();
+					break;
+			}
+		}
+		
 		protected virtual void OnDrawButtonClicked (object sender, System.EventArgs e)
 		{
 			int currentTime;



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