--- a/client/src/Iri.Modernisation.Controls/ViewModel/BookTimeLine/BookTimeLineVM.cs Wed Dec 16 17:14:38 2009 +0100
+++ b/client/src/Iri.Modernisation.Controls/ViewModel/BookTimeLine/BookTimeLineVM.cs Fri Dec 18 16:45:30 2009 +0100
@@ -19,10 +19,11 @@
/// </summary>
public class BookTimeLineVM : BaseMVVM.ViewModel.ViewModel
{
+
+ private VideoBook _selectedBook;
/// <summary>
/// Livre sélectionné
/// </summary>
- private VideoBook _selectedBook;
public VideoBook SelectedBook
{
get
@@ -32,20 +33,21 @@
}
/// <summary>
- ///
+ /// Nom de l'auteur
/// </summary>
public String AuthorFullname
{
get
{
- return Author.FirstName + " " + Author.Name;
+ return Author.UserName;
}
}
+
+ private String _title;
/// <summary>
/// Titre du Livre
/// </summary>
- private String _title;
public String Title
{
get
@@ -60,10 +62,11 @@
}
}
+
+ private User _author;
/// <summary>
/// Auteur du Livre
/// </summary>
- private User _author;
public User Author
{
get
@@ -79,10 +82,10 @@
}
+ private VideoChapter[] _chapters;
/// <summary>
/// Chapitre du Livre
/// </summary>
- private VideoChapter[] _chapters;
public VideoChapter[] Chapters
{
get
@@ -97,10 +100,11 @@
}
}
+
+ private List<SegmentIndex>[] _segmentIndex=new List<SegmentIndex>[4];
/// <summary>
/// Liste des Index des Chapitres
/// </summary>
- private List<SegmentIndex>[] _segmentIndex=new List<SegmentIndex>[4];
public List<SegmentIndex>[] SegmentIndex
{
get
@@ -114,10 +118,11 @@
}
}
+
+ private List<Annotation>[] _annotations=new List<Annotation>[4];
/// <summary>
/// Liste des Annotations
/// </summary>
- private List<Annotation>[] _annotations=new List<Annotation>[4];
public List<Annotation>[] Annotations
{
get
@@ -131,10 +136,11 @@
}
}
+
+ private TimeSpan _totalDuration;
/// <summary>
/// Durée totale du Livre
/// </summary>
- private TimeSpan _totalDuration;
public double TotalDuration
{
get
@@ -149,55 +155,11 @@
}
}
- private List<int> _polemicSpectrumData = new List<int>();
- public List<int> PolemicSpectrumData
- {
- get
- {
- return _polemicSpectrumData;
- }
- }
-
- private List<int> _adhesionSpectrumData = new List<int>();
- public List<int> AdhesionSpectrumData
- {
- get
- {
- return _adhesionSpectrumData;
- }
- }
-
- private List<int> _referenceSpectrumData = new List<int>();
- public List<int> ReferenceSpectrumData
- {
- get
- {
- return _referenceSpectrumData;
- }
- }
-
- private List<int> _questionSpectrumData = new List<int>();
- public List<int> QuestionSpectrumData
- {
- get
- {
- return _questionSpectrumData;
- }
- }
-
- private List<int> _generalSpectrumData = new List<int>();
- public List<int> GeneralSpectrumData
- {
- get
- {
- return _generalSpectrumData;
- }
- }
-
+
+ private double _position;
/// <summary>
/// Position du curseur de lecture
/// </summary>
- private double _position;
public double Position
{
get
@@ -211,53 +173,7 @@
}
}
- /// <summary>
- /// Chargement des données et annalyse
- /// </summary>
- private void LoadData()
- {
- if (_selectedBook.Duration != TimeSpan.Zero)
- {
-
- for (double i = 0; i <= _selectedBook.Duration.TotalMilliseconds; i = (i + _selectedBook.Duration.TotalMilliseconds / 150))
- {
- int[] Tem = new int[4]{0,0,0,0};
- foreach (VideoChapter Ch in _selectedBook.Chapters)
- {
- foreach (Annotation An in Ch.Annotations)
- {
- if (An.TimerIn.TotalMilliseconds <= i && An.TimerOut.TotalMilliseconds >= i)
- {
- switch (An.Type)
- {
- case PolemicElementType.Polemic:
- Tem[0]++;
- break;
- case PolemicElementType.Adhesion:
- Tem[1]++;
- break;
- case PolemicElementType.Reference:
- Tem[2]++;
- break;
- case PolemicElementType.Question:
- Tem[3]++;
- break;
- default:
- break;
- }
- }
- }
- }
- _polemicSpectrumData.Add(Tem[0]);
- _adhesionSpectrumData.Add(Tem[1]);
- _referenceSpectrumData.Add(Tem[2]);
- _questionSpectrumData.Add(Tem[3]);
- _generalSpectrumData.Add((Tem[0]+Tem[1]+Tem[2]+Tem[3]));
- }
- }
-
-
- }
+
/// <summary>
/// Constructeur
@@ -270,12 +186,15 @@
_author = bookParam.Author;
_chapters = bookParam.Chapters;
_totalDuration = bookParam.Duration;
- LoadData();
LoadElements();
Commands.TimeChange.Executed += new EventHandler<SLExtensions.Input.ExecutedEventArgs>(TimeChange_Executed);
}
+
private VideoViewerVM _videoViewerVM;
+ /// <summary>
+ /// ViewModel de VideoViewer
+ /// </summary>
public VideoViewerVM ViewModelVideoViewer
{
get
@@ -288,17 +207,12 @@
OnPropertyChanged("ViewModelVideoViewer");
}
}
- void TimeChange_Executed(object sender, SLExtensions.Input.ExecutedEventArgs e)
+ private void TimeChange_Executed(object sender, SLExtensions.Input.ExecutedEventArgs e)
{
- // Position = ((Slider)e.Parameter).Value;
- // Commands.VideoViewer.Pause.Execute();
if(e.Source == this)
{
ViewModelVideoViewer.GoTo(TimeSpan.FromMilliseconds(((double)e.Parameter)));
}
- //Commands.GoToTime.Execute(((Slider)e.Parameter).Value);
-
- // Commands.VideoViewer.Play.Execute();
}