author | cavaliet |
Wed, 25 Nov 2009 10:49:44 +0100 | |
changeset 231 | 4eff6b0c9215 |
parent 229 | 05aba5def1fc |
permissions | -rw-r--r-- |
35 | 1 |
using System; |
216
45d2dff788f2
almost last step of search : menu is active and we listen to the recognised event from the player.
cavaliet
parents:
206
diff
changeset
|
2 |
using System.Collections.Generic; |
35 | 3 |
using System.IO; |
4 |
using System.Net; |
|
5 |
using System.Windows; |
|
6 |
using System.Windows.Controls; |
|
7 |
using System.Windows.Data; |
|
8 |
using System.Windows.Media; |
|
9 |
using System.Windows.Media.Animation; |
|
10 |
using System.Windows.Navigation; |
|
216
45d2dff788f2
almost last step of search : menu is active and we listen to the recognised event from the player.
cavaliet
parents:
206
diff
changeset
|
11 |
|
39 | 12 |
using FingersDance.Control.TimeLine; |
190
619ca3ae13c7
MainViewModel is now well linked to all the users'cuttings. At any moment, the MVM has all annotations. This step prepares data saving.
cavaliet
parents:
188
diff
changeset
|
13 |
using FingersDance.Data; |
216
45d2dff788f2
almost last step of search : menu is active and we listen to the recognised event from the player.
cavaliet
parents:
206
diff
changeset
|
14 |
using FingersDance.ViewModels; |
195
48b3139bb182
Dictionnaire de données
PAMPHILE Jonathan <pamphile@efrei.fr>
parents:
193
diff
changeset
|
15 |
using FingersDance.Factory; |
203
2948b34324bb
first step of adding annotation from a recognised gesture.
cavaliet
parents:
195
diff
changeset
|
16 |
using GestureControl; |
35 | 17 |
|
18 |
namespace FingersDance.Control.SyncSource |
|
19 |
{ |
|
20 |
public partial class UserControlSyncSource |
|
21 |
{ |
|
162
0b9f989bcb37
Display annotations in all opened UserPanels with the user's color
sarias
parents:
160
diff
changeset
|
22 |
#region Variables |
216
45d2dff788f2
almost last step of search : menu is active and we listen to the recognised event from the player.
cavaliet
parents:
206
diff
changeset
|
23 |
public event EventHandler OnSuccessAnnotation; |
45d2dff788f2
almost last step of search : menu is active and we listen to the recognised event from the player.
cavaliet
parents:
206
diff
changeset
|
24 |
|
45d2dff788f2
almost last step of search : menu is active and we listen to the recognised event from the player.
cavaliet
parents:
206
diff
changeset
|
25 |
private String AnnotationOrSearchMode; |
45d2dff788f2
almost last step of search : menu is active and we listen to the recognised event from the player.
cavaliet
parents:
206
diff
changeset
|
26 |
private Project searchedProject; |
162
0b9f989bcb37
Display annotations in all opened UserPanels with the user's color
sarias
parents:
160
diff
changeset
|
27 |
#endregion |
0b9f989bcb37
Display annotations in all opened UserPanels with the user's color
sarias
parents:
160
diff
changeset
|
28 |
|
35 | 29 |
public UserControlSyncSource() |
30 |
{ |
|
31 |
this.InitializeComponent(); |
|
32 |
||
33 |
// Insert code required on object creation below this point. |
|
34 |
} |
|
35 |
||
229
05aba5def1fc
add an attribute Color to a Cutting, save it in ldt xml file and redisplay it in the pivot's button. Make ColorFactory truly static.
cavaliet
parents:
225
diff
changeset
|
36 |
public void Load(string path, Cutting cut, String AnnotOrSearchMode, Project searchedProj) |
119 | 37 |
{ |
38 |
this.UserControlPlayer.initPlayer(path); |
|
216
45d2dff788f2
almost last step of search : menu is active and we listen to the recognised event from the player.
cavaliet
parents:
206
diff
changeset
|
39 |
AnnotationOrSearchMode = AnnotOrSearchMode; |
45d2dff788f2
almost last step of search : menu is active and we listen to the recognised event from the player.
cavaliet
parents:
206
diff
changeset
|
40 |
searchedProject = searchedProj; |
150
569925b65604
Annotations are now colored with the same color as the pivot's button
cavaliet
parents:
143
diff
changeset
|
41 |
//Initialisation du Timer |
229
05aba5def1fc
add an attribute Color to a Cutting, save it in ldt xml file and redisplay it in the pivot's button. Make ColorFactory truly static.
cavaliet
parents:
225
diff
changeset
|
42 |
UCTimeLine.initTimer(cut); |
216
45d2dff788f2
almost last step of search : menu is active and we listen to the recognised event from the player.
cavaliet
parents:
206
diff
changeset
|
43 |
UserControlPlayer.playerPlay(); |
45d2dff788f2
almost last step of search : menu is active and we listen to the recognised event from the player.
cavaliet
parents:
206
diff
changeset
|
44 |
userControlTimeLine.OnSuccessAnnotation += new EventHandler(userControlTimeLine_OnSuccessAnnotation); |
45d2dff788f2
almost last step of search : menu is active and we listen to the recognised event from the player.
cavaliet
parents:
206
diff
changeset
|
45 |
userControlTimeLine.AnnotationAdded += new EventHandler(userControlTimeLine_AnnotationAdded); |
45d2dff788f2
almost last step of search : menu is active and we listen to the recognised event from the player.
cavaliet
parents:
206
diff
changeset
|
46 |
userControlTimeLine.AnnotationRemoved += new EventHandler(userControlTimeLine_AnnotationRemoved); |
45d2dff788f2
almost last step of search : menu is active and we listen to the recognised event from the player.
cavaliet
parents:
206
diff
changeset
|
47 |
UserControlPlayer.PlayerStopOrPause += new EventHandler(UserControlPlayer_PlayerStopOrPause); |
45d2dff788f2
almost last step of search : menu is active and we listen to the recognised event from the player.
cavaliet
parents:
206
diff
changeset
|
48 |
UserControlPlayer.NewGestureRegognized += new EventHandler(UserControlPlayer_NewGestureRegognized); |
45d2dff788f2
almost last step of search : menu is active and we listen to the recognised event from the player.
cavaliet
parents:
206
diff
changeset
|
49 |
UCTimeLine.NewGestureRecognized += new EventHandler<NewGestureRecognizedEventArg>(UCTimeLine_NewGestureRecognized); |
119 | 50 |
} |
35 | 51 |
|
195
48b3139bb182
Dictionnaire de données
PAMPHILE Jonathan <pamphile@efrei.fr>
parents:
193
diff
changeset
|
52 |
void userControlTimeLine_AnnotationRemoved(object sender, EventArgs e) |
48b3139bb182
Dictionnaire de données
PAMPHILE Jonathan <pamphile@efrei.fr>
parents:
193
diff
changeset
|
53 |
{ |
48b3139bb182
Dictionnaire de données
PAMPHILE Jonathan <pamphile@efrei.fr>
parents:
193
diff
changeset
|
54 |
try |
48b3139bb182
Dictionnaire de données
PAMPHILE Jonathan <pamphile@efrei.fr>
parents:
193
diff
changeset
|
55 |
{ |
48b3139bb182
Dictionnaire de données
PAMPHILE Jonathan <pamphile@efrei.fr>
parents:
193
diff
changeset
|
56 |
DataDictionary Data = (new DataFactory()).Data; |
48b3139bb182
Dictionnaire de données
PAMPHILE Jonathan <pamphile@efrei.fr>
parents:
193
diff
changeset
|
57 |
Data.RemoveAnnotation((Annotation)sender); |
48b3139bb182
Dictionnaire de données
PAMPHILE Jonathan <pamphile@efrei.fr>
parents:
193
diff
changeset
|
58 |
} |
48b3139bb182
Dictionnaire de données
PAMPHILE Jonathan <pamphile@efrei.fr>
parents:
193
diff
changeset
|
59 |
catch { } |
48b3139bb182
Dictionnaire de données
PAMPHILE Jonathan <pamphile@efrei.fr>
parents:
193
diff
changeset
|
60 |
} |
48b3139bb182
Dictionnaire de données
PAMPHILE Jonathan <pamphile@efrei.fr>
parents:
193
diff
changeset
|
61 |
|
48b3139bb182
Dictionnaire de données
PAMPHILE Jonathan <pamphile@efrei.fr>
parents:
193
diff
changeset
|
62 |
// Ajout Annotation |
48b3139bb182
Dictionnaire de données
PAMPHILE Jonathan <pamphile@efrei.fr>
parents:
193
diff
changeset
|
63 |
void userControlTimeLine_AnnotationAdded(object sender, EventArgs e) |
48b3139bb182
Dictionnaire de données
PAMPHILE Jonathan <pamphile@efrei.fr>
parents:
193
diff
changeset
|
64 |
{ |
48b3139bb182
Dictionnaire de données
PAMPHILE Jonathan <pamphile@efrei.fr>
parents:
193
diff
changeset
|
65 |
try |
48b3139bb182
Dictionnaire de données
PAMPHILE Jonathan <pamphile@efrei.fr>
parents:
193
diff
changeset
|
66 |
{ |
48b3139bb182
Dictionnaire de données
PAMPHILE Jonathan <pamphile@efrei.fr>
parents:
193
diff
changeset
|
67 |
DataDictionary Data = (new DataFactory()).Data; |
48b3139bb182
Dictionnaire de données
PAMPHILE Jonathan <pamphile@efrei.fr>
parents:
193
diff
changeset
|
68 |
Data.AddAnnotation((Annotation)sender); |
48b3139bb182
Dictionnaire de données
PAMPHILE Jonathan <pamphile@efrei.fr>
parents:
193
diff
changeset
|
69 |
} |
48b3139bb182
Dictionnaire de données
PAMPHILE Jonathan <pamphile@efrei.fr>
parents:
193
diff
changeset
|
70 |
catch { } |
48b3139bb182
Dictionnaire de données
PAMPHILE Jonathan <pamphile@efrei.fr>
parents:
193
diff
changeset
|
71 |
} |
48b3139bb182
Dictionnaire de données
PAMPHILE Jonathan <pamphile@efrei.fr>
parents:
193
diff
changeset
|
72 |
|
35 | 73 |
#region player |
74 |
private void UserControlPlayer_PlayerOpened(object sender, EventArgs e) |
|
75 |
{ |
|
76 |
//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
|
77 |
UCTimeLine.initslider(UserControlPlayer.TotalMilliseconds); |
35 | 78 |
//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
|
79 |
UCTimeLine.timerStart(); |
35 | 80 |
|
81 |
} |
|
162
0b9f989bcb37
Display annotations in all opened UserPanels with the user's color
sarias
parents:
160
diff
changeset
|
82 |
|
165 | 83 |
public void UserControlPlayer_PlayerStopOrPause(object sender, EventArgs e) |
168
d70ee2002f75
Thumb Timeline Rotation and Debug Closing Panels
ARIAS Santiago
parents:
165
diff
changeset
|
84 |
{ |
d70ee2002f75
Thumb Timeline Rotation and Debug Closing Panels
ARIAS Santiago
parents:
165
diff
changeset
|
85 |
try |
d70ee2002f75
Thumb Timeline Rotation and Debug Closing Panels
ARIAS Santiago
parents:
165
diff
changeset
|
86 |
{ |
d70ee2002f75
Thumb Timeline Rotation and Debug Closing Panels
ARIAS Santiago
parents:
165
diff
changeset
|
87 |
userControlTimeLine.thumbRotation((bool)sender); |
d70ee2002f75
Thumb Timeline Rotation and Debug Closing Panels
ARIAS Santiago
parents:
165
diff
changeset
|
88 |
}catch(Exception ){} |
162
0b9f989bcb37
Display annotations in all opened UserPanels with the user's color
sarias
parents:
160
diff
changeset
|
89 |
} |
188
e642ad0c366b
Tag Visualisation Control Sound (Use Byte Value "01") and Mute all other Players opened
ARIAS Santiago
parents:
186
diff
changeset
|
90 |
|
e642ad0c366b
Tag Visualisation Control Sound (Use Byte Value "01") and Mute all other Players opened
ARIAS Santiago
parents:
186
diff
changeset
|
91 |
public void setUserPlayerVolume(double val) |
e642ad0c366b
Tag Visualisation Control Sound (Use Byte Value "01") and Mute all other Players opened
ARIAS Santiago
parents:
186
diff
changeset
|
92 |
{ |
e642ad0c366b
Tag Visualisation Control Sound (Use Byte Value "01") and Mute all other Players opened
ARIAS Santiago
parents:
186
diff
changeset
|
93 |
try |
e642ad0c366b
Tag Visualisation Control Sound (Use Byte Value "01") and Mute all other Players opened
ARIAS Santiago
parents:
186
diff
changeset
|
94 |
{ |
e642ad0c366b
Tag Visualisation Control Sound (Use Byte Value "01") and Mute all other Players opened
ARIAS Santiago
parents:
186
diff
changeset
|
95 |
UserControlPlayer.setSound(val); |
e642ad0c366b
Tag Visualisation Control Sound (Use Byte Value "01") and Mute all other Players opened
ARIAS Santiago
parents:
186
diff
changeset
|
96 |
} |
e642ad0c366b
Tag Visualisation Control Sound (Use Byte Value "01") and Mute all other Players opened
ARIAS Santiago
parents:
186
diff
changeset
|
97 |
catch (Exception) { } |
e642ad0c366b
Tag Visualisation Control Sound (Use Byte Value "01") and Mute all other Players opened
ARIAS Santiago
parents:
186
diff
changeset
|
98 |
} |
e642ad0c366b
Tag Visualisation Control Sound (Use Byte Value "01") and Mute all other Players opened
ARIAS Santiago
parents:
186
diff
changeset
|
99 |
public void setUserPlayerMute(bool b) |
e642ad0c366b
Tag Visualisation Control Sound (Use Byte Value "01") and Mute all other Players opened
ARIAS Santiago
parents:
186
diff
changeset
|
100 |
{ |
e642ad0c366b
Tag Visualisation Control Sound (Use Byte Value "01") and Mute all other Players opened
ARIAS Santiago
parents:
186
diff
changeset
|
101 |
try |
e642ad0c366b
Tag Visualisation Control Sound (Use Byte Value "01") and Mute all other Players opened
ARIAS Santiago
parents:
186
diff
changeset
|
102 |
{ |
e642ad0c366b
Tag Visualisation Control Sound (Use Byte Value "01") and Mute all other Players opened
ARIAS Santiago
parents:
186
diff
changeset
|
103 |
UserControlPlayer.setMute(b); |
e642ad0c366b
Tag Visualisation Control Sound (Use Byte Value "01") and Mute all other Players opened
ARIAS Santiago
parents:
186
diff
changeset
|
104 |
} |
e642ad0c366b
Tag Visualisation Control Sound (Use Byte Value "01") and Mute all other Players opened
ARIAS Santiago
parents:
186
diff
changeset
|
105 |
catch (Exception) { } |
e642ad0c366b
Tag Visualisation Control Sound (Use Byte Value "01") and Mute all other Players opened
ARIAS Santiago
parents:
186
diff
changeset
|
106 |
} |
e642ad0c366b
Tag Visualisation Control Sound (Use Byte Value "01") and Mute all other Players opened
ARIAS Santiago
parents:
186
diff
changeset
|
107 |
|
35 | 108 |
#endregion |
109 |
||
110 |
#region TimeLine |
|
111 |
||
112 |
||
113 |
private void UserControlTimeLine_DragStarted(object sender, EventArgs e) |
|
114 |
{ |
|
115 |
UserControlPlayer.playerPause(); |
|
116 |
} |
|
117 |
||
118 |
||
119 |
private void UserControlTimeLine_DragCompleted(object sender, EventArgs e) |
|
120 |
{ |
|
121 |
} |
|
162
0b9f989bcb37
Display annotations in all opened UserPanels with the user's color
sarias
parents:
160
diff
changeset
|
122 |
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
|
123 |
{ |
0b9f989bcb37
Display annotations in all opened UserPanels with the user's color
sarias
parents:
160
diff
changeset
|
124 |
OnSuccessAnnotation(this, new EventArgs()); |
0b9f989bcb37
Display annotations in all opened UserPanels with the user's color
sarias
parents:
160
diff
changeset
|
125 |
} |
168
d70ee2002f75
Thumb Timeline Rotation and Debug Closing Panels
ARIAS Santiago
parents:
165
diff
changeset
|
126 |
|
35 | 127 |
#endregion |
128 |
||
129 |
||
130 |
#region SynSource pour chaque X milliseconds |
|
131 |
private void UserControlTimeLine_TimerTick(object sender, EventArgs e) |
|
132 |
{ |
|
75
99d003723474
data binding second step. we can add annotation by clicking on menu buttons or timeline.
cavaliet
parents:
39
diff
changeset
|
133 |
if (!UCTimeLine.IsDragging) |
35 | 134 |
{ |
224 | 135 |
|
136 |
UCTimeLine.Slider.Value = UserControlPlayer.Player.Position.TotalMilliseconds; |
|
137 |
|
|
35 | 138 |
} |
195
48b3139bb182
Dictionnaire de données
PAMPHILE Jonathan <pamphile@efrei.fr>
parents:
193
diff
changeset
|
139 |
int SliderValue = (int)UCTimeLine.Slider.Value; |
75
99d003723474
data binding second step. we can add annotation by clicking on menu buttons or timeline.
cavaliet
parents:
39
diff
changeset
|
140 |
if (UCTimeLine.FinishedDragging) |
35 | 141 |
{ |
142 |
TimeSpan ts = new TimeSpan(0, 0, 0, 0, SliderValue); |
|
143 |
||
144 |
UserControlPlayer.Player.Position = ts; |
|
145 |
UserControlPlayer.playerPlay(); |
|
146 |
||
75
99d003723474
data binding second step. we can add annotation by clicking on menu buttons or timeline.
cavaliet
parents:
39
diff
changeset
|
147 |
UCTimeLine.IsDragging = false; |
99d003723474
data binding second step. we can add annotation by clicking on menu buttons or timeline.
cavaliet
parents:
39
diff
changeset
|
148 |
UCTimeLine.FinishedDragging = false; |
35 | 149 |
} |
205
468f3757f1f8
Correction probleme tc annotation
PAMPHILE Jonathan <pamphile@efrei.fr>
parents:
195
diff
changeset
|
150 |
UserControlPlayer.Time = (float)SliderValue / 1000; |
195
48b3139bb182
Dictionnaire de données
PAMPHILE Jonathan <pamphile@efrei.fr>
parents:
193
diff
changeset
|
151 |
DataDictionary Data = (new DataFactory()).Data; |
48b3139bb182
Dictionnaire de données
PAMPHILE Jonathan <pamphile@efrei.fr>
parents:
193
diff
changeset
|
152 |
UserControlPlayer.ApplyColor(Data.GetColors((int)((float)SliderValue / 1000))); |
35 | 153 |
} |
154 |
#endregion |
|
75
99d003723474
data binding second step. we can add annotation by clicking on menu buttons or timeline.
cavaliet
parents:
39
diff
changeset
|
155 |
|
99d003723474
data binding second step. we can add annotation by clicking on menu buttons or timeline.
cavaliet
parents:
39
diff
changeset
|
156 |
public UserControlTimeLine userControlTimeLine |
99d003723474
data binding second step. we can add annotation by clicking on menu buttons or timeline.
cavaliet
parents:
39
diff
changeset
|
157 |
{ |
99d003723474
data binding second step. we can add annotation by clicking on menu buttons or timeline.
cavaliet
parents:
39
diff
changeset
|
158 |
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
|
159 |
} |
152
46577fd0a294
PlayerPause en resize
PAMPHILE Jonathan <pamphile@efrei.fr>
parents:
150
diff
changeset
|
160 |
|
46577fd0a294
PlayerPause en resize
PAMPHILE Jonathan <pamphile@efrei.fr>
parents:
150
diff
changeset
|
161 |
public void PlayerPause() |
46577fd0a294
PlayerPause en resize
PAMPHILE Jonathan <pamphile@efrei.fr>
parents:
150
diff
changeset
|
162 |
{ |
46577fd0a294
PlayerPause en resize
PAMPHILE Jonathan <pamphile@efrei.fr>
parents:
150
diff
changeset
|
163 |
UserControlPlayer.playerPause(); |
46577fd0a294
PlayerPause en resize
PAMPHILE Jonathan <pamphile@efrei.fr>
parents:
150
diff
changeset
|
164 |
} |
216
45d2dff788f2
almost last step of search : menu is active and we listen to the recognised event from the player.
cavaliet
parents:
206
diff
changeset
|
165 |
|
224 | 166 |
public void SyncSourceClose() |
167 |
{ |
|
168 |
//TimeLine and Player To Null |
|
169 |
UCTimeLine.TimerTick -= UserControlTimeLine_TimerTick; |
|
170 |
UCTimeLine = null; |
|
171 |
UserControlPlayer.playerStop(); |
|
172 |
UserControlPlayer = null; |
|
173 |
} |
|
216
45d2dff788f2
almost last step of search : menu is active and we listen to the recognised event from the player.
cavaliet
parents:
206
diff
changeset
|
174 |
|
45d2dff788f2
almost last step of search : menu is active and we listen to the recognised event from the player.
cavaliet
parents:
206
diff
changeset
|
175 |
public void UserControlPlayer_NewGestureRegognized(object sender, EventArgs e) |
45d2dff788f2
almost last step of search : menu is active and we listen to the recognised event from the player.
cavaliet
parents:
206
diff
changeset
|
176 |
{ |
45d2dff788f2
almost last step of search : menu is active and we listen to the recognised event from the player.
cavaliet
parents:
206
diff
changeset
|
177 |
try |
45d2dff788f2
almost last step of search : menu is active and we listen to the recognised event from the player.
cavaliet
parents:
206
diff
changeset
|
178 |
{ |
45d2dff788f2
almost last step of search : menu is active and we listen to the recognised event from the player.
cavaliet
parents:
206
diff
changeset
|
179 |
GestureEventArg grea = (GestureEventArg)e; |
45d2dff788f2
almost last step of search : menu is active and we listen to the recognised event from the player.
cavaliet
parents:
206
diff
changeset
|
180 |
//Console.WriteLine("Timeline NewGestureRegognized " + grea.Gesture.Name + ", " + grea.Gesture.Start + ", " + grea.Gesture.End); |
45d2dff788f2
almost last step of search : menu is active and we listen to the recognised event from the player.
cavaliet
parents:
206
diff
changeset
|
181 |
if (AnnotationOrSearchMode == "Annotation") |
45d2dff788f2
almost last step of search : menu is active and we listen to the recognised event from the player.
cavaliet
parents:
206
diff
changeset
|
182 |
{ |
45d2dff788f2
almost last step of search : menu is active and we listen to the recognised event from the player.
cavaliet
parents:
206
diff
changeset
|
183 |
// If the stroke has been drawed very fast, end and start can be the same, so we add a little length. |
45d2dff788f2
almost last step of search : menu is active and we listen to the recognised event from the player.
cavaliet
parents:
206
diff
changeset
|
184 |
float dur = (float)(grea.End - grea.Start); |
45d2dff788f2
almost last step of search : menu is active and we listen to the recognised event from the player.
cavaliet
parents:
206
diff
changeset
|
185 |
if (dur == 0) dur = (float)0.5; |
225
b60e13ed75c8
Now an annotation has a list of gesture string and not simple gesture string. These are saved into and loaded from the ldt xml file.
cavaliet
parents:
224
diff
changeset
|
186 |
// We build the list of string |
b60e13ed75c8
Now an annotation has a list of gesture string and not simple gesture string. These are saved into and loaded from the ldt xml file.
cavaliet
parents:
224
diff
changeset
|
187 |
List<String> gestList = new List<String>(); |
216
45d2dff788f2
almost last step of search : menu is active and we listen to the recognised event from the player.
cavaliet
parents:
206
diff
changeset
|
188 |
foreach (Gesture elt in grea.Gestures) |
225
b60e13ed75c8
Now an annotation has a list of gesture string and not simple gesture string. These are saved into and loaded from the ldt xml file.
cavaliet
parents:
224
diff
changeset
|
189 |
gestList.Add(elt.Name); |
b60e13ed75c8
Now an annotation has a list of gesture string and not simple gesture string. These are saved into and loaded from the ldt xml file.
cavaliet
parents:
224
diff
changeset
|
190 |
UCTimeLine.addAnnotation((float)grea.Start, dur, gestList); |
216
45d2dff788f2
almost last step of search : menu is active and we listen to the recognised event from the player.
cavaliet
parents:
206
diff
changeset
|
191 |
} |
45d2dff788f2
almost last step of search : menu is active and we listen to the recognised event from the player.
cavaliet
parents:
206
diff
changeset
|
192 |
else |
45d2dff788f2
almost last step of search : menu is active and we listen to the recognised event from the player.
cavaliet
parents:
206
diff
changeset
|
193 |
{ |
45d2dff788f2
almost last step of search : menu is active and we listen to the recognised event from the player.
cavaliet
parents:
206
diff
changeset
|
194 |
// We are in search mode. So we have to get all the searchedProject's annotation which have the wanted gesture |
45d2dff788f2
almost last step of search : menu is active and we listen to the recognised event from the player.
cavaliet
parents:
206
diff
changeset
|
195 |
List<Annotation> searchedAnnot = new List<Annotation>(); |
45d2dff788f2
almost last step of search : menu is active and we listen to the recognised event from the player.
cavaliet
parents:
206
diff
changeset
|
196 |
foreach(Cutting cut in searchedProject.Cuttings) |
45d2dff788f2
almost last step of search : menu is active and we listen to the recognised event from the player.
cavaliet
parents:
206
diff
changeset
|
197 |
{ |
45d2dff788f2
almost last step of search : menu is active and we listen to the recognised event from the player.
cavaliet
parents:
206
diff
changeset
|
198 |
foreach (Annotation annot in cut.AnnotList) |
45d2dff788f2
almost last step of search : menu is active and we listen to the recognised event from the player.
cavaliet
parents:
206
diff
changeset
|
199 |
{ |
45d2dff788f2
almost last step of search : menu is active and we listen to the recognised event from the player.
cavaliet
parents:
206
diff
changeset
|
200 |
foreach(Gesture gest in grea.Gestures) |
225
b60e13ed75c8
Now an annotation has a list of gesture string and not simple gesture string. These are saved into and loaded from the ldt xml file.
cavaliet
parents:
224
diff
changeset
|
201 |
foreach(String annotGest in annot.GestureType) |
b60e13ed75c8
Now an annotation has a list of gesture string and not simple gesture string. These are saved into and loaded from the ldt xml file.
cavaliet
parents:
224
diff
changeset
|
202 |
if (annotGest == gest.Name) |
b60e13ed75c8
Now an annotation has a list of gesture string and not simple gesture string. These are saved into and loaded from the ldt xml file.
cavaliet
parents:
224
diff
changeset
|
203 |
{ |
b60e13ed75c8
Now an annotation has a list of gesture string and not simple gesture string. These are saved into and loaded from the ldt xml file.
cavaliet
parents:
224
diff
changeset
|
204 |
// One of the gesture is enough for the annotation to be added |
b60e13ed75c8
Now an annotation has a list of gesture string and not simple gesture string. These are saved into and loaded from the ldt xml file.
cavaliet
parents:
224
diff
changeset
|
205 |
searchedAnnot.Add(annot); |
b60e13ed75c8
Now an annotation has a list of gesture string and not simple gesture string. These are saved into and loaded from the ldt xml file.
cavaliet
parents:
224
diff
changeset
|
206 |
break; |
b60e13ed75c8
Now an annotation has a list of gesture string and not simple gesture string. These are saved into and loaded from the ldt xml file.
cavaliet
parents:
224
diff
changeset
|
207 |
} |
216
45d2dff788f2
almost last step of search : menu is active and we listen to the recognised event from the player.
cavaliet
parents:
206
diff
changeset
|
208 |
} |
45d2dff788f2
almost last step of search : menu is active and we listen to the recognised event from the player.
cavaliet
parents:
206
diff
changeset
|
209 |
} |
45d2dff788f2
almost last step of search : menu is active and we listen to the recognised event from the player.
cavaliet
parents:
206
diff
changeset
|
210 |
// The list was built. If the number of found annotations is >0, we send the list to the timeline |
45d2dff788f2
almost last step of search : menu is active and we listen to the recognised event from the player.
cavaliet
parents:
206
diff
changeset
|
211 |
UCTimeLine.updateAnnotationList(searchedAnnot); |
45d2dff788f2
almost last step of search : menu is active and we listen to the recognised event from the player.
cavaliet
parents:
206
diff
changeset
|
212 |
} |
45d2dff788f2
almost last step of search : menu is active and we listen to the recognised event from the player.
cavaliet
parents:
206
diff
changeset
|
213 |
} |
45d2dff788f2
almost last step of search : menu is active and we listen to the recognised event from the player.
cavaliet
parents:
206
diff
changeset
|
214 |
catch { } |
45d2dff788f2
almost last step of search : menu is active and we listen to the recognised event from the player.
cavaliet
parents:
206
diff
changeset
|
215 |
} |
45d2dff788f2
almost last step of search : menu is active and we listen to the recognised event from the player.
cavaliet
parents:
206
diff
changeset
|
216 |
|
45d2dff788f2
almost last step of search : menu is active and we listen to the recognised event from the player.
cavaliet
parents:
206
diff
changeset
|
217 |
public void searchAnnotations(String gestureName) |
45d2dff788f2
almost last step of search : menu is active and we listen to the recognised event from the player.
cavaliet
parents:
206
diff
changeset
|
218 |
{ |
45d2dff788f2
almost last step of search : menu is active and we listen to the recognised event from the player.
cavaliet
parents:
206
diff
changeset
|
219 |
// We are in search mode. So we have to get all the searchedProject's annotation which have the wanted gesture |
45d2dff788f2
almost last step of search : menu is active and we listen to the recognised event from the player.
cavaliet
parents:
206
diff
changeset
|
220 |
List<Annotation> searchedAnnot = new List<Annotation>(); |
45d2dff788f2
almost last step of search : menu is active and we listen to the recognised event from the player.
cavaliet
parents:
206
diff
changeset
|
221 |
foreach (Cutting cut in searchedProject.Cuttings) |
45d2dff788f2
almost last step of search : menu is active and we listen to the recognised event from the player.
cavaliet
parents:
206
diff
changeset
|
222 |
{ |
45d2dff788f2
almost last step of search : menu is active and we listen to the recognised event from the player.
cavaliet
parents:
206
diff
changeset
|
223 |
foreach (Annotation annot in cut.AnnotList) |
45d2dff788f2
almost last step of search : menu is active and we listen to the recognised event from the player.
cavaliet
parents:
206
diff
changeset
|
224 |
{ |
225
b60e13ed75c8
Now an annotation has a list of gesture string and not simple gesture string. These are saved into and loaded from the ldt xml file.
cavaliet
parents:
224
diff
changeset
|
225 |
foreach (String annotGest in annot.GestureType) |
b60e13ed75c8
Now an annotation has a list of gesture string and not simple gesture string. These are saved into and loaded from the ldt xml file.
cavaliet
parents:
224
diff
changeset
|
226 |
if (annotGest == gestureName) |
b60e13ed75c8
Now an annotation has a list of gesture string and not simple gesture string. These are saved into and loaded from the ldt xml file.
cavaliet
parents:
224
diff
changeset
|
227 |
{ |
b60e13ed75c8
Now an annotation has a list of gesture string and not simple gesture string. These are saved into and loaded from the ldt xml file.
cavaliet
parents:
224
diff
changeset
|
228 |
// One of the gesture is enough for the annotation to be added |
b60e13ed75c8
Now an annotation has a list of gesture string and not simple gesture string. These are saved into and loaded from the ldt xml file.
cavaliet
parents:
224
diff
changeset
|
229 |
searchedAnnot.Add(annot); |
b60e13ed75c8
Now an annotation has a list of gesture string and not simple gesture string. These are saved into and loaded from the ldt xml file.
cavaliet
parents:
224
diff
changeset
|
230 |
} |
216
45d2dff788f2
almost last step of search : menu is active and we listen to the recognised event from the player.
cavaliet
parents:
206
diff
changeset
|
231 |
} |
45d2dff788f2
almost last step of search : menu is active and we listen to the recognised event from the player.
cavaliet
parents:
206
diff
changeset
|
232 |
} |
45d2dff788f2
almost last step of search : menu is active and we listen to the recognised event from the player.
cavaliet
parents:
206
diff
changeset
|
233 |
// The list was built. If the number of found annotations is >0, we send the list to the timeline |
45d2dff788f2
almost last step of search : menu is active and we listen to the recognised event from the player.
cavaliet
parents:
206
diff
changeset
|
234 |
UCTimeLine.updateAnnotationList(searchedAnnot); |
45d2dff788f2
almost last step of search : menu is active and we listen to the recognised event from the player.
cavaliet
parents:
206
diff
changeset
|
235 |
} |
45d2dff788f2
almost last step of search : menu is active and we listen to the recognised event from the player.
cavaliet
parents:
206
diff
changeset
|
236 |
|
45d2dff788f2
almost last step of search : menu is active and we listen to the recognised event from the player.
cavaliet
parents:
206
diff
changeset
|
237 |
void UCTimeLine_NewGestureRecognized(object sender, NewGestureRecognizedEventArg e) |
45d2dff788f2
almost last step of search : menu is active and we listen to the recognised event from the player.
cavaliet
parents:
206
diff
changeset
|
238 |
{ |
45d2dff788f2
almost last step of search : menu is active and we listen to the recognised event from the player.
cavaliet
parents:
206
diff
changeset
|
239 |
searchAnnotations(e.GestureName); |
45d2dff788f2
almost last step of search : menu is active and we listen to the recognised event from the player.
cavaliet
parents:
206
diff
changeset
|
240 |
} |
35 | 241 |
} |
242 |
} |