[longomatch] Use STEP modifier to trigger the step seek



commit 5886d285d6b757de00fe1831999111c1bf2ce63f
Author: Andoni Morales Alastruey <ylatuya gmail com>
Date:   Mon Apr 5 19:34:17 2010 +0200

    Use STEP modifier to trigger the step seek

 LongoMatch/Common/Constants.cs |    8 ++---
 LongoMatch/Gui/MainWindow.cs   |   70 +++++++++++++++++++++------------------
 2 files changed, 41 insertions(+), 37 deletions(-)
---
diff --git a/LongoMatch/Common/Constants.cs b/LongoMatch/Common/Constants.cs
index 0c625bb..7d9050a 100644
--- a/LongoMatch/Common/Constants.cs
+++ b/LongoMatch/Common/Constants.cs
@@ -57,13 +57,11 @@ Petr Kovar (cs)";
 		
 		public const string WEBSITE = "http://www.longomatch.ylatuya.es";;
 		
-		public const Key PREV_FRAME = Gdk.Key.Left;
-
-		public const Key NEXT_FRAME = Gdk.Key.Right;
+		public const ModifierType STEP = Gdk.ModifierType.ShiftMask;
 		
-		public const Key STEP_BACKWARD = Gdk.Key.a;
+		public const Key SEEK_BACKWARD = Gdk.Key.Left;
 		
-		public const Key STEP_FORWARD = Gdk.Key.s;		
+		public const Key SEEK_FORWARD = Gdk.Key.Right;		
 		
 		public const Key FRAMERATE_UP = Gdk.Key.Up;
 		
diff --git a/LongoMatch/Gui/MainWindow.cs b/LongoMatch/Gui/MainWindow.cs
index d3d23cc..266e534 100644
--- a/LongoMatch/Gui/MainWindow.cs
+++ b/LongoMatch/Gui/MainWindow.cs
@@ -470,41 +470,47 @@ namespace LongoMatch.Gui
 
 		protected override bool OnKeyPressEvent(EventKey evnt)
 		{
-			if (openedProject != null && evnt.State == ModifierType.None) {
-				Gdk.Key key = evnt.Key;
-				if (projectType == ProjectType.FileProject){
-					switch (key){
-						case Constants.PREV_FRAME:
-							playerbin1.SeekToPreviousFrame(selectedTimeNode != null);
-							break;
-						case Constants.NEXT_FRAME:
-							playerbin1.SeekToNextFrame(selectedTimeNode != null);
-							break;
-						case Constants.STEP_FORWARD:
+			Gdk.Key key = evnt.Key;
+			Gdk.ModifierType modifier = evnt.State;
+			bool ret;
+			
+			ret = base.OnKeyPressEvent(evnt);
+
+			if (openedProject == null)
+				return ret;
+			
+			if (projectType == ProjectType.FileProject){
+				switch (key){
+					case Constants.SEEK_FORWARD:
+						if (modifier == Constants.STEP)
 							playerbin1.StepForward();
-							break;
-						case Constants.STEP_BACKWARD:
+						else 
+							playerbin1.SeekToNextFrame(selectedTimeNode != null);						
+						break;
+					case Constants.SEEK_BACKWARD:
+						if (modifier == Constants.STEP)
 							playerbin1.StepBackward();
-							break;
-						case Constants.FRAMERATE_UP:
-							playerbin1.FramerateUp();
-							break;
-						case Constants.FRAMERATE_DOWN:
-							playerbin1.FramerateDown();
-							break;
-						case Constants.TOGGLE_PLAY:
-							playerbin1.TogglePlay();
-							break;			
-					}	
-				} else {
-					switch (key){
-						case Constants.TOGGLE_PLAY:
-							capturerBin.ToggleCapture();
-							break;			
-					}	
-				}
+						else 
+							playerbin1.SeekToPreviousFrame(selectedTimeNode != null);						
+						break;
+					case Constants.FRAMERATE_UP:
+						playerbin1.FramerateUp();
+						break;
+					case Constants.FRAMERATE_DOWN:
+						playerbin1.FramerateDown();
+						break;
+					case Constants.TOGGLE_PLAY:
+						playerbin1.TogglePlay();
+						break;			
+				}	
+			} else {
+				switch (key){
+					case Constants.TOGGLE_PLAY:
+						capturerBin.ToggleCapture();
+						break;			
+				}	
 			}
-			return base.OnKeyPressEvent(evnt);
+			return ret;
 		}
 
 		protected virtual void OnTimeNodeSelected(LongoMatch.TimeNodes.MediaTimeNode tNode)



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