author | cavaliet |
Fri, 16 Oct 2009 15:56:09 +0200 | |
changeset 160 | e940ca798fe3 |
parent 152 | 46577fd0a294 |
child 162 | 0b9f989bcb37 |
permissions | -rw-r--r-- |
35 | 1 |
using System; |
2 |
using System.IO; |
|
3 |
using System.Net; |
|
4 |
using System.Windows; |
|
5 |
using System.Windows.Controls; |
|
6 |
using System.Windows.Data; |
|
7 |
using System.Windows.Media; |
|
8 |
using System.Windows.Media.Animation; |
|
9 |
using System.Windows.Navigation; |
|
39 | 10 |
using FingersDance.Control.TimeLine; |
160
e940ca798fe3
Enhance color factory and send the current project (data) to the timeline instance in order to build the project's cutting's annotation list.
cavaliet
parents:
152
diff
changeset
|
11 |
using FingersDance.Data; |
35 | 12 |
|
13 |
namespace FingersDance.Control.SyncSource |
|
14 |
{ |
|
15 |
public partial class UserControlSyncSource |
|
16 |
{ |
|
17 |
public UserControlSyncSource() |
|
18 |
{ |
|
19 |
this.InitializeComponent(); |
|
20 |
||
21 |
// Insert code required on object creation below this point. |
|
22 |
} |
|
23 |
||
160
e940ca798fe3
Enhance color factory and send the current project (data) to the timeline instance in order to build the project's cutting's annotation list.
cavaliet
parents:
152
diff
changeset
|
24 |
public void Load(string path, Color col, Cutting projCutting) |
119 | 25 |
{ |
26 |
this.UserControlPlayer.initPlayer(path); |
|
150
569925b65604
Annotations are now colored with the same color as the pivot's button
cavaliet
parents:
143
diff
changeset
|
27 |
//Initialisation du Timer |
160
e940ca798fe3
Enhance color factory and send the current project (data) to the timeline instance in order to build the project's cutting's annotation list.
cavaliet
parents:
152
diff
changeset
|
28 |
UCTimeLine.initTimer(col, projCutting); |
143 | 29 |
this.UserControlPlayer.playerPlay(); |
119 | 30 |
} |
35 | 31 |
|
32 |
#region player |
|
33 |
private void UserControlPlayer_PlayerOpened(object sender, EventArgs e) |
|
34 |
{ |
|
35 |
//Initialisation du slider |
|
75
99d003723474
data binding second step. we can add annotation by clicking on menu buttons or timeline.
cavaliet
parents:
39
diff
changeset
|
36 |
UCTimeLine.initslider(UserControlPlayer.TotalMilliseconds); |
35 | 37 |
//Demarrage du Timer |
75
99d003723474
data binding second step. we can add annotation by clicking on menu buttons or timeline.
cavaliet
parents:
39
diff
changeset
|
38 |
UCTimeLine.timerStart(); |
35 | 39 |
|
40 |
} |
|
41 |
#endregion |
|
42 |
||
43 |
#region TimeLine |
|
44 |
||
45 |
||
46 |
private void UserControlTimeLine_DragStarted(object sender, EventArgs e) |
|
47 |
{ |
|
48 |
UserControlPlayer.playerPause(); |
|
49 |
} |
|
50 |
||
51 |
||
52 |
private void UserControlTimeLine_DragCompleted(object sender, EventArgs e) |
|
53 |
{ |
|
54 |
} |
|
55 |
#endregion |
|
56 |
||
57 |
||
58 |
#region SynSource pour chaque X milliseconds |
|
59 |
private void UserControlTimeLine_TimerTick(object sender, EventArgs e) |
|
60 |
{ |
|
75
99d003723474
data binding second step. we can add annotation by clicking on menu buttons or timeline.
cavaliet
parents:
39
diff
changeset
|
61 |
if (!UCTimeLine.IsDragging) |
35 | 62 |
{ |
75
99d003723474
data binding second step. we can add annotation by clicking on menu buttons or timeline.
cavaliet
parents:
39
diff
changeset
|
63 |
UCTimeLine.Slider.Value = UserControlPlayer.Player.Position.TotalMilliseconds; |
35 | 64 |
} |
75
99d003723474
data binding second step. we can add annotation by clicking on menu buttons or timeline.
cavaliet
parents:
39
diff
changeset
|
65 |
if (UCTimeLine.FinishedDragging) |
35 | 66 |
{ |
75
99d003723474
data binding second step. we can add annotation by clicking on menu buttons or timeline.
cavaliet
parents:
39
diff
changeset
|
67 |
int SliderValue = (int)UCTimeLine.Slider.Value; |
35 | 68 |
TimeSpan ts = new TimeSpan(0, 0, 0, 0, SliderValue); |
69 |
||
70 |
UserControlPlayer.Player.Position = ts; |
|
71 |
UserControlPlayer.playerPlay(); |
|
72 |
||
75
99d003723474
data binding second step. we can add annotation by clicking on menu buttons or timeline.
cavaliet
parents:
39
diff
changeset
|
73 |
UCTimeLine.IsDragging = false; |
99d003723474
data binding second step. we can add annotation by clicking on menu buttons or timeline.
cavaliet
parents:
39
diff
changeset
|
74 |
UCTimeLine.FinishedDragging = false; |
35 | 75 |
} |
76 |
} |
|
77 |
#endregion |
|
75
99d003723474
data binding second step. we can add annotation by clicking on menu buttons or timeline.
cavaliet
parents:
39
diff
changeset
|
78 |
|
99d003723474
data binding second step. we can add annotation by clicking on menu buttons or timeline.
cavaliet
parents:
39
diff
changeset
|
79 |
public UserControlTimeLine userControlTimeLine |
99d003723474
data binding second step. we can add annotation by clicking on menu buttons or timeline.
cavaliet
parents:
39
diff
changeset
|
80 |
{ |
99d003723474
data binding second step. we can add annotation by clicking on menu buttons or timeline.
cavaliet
parents:
39
diff
changeset
|
81 |
get { return this.UCTimeLine; } |
99d003723474
data binding second step. we can add annotation by clicking on menu buttons or timeline.
cavaliet
parents:
39
diff
changeset
|
82 |
} |
152
46577fd0a294
PlayerPause en resize
PAMPHILE Jonathan <pamphile@efrei.fr>
parents:
150
diff
changeset
|
83 |
|
46577fd0a294
PlayerPause en resize
PAMPHILE Jonathan <pamphile@efrei.fr>
parents:
150
diff
changeset
|
84 |
public void PlayerPause() |
46577fd0a294
PlayerPause en resize
PAMPHILE Jonathan <pamphile@efrei.fr>
parents:
150
diff
changeset
|
85 |
{ |
46577fd0a294
PlayerPause en resize
PAMPHILE Jonathan <pamphile@efrei.fr>
parents:
150
diff
changeset
|
86 |
UserControlPlayer.playerPause(); |
46577fd0a294
PlayerPause en resize
PAMPHILE Jonathan <pamphile@efrei.fr>
parents:
150
diff
changeset
|
87 |
} |
35 | 88 |
} |
89 |
} |