diff -r beb938b4fb76 -r bd33267300aa client/src/Iri.Modernisation.Controls/ViewModel/BookTimeLine/BookTimeLineVM.cs
--- a/client/src/Iri.Modernisation.Controls/ViewModel/BookTimeLine/BookTimeLineVM.cs Wed Jan 27 10:55:59 2010 +0100
+++ b/client/src/Iri.Modernisation.Controls/ViewModel/BookTimeLine/BookTimeLineVM.cs Thu Feb 04 16:38:04 2010 +0100
@@ -12,6 +12,7 @@
using Iri.Modernisation.BaseMVVM.Commands;
using Iri.Modernisation.BaseMVVM.ViewModel;
using System.Collections.Generic;
+using System.IO;
namespace Iri.Modernisation.Controls.ViewModel
{
///
@@ -19,7 +20,7 @@
///
public class BookTimeLineVM : BaseMVVM.ViewModel.ViewModel
{
-
+ static public double ratioPixMs = 6000;
private VideoBook _selectedBook;
///
/// Livre sélectionné
@@ -100,8 +101,8 @@
}
}
-
- private List[] _segmentIndex=new List[4];
+
+ private List[] _segmentIndex;
///
/// Liste des Index des Chapitres
///
@@ -118,8 +119,8 @@
}
}
-
- private List[] _annotations=new List[4];
+
+ private List[] _annotations;
///
/// Liste des Annotations
///
@@ -181,16 +182,45 @@
/// VideoLivre à étudier
public BookTimeLineVM(VideoBook bookParam)
{
+ ScaleValue = 1;
_selectedBook = bookParam;
_title = bookParam.Title;
_author = bookParam.Author;
_chapters = bookParam.Chapters;
_totalDuration = bookParam.Duration;
+ _segmentIndex = new List[bookParam.Chapters.Length];
+ _annotations = new List[bookParam.Chapters.Length];
LoadElements();
Commands.TimeChange.Executed += new EventHandler(TimeChange_Executed);
+ Commands.BookTimeLine.SaveAnnotations.Executed += new EventHandler(SaveAnnotations_Executed);
}
+ void SaveAnnotations_Executed(object sender, SLExtensions.Input.ExecutedEventArgs e)
+ {
+
+ }
+ private double _scaleValue;
+ public double ScaleValue
+ {
+ get
+ {
+ return _scaleValue;
+ }
+ set
+ {
+ _scaleValue = value;
+ OnPropertyChanged("ScaleValue");
+ OnPropertyChanged("WidthTimeStrip");
+ }
+ }
+ public double WidthTimeStrip
+ {
+ get
+ {
+ return (_selectedBook.Duration.TotalMilliseconds / BookTimeLineVM.ratioPixMs) * ScaleValue;
+ }
+ }
private VideoViewerVM _videoViewerVM;
///
/// ViewModel de VideoViewer
@@ -224,7 +254,10 @@
for(int key=0;key< _selectedBook.Chapters.Length;key++)
{
_segmentIndex[key] = _selectedBook.Chapters[key].Index;
- _annotations[key] = _selectedBook.Chapters[key].Annotations;
+ if (_selectedBook.Chapters[key].Annotations != null)
+ {
+ _annotations[key] = _selectedBook.Chapters[key].Annotations;
+ }
}
}