author | sarias |
Fri, 16 Oct 2009 21:06:25 +0200 | |
changeset 162 | 0b9f989bcb37 |
parent 160 | e940ca798fe3 |
child 165 | e78e40b9d761 |
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 |
{ |
|
162
0b9f989bcb37
Display annotations in all opened UserPanels with the user's color
sarias
parents:
160
diff
changeset
|
17 |
#region Variables |
0b9f989bcb37
Display annotations in all opened UserPanels with the user's color
sarias
parents:
160
diff
changeset
|
18 |
public event EventHandler OnSuccessAnnotation; |
0b9f989bcb37
Display annotations in all opened UserPanels with the user's color
sarias
parents:
160
diff
changeset
|
19 |
#endregion |
0b9f989bcb37
Display annotations in all opened UserPanels with the user's color
sarias
parents:
160
diff
changeset
|
20 |
|
35 | 21 |
public UserControlSyncSource() |
22 |
{ |
|
23 |
this.InitializeComponent(); |
|
24 |
||
25 |
// Insert code required on object creation below this point. |
|
26 |
} |
|
27 |
||
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 |
public void Load(string path, Color col, Cutting projCutting) |
119 | 29 |
{ |
30 |
this.UserControlPlayer.initPlayer(path); |
|
150
569925b65604
Annotations are now colored with the same color as the pivot's button
cavaliet
parents:
143
diff
changeset
|
31 |
//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
|
32 |
UCTimeLine.initTimer(col, projCutting); |
143 | 33 |
this.UserControlPlayer.playerPlay(); |
162
0b9f989bcb37
Display annotations in all opened UserPanels with the user's color
sarias
parents:
160
diff
changeset
|
34 |
this.userControlTimeLine.OnSuccessAnnotation+=new EventHandler(userControlTimeLine_OnSuccessAnnotation); |
119 | 35 |
} |
35 | 36 |
|
37 |
#region player |
|
38 |
private void UserControlPlayer_PlayerOpened(object sender, EventArgs e) |
|
39 |
{ |
|
40 |
//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
|
41 |
UCTimeLine.initslider(UserControlPlayer.TotalMilliseconds); |
35 | 42 |
//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
|
43 |
UCTimeLine.timerStart(); |
35 | 44 |
|
45 |
} |
|
162
0b9f989bcb37
Display annotations in all opened UserPanels with the user's color
sarias
parents:
160
diff
changeset
|
46 |
|
0b9f989bcb37
Display annotations in all opened UserPanels with the user's color
sarias
parents:
160
diff
changeset
|
47 |
//Set a bursh color to the stack panel in the Player |
0b9f989bcb37
Display annotations in all opened UserPanels with the user's color
sarias
parents:
160
diff
changeset
|
48 |
public void UserControlPlayer_DisplayAnnotation(int id, Brush b) |
0b9f989bcb37
Display annotations in all opened UserPanels with the user's color
sarias
parents:
160
diff
changeset
|
49 |
{ |
0b9f989bcb37
Display annotations in all opened UserPanels with the user's color
sarias
parents:
160
diff
changeset
|
50 |
UserControlPlayer.displayStackPanelAnnotations(id, b); |
0b9f989bcb37
Display annotations in all opened UserPanels with the user's color
sarias
parents:
160
diff
changeset
|
51 |
} |
35 | 52 |
#endregion |
53 |
||
54 |
#region TimeLine |
|
55 |
||
56 |
||
57 |
private void UserControlTimeLine_DragStarted(object sender, EventArgs e) |
|
58 |
{ |
|
59 |
UserControlPlayer.playerPause(); |
|
60 |
} |
|
61 |
||
62 |
||
63 |
private void UserControlTimeLine_DragCompleted(object sender, EventArgs e) |
|
64 |
{ |
|
65 |
} |
|
162
0b9f989bcb37
Display annotations in all opened UserPanels with the user's color
sarias
parents:
160
diff
changeset
|
66 |
private void userControlTimeLine_OnSuccessAnnotation(object sender, EventArgs e) |
0b9f989bcb37
Display annotations in all opened UserPanels with the user's color
sarias
parents:
160
diff
changeset
|
67 |
{ |
0b9f989bcb37
Display annotations in all opened UserPanels with the user's color
sarias
parents:
160
diff
changeset
|
68 |
OnSuccessAnnotation(this, new EventArgs()); |
0b9f989bcb37
Display annotations in all opened UserPanels with the user's color
sarias
parents:
160
diff
changeset
|
69 |
} |
35 | 70 |
#endregion |
71 |
||
72 |
||
73 |
#region SynSource pour chaque X milliseconds |
|
74 |
private void UserControlTimeLine_TimerTick(object sender, EventArgs e) |
|
75 |
{ |
|
75
99d003723474
data binding second step. we can add annotation by clicking on menu buttons or timeline.
cavaliet
parents:
39
diff
changeset
|
76 |
if (!UCTimeLine.IsDragging) |
35 | 77 |
{ |
75
99d003723474
data binding second step. we can add annotation by clicking on menu buttons or timeline.
cavaliet
parents:
39
diff
changeset
|
78 |
UCTimeLine.Slider.Value = UserControlPlayer.Player.Position.TotalMilliseconds; |
35 | 79 |
} |
75
99d003723474
data binding second step. we can add annotation by clicking on menu buttons or timeline.
cavaliet
parents:
39
diff
changeset
|
80 |
if (UCTimeLine.FinishedDragging) |
35 | 81 |
{ |
75
99d003723474
data binding second step. we can add annotation by clicking on menu buttons or timeline.
cavaliet
parents:
39
diff
changeset
|
82 |
int SliderValue = (int)UCTimeLine.Slider.Value; |
35 | 83 |
TimeSpan ts = new TimeSpan(0, 0, 0, 0, SliderValue); |
84 |
||
85 |
UserControlPlayer.Player.Position = ts; |
|
86 |
UserControlPlayer.playerPlay(); |
|
87 |
||
75
99d003723474
data binding second step. we can add annotation by clicking on menu buttons or timeline.
cavaliet
parents:
39
diff
changeset
|
88 |
UCTimeLine.IsDragging = false; |
99d003723474
data binding second step. we can add annotation by clicking on menu buttons or timeline.
cavaliet
parents:
39
diff
changeset
|
89 |
UCTimeLine.FinishedDragging = false; |
35 | 90 |
} |
91 |
} |
|
92 |
#endregion |
|
75
99d003723474
data binding second step. we can add annotation by clicking on menu buttons or timeline.
cavaliet
parents:
39
diff
changeset
|
93 |
|
99d003723474
data binding second step. we can add annotation by clicking on menu buttons or timeline.
cavaliet
parents:
39
diff
changeset
|
94 |
public UserControlTimeLine userControlTimeLine |
99d003723474
data binding second step. we can add annotation by clicking on menu buttons or timeline.
cavaliet
parents:
39
diff
changeset
|
95 |
{ |
99d003723474
data binding second step. we can add annotation by clicking on menu buttons or timeline.
cavaliet
parents:
39
diff
changeset
|
96 |
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
|
97 |
} |
152
46577fd0a294
PlayerPause en resize
PAMPHILE Jonathan <pamphile@efrei.fr>
parents:
150
diff
changeset
|
98 |
|
46577fd0a294
PlayerPause en resize
PAMPHILE Jonathan <pamphile@efrei.fr>
parents:
150
diff
changeset
|
99 |
public void PlayerPause() |
46577fd0a294
PlayerPause en resize
PAMPHILE Jonathan <pamphile@efrei.fr>
parents:
150
diff
changeset
|
100 |
{ |
46577fd0a294
PlayerPause en resize
PAMPHILE Jonathan <pamphile@efrei.fr>
parents:
150
diff
changeset
|
101 |
UserControlPlayer.playerPause(); |
46577fd0a294
PlayerPause en resize
PAMPHILE Jonathan <pamphile@efrei.fr>
parents:
150
diff
changeset
|
102 |
} |
35 | 103 |
} |
104 |
} |