author | cavaliet |
Fri, 20 Nov 2009 17:14:52 +0100 | |
changeset 216 | 45d2dff788f2 |
parent 206 | 89813df17ec2 |
child 224 | 874de6d84a2e |
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 |
||
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
|
36 |
public void Load(string path, Color col, 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 |
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
|
42 |
UCTimeLine.initTimer(col, 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 |
{ |
75
99d003723474
data binding second step. we can add annotation by clicking on menu buttons or timeline.
cavaliet
parents:
39
diff
changeset
|
135 |
UCTimeLine.Slider.Value = UserControlPlayer.Player.Position.TotalMilliseconds; |
35 | 136 |
} |
195
48b3139bb182
Dictionnaire de données
PAMPHILE Jonathan <pamphile@efrei.fr>
parents:
193
diff
changeset
|
137 |
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
|
138 |
if (UCTimeLine.FinishedDragging) |
35 | 139 |
{ |
140 |
TimeSpan ts = new TimeSpan(0, 0, 0, 0, SliderValue); |
|
141 |
||
142 |
UserControlPlayer.Player.Position = ts; |
|
143 |
UserControlPlayer.playerPlay(); |
|
144 |
||
75
99d003723474
data binding second step. we can add annotation by clicking on menu buttons or timeline.
cavaliet
parents:
39
diff
changeset
|
145 |
UCTimeLine.IsDragging = false; |
99d003723474
data binding second step. we can add annotation by clicking on menu buttons or timeline.
cavaliet
parents:
39
diff
changeset
|
146 |
UCTimeLine.FinishedDragging = false; |
35 | 147 |
} |
205
468f3757f1f8
Correction probleme tc annotation
PAMPHILE Jonathan <pamphile@efrei.fr>
parents:
195
diff
changeset
|
148 |
UserControlPlayer.Time = (float)SliderValue / 1000; |
195
48b3139bb182
Dictionnaire de données
PAMPHILE Jonathan <pamphile@efrei.fr>
parents:
193
diff
changeset
|
149 |
DataDictionary Data = (new DataFactory()).Data; |
48b3139bb182
Dictionnaire de données
PAMPHILE Jonathan <pamphile@efrei.fr>
parents:
193
diff
changeset
|
150 |
UserControlPlayer.ApplyColor(Data.GetColors((int)((float)SliderValue / 1000))); |
35 | 151 |
} |
152 |
#endregion |
|
75
99d003723474
data binding second step. we can add annotation by clicking on menu buttons or timeline.
cavaliet
parents:
39
diff
changeset
|
153 |
|
99d003723474
data binding second step. we can add annotation by clicking on menu buttons or timeline.
cavaliet
parents:
39
diff
changeset
|
154 |
public UserControlTimeLine userControlTimeLine |
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 |
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
|
157 |
} |
152
46577fd0a294
PlayerPause en resize
PAMPHILE Jonathan <pamphile@efrei.fr>
parents:
150
diff
changeset
|
158 |
|
46577fd0a294
PlayerPause en resize
PAMPHILE Jonathan <pamphile@efrei.fr>
parents:
150
diff
changeset
|
159 |
public void PlayerPause() |
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 |
UserControlPlayer.playerPause(); |
46577fd0a294
PlayerPause en resize
PAMPHILE Jonathan <pamphile@efrei.fr>
parents:
150
diff
changeset
|
162 |
} |
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
|
163 |
|
45d2dff788f2
almost last step of search : menu is active and we listen to the recognised event from the player.
cavaliet
parents:
206
diff
changeset
|
164 |
|
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 |
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
|
166 |
{ |
45d2dff788f2
almost last step of search : menu is active and we listen to the recognised event from the player.
cavaliet
parents:
206
diff
changeset
|
167 |
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
|
168 |
{ |
45d2dff788f2
almost last step of search : menu is active and we listen to the recognised event from the player.
cavaliet
parents:
206
diff
changeset
|
169 |
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
|
170 |
//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
|
171 |
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
|
172 |
{ |
45d2dff788f2
almost last step of search : menu is active and we listen to the recognised event from the player.
cavaliet
parents:
206
diff
changeset
|
173 |
// 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
|
174 |
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
|
175 |
if (dur == 0) dur = (float)0.5; |
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 |
foreach (Gesture elt in grea.Gestures) |
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 |
UCTimeLine.addAnnotation((float)grea.Start, dur, elt.Name); |
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 |
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
|
180 |
{ |
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 |
// 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
|
182 |
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
|
183 |
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
|
184 |
{ |
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 |
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
|
186 |
{ |
45d2dff788f2
almost last step of search : menu is active and we listen to the recognised event from the player.
cavaliet
parents:
206
diff
changeset
|
187 |
foreach(Gesture gest in grea.Gestures) |
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 |
if (annot.GestureType == gest.Name) |
45d2dff788f2
almost last step of search : menu is active and we listen to the recognised event from the player.
cavaliet
parents:
206
diff
changeset
|
189 |
{ |
45d2dff788f2
almost last step of search : menu is active and we listen to the recognised event from the player.
cavaliet
parents:
206
diff
changeset
|
190 |
// One of the gesture is enough for the annotation to be added |
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 |
searchedAnnot.Add(annot); |
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 |
break; |
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 |
} |
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 |
} |
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 |
// 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
|
197 |
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
|
198 |
} |
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 |
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
|
201 |
} |
45d2dff788f2
almost last step of search : menu is active and we listen to the recognised event from the player.
cavaliet
parents:
206
diff
changeset
|
202 |
|
45d2dff788f2
almost last step of search : menu is active and we listen to the recognised event from the player.
cavaliet
parents:
206
diff
changeset
|
203 |
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
|
204 |
{ |
45d2dff788f2
almost last step of search : menu is active and we listen to the recognised event from the player.
cavaliet
parents:
206
diff
changeset
|
205 |
// 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
|
206 |
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
|
207 |
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
|
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 |
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
|
210 |
{ |
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 |
if (annot.GestureType == 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
|
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 |
// One of the gesture is enough for the annotation to be added |
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 |
searchedAnnot.Add(annot); |
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 |
} |
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 |
// 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
|
219 |
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
|
220 |
} |
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 |
|
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 |
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
|
223 |
{ |
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 |
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
|
225 |
} |
35 | 226 |
} |
227 |
} |