client/src/Iri.Modernisation.Controls/ViewModel/ProductionTimeLine/ProductionTimeLineVM.cs
author Matthieu Totet
Mon, 14 Dec 2009 17:02:03 +0100
changeset 23 10acb6a11a73
parent 20 c2dd8119a6c1
child 24 c031f1132dde
permissions -rw-r--r--
Update VideoViewer ( Allow Multi-VideoViewer)
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
0
249d70e7b32d Create Directories & Project
Matthieu Totet
parents:
diff changeset
     1
using System;
249d70e7b32d Create Directories & Project
Matthieu Totet
parents:
diff changeset
     2
using System.Net;
249d70e7b32d Create Directories & Project
Matthieu Totet
parents:
diff changeset
     3
using System.Windows;
249d70e7b32d Create Directories & Project
Matthieu Totet
parents:
diff changeset
     4
using System.Windows.Controls;
249d70e7b32d Create Directories & Project
Matthieu Totet
parents:
diff changeset
     5
using System.Windows.Documents;
249d70e7b32d Create Directories & Project
Matthieu Totet
parents:
diff changeset
     6
using System.Windows.Ink;
249d70e7b32d Create Directories & Project
Matthieu Totet
parents:
diff changeset
     7
using System.Windows.Input;
249d70e7b32d Create Directories & Project
Matthieu Totet
parents:
diff changeset
     8
using System.Windows.Media;
249d70e7b32d Create Directories & Project
Matthieu Totet
parents:
diff changeset
     9
using System.Windows.Media.Animation;
249d70e7b32d Create Directories & Project
Matthieu Totet
parents:
diff changeset
    10
using System.Windows.Shapes;
249d70e7b32d Create Directories & Project
Matthieu Totet
parents:
diff changeset
    11
using Iri.Modernisation.Data.Models;
249d70e7b32d Create Directories & Project
Matthieu Totet
parents:
diff changeset
    12
using Iri.Modernisation.BaseMVVM.Commands;
249d70e7b32d Create Directories & Project
Matthieu Totet
parents:
diff changeset
    13
using Iri.Modernisation.BaseMVVM.ViewModel;
17
0e4e63f6f567 Update ProductinoView and Components
Matthieu Totet
parents: 0
diff changeset
    14
using Iri.Modernisation.Controls.View;
0
249d70e7b32d Create Directories & Project
Matthieu Totet
parents:
diff changeset
    15
using System.Collections.Generic;
20
c2dd8119a6c1 Update ProductionView
Matthieu Totet
parents: 19
diff changeset
    16
using System.Collections.ObjectModel;
c2dd8119a6c1 Update ProductionView
Matthieu Totet
parents: 19
diff changeset
    17
0
249d70e7b32d Create Directories & Project
Matthieu Totet
parents:
diff changeset
    18
