client/src/Iri.Modernisation.Controls/ViewModel/ProductionTimeLine/CustomableVideoElementVM.cs
changeset 0 249d70e7b32d
child 17 0e4e63f6f567
equal deleted inserted replaced
-1:000000000000 0:249d70e7b32d
       
     1 using System;
       
     2 using System.Net;
       
     3 using System.Windows;
       
     4 using System.Windows.Controls;
       
     5 using System.Windows.Documents;
       
     6 using System.Windows.Ink;
       
     7 using System.Windows.Input;
       
     8 using System.Windows.Media;
       
     9 using System.Windows.Media.Animation;
       
    10 using System.Windows.Shapes;
       
    11 using Iri.Modernisation.Data.Models;
       
    12 using Iri.Modernisation.BaseMVVM.Commands;
       
    13 using Iri.Modernisation.BaseMVVM.ViewModel;
       
    14 using Iri.Modernisation.Controls.View;
       
    15 using System.Collections.Generic;
       
    16 namespace Iri.Modernisation.Controls.ViewModel
       
    17 {
       
    18     public class CustomableVideoElementVM : BaseMVVM.ViewModel.ViewModel
       
    19     {
       
    20         public CustomableVideoElementVM(VideoSequence paramSeq)
       
    21         {
       
    22             _videoSequence = paramSeq;
       
    23             _runTime = paramSeq.RunTime;
       
    24             _beginTrim = paramSeq.BeginTrim;
       
    25             _endTrim = paramSeq.EndTrim;
       
    26             OnPropertyChanged("Duration");
       
    27         }
       
    28 
       
    29         private VideoSequence _videoSequence;
       
    30 
       
    31         private TimeSpan _runTime;
       
    32         public TimeSpan RunTime 
       
    33         {
       
    34             get
       
    35             {
       
    36                 return _runTime;
       
    37             }
       
    38             set
       
    39             {
       
    40                 _runTime = value;
       
    41                 _videoSequence.RunTime = value;
       
    42                 OnPropertyChanged(String.Empty);
       
    43                
       
    44             }
       
    45         }
       
    46 
       
    47         private TimeSpan _beginTrim;
       
    48         public TimeSpan BeginTrim 
       
    49         {
       
    50             get
       
    51             {
       
    52                 return _beginTrim;
       
    53             }
       
    54             set
       
    55             {
       
    56                 _beginTrim = value;
       
    57                 _videoSequence.BeginTrim = value;
       
    58                 OnPropertyChanged(String.Empty);
       
    59             }
       
    60         }
       
    61 
       
    62         private TimeSpan _endTrim;
       
    63         public TimeSpan EndTrim 
       
    64         { 
       
    65             get
       
    66             {
       
    67                 return _endTrim;
       
    68             }
       
    69             set
       
    70             {
       
    71                 _endTrim = value;
       
    72                 _videoSequence.EndTrim = value;
       
    73                 OnPropertyChanged(String.Empty);
       
    74             }
       
    75         }
       
    76 
       
    77         private double _duration;
       
    78         public new double Duration
       
    79         {
       
    80             get
       
    81             {
       
    82                 return( RunTime.TotalMilliseconds - (BeginTrim.TotalMilliseconds + EndTrim.TotalMilliseconds))*ProductionTimeLine.ScaleTime;
       
    83             }
       
    84 
       
    85         }
       
    86         public new TimeSpan DurationTimeSpan
       
    87         {
       
    88             get
       
    89             {
       
    90                 return _videoSequence.Duration;
       
    91             }
       
    92 
       
    93         }
       
    94 
       
    95        
       
    96         
       
    97     }
       
    98 }