client/src/Iri.Modernisation.Controls/ViewModel/ProductionTimeLine/ProductionTimeLineVM.cs
changeset 35 43bb1b8ed555
parent 27 f292db96b050
child 36 b6df6fce6e5d
equal deleted inserted replaced
34:4d9ebc6fbbe8 35:43bb1b8ed555
    12 using Iri.Modernisation.BaseMVVM.Commands;
    12 using Iri.Modernisation.BaseMVVM.Commands;
    13 using Iri.Modernisation.BaseMVVM.ViewModel;
    13 using Iri.Modernisation.BaseMVVM.ViewModel;
    14 using Iri.Modernisation.Controls.View;
    14 using Iri.Modernisation.Controls.View;
    15 using System.Collections.Generic;
    15 using System.Collections.Generic;
    16 using System.Collections.ObjectModel;
    16 using System.Collections.ObjectModel;
    17 
    17 using Iri.Modernisation.Data.LDTClass;
    18 namespace Iri.Modernisation.Controls.ViewModel
    18 namespace Iri.Modernisation.Controls.ViewModel
    19 {
    19 {
    20     /// <summary>
    20     /// <summary>
    21     /// ViewModel de la ProductionTimeLine
    21     /// ViewModel de la ProductionTimeLine
    22     /// </summary>
    22     /// </summary>
   264             Commands.ProductionView.DelVideoSequence.Executed += new EventHandler<SLExtensions.Input.ExecutedEventArgs>(DelVideoSequence_Executed);
   264             Commands.ProductionView.DelVideoSequence.Executed += new EventHandler<SLExtensions.Input.ExecutedEventArgs>(DelVideoSequence_Executed);
   265             Commands.ProductionTimeLine.EditorPartSelected.Executed += new EventHandler<SLExtensions.Input.ExecutedEventArgs>(EditorPartSelected_Executed);
   265             Commands.ProductionTimeLine.EditorPartSelected.Executed += new EventHandler<SLExtensions.Input.ExecutedEventArgs>(EditorPartSelected_Executed);
   266             Commands.ProductionTimeLine.EditorPartFinished.Executed += new EventHandler<SLExtensions.Input.ExecutedEventArgs>(EditorPartFinished_Executed);
   266             Commands.ProductionTimeLine.EditorPartFinished.Executed += new EventHandler<SLExtensions.Input.ExecutedEventArgs>(EditorPartFinished_Executed);
   267             Commands.ProductionView.ClickAddIndex.Executed += new EventHandler<SLExtensions.Input.ExecutedEventArgs>(ClickAddIndex_Executed);
   267             Commands.ProductionView.ClickAddIndex.Executed += new EventHandler<SLExtensions.Input.ExecutedEventArgs>(ClickAddIndex_Executed);
   268             Commands.TimeChange.Executed += new EventHandler<SLExtensions.Input.ExecutedEventArgs>(TimeChange_Executed);
   268             Commands.TimeChange.Executed += new EventHandler<SLExtensions.Input.ExecutedEventArgs>(TimeChange_Executed);
   269             #endregion
   269            #endregion
   270 
   270 
   271 
   271 
   272             #region VideoSequences CollectionChanged
   272             #region VideoSequences CollectionChanged
   273             foreach (ObservableCollection<VideoSequence> Ocvs in _listVideoSequences)
   273             foreach (ObservableCollection<VideoSequence> Ocvs in _listVideoSequences)
   274             {
   274             {
   281             {
   281             {
   282                 Ocsi.CollectionChanged += new System.Collections.Specialized.NotifyCollectionChangedEventHandler(SelectedVideoSequences_CollectionChanged);
   282                 Ocsi.CollectionChanged += new System.Collections.Specialized.NotifyCollectionChangedEventHandler(SelectedVideoSequences_CollectionChanged);
   283             }
   283             }
   284             #endregion
   284             #endregion
   285         }
   285         }
       
   286 
       
   287        
   286         public ProductionTimeLineVM()
   288         public ProductionTimeLineVM()
   287         {
   289         {
   288             _newBook = new VideoBook();
   290             _newBook = new VideoBook();
   289  
   291  
   290             _listVideoSequences = new ObservableCollection<VideoSequence>[FactoryVideoLivre.NumberOfChapters];
   292             _listVideoSequences = new ObservableCollection<VideoSequence>[FactoryVideoLivre.NumberOfChapters];
   313                     foreach (VideoSequence Vs in TimeLine)
   315                     foreach (VideoSequence Vs in TimeLine)
   314                     {
   316                     {
   315                         if (Vs.TimerIn.TotalMilliseconds <= newValue && Vs.TimerOut.TotalMilliseconds > newValue)
   317                         if (Vs.TimerIn.TotalMilliseconds <= newValue && Vs.TimerOut.TotalMilliseconds > newValue)
   316                         {
   318                         {
   317                             ActualVideoSequence = Vs;
   319                             ActualVideoSequence = Vs;
   318                             ViewModelVideoViewer.Source = ActualVideoSequence.Path;
   320                             ViewModelVideoViewer.Source = ActualVideoSequence.Path;                  
   319                             ViewModelVideoViewer.GoTo(TimeSpan.FromMilliseconds(newValue) - Vs.TimerIn +Vs.BeginTrim);
   321                             ViewModelVideoViewer.GoTo(TimeSpan.FromMilliseconds(newValue) - Vs.TimerIn +Vs.BeginTrim);
       
   322 
   320                         }
   323                         }
   321                     }
   324                     }
   322                 }
   325                 }
   323                 else
   326                 else
   324                 {
   327                 {