208 { |
255 { |
209 _selectedChapterType = value; |
256 _selectedChapterType = value; |
210 OnPropertyChanged("SelectedChapterType"); |
257 OnPropertyChanged("SelectedChapterType"); |
211 } |
258 } |
212 } |
259 } |
213 |
260 |
214 |
261 private void InitializeCommands() |
|
262 { |
|
263 #region Commands |
|
264 Commands.ProductionView.DelVideoSequence.Executed += new EventHandler<SLExtensions.Input.ExecutedEventArgs>(DelVideoSequence_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); |
|
267 Commands.ProductionView.ClickAddIndex.Executed += new EventHandler<SLExtensions.Input.ExecutedEventArgs>(ClickAddIndex_Executed); |
|
268 Commands.TimeChange.Executed += new EventHandler<SLExtensions.Input.ExecutedEventArgs>(TimeChange_Executed); |
|
269 #endregion |
|
270 |
|
271 #region VideoSequences CollectionChanged |
|
272 _listVideoSequences[0].CollectionChanged += new System.Collections.Specialized.NotifyCollectionChangedEventHandler(SelectedVideoSequences_CollectionChanged); |
|
273 _listVideoSequences[1].CollectionChanged += new System.Collections.Specialized.NotifyCollectionChangedEventHandler(SelectedVideoSequences_CollectionChanged); |
|
274 _listVideoSequences[2].CollectionChanged += new System.Collections.Specialized.NotifyCollectionChangedEventHandler(SelectedVideoSequences_CollectionChanged); |
|
275 _listVideoSequences[3].CollectionChanged += new System.Collections.Specialized.NotifyCollectionChangedEventHandler(SelectedVideoSequences_CollectionChanged); |
|
276 #endregion |
|
277 |
|
278 #region SegmentIndex CollectionChanged |
|
279 _listSegmentIndex[0].CollectionChanged += new System.Collections.Specialized.NotifyCollectionChangedEventHandler(SelectedVideoSequences_CollectionChanged); |
|
280 _listSegmentIndex[1].CollectionChanged += new System.Collections.Specialized.NotifyCollectionChangedEventHandler(SelectedVideoSequences_CollectionChanged); |
|
281 _listSegmentIndex[2].CollectionChanged += new System.Collections.Specialized.NotifyCollectionChangedEventHandler(SelectedVideoSequences_CollectionChanged); |
|
282 _listSegmentIndex[3].CollectionChanged += new System.Collections.Specialized.NotifyCollectionChangedEventHandler(SelectedVideoSequences_CollectionChanged); |
|
283 #endregion |
|
284 } |
215 public ProductionTimeLineVM() |
285 public ProductionTimeLineVM() |
216 { |
286 { |
217 _newBook = new VideoBook(); |
287 _newBook = new VideoBook(); |
218 _listVideoSequences = new ObservableCollection<VideoSequence>[4] |
288 _listVideoSequences = new ObservableCollection<VideoSequence>[4] |
219 { |
289 { |
220 new ObservableCollection<VideoSequence>(), |
290 new ObservableCollection<VideoSequence>(), |
221 new ObservableCollection<VideoSequence>(), |
291 new ObservableCollection<VideoSequence>(), |
222 new ObservableCollection<VideoSequence>(), |
292 new ObservableCollection<VideoSequence>(), |
223 new ObservableCollection<VideoSequence>() |
293 new ObservableCollection<VideoSequence>() |
224 }; |
294 }; |
225 // PropertyChanged += new System.ComponentModel.PropertyChangedEventHandler(ProductionTimeLineVM_PropertyChanged); |
|
226 // SelectedVideoSequences = new ObservableCollection<VideoSequence>(); |
|
227 Commands.ProductionView.DelVideoSequence.Executed += new EventHandler<SLExtensions.Input.ExecutedEventArgs>(DelVideoSequence_Executed); |
|
228 Commands.ProductionTimeLine.EditorPartSelected.Executed += new EventHandler<SLExtensions.Input.ExecutedEventArgs>(EditorPartSelected_Executed); |
|
229 Commands.ProductionTimeLine.EditorPartFinished.Executed += new EventHandler<SLExtensions.Input.ExecutedEventArgs>(EditorPartFinished_Executed); |
|
230 Commands.ProductionView.ClickAddIndex.Executed += new EventHandler<SLExtensions.Input.ExecutedEventArgs>(ClickAddIndex_Executed); |
|
231 Commands.TimeChange.Executed += new EventHandler<SLExtensions.Input.ExecutedEventArgs>(TimeChange_Executed); |
|
232 _listVideoSequences[0].CollectionChanged += new System.Collections.Specialized.NotifyCollectionChangedEventHandler(SelectedVideoSequences_CollectionChanged); |
|
233 _listVideoSequences[1].CollectionChanged += new System.Collections.Specialized.NotifyCollectionChangedEventHandler(SelectedVideoSequences_CollectionChanged); |
|
234 _listVideoSequences[2].CollectionChanged += new System.Collections.Specialized.NotifyCollectionChangedEventHandler(SelectedVideoSequences_CollectionChanged); |
|
235 _listVideoSequences[3].CollectionChanged += new System.Collections.Specialized.NotifyCollectionChangedEventHandler(SelectedVideoSequences_CollectionChanged); |
|
236 |
|
237 _listSegmentIndex = new ObservableCollection<SegmentIndex>[4] |
295 _listSegmentIndex = new ObservableCollection<SegmentIndex>[4] |
238 { |
296 { |
239 new ObservableCollection<SegmentIndex>(), |
297 new ObservableCollection<SegmentIndex>(), |
240 new ObservableCollection<SegmentIndex>(), |
298 new ObservableCollection<SegmentIndex>(), |
241 new ObservableCollection<SegmentIndex>(), |
299 new ObservableCollection<SegmentIndex>(), |
242 new ObservableCollection<SegmentIndex>() |
300 new ObservableCollection<SegmentIndex>() |
243 }; |
301 }; |
244 _listSegmentIndex[0].CollectionChanged += new System.Collections.Specialized.NotifyCollectionChangedEventHandler(SelectedVideoSequences_CollectionChanged); |
302 // PropertyChanged += new System.ComponentModel.PropertyChangedEventHandler(ProductionTimeLineVM_PropertyChanged); |
245 _listSegmentIndex[1].CollectionChanged += new System.Collections.Specialized.NotifyCollectionChangedEventHandler(SelectedVideoSequences_CollectionChanged); |
303 // SelectedVideoSequences = new ObservableCollection<VideoSequence>(); |
246 _listSegmentIndex[2].CollectionChanged += new System.Collections.Specialized.NotifyCollectionChangedEventHandler(SelectedVideoSequences_CollectionChanged); |
304 InitializeCommands(); |
247 _listSegmentIndex[3].CollectionChanged += new System.Collections.Specialized.NotifyCollectionChangedEventHandler(SelectedVideoSequences_CollectionChanged); |
305 } |
248 } |
306 |
249 |
307 |
250 void TimeChange_Executed(object sender, SLExtensions.Input.ExecutedEventArgs e) |
308 private void TimeChange_Executed(object sender, SLExtensions.Input.ExecutedEventArgs e) |
251 { |
309 { |
252 double newValue = ((double)e.Parameter); |
310 double newValue = ((double)e.Parameter); |
253 if(e.Source == this) |
311 if(e.Source == this) |
254 { |
312 { |
255 if (ActualVideoSequence.TimerIn.TotalMilliseconds > newValue || ActualVideoSequence.TimerOut.TotalMilliseconds < newValue) |
313 if (ActualVideoSequence.TimerIn.TotalMilliseconds > newValue || ActualVideoSequence.TimerOut.TotalMilliseconds < newValue) |
295 |
354 |
296 } |
355 } |
297 |
356 |
298 } |
357 } |
299 |
358 |
300 void DelVideoSequence_Executed(object sender, SLExtensions.Input.ExecutedEventArgs e) |
359 private void DelVideoSequence_Executed(object sender, SLExtensions.Input.ExecutedEventArgs e) |
301 { |
360 { |
302 SelectedVideoSequences.Remove(((CustomableVideoElementVM)e.Parameter).VideoSequence); |
361 SelectedVideoSequences.Remove(((CustomableVideoElementVM)e.Parameter).VideoSequence); |
303 OnPropertyChanged("TotalBookDuration"); |
362 OnPropertyChanged("TotalBookDuration"); |
304 } |
363 } |
305 |
364 |
306 void SelectedVideoSequences_CollectionChanged(object sender, System.Collections.Specialized.NotifyCollectionChangedEventArgs e) |
365 private void SelectedVideoSequences_CollectionChanged(object sender, System.Collections.Specialized.NotifyCollectionChangedEventArgs e) |
307 { |
366 { |
308 |
367 |
309 OnPropertyChanged("TotalBookDuration"); |
368 OnPropertyChanged("TotalBookDuration"); |
310 Commands.ProductionView.VideoRecordUpdated.Execute(); |
369 Commands.ProductionView.VideoRecordUpdated.Execute(); |
311 } |
370 } |
312 |
371 |
313 void ProductionTimeLineVM_PropertyChanged(object sender, System.ComponentModel.PropertyChangedEventArgs e) |
372 private void EditorPartFinished_Executed(object sender, SLExtensions.Input.ExecutedEventArgs e) |
314 { |
|
315 //Commands.ProductionView.VideoRecordUpdated.Execute(); |
|
316 } |
|
317 |
|
318 void EditorPartFinished_Executed(object sender, SLExtensions.Input.ExecutedEventArgs e) |
|
319 { |
373 { |
320 SelectedChapter = -1; |
374 SelectedChapter = -1; |
321 } |
375 } |
322 |
376 |
323 void EditorPartSelected_Executed(object sender, SLExtensions.Input.ExecutedEventArgs e) |
377 private void EditorPartSelected_Executed(object sender, SLExtensions.Input.ExecutedEventArgs e) |
324 { |
378 { |
325 |
379 |
326 SelectedChapter = (int)((HeaderProductionEventArgs)e.Source).ChapterType; |
380 SelectedChapter = (int)((HeaderProductionEventArgs)e.Source).ChapterType; |
327 SelectedChapterType = ((HeaderProductionEventArgs)e.Source).ChapterType ; |
381 SelectedChapterType = ((HeaderProductionEventArgs)e.Source).ChapterType ; |
328 IsIndexing = ((HeaderProductionEventArgs)e.Source).IsIndexPart; |
382 IsIndexing = ((HeaderProductionEventArgs)e.Source).IsIndexPart; |