# HG changeset patch # User PAMPHILE Jonathan # Date 1258066231 -3600 # Node ID 96374d03e714a4ebcb97d86050c51690ca1c6d7f # Parent 11083c390ce42cfe9d142b6785bd9a0abfcf4158 Gesture diff -r 11083c390ce4 -r 96374d03e714 src/FingersDance.Control.Player/UserControlPlayer.xaml --- a/src/FingersDance.Control.Player/UserControlPlayer.xaml Thu Nov 12 16:15:19 2009 +0100 +++ b/src/FingersDance.Control.Player/UserControlPlayer.xaml Thu Nov 12 23:50:31 2009 +0100 @@ -177,21 +177,13 @@ - - - - + diff -r 11083c390ce4 -r 96374d03e714 src/FingersDance.Control.Player/UserControlPlayer.xaml.cs --- a/src/FingersDance.Control.Player/UserControlPlayer.xaml.cs Thu Nov 12 16:15:19 2009 +0100 +++ b/src/FingersDance.Control.Player/UserControlPlayer.xaml.cs Thu Nov 12 23:50:31 2009 +0100 @@ -32,6 +32,12 @@ public event EventHandler PlayerOpened; public event EventHandler PlayerStopOrPause; + public double Time + { + get { return gestureControl.time; } + set { gestureControl.time = value; } + } + #region constructors public UserControlPlayer() { @@ -118,8 +124,15 @@ public void GestureDetected(object sender, GestureControl.GestureRoutedEventArgs e) { - Console.WriteLine("gesture detected: " + e.Gesture); - switch (e.Gesture) + + /* + * e.Gesture.Name = Nom de la gesture + * e.Gesture.Start = Valeur de la timeline au début de l'annotation + * e.Gesture.End = Valeur de la timeline à la fin de l'annotation + * + */ + + switch (e.Gesture.Name) { case "TRIGGER": @@ -178,7 +191,6 @@ ButtonPlayPause_ContactDown(null, null); break; default: - //this.TxtGesture.Text = e.Gesture; break; } } @@ -212,6 +224,8 @@ } + /* + private void ButtonPlayPause_Click(object sender, RoutedEventArgs e) { if (!isPlaying)//Play @@ -278,6 +292,8 @@ MediaElementVideo.Position = MediaElementVideo.Position.Add(new TimeSpan(0, 0, 0, -5)); } } + + */ #endregion @@ -308,20 +324,20 @@ { // e.Cursor.Visual is the ContentControl, so its Content is the dragged TimelineAnnotationView AnnotationViewModel annotationDataVM = (AnnotationViewModel)((TimelineAnnotationView)((ContentControl)e.Cursor.Visual).Content).DataContext; - Play_Pause_area.Background = tl.isAnnotationAccepted(annotationDataVM) ? new SolidColorBrush(Colors.Green) : new SolidColorBrush(Colors.Red); + //Play_Pause_area.Background = tl.isAnnotationAccepted(annotationDataVM) ? new SolidColorBrush(Colors.Green) : new SolidColorBrush(Colors.Red); } else { - Play_Pause_area.Background = new SolidColorBrush(Colors.White); + //Play_Pause_area.Background = new SolidColorBrush(Colors.White); } - Play_Pause_area.Opacity = 0.3; + //Play_Pause_area.Opacity = 0.3; } private void Play_Pause_area_DragLeave(object sender, SurfaceDragDropEventArgs e) { //Console.WriteLine("Leave"); - Play_Pause_area.Opacity = 0; + //Play_Pause_area.Opacity = 0; } private void Play_Pause_area_DragOver(object sender, SurfaceDragDropEventArgs e) @@ -332,7 +348,7 @@ private void Play_Pause_area_Drop(object sender, SurfaceDragDropEventArgs e) { //Console.WriteLine("Drop"); - Play_Pause_area.Opacity = 0; + //Play_Pause_area.Opacity = 0; // e.Cursor.Visual is the ContentControl, so its Content is the dragged TimelineAnnotationView AnnotationViewModel annotationDataVM = (AnnotationViewModel)((TimelineAnnotationView)((ContentControl)e.Cursor.Visual).Content).DataContext; int nbSeconds = (int)annotationDataVM.TcBegin; diff -r 11083c390ce4 -r 96374d03e714 src/FingersDance.Control.SyncSource/UserControlSyncSource.xaml.cs --- a/src/FingersDance.Control.SyncSource/UserControlSyncSource.xaml.cs Thu Nov 12 16:15:19 2009 +0100 +++ b/src/FingersDance.Control.SyncSource/UserControlSyncSource.xaml.cs Thu Nov 12 23:50:31 2009 +0100 @@ -112,6 +112,7 @@ UserControlPlayer.Player.Position = ts; UserControlPlayer.playerPlay(); + UserControlPlayer.Time = SliderValue; UCTimeLine.IsDragging = false; UCTimeLine.FinishedDragging = false; diff -r 11083c390ce4 -r 96374d03e714 src/FingersDance.GestureControl/Gesture.cs --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/src/FingersDance.GestureControl/Gesture.cs Thu Nov 12 23:50:31 2009 +0100 @@ -0,0 +1,14 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; + +namespace GestureControl +{ + public class Gesture + { + public string Name { get; set; } + public double Start { get; set; } + public double End { get; set; } + } +} diff -r 11083c390ce4 -r 96374d03e714 src/FingersDance.GestureControl/GestureControl.cs --- a/src/FingersDance.GestureControl/GestureControl.cs Thu Nov 12 16:15:19 2009 +0100 +++ b/src/FingersDance.GestureControl/GestureControl.cs Thu Nov 12 23:50:31 2009 +0100 @@ -27,6 +27,8 @@ { public class GestureControl : ContentControl { + public double time; + double start = -1; private double angle = 0; public static readonly DependencyProperty GestureProperty; Thread inProgess; @@ -55,9 +57,9 @@ remove { RemoveHandler(gestureEvent, value); } } - public delegate void RaiseGestureEventCallBack(string gesture); + public delegate void RaiseGestureEventCallBack(Gesture gesture); - public void RaiseGestureEvent(string gesture) + public void RaiseGestureEvent(Gesture gesture) { if (this.Dispatcher.CheckAccess()) { @@ -104,6 +106,8 @@ // get angle from the first contact of the stroke protected void AreaDown(object source, RoutedEventArgs e) { + if (start == -1) + start = time; ContactEventArgs c = (ContactEventArgs)e; this.angle = c.Contact.GetOrientation(this) - 270; } @@ -147,6 +151,7 @@ catch { } } + void RunCapture() { try @@ -156,9 +161,10 @@ string gesture = GetPattern(_Gestures); if (gesture != "None") { - this.RaiseGestureEvent(gesture); + this.RaiseGestureEvent(new Gesture{Start=start, End=time, Name=gesture}); } _Gestures.Clear(); + start = -1; inProgess = null; } catch (Exception) diff -r 11083c390ce4 -r 96374d03e714 src/FingersDance.GestureControl/GestureControl.csproj --- a/src/FingersDance.GestureControl/GestureControl.csproj Thu Nov 12 16:15:19 2009 +0100 +++ b/src/FingersDance.GestureControl/GestureControl.csproj Thu Nov 12 23:50:31 2009 +0100 @@ -82,6 +82,7 @@ + diff -r 11083c390ce4 -r 96374d03e714 src/FingersDance.GestureControl/GestureRoutedEventArgs.cs --- a/src/FingersDance.GestureControl/GestureRoutedEventArgs.cs Thu Nov 12 16:15:19 2009 +0100 +++ b/src/FingersDance.GestureControl/GestureRoutedEventArgs.cs Thu Nov 12 23:50:31 2009 +0100 @@ -12,13 +12,13 @@ /// public class GestureRoutedEventArgs : RoutedEventArgs { - public String Gesture { get; private set; } + public Gesture Gesture { get; private set; } public GestureRoutedEventArgs() : base() { } - public GestureRoutedEventArgs(String gesture) : base() { this.Gesture = gesture; } + public GestureRoutedEventArgs(Gesture gesture) : base() { this.Gesture = gesture; } public GestureRoutedEventArgs(RoutedEvent routedEvent) : base(routedEvent) { } - public GestureRoutedEventArgs(RoutedEvent routedEvent, String gesture) : base(routedEvent) { this.Gesture = gesture; } + public GestureRoutedEventArgs(RoutedEvent routedEvent, Gesture gesture) : base(routedEvent) { this.Gesture = gesture; } public GestureRoutedEventArgs(RoutedEvent routedEvent, Object source) : base(routedEvent, source) { } - public GestureRoutedEventArgs(RoutedEvent routedEvent, Object source, String gesture) : base(routedEvent, source) { this.Gesture = gesture; } + public GestureRoutedEventArgs(RoutedEvent routedEvent, Object source, Gesture gesture) : base(routedEvent, source) { this.Gesture = gesture; } } } diff -r 11083c390ce4 -r 96374d03e714 src/FingersDance.GestureControl/Themes/Generic.xaml --- a/src/FingersDance.GestureControl/Themes/Generic.xaml Thu Nov 12 16:15:19 2009 +0100 +++ b/src/FingersDance.GestureControl/Themes/Generic.xaml Thu Nov 12 23:50:31 2009 +0100 @@ -18,8 +18,8 @@ - - +