namespace Iri.Modernisation.Controls.ViewModel
249d70e7b32d Create Directories & Project
Matthieu Totet
parents:
diff changeset
    19
{
249d70e7b32d Create Directories & Project
Matthieu Totet
parents:
diff changeset
    20
    public class ProductionTimeLineVM : BaseMVVM.ViewModel.ViewModel
249d70e7b32d Create Directories & Project
Matthieu Totet
parents:
diff changeset
    21
    {
249d70e7b32d Create Directories & Project
Matthieu Totet
parents:
diff changeset
    22
17
0e4e63f6f567 Update ProductinoView and Components
Matthieu Totet
parents: 0
diff changeset
    23
0e4e63f6f567 Update ProductinoView and Components
Matthieu Totet
parents: 0
diff changeset
    24
        private bool _isIndexing;
0e4e63f6f567 Update ProductinoView and Components
Matthieu Totet
parents: 0
diff changeset
    25
        public bool IsIndexing
0e4e63f6f567 Update ProductinoView and Components
Matthieu Totet
parents: 0
diff changeset
    26
        {
0e4e63f6f567 Update ProductinoView and Components
Matthieu Totet
parents: 0
diff changeset
    27
            get
0e4e63f6f567 Update ProductinoView and Components
Matthieu Totet
parents: 0
diff changeset
    28
            {
0e4e63f6f567 Update ProductinoView and Components
Matthieu Totet
parents: 0
diff changeset
    29
                return _isIndexing;
0e4e63f6f567 Update ProductinoView and Components
Matthieu Totet
parents: 0
diff changeset
    30
            }
0e4e63f6f567 Update ProductinoView and Components
Matthieu Totet
parents: 0
diff changeset
    31
            set
0e4e63f6f567 Update ProductinoView and Components
Matthieu Totet
parents: 0
diff changeset
    32
            {
0e4e63f6f567 Update ProductinoView and Components
Matthieu Totet
parents: 0
diff changeset
    33
                _isIndexing = value;
0e4e63f6f567 Update ProductinoView and Components
Matthieu Totet
parents: 0
diff changeset
    34
                OnPropertyChanged("IsIndexing");
0e4e63f6f567 Update ProductinoView and Components
Matthieu Totet
parents: 0
diff changeset
    35
            }
0e4e63f6f567 Update ProductinoView and Components
Matthieu Totet
parents: 0
diff changeset
    36
        }
0
249d70e7b32d Create Directories & Project
Matthieu Totet
parents:
diff changeset
    37
249d70e7b32d Create Directories & Project
Matthieu Totet
parents:
diff changeset
    38
        private VideoBook _newBook;
19
7d044e7562ea Update ProductionView
Matthieu Totet
parents: 18
diff changeset
    39
        private ObservableCollection<VideoSequence>[] _listVideoSequences = new ObservableCollection<VideoSequence>[4];
7d044e7562ea Update ProductionView
Matthieu Totet
parents: 18
diff changeset
    40
        public ObservableCollection<VideoSequence>[] ListVideoSequences
0
249d70e7b32d Create Directories & Project
Matthieu Totet
parents:
diff changeset
    41
        {
249d70e7b32d Create Directories & Project
Matthieu Totet
parents:
diff changeset
    42
            get
249d70e7b32d Create Directories & Project
Matthieu Totet
parents:
diff changeset
    43
            {
19
7d044e7562ea Update ProductionView
Matthieu Totet
parents: 18
diff changeset
    44
                return _listVideoSequences;
7d044e7562ea Update ProductionView
Matthieu Totet
parents: 18
diff changeset
    45
            }
7d044e7562ea Update ProductionView
Matthieu Totet
parents: 18
diff changeset
    46
            set
7d044e7562ea Update ProductionView
Matthieu Totet
parents: 18
diff changeset
    47
            {
7d044e7562ea Update ProductionView
Matthieu Totet
parents: 18
diff changeset
    48
                _listVideoSequences = value;
7d044e7562ea Update ProductionView
Matthieu Totet
parents: 18
diff changeset
    49
                OnPropertyChanged("ListVideoSequences");
7d044e7562ea Update ProductionView
Matthieu Totet
parents: 18
diff changeset
    50
            }
7d044e7562ea Update ProductionView
Matthieu Totet
parents: 18
diff changeset
    51
        }
7d044e7562ea Update ProductionView
Matthieu Totet
parents: 18
diff changeset
    52
        
7d044e7562ea Update ProductionView
Matthieu Totet
parents: 18
diff changeset
    53
        public ObservableCollection<VideoSequence> SelectedVideoSequences
7d044e7562ea Update ProductionView
Matthieu Totet
parents: 18
diff changeset
    54
        {
7d044e7562ea Update ProductionView
Matthieu Totet
parents: 18
diff changeset
    55
            get
7d044e7562ea Update ProductionView
Matthieu Totet
parents: 18
diff changeset
    56
            {
7d044e7562ea Update ProductionView
Matthieu Totet
parents: 18
diff changeset
    57
                
0
249d70e7b32d Create Directories & Project
Matthieu Totet
parents:
diff changeset
    58
                return _listVideoSequences[SelectedChapter];
249d70e7b32d Create Directories & Project
Matthieu Totet
parents:
diff changeset
    59
            }
249d70e7b32d Create Directories & Project
Matthieu Totet
parents:
diff changeset
    60
            set
249d70e7b32d Create Directories & Project
Matthieu Totet
parents:
diff changeset
    61
            {
249d70e7b32d Create Directories & Project
Matthieu Totet
parents:
diff changeset
    62
                _listVideoSequences[SelectedChapter] = value;
19
7d044e7562ea Update ProductionView
Matthieu Totet
parents: 18
diff changeset
    63
                //_newBook.Chapters[SelectedChapter].VideoSequences = value;
0
249d70e7b32d Create Directories & Project
Matthieu Totet
parents:
diff changeset
    64
                OnPropertyChanged("SelectedVideoSequences");
249d70e7b32d Create Directories & Project
Matthieu Totet
parents:
diff changeset
    65
            }
249d70e7b32d Create Directories & Project
Matthieu Totet
parents:
diff changeset
    66
        }
23
10acb6a11a73 Update VideoViewer ( Allow Multi-VideoViewer)
Matthieu Totet
parents: 20
diff changeset
    67
        public TimeSpan TotalBookDuration
10acb6a11a73 Update VideoViewer ( Allow Multi-VideoViewer)
Matthieu Totet
parents: 20
diff changeset
    68
        {
10acb6a11a73 Update VideoViewer ( Allow Multi-VideoViewer)
Matthieu Totet
parents: 20
diff changeset
    69
            get
10acb6a11a73 Update VideoViewer ( Allow Multi-VideoViewer)
Matthieu Totet
parents: 20
diff changeset
    70
            {
10acb6a11a73 Update VideoViewer ( Allow Multi-VideoViewer)
Matthieu Totet
parents: 20
diff changeset
    71
                TimeSpan temp = TimeSpan.Zero;
10acb6a11a73 Update VideoViewer ( Allow Multi-VideoViewer)
Matthieu Totet
parents: 20
diff changeset
    72
                foreach (ObservableCollection<VideoSequence> Ocvs in _listVideoSequences)
10acb6a11a73 Update VideoViewer ( Allow Multi-VideoViewer)
Matthieu Totet
parents: 20
diff changeset
    73
                {
10acb6a11a73 Update VideoViewer ( Allow Multi-VideoViewer)
Matthieu Totet
parents: 20
diff changeset
    74
                    foreach (VideoSequence Vs in Ocvs)
10acb6a11a73 Update VideoViewer ( Allow Multi-VideoViewer)
Matthieu Totet
parents: 20
diff changeset
    75
                    {
10acb6a11a73 Update VideoViewer ( Allow Multi-VideoViewer)
Matthieu Totet
parents: 20
diff changeset
    76
                        temp += Vs.Duration;
10acb6a11a73 Update VideoViewer ( Allow Multi-VideoViewer)
Matthieu Totet
parents: 20
diff changeset
    77
                    }
10acb6a11a73 Update VideoViewer ( Allow Multi-VideoViewer)
Matthieu Totet
parents: 20
diff changeset
    78
                }
10acb6a11a73 Update VideoViewer ( Allow Multi-VideoViewer)
Matthieu Totet
parents: 20
diff changeset
    79
                return temp;
10acb6a11a73 Update VideoViewer ( Allow Multi-VideoViewer)
Matthieu Totet
parents: 20
diff changeset
    80
            }
10acb6a11a73 Update VideoViewer ( Allow Multi-VideoViewer)
Matthieu Totet
parents: 20
diff changeset
    81
        }
17
0e4e63f6f567 Update ProductinoView and Components
Matthieu Totet
parents: 0
diff changeset
    82
        public VideoChapter[] Chapters
0e4e63f6f567 Update ProductinoView and Components
Matthieu Totet
parents: 0
diff changeset
    83
        {
0e4e63f6f567 Update ProductinoView and Components
Matthieu Totet
parents: 0
diff changeset
    84
            get
0e4e63f6f567 Update ProductinoView and Components
Matthieu Totet
parents: 0
diff changeset
    85
            {
0e4e63f6f567 Update ProductinoView and Components
Matthieu Totet
parents: 0
diff changeset
    86
                return _newBook.Chapters;
0e4e63f6f567 Update ProductinoView and Components
Matthieu Totet
parents: 0
diff changeset
    87
            }
0e4e63f6f567 Update ProductinoView and Components
Matthieu Totet
parents: 0
diff changeset
    88
          
0e4e63f6f567 Update ProductinoView and Components
Matthieu Totet
parents: 0
diff changeset
    89
        
0e4e63f6f567 Update ProductinoView and Components
Matthieu Totet
parents: 0
diff changeset
    90
        }
0e4e63f6f567 Update ProductinoView and Components
Matthieu Totet
parents: 0
diff changeset
    91
        public VideoChapter SelectedBookChapter
0e4e63f6f567 Update ProductinoView and Components
Matthieu Totet
parents: 0
diff changeset
    92
        {
0e4e63f6f567 Update ProductinoView and Components
Matthieu Totet
parents: 0
diff changeset
    93
            get
0e4e63f6f567 Update ProductinoView and Components
Matthieu Totet
parents: 0
diff changeset
    94
            {
0e4e63f6f567 Update ProductinoView and Components
Matthieu Totet
parents: 0
diff changeset
    95
                return _newBook.Chapters[SelectedChapter];
0e4e63f6f567 Update ProductinoView and Components
Matthieu Totet
parents: 0
diff changeset
    96
            }
0e4e63f6f567 Update ProductinoView and Components
Matthieu Totet
parents: 0
diff changeset
    97
        }
0e4e63f6f567 Update ProductinoView and Components
Matthieu Totet
parents: 0
diff changeset
    98
0
249d70e7b32d Create Directories & Project
Matthieu Totet
parents:
diff changeset
    99
        private int _selectedChapter=0;
249d70e7b32d Create Directories & Project
Matthieu Totet
parents:
diff changeset
   100
        public int SelectedChapter
249d70e7b32d Create Directories & Project
Matthieu Totet
parents:
diff changeset
   101
        {
249d70e7b32d Create Directories & Project
Matthieu Totet
parents:
diff changeset
   102
            get
249d70e7b32d Create Directories & Project
Matthieu Totet
parents:
diff changeset
   103
            {
249d70e7b32d Create Directories & Project
Matthieu Totet
parents:
diff changeset
   104
                return _selectedChapter;
249d70e7b32d Create Directories & Project
Matthieu Totet
parents:
diff changeset
   105
            }
249d70e7b32d Create Directories & Project
Matthieu Totet
parents:
diff changeset
   106
            set
249d70e7b32d Create Directories & Project
Matthieu Totet
parents:
diff changeset
   107
            {
249d70e7b32d Create Directories & Project
Matthieu Totet
parents:
diff changeset
   108
                _selectedChapter = value;
249d70e7b32d Create Directories & Project
Matthieu Totet
parents:
diff changeset
   109
                OnPropertyChanged("SelectedChapter");
249d70e7b32d Create Directories & Project
Matthieu Totet
parents:
diff changeset
   110
            }
249d70e7b32d Create Directories & Project
Matthieu Totet
parents:
diff changeset
   111
        }
249d70e7b32d Create Directories & Project
Matthieu Totet
parents:
diff changeset
   112
20
c2dd8119a6c1 Update ProductionView
Matthieu Totet
parents: 19
diff changeset
   113
23
10acb6a11a73 Update VideoViewer ( Allow Multi-VideoViewer)
Matthieu Totet
parents: 20
diff changeset
   114
        private double _position;
10acb6a11a73 Update VideoViewer ( Allow Multi-VideoViewer)
Matthieu Totet
parents: 20
diff changeset
   115
        public double Position
10acb6a11a73 Update VideoViewer ( Allow Multi-VideoViewer)
Matthieu Totet
parents: 20
diff changeset
   116
        {
10acb6a11a73 Update VideoViewer ( Allow Multi-VideoViewer)
Matthieu Totet
parents: 20
diff changeset
   117
            get
10acb6a11a73 Update VideoViewer ( Allow Multi-VideoViewer)
Matthieu Totet
parents: 20
diff changeset
   118
            {
10acb6a11a73 Update VideoViewer ( Allow Multi-VideoViewer)
Matthieu Totet
parents: 20
diff changeset
   119
                return _position;
10acb6a11a73 Update VideoViewer ( Allow Multi-VideoViewer)
Matthieu Totet
parents: 20
diff changeset
   120
            }
10acb6a11a73 Update VideoViewer ( Allow Multi-VideoViewer)
Matthieu Totet
parents: 20
diff changeset
   121
            set
10acb6a11a73 Update VideoViewer ( Allow Multi-VideoViewer)
Matthieu Totet
parents: 20
diff changeset
   122
            {
10acb6a11a73 Update VideoViewer ( Allow Multi-VideoViewer)
Matthieu Totet
parents: 20
diff changeset
   123
                _position = value;
10acb6a11a73 Update VideoViewer ( Allow Multi-VideoViewer)
Matthieu Totet
parents: 20
diff changeset
   124
                OnPropertyChanged("Position");
10acb6a11a73 Update VideoViewer ( Allow Multi-VideoViewer)
Matthieu Totet
parents: 20
diff changeset
   125
            }
10acb6a11a73 Update VideoViewer ( Allow Multi-VideoViewer)
Matthieu Totet
parents: 20
diff changeset
   126
        }
20
c2dd8119a6c1 Update ProductionView
Matthieu Totet
parents: 19
diff changeset
   127
c2dd8119a6c1 Update ProductionView
Matthieu Totet
parents: 19
diff changeset
   128
        private ObservableCollection<SegmentIndex>[] _listSegmentIndex;
c2dd8119a6c1 Update ProductionView
Matthieu Totet
parents: 19
diff changeset
   129
        public ObservableCollection<SegmentIndex>[] ListIndex
c2dd8119a6c1 Update ProductionView
Matthieu Totet
parents: 19
diff changeset
   130
        {
c2dd8119a6c1 Update ProductionView
Matthieu Totet
parents: 19
diff changeset
   131
            get
c2dd8119a6c1 Update ProductionView
Matthieu Totet
parents: 19
diff changeset
   132
            {
c2dd8119a6c1 Update ProductionView
Matthieu Totet
parents: 19
diff changeset
   133
                return _listSegmentIndex;
c2dd8119a6c1 Update ProductionView
Matthieu Totet
parents: 19
diff changeset
   134
            }
c2dd8119a6c1 Update ProductionView
Matthieu Totet
parents: 19
diff changeset
   135
        }
c2dd8119a6c1 Update ProductionView
Matthieu Totet
parents: 19
diff changeset
   136
        public ObservableCollection<SegmentIndex> SelectedIndex
0
249d70e7b32d Create Directories & Project
Matthieu Totet
parents:
diff changeset
   137
        {
249d70e7b32d Create Directories & Project
Matthieu Totet
parents:
diff changeset
   138
            get
249d70e7b32d Create Directories & Project
Matthieu Totet
parents:
diff changeset
   139
            {
249d70e7b32d Create Directories & Project
Matthieu Totet
parents:
diff changeset
   140
                return _listSegmentIndex[SelectedChapter];
249d70e7b32d Create Directories & Project
Matthieu Totet
parents:
diff changeset
   141
            }
249d70e7b32d Create Directories & Project
Matthieu Totet
parents:
diff changeset
   142
            set
249d70e7b32d Create Directories & Project
Matthieu Totet
parents:
diff changeset
   143
            {
249d70e7b32d Create Directories & Project
Matthieu Totet
parents:
diff changeset
   144
                _listSegmentIndex[SelectedChapter] = value;
20
c2dd8119a6c1 Update ProductionView
Matthieu Totet
parents: 19
diff changeset
   145
                //_newBook.Chapters[SelectedChapter].Index = value;
0
249d70e7b32d Create Directories & Project
Matthieu Totet
parents:
diff changeset
   146
                OnPropertyChanged("SelectedIndex");
249d70e7b32d Create Directories & Project
Matthieu Totet
parents:
diff changeset
   147
            }
249d70e7b32d Create Directories & Project
Matthieu Totet
parents:
diff changeset
   148
        }
249d70e7b32d Create Directories & Project
Matthieu Totet
parents:
diff changeset
   149
17
0e4e63f6f567 Update ProductinoView and Components
Matthieu Totet
parents: 0
diff changeset
   150
        private VideoChapterType _selectedChapterType;
0e4e63f6f567 Update ProductinoView and Components
Matthieu Totet
parents: 0
diff changeset
   151
        public VideoChapterType SelectedChapterType
0e4e63f6f567 Update ProductinoView and Components
Matthieu Totet
parents: 0
diff changeset
   152
        {
0e4e63f6f567 Update ProductinoView and Components
Matthieu Totet
parents: 0
diff changeset
   153
            get
0e4e63f6f567 Update ProductinoView and Components
Matthieu Totet
parents: 0
diff changeset
   154
            {
0e4e63f6f567 Update ProductinoView and Components
Matthieu Totet
parents: 0
diff changeset
   155
                return _selectedChapterType;
0e4e63f6f567 Update ProductinoView and Components
Matthieu Totet
parents: 0
diff changeset
   156
            }
0e4e63f6f567 Update ProductinoView and Components
Matthieu Totet
parents: 0
diff changeset
   157
            set
0e4e63f6f567 Update ProductinoView and Components
Matthieu Totet
parents: 0
diff changeset
   158
            {
0e4e63f6f567 Update ProductinoView and Components
Matthieu Totet
parents: 0
diff changeset
   159
                _selectedChapterType = value;
0e4e63f6f567 Update ProductinoView and Components
Matthieu Totet
parents: 0
diff changeset
   160
                OnPropertyChanged("SelectedChapterType");
0e4e63f6f567 Update ProductinoView and Components
Matthieu Totet
parents: 0
diff changeset
   161
            }
0e4e63f6f567 Update ProductinoView and Components
Matthieu Totet
parents: 0
diff changeset
   162
        }
0e4e63f6f567 Update ProductinoView and Components
Matthieu Totet
parents: 0
diff changeset
   163
 
0e4e63f6f567 Update ProductinoView and Components
Matthieu Totet
parents: 0
diff changeset
   164
      
0
249d70e7b32d Create Directories & Project
Matthieu Totet
parents:
diff changeset
   165
        public ProductionTimeLineVM()
249d70e7b32d Create Directories & Project
Matthieu Totet
parents:
diff changeset
   166
        {
249d70e7b32d Create Directories & Project
Matthieu Totet
parents:
diff changeset
   167
            _newBook = new VideoBook();
19
7d044e7562ea Update ProductionView
Matthieu Totet
parents: 18
diff changeset
   168
            _listVideoSequences = new ObservableCollection<VideoSequence>[4]
7d044e7562ea Update ProductionView
Matthieu Totet
parents: 18
diff changeset
   169
            {
7d044e7562ea Update ProductionView
Matthieu Totet
parents: 18
diff changeset
   170
                new ObservableCollection<VideoSequence>(),
7d044e7562ea Update ProductionView
Matthieu Totet
parents: 18
diff changeset
   171
                new ObservableCollection<VideoSequence>(),
7d044e7562ea Update ProductionView
Matthieu Totet
parents: 18
diff changeset
   172
                new ObservableCollection<VideoSequence>(),
7d044e7562ea Update ProductionView
Matthieu Totet
parents: 18
diff changeset
   173
                new ObservableCollection<VideoSequence>()
7d044e7562ea Update ProductionView
Matthieu Totet
parents: 18
diff changeset
   174
            };
7d044e7562ea Update ProductionView
Matthieu Totet
parents: 18
diff changeset
   175
           // PropertyChanged += new System.ComponentModel.PropertyChangedEventHandler(ProductionTimeLineVM_PropertyChanged);
7d044e7562ea Update ProductionView
Matthieu Totet
parents: 18
diff changeset
   176
           // SelectedVideoSequences = new ObservableCollection<VideoSequence>();
20
c2dd8119a6c1 Update ProductionView
Matthieu Totet
parents: 19
diff changeset
   177
            Commands.ProductionView.DelVideoSequence.Executed += new EventHandler<SLExtensions.Input.ExecutedEventArgs>(DelVideoSequence_Executed);
17
0e4e63f6f567 Update ProductinoView and Components
Matthieu Totet
parents: 0
diff changeset
   178
            Commands.ProductionTimeLine.EditorPartSelected.Executed += new EventHandler<SLExtensions.Input.ExecutedEventArgs>(EditorPartSelected_Executed);
18
66911d0f0eb6 Update ProductionView
Matthieu Totet
parents: 17
diff changeset
   179
            Commands.ProductionTimeLine.EditorPartFinished.Executed += new EventHandler<SLExtensions.Input.ExecutedEventArgs>(EditorPartFinished_Executed);
20
c2dd8119a6c1 Update ProductionView
Matthieu Totet
parents: 19
diff changeset
   180
            Commands.ProductionView.ClickAddIndex.Executed += new EventHandler<SLExtensions.Input.ExecutedEventArgs>(ClickAddIndex_Executed);
19
7d044e7562ea Update ProductionView
Matthieu Totet
parents: 18
diff changeset
   181
            _listVideoSequences[0].CollectionChanged += new System.Collections.Specialized.NotifyCollectionChangedEventHandler(SelectedVideoSequences_CollectionChanged);
7d044e7562ea Update ProductionView
Matthieu Totet
parents: 18
diff changeset
   182
            _listVideoSequences[1].CollectionChanged += new System.Collections.Specialized.NotifyCollectionChangedEventHandler(SelectedVideoSequences_CollectionChanged);
7d044e7562ea Update ProductionView
Matthieu Totet
parents: 18
diff changeset
   183
            _listVideoSequences[2].CollectionChanged += new System.Collections.Specialized.NotifyCollectionChangedEventHandler(SelectedVideoSequences_CollectionChanged);
7d044e7562ea Update ProductionView
Matthieu Totet
parents: 18
diff changeset
   184
            _listVideoSequences[3].CollectionChanged += new System.Collections.Specialized.NotifyCollectionChangedEventHandler(SelectedVideoSequences_CollectionChanged);
20
c2dd8119a6c1 Update ProductionView
Matthieu Totet
parents: 19
diff changeset
   185
c2dd8119a6c1 Update ProductionView
Matthieu Totet
parents: 19
diff changeset
   186
            _listSegmentIndex = new ObservableCollection<SegmentIndex>[4]
c2dd8119a6c1 Update ProductionView
Matthieu Totet
parents: 19
diff changeset
   187
            {
c2dd8119a6c1 Update ProductionView
Matthieu Totet
parents: 19
diff changeset
   188
                new ObservableCollection<SegmentIndex>(),
c2dd8119a6c1 Update ProductionView
Matthieu Totet
parents: 19
diff changeset
   189
                new ObservableCollection<SegmentIndex>(),
c2dd8119a6c1 Update ProductionView
Matthieu Totet
parents: 19
diff changeset
   190
                new ObservableCollection<SegmentIndex>(),
c2dd8119a6c1 Update ProductionView
Matthieu Totet
parents: 19
diff changeset
   191
                new ObservableCollection<SegmentIndex>()
c2dd8119a6c1 Update ProductionView
Matthieu Totet
parents: 19
diff changeset
   192
            };
c2dd8119a6c1 Update ProductionView
Matthieu Totet
parents: 19
diff changeset
   193
            _listSegmentIndex[0].CollectionChanged += new System.Collections.Specialized.NotifyCollectionChangedEventHandler(SelectedVideoSequences_CollectionChanged);
c2dd8119a6c1 Update ProductionView
Matthieu Totet
parents: 19
diff changeset
   194
            _listSegmentIndex[1].CollectionChanged += new System.Collections.Specialized.NotifyCollectionChangedEventHandler(SelectedVideoSequences_CollectionChanged);
c2dd8119a6c1 Update ProductionView
Matthieu Totet
parents: 19
diff changeset
   195
            _listSegmentIndex[2].CollectionChanged += new System.Collections.Specialized.NotifyCollectionChangedEventHandler(SelectedVideoSequences_CollectionChanged);
c2dd8119a6c1 Update ProductionView
Matthieu Totet
parents: 19
diff changeset
   196
            _listSegmentIndex[3].CollectionChanged += new System.Collections.Specialized.NotifyCollectionChangedEventHandler(SelectedVideoSequences_CollectionChanged);
c2dd8119a6c1 Update ProductionView
Matthieu Totet
parents: 19
diff changeset
   197
        }
c2dd8119a6c1 Update ProductionView
Matthieu Totet
parents: 19
diff changeset
   198
c2dd8119a6c1 Update ProductionView
Matthieu Totet
parents: 19
diff changeset
   199
        void ClickAddIndex_Executed(object sender, SLExtensions.Input.ExecutedEventArgs e)
c2dd8119a6c1 Update ProductionView
Matthieu Totet
parents: 19
diff changeset
   200
        {
c2dd8119a6c1 Update ProductionView
Matthieu Totet
parents: 19
diff changeset
   201
            if(IsIndexing)
c2dd8119a6c1 Update ProductionView
Matthieu Totet
parents: 19
diff changeset
   202
            {
c2dd8119a6c1 Update ProductionView
Matthieu Totet
parents: 19
diff changeset
   203
                TimeSpan dur = TimeSpan.Zero;
c2dd8119a6c1 Update ProductionView
Matthieu Totet
parents: 19
diff changeset
   204
                // Permet de créer un Index avec une durée calé sur les videos.
c2dd8119a6c1 Update ProductionView
Matthieu Totet
parents: 19
diff changeset
   205
                foreach (VideoSequence Vs in SelectedVideoSequences)
c2dd8119a6c1 Update ProductionView
Matthieu Totet
parents: 19
diff changeset
   206
                {
c2dd8119a6c1 Update ProductionView
Matthieu Totet
parents: 19
diff changeset
   207
                    dur += Vs.Duration;
c2dd8119a6c1 Update ProductionView
Matthieu Totet
parents: 19
diff changeset
   208
                }
c2dd8119a6c1 Update ProductionView
Matthieu Totet
parents: 19
diff changeset
   209
                foreach (SegmentIndex Si in SelectedIndex)
c2dd8119a6c1 Update ProductionView
Matthieu Totet
parents: 19
diff changeset
   210
                {
c2dd8119a6c1 Update ProductionView
Matthieu Totet
parents: 19
diff changeset
   211
                    dur -= Si.Duration;
c2dd8119a6c1 Update ProductionView
Matthieu Totet
parents: 19
diff changeset
   212
                }
c2dd8119a6c1 Update ProductionView
Matthieu Totet
parents: 19
diff changeset
   213
                SelectedIndex.Add(new SegmentIndex(SelectedBookChapter) 
c2dd8119a6c1 Update ProductionView
Matthieu Totet
parents: 19
diff changeset
   214
                { 
c2dd8119a6c1 Update ProductionView
Matthieu Totet
parents: 19
diff changeset
   215
                    TimerIn = TimeSpan.Zero, 
c2dd8119a6c1 Update ProductionView
Matthieu Totet
parents: 19
diff changeset
   216
                    TimerOut = dur,
c2dd8119a6c1 Update ProductionView
Matthieu Totet
parents: 19
diff changeset
   217
                    Chapter = SelectedBookChapter
c2dd8119a6c1 Update ProductionView
Matthieu Totet
parents: 19
diff changeset
   218
                });
23
10acb6a11a73 Update VideoViewer ( Allow Multi-VideoViewer)
Matthieu Totet
parents: 20
diff changeset
   219
20
c2dd8119a6c1 Update ProductionView
Matthieu Totet
parents: 19
diff changeset
   220
            }
c2dd8119a6c1 Update ProductionView
Matthieu Totet
parents: 19
diff changeset
   221
 
c2dd8119a6c1 Update ProductionView
Matthieu Totet
parents: 19
diff changeset
   222
        }
c2dd8119a6c1 Update ProductionView
Matthieu Totet
parents: 19
diff changeset
   223
c2dd8119a6c1 Update ProductionView
Matthieu Totet
parents: 19
diff changeset
   224
        void DelVideoSequence_Executed(object sender, SLExtensions.Input.ExecutedEventArgs e)
c2dd8119a6c1 Update ProductionView
Matthieu Totet
parents: 19
diff changeset
   225
        {
c2dd8119a6c1 Update ProductionView
Matthieu Totet
parents: 19
diff changeset
   226
            SelectedVideoSequences.Remove(((CustomableVideoElementVM)e.Parameter).VideoSequence);
23
10acb6a11a73 Update VideoViewer ( Allow Multi-VideoViewer)
Matthieu Totet
parents: 20
diff changeset
   227
            OnPropertyChanged("TotalBookDuration");
19
7d044e7562ea Update ProductionView
Matthieu Totet
parents: 18
diff changeset
   228
        }
7d044e7562ea Update ProductionView
Matthieu Totet
parents: 18
diff changeset
   229
7d044e7562ea Update ProductionView
Matthieu Totet
parents: 18
diff changeset
   230
        void SelectedVideoSequences_CollectionChanged(object sender, System.Collections.Specialized.NotifyCollectionChangedEventArgs e)
7d044e7562ea Update ProductionView
Matthieu Totet
parents: 18
diff changeset
   231
        {
23
10acb6a11a73 Update VideoViewer ( Allow Multi-VideoViewer)
Matthieu Totet
parents: 20
diff changeset
   232
            OnPropertyChanged("TotalBookDuration");
19
7d044e7562ea Update ProductionView
Matthieu Totet
parents: 18
diff changeset
   233
            Commands.ProductionView.VideoRecordUpdated.Execute();
7d044e7562ea Update ProductionView
Matthieu Totet
parents: 18
diff changeset
   234
        }
7d044e7562ea Update ProductionView
Matthieu Totet
parents: 18
diff changeset
   235
7d044e7562ea Update ProductionView
Matthieu Totet
parents: 18
diff changeset
   236
        void ProductionTimeLineVM_PropertyChanged(object sender, System.ComponentModel.PropertyChangedEventArgs e)
7d044e7562ea Update ProductionView
Matthieu Totet
parents: 18
diff changeset
   237
        {
20
c2dd8119a6c1 Update ProductionView
Matthieu Totet
parents: 19
diff changeset
   238
            //Commands.ProductionView.VideoRecordUpdated.Execute();
19
7d044e7562ea Update ProductionView
Matthieu Totet
parents: 18
diff changeset
   239
        }
17
0e4e63f6f567 Update ProductinoView and Components
Matthieu Totet
parents: 0
diff changeset
   240
18
66911d0f0eb6 Update ProductionView
Matthieu Totet
parents: 17
diff changeset
   241
        void EditorPartFinished_Executed(object sender, SLExtensions.Input.ExecutedEventArgs e)
66911d0f0eb6 Update ProductionView
Matthieu Totet
parents: 17
diff changeset
   242
        {
66911d0f0eb6 Update ProductionView
Matthieu Totet
parents: 17
diff changeset
   243
            SelectedChapter = -1;
66911d0f0eb6 Update ProductionView
Matthieu Totet
parents: 17
diff changeset
   244
        }
66911d0f0eb6 Update ProductionView
Matthieu Totet
parents: 17
diff changeset
   245
17
0e4e63f6f567 Update ProductinoView and Components
Matthieu Totet
parents: 0
diff changeset
   246
        void EditorPartSelected_Executed(object sender, SLExtensions.Input.ExecutedEventArgs e)
0e4e63f6f567 Update ProductinoView and Components
Matthieu Totet
parents: 0
diff changeset
   247
        {
18
66911d0f0eb6 Update ProductionView
Matthieu Totet
parents: 17
diff changeset
   248
           
66911d0f0eb6 Update ProductionView
Matthieu Totet
parents: 17
diff changeset
   249
            SelectedChapter = (int)((HeaderProductionEventArgs)e.Source).ChapterType;
17
0e4e63f6f567 Update ProductinoView and Components
Matthieu Totet
parents: 0
diff changeset
   250
            SelectedChapterType = ((HeaderProductionEventArgs)e.Source).ChapterType ;
0e4e63f6f567 Update ProductinoView and Components
Matthieu Totet
parents: 0
diff changeset
   251
            IsIndexing = ((HeaderProductionEventArgs)e.Source).IsIndexPart;
0
249d70e7b32d Create Directories & Project
Matthieu Totet
parents:
diff changeset
   252
        }
23
10acb6a11a73 Update VideoViewer ( Allow Multi-VideoViewer)
Matthieu Totet
parents: 20
diff changeset
   253
0
249d70e7b32d Create Directories & Project
Matthieu Totet
parents:
diff changeset
   254
    }
249d70e7b32d Create Directories & Project
Matthieu Totet
parents:
diff changeset
   255
}