|
16
|
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.BaseMVVM.Commands; |
|
|
12 |
using Iri.Modernisation.BaseMVVM.ViewModel; |
|
18
|
13 |
using Iri.Modernisation.Controls.View; |
|
19
|
14 |
using Iri.Modernisation.Data.Models; |
|
|
15 |
using System.Collections.ObjectModel; |
|
|
16 |
using System.Collections.Generic; |
|
16
|
17 |
namespace Iri.Modernisation.Controls.ViewModel |
|
|
18 |
{ |
|
|
19 |
public class ProductionViewVM : BaseMVVM.ViewModel.ViewModel |
|
|
20 |
{ |
|
19
|
21 |
|
|
|
22 |
private VideoSequence _selectedVideoSequence; |
|
|
23 |
public VideoSequence SelectedVideoSequence |
|
|
24 |
{ |
|
|
25 |
get |
|
|
26 |
{ |
|
|
27 |
return _selectedVideoSequence; |
|
|
28 |
} |
|
|
29 |
set |
|
|
30 |
{ |
|
|
31 |
_selectedVideoSequence = value; |
|
22
|
32 |
ViewModelProductionEditor = new ProductionEditorVM(value); |
|
19
|
33 |
OnPropertyChanged("SelectedVideoSequence"); |
|
|
34 |
|
|
|
35 |
} |
|
|
36 |
} |
|
|
37 |
|
|
|
38 |
private ObservableCollection<VideoSequence> _recordedVideoSequences; |
|
|
39 |
public ObservableCollection<VideoSequence> RecordedVideoSequences |
|
|
40 |
{ |
|
|
41 |
get |
|
|
42 |
{ |
|
|
43 |
return _recordedVideoSequences; |
|
|
44 |
} |
|
|
45 |
set |
|
|
46 |
{ |
|
|
47 |
_recordedVideoSequences = value; |
|
|
48 |
OnPropertyChanged("RecordedVideoSequences"); |
|
|
49 |
} |
|
|
50 |
} |
|
|
51 |
|
|
|
52 |
|
|
16
|
53 |
private HeaderProductionVM _headerProductionVM; |
|
|
54 |
public HeaderProductionVM ViewModelHeaderProduction |
|
|
55 |
{ |
|
|
56 |
get |
|
|
57 |
{ |
|
|
58 |
return _headerProductionVM; |
|
|
59 |
} |
|
|
60 |
set |
|
|
61 |
{ |
|
|
62 |
_headerProductionVM = value; |
|
|
63 |
OnPropertyChanged("ViewModelHeaderProduction"); |
|
|
64 |
} |
|
|
65 |
} |
|
|
66 |
private ProductionTimeLineVM _productionTimeLineVM; |
|
|
67 |
public ProductionTimeLineVM ViewModelProductionTimeLine |
|
|
68 |
{ |
|
|
69 |
get |
|
|
70 |
{ |
|
|
71 |
return _productionTimeLineVM; |
|
|
72 |
} |
|
|
73 |
set |
|
|
74 |
{ |
|
|
75 |
_productionTimeLineVM = value; |
|
|
76 |
OnPropertyChanged("ViewModelProductionTimeLine"); |
|
|
77 |
} |
|
|
78 |
} |
|
21
|
79 |
|
|
|
80 |
private ProductionEditorVM _productionEditorVM; |
|
|
81 |
public ProductionEditorVM ViewModelProductionEditor |
|
|
82 |
{ |
|
|
83 |
get |
|
|
84 |
{ |
|
|
85 |
return _productionEditorVM; |
|
|
86 |
} |
|
|
87 |
set |
|
|
88 |
{ |
|
|
89 |
_productionEditorVM = value; |
|
|
90 |
OnPropertyChanged("ViewModelProductionEditor"); |
|
|
91 |
} |
|
|
92 |
} |
|
18
|
93 |
//SelectedChapter |
|
16
|
94 |
public ProductionViewVM() |
|
|
95 |
{ |
|
19
|
96 |
RecordedVideoSequences = new ObservableCollection<VideoSequence>(); |
|
16
|
97 |
ViewModelHeaderProduction = new HeaderProductionVM(); |
|
|
98 |
ViewModelProductionTimeLine = new ProductionTimeLineVM(); |
|
21
|
99 |
ViewModelProductionEditor = new ProductionEditorVM(); |
|
19
|
100 |
Commands.ProductionView.ClickAddSelectedRecord.Executed += new EventHandler<SLExtensions.Input.ExecutedEventArgs>(ClickAddSelectedRecord_Executed); |
|
|
101 |
Random rndNumbers = new Random(); |
|
|
102 |
for (int i = 0; i < 10; i++) |
|
|
103 |
{ |
|
|
104 |
|
|
|
105 |
_recordedVideoSequences.Add(new VideoSequence() |
|
|
106 |
{ |
|
22
|
107 |
Path=Application.Current.Host.Source.Host+@"/video.mp4", |
|
19
|
108 |
RunTime = new TimeSpan(0, rndNumbers.Next(10, 60), 0), |
|
|
109 |
BeginTrim = new TimeSpan(0, 0, 0), |
|
|
110 |
EndTrim = new TimeSpan(0, 0, 0), |
|
|
111 |
}); |
|
|
112 |
} |
|
18
|
113 |
|
|
16
|
114 |
} |
|
18
|
115 |
|
|
19
|
116 |
void ClickAddSelectedRecord_Executed(object sender, SLExtensions.Input.ExecutedEventArgs e) |
|
|
117 |
{ |
|
20
|
118 |
if (ViewModelProductionTimeLine.SelectedChapter != -1) |
|
|
119 |
{ |
|
|
120 |
if (!ViewModelProductionTimeLine.IsIndexing) |
|
|
121 |
{ |
|
|
122 |
if(SelectedVideoSequence!=null) |
|
|
123 |
ViewModelProductionTimeLine.SelectedVideoSequences.Add(new VideoSequence(SelectedVideoSequence)); |
|
|
124 |
} |
|
|
125 |
|
|
|
126 |
} |
|
19
|
127 |
|
|
|
128 |
} |
|
|
129 |
|
|
18
|
130 |
|
|
16
|
131 |
} |
|
|
132 |
} |