|
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; |
|
36
|
11 |
using System.Xml.Linq; |
|
|
12 |
using System.Collections.Generic; |
|
0
|
13 |
namespace Iri.Modernisation.Data.Models |
|
|
14 |
{ |
|
|
15 |
/// <summary> |
|
|
16 |
/// Classe représentant les segments Vidéo que l'utilisateur enregistre via la web cam et modifie (trimming) |
|
|
17 |
/// via l'application |
|
|
18 |
/// </summary> |
|
|
19 |
public class VideoSequence : SegmentElement |
|
|
20 |
{ |
|
20
|
21 |
|
|
|
22 |
public VideoSequence(): |
|
|
23 |
base() |
|
|
24 |
{ |
|
|
25 |
} |
|
|
26 |
|
|
|
27 |
public VideoSequence(VideoSequence oldVs) |
|
|
28 |
: base(oldVs) |
|
|
29 |
{ |
|
|
30 |
Path = oldVs.Path; |
|
|
31 |
RunTime = oldVs.RunTime; |
|
|
32 |
BeginTrim = oldVs.BeginTrim; |
|
|
33 |
EndTrim = oldVs.EndTrim; |
|
|
34 |
|
|
|
35 |
} |
|
|
36 |
|
|
0
|
37 |
/// <summary> |
|
|
38 |
/// Chemin d'accès à la vidéo |
|
|
39 |
/// </summary> |
|
|
40 |
public String Path { get; set; } |
|
|
41 |
|
|
|
42 |
/// <summary> |
|
|
43 |
/// Temps de la video (Absolue - sans recadrage) |
|
|
44 |
/// </summary> |
|
|
45 |
public TimeSpan RunTime { get; set; } |
|
|
46 |
|
|
|
47 |
/// <summary> |
|
|
48 |
/// Recadrage à gauche (Débuter la vidéo plus tard) |
|
|
49 |
/// </summary> |
|
|
50 |
public TimeSpan BeginTrim { get; set; } |
|
|
51 |
|
|
|
52 |
/// <summary> |
|
|
53 |
/// Recadrage à droite (Finir la vidéo plus tôt |
|
|
54 |
/// </summary> |
|
|
55 |
public TimeSpan EndTrim { get; set; } |
|
|
56 |
|
|
|
57 |
/// <summary> |
|
|
58 |
/// Temps de la vidéo (Effectif - avec les recadrage) |
|
|
59 |
/// </summary> |
|
|
60 |
public new TimeSpan Duration |
|
|
61 |
{ |
|
|
62 |
get |
|
|
63 |
{ |
|
34
|
64 |
|
|
0
|
65 |
return RunTime - (BeginTrim + EndTrim); |
|
|
66 |
} |
|
|
67 |
|
|
|
68 |
} |
|
|
69 |
|
|
|
70 |
public new TimeSpan TimerOut |
|
|
71 |
{ |
|
|
72 |
get |
|
|
73 |
{ |
|
|
74 |
return TimerIn + Duration; |
|
|
75 |
} |
|
|
76 |
} |
|
36
|
77 |
|
|
|
78 |
static public List<VideoSequence> GetProductionVideo(XDocument xdoc) |
|
|
79 |
{ |
|
|
80 |
List<VideoSequence> returnList = new List<VideoSequence>(); |
|
|
81 |
foreach (XElement XVideo in xdoc.Root.Elements()) |
|
|
82 |
{ |
|
|
83 |
|
|
|
84 |
returnList.Add( |
|
|
85 |
new VideoSequence() |
|
|
86 |
{ |
|
|
87 |
Path = XVideo.Attribute("mediafile").Value, |
|
|
88 |
RunTime = TimeSpan.FromMilliseconds(double.Parse(XVideo.Attribute("dur").Value)), |
|
|
89 |
BeginTrim = new TimeSpan(0, 0, 0), |
|
|
90 |
EndTrim = new TimeSpan(0, 0, 0), |
|
|
91 |
} |
|
|
92 |
); |
|
|
93 |
} |
|
|
94 |
return returnList; |
|
|
95 |
} |
|
|
96 |
|
|
0
|
97 |
|
|
|
98 |
} |
|
|
99 |
} |