diff -r c031f1132dde -r a9c815025a1b client/src/Iri.Modernisation.Controls/ViewModel/ProductionTimeLine/ProductionTimeLineVM.cs --- a/client/src/Iri.Modernisation.Controls/ViewModel/ProductionTimeLine/ProductionTimeLineVM.cs Wed Dec 16 17:14:38 2009 +0100 +++ b/client/src/Iri.Modernisation.Controls/ViewModel/ProductionTimeLine/ProductionTimeLineVM.cs Fri Dec 18 16:45:30 2009 +0100 @@ -17,11 +17,17 @@ namespace Iri.Modernisation.Controls.ViewModel { + /// + /// ViewModel de la ProductionTimeLine + /// public class ProductionTimeLineVM : BaseMVVM.ViewModel.ViewModel { - private bool _isIndexing; + + /// + /// Mode Indexation + /// public bool IsIndexing { get @@ -37,6 +43,10 @@ private VideoBook _newBook; private ObservableCollection[] _listVideoSequences = new ObservableCollection[4]; + + /// + /// Ensembles des VideoSequences par Chapitre + /// public ObservableCollection[] ListVideoSequences { get @@ -50,6 +60,9 @@ } } + /// + /// VideoSequences du Chapitre en cours + /// public ObservableCollection SelectedVideoSequences { get @@ -64,6 +77,10 @@ OnPropertyChanged("SelectedVideoSequences"); } } + + /// + /// Durée Total du livre + /// public TimeSpan TotalBookDuration { get @@ -79,6 +96,10 @@ return temp; } } + + /// + /// Chapitres + /// public VideoChapter[] Chapters { get @@ -88,6 +109,10 @@ } + + /// + /// Chapites Courant + /// public VideoChapter SelectedBookChapter { get @@ -98,6 +123,9 @@ private VideoSequence _actualVideoSequence; + /// + /// VideoSequence en lecture sur le Master + /// public VideoSequence ActualVideoSequence { get @@ -111,7 +139,9 @@ } } - + /// + /// Ensemble des VideoSequences + /// public List TimeLine { get @@ -146,7 +176,11 @@ OnPropertyChanged("SelectedChapter"); } } + private VideoViewerVM _videoViewerVM; + /// + /// ViewModel du Master + /// public VideoViewerVM ViewModelVideoViewer { get @@ -161,6 +195,9 @@ } private double _position; + /// + /// Position Actuelle de lecture + /// public double Position { get @@ -176,6 +213,9 @@ } private ObservableCollection[] _listSegmentIndex; + /// + /// Ensemble des Index par Chapitre + /// public ObservableCollection[] ListIndex { get @@ -183,6 +223,9 @@ return _listSegmentIndex; } } + /// + /// Index du Chapitre en cours + /// public ObservableCollection SelectedIndex { get @@ -198,6 +241,10 @@ } private VideoChapterType _selectedChapterType; + + /// + /// Chapitre en cours + /// public VideoChapterType SelectedChapterType { get @@ -210,8 +257,31 @@ OnPropertyChanged("SelectedChapterType"); } } - - + + private void InitializeCommands() + { + #region Commands + Commands.ProductionView.DelVideoSequence.Executed += new EventHandler(DelVideoSequence_Executed); + Commands.ProductionTimeLine.EditorPartSelected.Executed += new EventHandler(EditorPartSelected_Executed); + Commands.ProductionTimeLine.EditorPartFinished.Executed += new EventHandler(EditorPartFinished_Executed); + Commands.ProductionView.ClickAddIndex.Executed += new EventHandler(ClickAddIndex_Executed); + Commands.TimeChange.Executed += new EventHandler(TimeChange_Executed); + #endregion + + #region VideoSequences CollectionChanged + _listVideoSequences[0].CollectionChanged += new System.Collections.Specialized.NotifyCollectionChangedEventHandler(SelectedVideoSequences_CollectionChanged); + _listVideoSequences[1].CollectionChanged += new System.Collections.Specialized.NotifyCollectionChangedEventHandler(SelectedVideoSequences_CollectionChanged); + _listVideoSequences[2].CollectionChanged += new System.Collections.Specialized.NotifyCollectionChangedEventHandler(SelectedVideoSequences_CollectionChanged); + _listVideoSequences[3].CollectionChanged += new System.Collections.Specialized.NotifyCollectionChangedEventHandler(SelectedVideoSequences_CollectionChanged); + #endregion + + #region SegmentIndex CollectionChanged + _listSegmentIndex[0].CollectionChanged += new System.Collections.Specialized.NotifyCollectionChangedEventHandler(SelectedVideoSequences_CollectionChanged); + _listSegmentIndex[1].CollectionChanged += new System.Collections.Specialized.NotifyCollectionChangedEventHandler(SelectedVideoSequences_CollectionChanged); + _listSegmentIndex[2].CollectionChanged += new System.Collections.Specialized.NotifyCollectionChangedEventHandler(SelectedVideoSequences_CollectionChanged); + _listSegmentIndex[3].CollectionChanged += new System.Collections.Specialized.NotifyCollectionChangedEventHandler(SelectedVideoSequences_CollectionChanged); + #endregion + } public ProductionTimeLineVM() { _newBook = new VideoBook(); @@ -222,18 +292,6 @@ new ObservableCollection(), new ObservableCollection() }; - // PropertyChanged += new System.ComponentModel.PropertyChangedEventHandler(ProductionTimeLineVM_PropertyChanged); - // SelectedVideoSequences = new ObservableCollection(); - Commands.ProductionView.DelVideoSequence.Executed += new EventHandler(DelVideoSequence_Executed); - Commands.ProductionTimeLine.EditorPartSelected.Executed += new EventHandler(EditorPartSelected_Executed); - Commands.ProductionTimeLine.EditorPartFinished.Executed += new EventHandler(EditorPartFinished_Executed); - Commands.ProductionView.ClickAddIndex.Executed += new EventHandler(ClickAddIndex_Executed); - Commands.TimeChange.Executed += new EventHandler(TimeChange_Executed); - _listVideoSequences[0].CollectionChanged += new System.Collections.Specialized.NotifyCollectionChangedEventHandler(SelectedVideoSequences_CollectionChanged); - _listVideoSequences[1].CollectionChanged += new System.Collections.Specialized.NotifyCollectionChangedEventHandler(SelectedVideoSequences_CollectionChanged); - _listVideoSequences[2].CollectionChanged += new System.Collections.Specialized.NotifyCollectionChangedEventHandler(SelectedVideoSequences_CollectionChanged); - _listVideoSequences[3].CollectionChanged += new System.Collections.Specialized.NotifyCollectionChangedEventHandler(SelectedVideoSequences_CollectionChanged); - _listSegmentIndex = new ObservableCollection[4] { new ObservableCollection(), @@ -241,13 +299,13 @@ new ObservableCollection(), new ObservableCollection() }; - _listSegmentIndex[0].CollectionChanged += new System.Collections.Specialized.NotifyCollectionChangedEventHandler(SelectedVideoSequences_CollectionChanged); - _listSegmentIndex[1].CollectionChanged += new System.Collections.Specialized.NotifyCollectionChangedEventHandler(SelectedVideoSequences_CollectionChanged); - _listSegmentIndex[2].CollectionChanged += new System.Collections.Specialized.NotifyCollectionChangedEventHandler(SelectedVideoSequences_CollectionChanged); - _listSegmentIndex[3].CollectionChanged += new System.Collections.Specialized.NotifyCollectionChangedEventHandler(SelectedVideoSequences_CollectionChanged); + // PropertyChanged += new System.ComponentModel.PropertyChangedEventHandler(ProductionTimeLineVM_PropertyChanged); + // SelectedVideoSequences = new ObservableCollection(); + InitializeCommands(); } - void TimeChange_Executed(object sender, SLExtensions.Input.ExecutedEventArgs e) + + private void TimeChange_Executed(object sender, SLExtensions.Input.ExecutedEventArgs e) { double newValue = ((double)e.Parameter); if(e.Source == this) @@ -259,6 +317,7 @@ if (Vs.TimerIn.TotalMilliseconds <= newValue && Vs.TimerOut.TotalMilliseconds > newValue) { ActualVideoSequence = Vs; + ViewModelVideoViewer.Source = ActualVideoSequence.Path; ViewModelVideoViewer.GoTo(TimeSpan.FromMilliseconds(newValue) - Vs.TimerIn +Vs.BeginTrim); } } @@ -272,7 +331,7 @@ } } - void ClickAddIndex_Executed(object sender, SLExtensions.Input.ExecutedEventArgs e) + private void ClickAddIndex_Executed(object sender, SLExtensions.Input.ExecutedEventArgs e) { if(IsIndexing) { @@ -297,30 +356,25 @@ } - void DelVideoSequence_Executed(object sender, SLExtensions.Input.ExecutedEventArgs e) + private void DelVideoSequence_Executed(object sender, SLExtensions.Input.ExecutedEventArgs e) { SelectedVideoSequences.Remove(((CustomableVideoElementVM)e.Parameter).VideoSequence); OnPropertyChanged("TotalBookDuration"); } - void SelectedVideoSequences_CollectionChanged(object sender, System.Collections.Specialized.NotifyCollectionChangedEventArgs e) + private void SelectedVideoSequences_CollectionChanged(object sender, System.Collections.Specialized.NotifyCollectionChangedEventArgs e) { OnPropertyChanged("TotalBookDuration"); Commands.ProductionView.VideoRecordUpdated.Execute(); } - void ProductionTimeLineVM_PropertyChanged(object sender, System.ComponentModel.PropertyChangedEventArgs e) - { - //Commands.ProductionView.VideoRecordUpdated.Execute(); - } - - void EditorPartFinished_Executed(object sender, SLExtensions.Input.ExecutedEventArgs e) + private void EditorPartFinished_Executed(object sender, SLExtensions.Input.ExecutedEventArgs e) { SelectedChapter = -1; } - void EditorPartSelected_Executed(object sender, SLExtensions.Input.ExecutedEventArgs e) + private void EditorPartSelected_Executed(object sender, SLExtensions.Input.ExecutedEventArgs e) { SelectedChapter = (int)((HeaderProductionEventArgs)e.Source).ChapterType;