author | cavaliet |
Wed, 04 Nov 2009 16:28:01 +0100 | |
changeset 186 | 83615722dbab |
parent 168 | d70ee2002f75 |
child 188 | e642ad0c366b |
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; |
186
83615722dbab
Debug data management for others panels to redisplay.
cavaliet
parents:
168
diff
changeset
|
11 |
using FingersDance.ViewModels; |
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 |
||
186
83615722dbab
Debug data management for others panels to redisplay.
cavaliet
parents:
168
diff
changeset
|
28 |
public void Load(string path, Color col, CuttingViewModel cutVM) |
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 |
186
83615722dbab
Debug data management for others panels to redisplay.
cavaliet
parents:
168
diff
changeset
|
32 |
UCTimeLine.initTimer(col, cutVM); |
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); |
165 | 35 |
this.UserControlPlayer.PlayerStopOrPause +=new EventHandler(UserControlPlayer_PlayerStopOrPause); |
119 | 36 |
} |
35 | 37 |
|
38 |
#region player |
|
39 |
private void UserControlPlayer_PlayerOpened(object sender, EventArgs e) |
|
40 |
{ |
|
41 |
//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
|
42 |
UCTimeLine.initslider(UserControlPlayer.TotalMilliseconds); |
35 | 43 |
//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
|
44 |
UCTimeLine.timerStart(); |
35 | 45 |
|
46 |
} |
|
162
0b9f989bcb37
Display annotations in all opened UserPanels with the user's color
sarias
parents:
160
diff
changeset
|
47 |
|
0b9f989bcb37
Display annotations in all opened UserPanels with the user's color
sarias
parents:
160
diff
changeset
|
48 |
//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
|
49 |
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
|
50 |
{ |
0b9f989bcb37
Display annotations in all opened UserPanels with the user's color
sarias
parents:
160
diff
changeset
|
51 |
UserControlPlayer.displayStackPanelAnnotations(id, b); |
165 | 52 |
|
53 |
} |
|
54 |
public void UserControlPlayer_PlayerStopOrPause(object sender, EventArgs e) |
|
168
d70ee2002f75
Thumb Timeline Rotation and Debug Closing Panels
ARIAS Santiago
parents:
165
diff
changeset
|
55 |
{ |
d70ee2002f75
Thumb Timeline Rotation and Debug Closing Panels
ARIAS Santiago
parents:
165
diff
changeset
|
56 |
try |
d70ee2002f75
Thumb Timeline Rotation and Debug Closing Panels
ARIAS Santiago
parents:
165
diff
changeset
|
57 |
{ |
d70ee2002f75
Thumb Timeline Rotation and Debug Closing Panels
ARIAS Santiago
parents:
165
diff
changeset
|
58 |
userControlTimeLine.thumbRotation((bool)sender); |
d70ee2002f75
Thumb Timeline Rotation and Debug Closing Panels
ARIAS Santiago
parents:
165
diff
changeset
|
59 |
}catch(Exception ){} |
162
0b9f989bcb37
Display annotations in all opened UserPanels with the user's color
sarias
parents:
160
diff
changeset
|
60 |
} |
35 | 61 |
#endregion |
62 |
||
63 |
#region TimeLine |
|
64 |
||
65 |
||
66 |
private void UserControlTimeLine_DragStarted(object sender, EventArgs e) |
|
67 |
{ |
|
68 |
UserControlPlayer.playerPause(); |
|
69 |
} |
|
70 |
||
71 |
||
72 |
private void UserControlTimeLine_DragCompleted(object sender, EventArgs e) |
|
73 |
{ |
|
74 |
} |
|
162
0b9f989bcb37
Display annotations in all opened UserPanels with the user's color
sarias
parents:
160
diff
changeset
|
75 |
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
|
76 |
{ |
0b9f989bcb37
Display annotations in all opened UserPanels with the user's color
sarias
parents:
160
diff
changeset
|
77 |
OnSuccessAnnotation(this, new EventArgs()); |
0b9f989bcb37
Display annotations in all opened UserPanels with the user's color
sarias
parents:
160
diff
changeset
|
78 |
} |
168
d70ee2002f75
Thumb Timeline Rotation and Debug Closing Panels
ARIAS Santiago
parents:
165
diff
changeset
|
79 |
|
35 | 80 |
#endregion |
81 |
||
82 |
||
83 |
#region SynSource pour chaque X milliseconds |
|
84 |
private void UserControlTimeLine_TimerTick(object sender, EventArgs e) |
|
85 |
{ |
|
75
99d003723474
data binding second step. we can add annotation by clicking on menu buttons or timeline.
cavaliet
parents:
39
diff
changeset
|
86 |
if (!UCTimeLine.IsDragging) |
35 | 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.Slider.Value = UserControlPlayer.Player.Position.TotalMilliseconds; |
35 | 89 |
} |
75
99d003723474
data binding second step. we can add annotation by clicking on menu buttons or timeline.
cavaliet
parents:
39
diff
changeset
|
90 |
if (UCTimeLine.FinishedDragging) |
35 | 91 |
{ |
75
99d003723474
data binding second step. we can add annotation by clicking on menu buttons or timeline.
cavaliet
parents:
39
diff
changeset
|
92 |
int SliderValue = (int)UCTimeLine.Slider.Value; |
35 | 93 |
TimeSpan ts = new TimeSpan(0, 0, 0, 0, SliderValue); |
94 |
||
95 |
UserControlPlayer.Player.Position = ts; |
|
96 |
UserControlPlayer.playerPlay(); |
|
97 |
||
75
99d003723474
data binding second step. we can add annotation by clicking on menu buttons or timeline.
cavaliet
parents:
39
diff
changeset
|
98 |
UCTimeLine.IsDragging = false; |
99d003723474
data binding second step. we can add annotation by clicking on menu buttons or timeline.
cavaliet
parents:
39
diff
changeset
|
99 |
UCTimeLine.FinishedDragging = false; |
35 | 100 |
} |
101 |
} |
|
102 |
#endregion |
|
75
99d003723474
data binding second step. we can add annotation by clicking on menu buttons or timeline.
cavaliet
parents:
39
diff
changeset
|
103 |
|
99d003723474
data binding second step. we can add annotation by clicking on menu buttons or timeline.
cavaliet
parents:
39
diff
changeset
|
104 |
public UserControlTimeLine userControlTimeLine |
99d003723474
data binding second step. we can add annotation by clicking on menu buttons or timeline.
cavaliet
parents:
39
diff
changeset
|
105 |
{ |
99d003723474
data binding second step. we can add annotation by clicking on menu buttons or timeline.
cavaliet
parents:
39
diff
changeset
|
106 |
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
|
107 |
} |
152
46577fd0a294
PlayerPause en resize
PAMPHILE Jonathan <pamphile@efrei.fr>
parents:
150
diff
changeset
|
108 |
|
46577fd0a294
PlayerPause en resize
PAMPHILE Jonathan <pamphile@efrei.fr>
parents:
150
diff
changeset
|
109 |
public void PlayerPause() |
46577fd0a294
PlayerPause en resize
PAMPHILE Jonathan <pamphile@efrei.fr>
parents:
150
diff
changeset
|
110 |
{ |
46577fd0a294
PlayerPause en resize
PAMPHILE Jonathan <pamphile@efrei.fr>
parents:
150
diff
changeset
|
111 |
UserControlPlayer.playerPause(); |
46577fd0a294
PlayerPause en resize
PAMPHILE Jonathan <pamphile@efrei.fr>
parents:
150
diff
changeset
|
112 |
} |
35 | 113 |
} |
114 |
} |