|
0
|
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; |
|
17
|
26 |
|
|
0
|
27 |
OnPropertyChanged("Duration"); |
|
|
28 |
} |
|
|
29 |
|
|
|
30 |
private VideoSequence _videoSequence; |
|
20
|
31 |
public VideoSequence VideoSequence |
|
|
32 |
{ |
|
|
33 |
get |
|
|
34 |
{ |
|
|
35 |
return _videoSequence; |
|
|
36 |
} |
|
|
37 |
} |
|
0
|
38 |
|
|
|
39 |
private TimeSpan _runTime; |
|
|
40 |
public TimeSpan RunTime |
|
|
41 |
{ |
|
|
42 |
get |
|
|
43 |
{ |
|
|
44 |
return _runTime; |
|
|
45 |
} |
|
|
46 |
set |
|
|
47 |
{ |
|
|
48 |
_runTime = value; |
|
|
49 |
_videoSequence.RunTime = value; |
|
|
50 |
OnPropertyChanged(String.Empty); |
|
|
51 |
|
|
|
52 |
} |
|
|
53 |
} |
|
|
54 |
|
|
|
55 |
private TimeSpan _beginTrim; |
|
|
56 |
public TimeSpan BeginTrim |
|
|
57 |
{ |
|
|
58 |
get |
|
|
59 |
{ |
|
|
60 |
return _beginTrim; |
|
|
61 |
} |
|
|
62 |
set |
|
|
63 |
{ |
|
|
64 |
_beginTrim = value; |
|
|
65 |
_videoSequence.BeginTrim = value; |
|
|
66 |
OnPropertyChanged(String.Empty); |
|
|
67 |
} |
|
|
68 |
} |
|
|
69 |
|
|
|
70 |
private TimeSpan _endTrim; |
|
|
71 |
public TimeSpan EndTrim |
|
|
72 |
{ |
|
|
73 |
get |
|
|
74 |
{ |
|
|
75 |
return _endTrim; |
|
|
76 |
} |
|
|
77 |
set |
|
|
78 |
{ |
|
|
79 |
_endTrim = value; |
|
|
80 |
_videoSequence.EndTrim = value; |
|
|
81 |
OnPropertyChanged(String.Empty); |
|
|
82 |
} |
|
|
83 |
} |
|
|
84 |
|
|
27
|
85 |
|
|
|
86 |
public double Duration |
|
0
|
87 |
{ |
|
|
88 |
get |
|
|
89 |
{ |
|
|
90 |
return( RunTime.TotalMilliseconds - (BeginTrim.TotalMilliseconds + EndTrim.TotalMilliseconds))*ProductionTimeLine.ScaleTime; |
|
|
91 |
} |
|
|
92 |
|
|
|
93 |
} |
|
17
|
94 |
|
|
|
95 |
private VideoChapterType _chapter; |
|
|
96 |
public VideoChapterType Chapter |
|
|
97 |
{ |
|
|
98 |
get |
|
|
99 |
{ |
|
|
100 |
return _chapter; |
|
|
101 |
} |
|
|
102 |
set |
|
|
103 |
{ |
|
|
104 |
_chapter = value; |
|
|
105 |
OnPropertyChanged("Chapter"); |
|
|
106 |
} |
|
|
107 |
} |
|
|
108 |
|
|
27
|
109 |
private Color _chapterColor; |
|
|
110 |
public Color ChapterColor |
|
|
111 |
{ |
|
|
112 |
get |
|
|
113 |
{ |
|
|
114 |
return _chapterColor; |
|
|
115 |
} |
|
|
116 |
set |
|
|
117 |
{ |
|
|
118 |
_chapterColor = value; |
|
|
119 |
OnPropertyChanged("ChapterColor"); |
|
|
120 |
} |
|
|
121 |
} |
|
|
122 |
public SolidColorBrush ChapterSolidColorBrush |
|
|
123 |
{ |
|
|
124 |
get |
|
|
125 |
{ |
|
|
126 |
return new SolidColorBrush(this.ChapterColor); |
|
|
127 |
} |
|
|
128 |
} |
|
|
129 |
public TimeSpan DurationTimeSpan |
|
0
|
130 |
{ |
|
|
131 |
get |
|
|
132 |
{ |
|
|
133 |
return _videoSequence.Duration; |
|
|
134 |
} |
|
|
135 |
|
|
|
136 |
} |
|
|
137 |
|
|
|
138 |
|
|
|
139 |
|
|
|
140 |
} |
|
|
141 |
} |