author | cavaliet |
Wed, 14 Oct 2009 17:08:43 +0200 | |
changeset 150 | 569925b65604 |
parent 143 | 9f157d9c725b |
child 152 | 46577fd0a294 |
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; |
35 | 11 |
|
12 |
namespace FingersDance.Control.SyncSource |
|
13 |
{ |
|
14 |
public partial class UserControlSyncSource |
|
15 |
{ |
|
16 |
public UserControlSyncSource() |
|
17 |
{ |
|
18 |
this.InitializeComponent(); |
|
19 |
||
20 |
// Insert code required on object creation below this point. |
|
21 |
} |
|
22 |
||
150
569925b65604
Annotations are now colored with the same color as the pivot's button
cavaliet
parents:
143
diff
changeset
|
23 |
public void Load(string path, UInt32 intColor) |
119 | 24 |
{ |
25 |
this.UserControlPlayer.initPlayer(path); |
|
150
569925b65604
Annotations are now colored with the same color as the pivot's button
cavaliet
parents:
143
diff
changeset
|
26 |
//Initialisation du Timer |
569925b65604
Annotations are now colored with the same color as the pivot's button
cavaliet
parents:
143
diff
changeset
|
27 |
UCTimeLine.initTimer(intColor); |
143 | 28 |
this.UserControlPlayer.playerPlay(); |
119 | 29 |
} |
35 | 30 |
|
31 |
#region player |
|
32 |
private void UserControlPlayer_PlayerOpened(object sender, EventArgs e) |
|
33 |
{ |
|
34 |
//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
|
35 |
UCTimeLine.initslider(UserControlPlayer.TotalMilliseconds); |
35 | 36 |
//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
|
37 |
UCTimeLine.timerStart(); |
35 | 38 |
|
39 |
} |
|
40 |
#endregion |
|
41 |
||
42 |
#region TimeLine |
|
43 |
||
44 |
||
45 |
private void UserControlTimeLine_DragStarted(object sender, EventArgs e) |
|
46 |
{ |
|
47 |
UserControlPlayer.playerPause(); |
|
48 |
} |
|
49 |
||
50 |
||
51 |
private void UserControlTimeLine_DragCompleted(object sender, EventArgs e) |
|
52 |
{ |
|
53 |
} |
|
54 |
#endregion |
|
55 |
||
56 |
||
57 |
#region SynSource pour chaque X milliseconds |
|
58 |
private void UserControlTimeLine_TimerTick(object sender, EventArgs e) |
|
59 |
{ |
|
75
99d003723474
data binding second step. we can add annotation by clicking on menu buttons or timeline.
cavaliet
parents:
39
diff
changeset
|
60 |
if (!UCTimeLine.IsDragging) |
35 | 61 |
{ |
75
99d003723474
data binding second step. we can add annotation by clicking on menu buttons or timeline.
cavaliet
parents:
39
diff
changeset
|
62 |
UCTimeLine.Slider.Value = UserControlPlayer.Player.Position.TotalMilliseconds; |
35 | 63 |
} |
75
99d003723474
data binding second step. we can add annotation by clicking on menu buttons or timeline.
cavaliet
parents:
39
diff
changeset
|
64 |
if (UCTimeLine.FinishedDragging) |
35 | 65 |
{ |
75
99d003723474
data binding second step. we can add annotation by clicking on menu buttons or timeline.
cavaliet
parents:
39
diff
changeset
|
66 |
int SliderValue = (int)UCTimeLine.Slider.Value; |
35 | 67 |
TimeSpan ts = new TimeSpan(0, 0, 0, 0, SliderValue); |
68 |
||
69 |
UserControlPlayer.Player.Position = ts; |
|
70 |
UserControlPlayer.playerPlay(); |
|
71 |
||
75
99d003723474
data binding second step. we can add annotation by clicking on menu buttons or timeline.
cavaliet
parents:
39
diff
changeset
|
72 |
UCTimeLine.IsDragging = false; |
99d003723474
data binding second step. we can add annotation by clicking on menu buttons or timeline.
cavaliet
parents:
39
diff
changeset
|
73 |
UCTimeLine.FinishedDragging = false; |
35 | 74 |
} |
75 |
} |
|
76 |
#endregion |
|
75
99d003723474
data binding second step. we can add annotation by clicking on menu buttons or timeline.
cavaliet
parents:
39
diff
changeset
|
77 |
|
99d003723474
data binding second step. we can add annotation by clicking on menu buttons or timeline.
cavaliet
parents:
39
diff
changeset
|
78 |
public UserControlTimeLine userControlTimeLine |
99d003723474
data binding second step. we can add annotation by clicking on menu buttons or timeline.
cavaliet
parents:
39
diff
changeset
|
79 |
{ |
99d003723474
data binding second step. we can add annotation by clicking on menu buttons or timeline.
cavaliet
parents:
39
diff
changeset
|
80 |
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
|
81 |
} |
35 | 82 |
} |
83 |
} |