# HG changeset patch # User cavaliet # Date 1259058907 -3600 # Node ID b60e13ed75c886ab5a45c402fb9cf3099bcaa0b4 # Parent 874de6d84a2e946e047ffd54c3ad41dff227019b Now an annotation has a list of gesture string and not simple gesture string. These are saved into and loaded from the ldt xml file. diff -r 874de6d84a2e -r b60e13ed75c8 src/FingersDance.Control.Screen/UserControlScreen.xaml.cs --- a/src/FingersDance.Control.Screen/UserControlScreen.xaml.cs Tue Nov 24 07:50:17 2009 +0100 +++ b/src/FingersDance.Control.Screen/UserControlScreen.xaml.cs Tue Nov 24 11:35:07 2009 +0100 @@ -173,13 +173,15 @@ String aId = annotNode.Attribute("id").Value; float begin = (float)annotNode.Attribute("begin"); float dur = (float)annotNode.Attribute("dur"); - String gt = annotNode.Element("gestureType").Value; + String[] gt = annotNode.Element("gestureType").Value.Split(new Char[] { ',' }); + List gtList = new List(); + gtList.AddRange(gt); String colorString = annotNode.Attribute("color").Value; // is type 0xRRGGBB Byte r = Convert.ToByte(colorString.Substring(2, 2), 16); Byte g = Convert.ToByte(colorString.Substring(4, 2), 16); Byte b = Convert.ToByte(colorString.Substring(6, 2), 16); Color c = Color.FromRgb(r, g, b); - Annotation Annotation = new Annotation(aId, begin, dur, gt, c); + Annotation Annotation = new Annotation(aId, begin, dur, gtList, c); la.Add(Annotation); Data.AddAnnotation(Annotation); } diff -r 874de6d84a2e -r b60e13ed75c8 src/FingersDance.Control.SyncSource/UserControlSyncSource.xaml.cs --- a/src/FingersDance.Control.SyncSource/UserControlSyncSource.xaml.cs Tue Nov 24 07:50:17 2009 +0100 +++ b/src/FingersDance.Control.SyncSource/UserControlSyncSource.xaml.cs Tue Nov 24 11:35:07 2009 +0100 @@ -183,8 +183,11 @@ // If the stroke has been drawed very fast, end and start can be the same, so we add a little length. float dur = (float)(grea.End - grea.Start); if (dur == 0) dur = (float)0.5; + // We build the list of string + List gestList = new List(); foreach (Gesture elt in grea.Gestures) - UCTimeLine.addAnnotation((float)grea.Start, dur, elt.Name); + gestList.Add(elt.Name); + UCTimeLine.addAnnotation((float)grea.Start, dur, gestList); } else { @@ -195,12 +198,13 @@ foreach (Annotation annot in cut.AnnotList) { foreach(Gesture gest in grea.Gestures) - if (annot.GestureType == gest.Name) - { - // One of the gesture is enough for the annotation to be added - searchedAnnot.Add(annot); - break; - } + foreach(String annotGest in annot.GestureType) + if (annotGest == gest.Name) + { + // One of the gesture is enough for the annotation to be added + searchedAnnot.Add(annot); + break; + } } } // The list was built. If the number of found annotations is >0, we send the list to the timeline @@ -218,11 +222,12 @@ { foreach (Annotation annot in cut.AnnotList) { - if (annot.GestureType == gestureName) - { - // One of the gesture is enough for the annotation to be added - searchedAnnot.Add(annot); - } + foreach (String annotGest in annot.GestureType) + if (annotGest == gestureName) + { + // One of the gesture is enough for the annotation to be added + searchedAnnot.Add(annot); + } } } // The list was built. If the number of found annotations is >0, we send the list to the timeline diff -r 874de6d84a2e -r b60e13ed75c8 src/FingersDance.Control.TimeLine/UserControlTimeLine.xaml.cs --- a/src/FingersDance.Control.TimeLine/UserControlTimeLine.xaml.cs Tue Nov 24 07:50:17 2009 +0100 +++ b/src/FingersDance.Control.TimeLine/UserControlTimeLine.xaml.cs Tue Nov 24 11:35:07 2009 +0100 @@ -302,7 +302,7 @@ } - public void addAnnotation(float start, float dur, String gestureType) + public void addAnnotation(float start, float dur, List gestureType) { addAnnotation(new AnnotationViewModel(new Annotation("temp", start, dur, gestureType, CurrentColor), 0)); } @@ -327,7 +327,9 @@ // if not, we mark the beginning if (annotOk == true) { - Annotation annotation = new Annotation("s_" + System.Guid.NewGuid(), AnnotTcBegin, 0, gestureType, CurrentColor); + List ls = new List(); + ls.Add(gestureType); + Annotation annotation = new Annotation("s_" + System.Guid.NewGuid(), AnnotTcBegin, 0, ls, CurrentColor); cut.AnnotList.Add(annotation); tv.DataContext = new CuttingViewModel(cut, AnnotWidth, tv.ScaleX); AnnotWaiting = true; @@ -353,7 +355,9 @@ if (annotOk == true) { cut.AnnotList.RemoveAt(cut.AnnotList.Count - 1); - Annotation annotation = new Annotation("s_" + System.Guid.NewGuid(), AnnotTcBegin, currentDuration, gestureType, CurrentColor); + List ls = new List(); + ls.Add(gestureType); + Annotation annotation = new Annotation("s_" + System.Guid.NewGuid(), AnnotTcBegin, currentDuration, ls, CurrentColor); cut.AnnotList.Add(annotation); //Console.WriteLine("currentTimecode = " + AnnotTcBegin + ", curDur = " + currentDuration + ", nb = " + cut.AnnotList.Count + ", res = " + (AnnotTcBegin - (cut.AnnotList.Count * AnnotWidth))); tv.DataContext = new CuttingViewModel(cut, AnnotWidth, tv.ScaleX); diff -r 874de6d84a2e -r b60e13ed75c8 src/FingersDance.Data/Annotation.cs --- a/src/FingersDance.Data/Annotation.cs Tue Nov 24 07:50:17 2009 +0100 +++ b/src/FingersDance.Data/Annotation.cs Tue Nov 24 11:35:07 2009 +0100 @@ -11,10 +11,10 @@ private String _id; private float _tcBegin; private float _dur; - private String _gestureType; + private List _gestureType; private Color _color; - public Annotation(String idPar, float tcBeginPar, float durPar, String gesturePar, Color colorPar) + public Annotation(String idPar, float tcBeginPar, float durPar, List gesturePar, Color colorPar) { this._id = idPar; this._tcBegin = tcBeginPar; @@ -53,12 +53,12 @@ _dur = value; } } - public String GestureType + public List GestureType { get { return _gestureType; } set { - if (value == _gestureType || String.IsNullOrEmpty(value)) + if (value == _gestureType) return; _gestureType = value; } diff -r 874de6d84a2e -r b60e13ed75c8 src/FingersDance.GestureControl/Resources/Patterns.xml --- a/src/FingersDance.GestureControl/Resources/Patterns.xml Tue Nov 24 07:50:17 2009 +0100 +++ b/src/FingersDance.GestureControl/Resources/Patterns.xml Tue Nov 24 11:35:07 2009 +0100 @@ -1,7 +1,7 @@  - UN DANSEUR + 1 DANSEUR DOWN @@ -13,7 +13,7 @@ - DEUX DANSEURS + 2 DANSEURS DOWN @@ -31,7 +31,7 @@ - TROIS DANSEURS + 3 DANSEURS DOWN @@ -191,7 +191,7 @@ - IMAGE AVANT + MVT IMAGE AVANT TAP @@ -209,7 +209,7 @@ - IMAGE ARRIERE + MVT IMAGE ARRIERE TAP diff -r 874de6d84a2e -r b60e13ed75c8 src/FingersDance.ViewModel/AnnotationViewModel.cs --- a/src/FingersDance.ViewModel/AnnotationViewModel.cs Tue Nov 24 07:50:17 2009 +0100 +++ b/src/FingersDance.ViewModel/AnnotationViewModel.cs Tue Nov 24 11:35:07 2009 +0100 @@ -63,12 +63,12 @@ base.OnPropertyChanged("Dur"); } } - public String GestureType + public List GestureType { get { return a.GestureType; } set { - if (value == a.GestureType || String.IsNullOrEmpty(value)) + if (value == a.GestureType) return; a.GestureType = value; base.OnPropertyChanged("GestureType"); diff -r 874de6d84a2e -r b60e13ed75c8 src/FingersDance.Views/TimelineAnnotationView.xaml --- a/src/FingersDance.Views/TimelineAnnotationView.xaml Tue Nov 24 07:50:17 2009 +0100 +++ b/src/FingersDance.Views/TimelineAnnotationView.xaml Tue Nov 24 11:35:07 2009 +0100 @@ -18,7 +18,8 @@ > - + diff -r 874de6d84a2e -r b60e13ed75c8 src/FingersDance/MainSurfaceWindow.xaml --- a/src/FingersDance/MainSurfaceWindow.xaml Tue Nov 24 07:50:17 2009 +0100 +++ b/src/FingersDance/MainSurfaceWindow.xaml Tue Nov 24 11:35:07 2009 +0100 @@ -6,14 +6,8 @@ xmlns:d="http://schemas.microsoft.com/expression/blend/2008" xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" mc:Ignorable="d" xmlns:FingersDance_Control_UserPanel="clr-namespace:FingersDance.Control.UserPanel;assembly=FingersDance.Control.UserPanel" xmlns:FingersDance_Control_Pivot="clr-namespace:FingersDance.Control.Pivot;assembly=FingersDance.Control.Pivot" - - xmlns:FingersDance_Control_SessionInput1="clr-namespace:FingersDance.Control.SessionInput;assembly=FingersDance.Control.SaisieSeance" - - xmlns:Microsoft_Surface_Presentation_Generic="clr-namespace:Microsoft.Surface.Presentation.Generic;assembly=Microsoft.Surface.Presentation.Generic" - - x:Class="FingersDance.SurfaceWindow1" Title="FingersDance" Width="1024" Height="768" x:Name="mainSurfaceWindow" diff -r 874de6d84a2e -r b60e13ed75c8 src/FingersDance/MainSurfaceWindow.xaml.cs --- a/src/FingersDance/MainSurfaceWindow.xaml.cs Tue Nov 24 07:50:17 2009 +0100 +++ b/src/FingersDance/MainSurfaceWindow.xaml.cs Tue Nov 24 11:35:07 2009 +0100 @@ -58,7 +58,7 @@ AddActivationHandlers(); // Add credit text CreditsText1.Text = CreditsText2.Text = CreditsText3.Text = CreditsText4.Text = - "MICROSOFT :\nPierre-Louis Xech\n\nEFREI :\nSantiago Aria\nRiley Ikni\nJonathan Pamphile\nAmine Tarari\n\nSTRATE COLLEGE :\nAnnabelle Eugénia\nHuieun Kim\nBaptiste Lanne\nIoana Ocnarescu\nVanessa Reiser\nDominique Sciamma\n\nINSTITUT DE RECHERCHE ET D'INNOVATION\nThibaut Cavalié\nYves-Marie Haussonne\nVincent Puig"; + "MICROSOFT :\nPierre-Louis Xech\n\nEFREI :\nSantiago Arias\nRiley Ikni\nJonathan Pamphile\n\nSTRATE COLLEGE :\nAnnabelle Eugénia\nHuieun Kim\nBaptiste Lanne\nIoana Ocnarescu\nVanessa Reiser\nDominique Sciamma\n\nINSTITUT DE RECHERCHE ET D'INNOVATION\nThibaut Cavalié\nYves-Marie Haussonne\nVincent Puig"; } #endregion @@ -642,11 +642,11 @@ new XAttribute("date", DateTime.Now.Day.ToString() + "/" + DateTime.Now.Month.ToString() + "/" + DateTime.Now.Year.ToString()), new XAttribute("color", "0x" + annot.Color.ToString().Substring(3)), // Color.ToString() return #AARRGGBB and we keep only 0xRRGGBB new XAttribute("src", ""), - new XElement("title", annot.GestureType), + new XElement("title", String.Join(",", annot.GestureType.ToArray())), new XElement("abstract"), new XElement("audio"), new XElement("tags"), - new XElement("gestureType", annot.GestureType))); + new XElement("gestureType", String.Join(",", annot.GestureType.ToArray())))); } annotContent.Add(cutNode); }