src/FingersDance.Control.TimeLine/UserControlTimeLine.xaml.cs
changeset 128 90c29e979ef4
parent 125 fab494cd9da7
child 129 1f37ef03ebee
--- a/src/FingersDance.Control.TimeLine/UserControlTimeLine.xaml.cs	Wed Sep 30 16:58:58 2009 +0200
+++ b/src/FingersDance.Control.TimeLine/UserControlTimeLine.xaml.cs	Fri Oct 02 18:49:07 2009 +0200
@@ -33,7 +33,7 @@
         private double totalmilliseconds;
 
         private List<Annotation> AnnotList = new List<Annotation>();
-        private float AnnotWidth = 40+1;
+        private float AnnotWidth = 300 + 15; // The surfaceListBox adds 15 pixels between each item
         private CuttingViewModel CuttingVM;
         private Boolean AnnotWaiting = false;
         private float AnnotTcBegin;
@@ -111,10 +111,10 @@
             // TEMP FOR DATA BINDING
             AnnotList = new List<Annotation>();
             AnnotList.Add(new Annotation(0, 10, "Axe Cam 1"));
-            //annotList.Add(new Annotation(20 - (1 * annotWidth), 30, "Mvt Cam 2"));
-            //annotList.Add(new Annotation(50 - (2 * annotWidth), 60, "Saut 3"));
-            //annotList.Add(new Annotation(100 - (3 * annotWidth), 20, "Saut 4"));
-            //annotList.Add(new Annotation(120 - (4 * annotWidth), 50, "Saut 5"));
+            //AnnotList.Add(new Annotation(100 - (1 * AnnotWidth), 70, "Mvt Cam 2"));
+            //AnnotList.Add(new Annotation(200 - (2 * AnnotWidth), 50, "Saut 3"));
+            //AnnotList.Add(new Annotation(100 - (3 * AnnotWidth), 20, "Saut 4"));
+            //AnnotList.Add(new Annotation(120 - (4 * AnnotWidth), 50, "Saut 5"));
             Cutting cut = new Cutting("titre de cutting", AnnotList);
             CuttingVM = new CuttingViewModel(cut);
             tv.DataContext = CuttingVM;
@@ -171,8 +171,7 @@
 
         #endregion
 
-        private void sliderPosition_DragStarted(
-            object sender, DragStartedEventArgs e)
+        private void sliderPosition_DragStarted(object sender, DragStartedEventArgs e)
         {
             isDragging = true;
             OnDragStarted();
@@ -208,6 +207,8 @@
             {
                 AnnotTcBegin = (float)slider.Value;
                 lastAnnotVM = new AnnotationViewModel(new Annotation((AnnotTcBegin / 1000) - (CuttingVM.AnnotList.Count * AnnotWidth), 0, CuttingVM.AnnotList.Count.ToString()));
+                //lastAnnotVM = new AnnotationViewModel(new Annotation((AnnotTcBegin / 1000), 0, CuttingVM.AnnotList.Count.ToString()));
+                //lastAnnotVM = new AnnotationViewModel(new Annotation(0, 0, CuttingVM.AnnotList.Count.ToString()));
                 CuttingVM.AnnotList.Add(lastAnnotVM);
                 Console.WriteLine("BEGIN currentTimecode = " + (AnnotTcBegin / 1000) + ", nb = " + CuttingVM.AnnotList.Count + ", res = " + ((AnnotTcBegin / 1000) - (CuttingVM.AnnotList.Count * AnnotWidth)));
                 tv.DataContext = null;
@@ -221,6 +222,8 @@
                 float currentDuration = ((float)slider.Value - AnnotTcBegin) / 1000;
                 CuttingVM.AnnotList.RemoveAt(CuttingVM.AnnotList.Count - 1);
                 CuttingVM.AnnotList.Add(new AnnotationViewModel(new Annotation((AnnotTcBegin / 1000) - (CuttingVM.AnnotList.Count * AnnotWidth), currentDuration, CuttingVM.AnnotList.Count.ToString())));
+                //CuttingVM.AnnotList.Add(new AnnotationViewModel(new Annotation((AnnotTcBegin / 1000), currentDuration, CuttingVM.AnnotList.Count.ToString())));
+                //CuttingVM.AnnotList.Add(new AnnotationViewModel(new Annotation(0, currentDuration, CuttingVM.AnnotList.Count.ToString())));
                 Console.WriteLine("currentTimecode = " + (AnnotTcBegin / 1000) + ", curDur = " + currentDuration + ", nb = " + CuttingVM.AnnotList.Count + ", res = " + ((AnnotTcBegin / 1000) - (CuttingVM.AnnotList.Count * AnnotWidth)));
                 tv.DataContext = null;
                 tv.DataContext = CuttingVM;