src/FingersDance.Control.TimeLine/UserControlTimeLine.xaml.cs
changeset 194 d96cd2bce653
parent 192 11083c390ce4
child 195 48b3139bb182
equal deleted inserted replaced
193:96374d03e714 194:d96cd2bce653
   291             if (annotOk)
   291             if (annotOk)
   292                 OnSuccessAnnotation(this, new EventArgs());
   292                 OnSuccessAnnotation(this, new EventArgs());
   293 
   293 
   294         }
   294         }
   295 
   295 
   296         public void startOrEndAnnotation()
   296         public void startOrEndAnnotation(String gestureType)
   297         {
   297         {
   298             Boolean annotOk = true;
   298             Boolean annotOk = true;
   299             // We open a new annotation
   299             // We open a new annotation
   300             if (cut != null && AnnotWaiting == false)
   300             if (cut != null && AnnotWaiting == false)
   301             {
   301             {
   311                     }
   311                     }
   312                 }
   312                 }
   313                 // if not, we mark the beginning
   313                 // if not, we mark the beginning
   314                 if (annotOk == true)
   314                 if (annotOk == true)
   315                 {
   315                 {
   316                     cut.AnnotList.Add(new Annotation("s_" + System.Guid.NewGuid(), AnnotTcBegin, 0, cut.AnnotList.Count.ToString(), CurrentColor));
   316                     cut.AnnotList.Add(new Annotation("s_" + System.Guid.NewGuid(), AnnotTcBegin, 0, gestureType, CurrentColor));
   317                     tv.DataContext = new CuttingViewModel(cut, AnnotWidth, tv.ScaleX);
   317                     tv.DataContext = new CuttingViewModel(cut, AnnotWidth, tv.ScaleX);
   318                     AnnotWaiting = true;
   318                     AnnotWaiting = true;
   319                 }
   319                 }
   320             }
   320             }
   321             // We close the current opened annotation...
   321             // We close the current opened annotation...
   336                 }
   336                 }
   337 
   337 
   338                 if (annotOk == true)
   338                 if (annotOk == true)
   339                 {
   339                 {
   340                     cut.AnnotList.RemoveAt(cut.AnnotList.Count - 1);
   340                     cut.AnnotList.RemoveAt(cut.AnnotList.Count - 1);
   341                     cut.AnnotList.Add(new Annotation("s_" + System.Guid.NewGuid(), AnnotTcBegin, currentDuration, cut.AnnotList.Count.ToString(), CurrentColor));
   341                     cut.AnnotList.Add(new Annotation("s_" + System.Guid.NewGuid(), AnnotTcBegin, currentDuration, gestureType, CurrentColor));
   342                     //Console.WriteLine("currentTimecode = " + AnnotTcBegin + ", curDur = " + currentDuration + ", nb = " + cut.AnnotList.Count + ", res = " + (AnnotTcBegin - (cut.AnnotList.Count * AnnotWidth)));
   342                     //Console.WriteLine("currentTimecode = " + AnnotTcBegin + ", curDur = " + currentDuration + ", nb = " + cut.AnnotList.Count + ", res = " + (AnnotTcBegin - (cut.AnnotList.Count * AnnotWidth)));
   343                     tv.DataContext = new CuttingViewModel(cut, AnnotWidth, tv.ScaleX);
   343                     tv.DataContext = new CuttingViewModel(cut, AnnotWidth, tv.ScaleX);
   344                     AnnotWaiting = false;
   344                     AnnotWaiting = false;
   345                 }
   345                 }
   346                 //Raise Event to display Annotation in all Openned UserPanels
   346                 //Raise Event to display Annotation in all Openned UserPanels