author | cavaliet |
Thu, 19 Nov 2009 12:15:12 +0100 | |
changeset 211 | 50e6fe2c2ea2 |
parent 199 | 70e93b0bd778 |
permissions | -rw-r--r-- |
180 | 1 |
using System; |
2 |
using System.Collections.Generic; |
|
3 |
using System.Linq; |
|
4 |
using System.Text; |
|
5 |
using System.Windows; |
|
6 |
using System.Windows.Controls; |
|
7 |
using System.Windows.Data; |
|
8 |
using System.Windows.Documents; |
|
9 |
using System.Windows.Input; |
|
10 |
using System.Windows.Media; |
|
11 |
using System.Windows.Media.Imaging; |
|
12 |
using System.Windows.Navigation; |
|
13 |
using System.Windows.Shapes; |
|
14 |
using Microsoft.Surface; |
|
15 |
using Microsoft.Surface.Presentation; |
|
16 |
using Microsoft.Surface.Presentation.Controls; |
|
188
e642ad0c366b
Tag Visualisation Control Sound (Use Byte Value "01") and Mute all other Players opened
ARIAS Santiago
parents:
180
diff
changeset
|
17 |
using System.ComponentModel; |
180 | 18 |
|
19 |
namespace FingersDance.Control.UserPanel |
|
20 |
{ |
|
21 |
/// <summary> |
|
22 |
/// Interaction logic for TagVisuSoundControl.xaml |
|
23 |
/// </summary> |
|
24 |
public partial class TagVisuSoundControl : TagVisualization |
|
25 |
{ |
|
188
e642ad0c366b
Tag Visualisation Control Sound (Use Byte Value "01") and Mute all other Players opened
ARIAS Santiago
parents:
180
diff
changeset
|
26 |
//Base sound |
e642ad0c366b
Tag Visualisation Control Sound (Use Byte Value "01") and Mute all other Players opened
ARIAS Santiago
parents:
180
diff
changeset
|
27 |
int sound =5; |
e642ad0c366b
Tag Visualisation Control Sound (Use Byte Value "01") and Mute all other Players opened
ARIAS Santiago
parents:
180
diff
changeset
|
28 |
int lastlevel = 0; |
e642ad0c366b
Tag Visualisation Control Sound (Use Byte Value "01") and Mute all other Players opened
ARIAS Santiago
parents:
180
diff
changeset
|
29 |
//Vars For Debug |
e642ad0c366b
Tag Visualisation Control Sound (Use Byte Value "01") and Mute all other Players opened
ARIAS Santiago
parents:
180
diff
changeset
|
30 |
List<int> listniveau = new List<int>(); |
e642ad0c366b
Tag Visualisation Control Sound (Use Byte Value "01") and Mute all other Players opened
ARIAS Santiago
parents:
180
diff
changeset
|
31 |
List<int> listsound = new List<int>(); |
e642ad0c366b
Tag Visualisation Control Sound (Use Byte Value "01") and Mute all other Players opened
ARIAS Santiago
parents:
180
diff
changeset
|
32 |
|
180 | 33 |
public TagVisuSoundControl() |
34 |
{ |
|
35 |
InitializeComponent(); |
|
188
e642ad0c366b
Tag Visualisation Control Sound (Use Byte Value "01") and Mute all other Players opened
ARIAS Santiago
parents:
180
diff
changeset
|
36 |
lastlevel = 1; |
e642ad0c366b
Tag Visualisation Control Sound (Use Byte Value "01") and Mute all other Players opened
ARIAS Santiago
parents:
180
diff
changeset
|
37 |
TagVisuSoundLevelUpdate(0); |
198 | 38 |
volumeModel.Visibility = Visibility.Hidden; |
39 |
#if DEBUG |
|
40 |
volumeModel.Visibility = Visibility.Visible; |
|
41 |
#endif |
|
180 | 42 |
} |
43 |
||
44 |
private void TagVisuSoundControl_Loaded(object sender, RoutedEventArgs e) |
|
45 |
{ |
|
46 |
//TODO: customize TagVisuSoundControl's UI based on this.VisualizedTag here |
|
188
e642ad0c366b
Tag Visualisation Control Sound (Use Byte Value "01") and Mute all other Players opened
ARIAS Santiago
parents:
180
diff
changeset
|
47 |
|
e642ad0c366b
Tag Visualisation Control Sound (Use Byte Value "01") and Mute all other Players opened
ARIAS Santiago
parents:
180
diff
changeset
|
48 |
} |
e642ad0c366b
Tag Visualisation Control Sound (Use Byte Value "01") and Mute all other Players opened
ARIAS Santiago
parents:
180
diff
changeset
|
49 |
|
e642ad0c366b
Tag Visualisation Control Sound (Use Byte Value "01") and Mute all other Players opened
ARIAS Santiago
parents:
180
diff
changeset
|
50 |
//This Method Make the different elipses visible in accordance to the viriable "niveau" |
199 | 51 |
public int TagVisuSoundLevelUpdate(int niveau) |
188
e642ad0c366b
Tag Visualisation Control Sound (Use Byte Value "01") and Mute all other Players opened
ARIAS Santiago
parents:
180
diff
changeset
|
52 |
{ |
199 | 53 |
int nbelipsesvisible = -1; |
188
e642ad0c366b
Tag Visualisation Control Sound (Use Byte Value "01") and Mute all other Players opened
ARIAS Santiago
parents:
180
diff
changeset
|
54 |
int tempsound = 0; |
e642ad0c366b
Tag Visualisation Control Sound (Use Byte Value "01") and Mute all other Players opened
ARIAS Santiago
parents:
180
diff
changeset
|
55 |
//--DEBUG listniveau.Add(niveau); |
e642ad0c366b
Tag Visualisation Control Sound (Use Byte Value "01") and Mute all other Players opened
ARIAS Santiago
parents:
180
diff
changeset
|
56 |
if (Math.Abs(lastlevel - niveau) == 1) |
e642ad0c366b
Tag Visualisation Control Sound (Use Byte Value "01") and Mute all other Players opened
ARIAS Santiago
parents:
180
diff
changeset
|
57 |
{ |
e642ad0c366b
Tag Visualisation Control Sound (Use Byte Value "01") and Mute all other Players opened
ARIAS Santiago
parents:
180
diff
changeset
|
58 |
lastlevel = niveau; |
e642ad0c366b
Tag Visualisation Control Sound (Use Byte Value "01") and Mute all other Players opened
ARIAS Santiago
parents:
180
diff
changeset
|
59 |
tempsound = sound + niveau; |
199 | 60 |
if (tempsound > -1 && tempsound < 11) |
188
e642ad0c366b
Tag Visualisation Control Sound (Use Byte Value "01") and Mute all other Players opened
ARIAS Santiago
parents:
180
diff
changeset
|
61 |
{ |
199 | 62 |
nbelipsesvisible = 0; |
63 |
//--DEBUG listsound.Add(tempsound); |
|
64 |
for (int i = 1; i <= tempsound; i++) |
|
188
e642ad0c366b
Tag Visualisation Control Sound (Use Byte Value "01") and Mute all other Players opened
ARIAS Santiago
parents:
180
diff
changeset
|
65 |
{ |
199 | 66 |
switch (i) |
67 |
{ |
|
68 |
case 1: |
|
69 |
elipse01.Visibility = Visibility.Visible; |
|
70 |
nbelipsesvisible++; |
|
71 |
break; |
|
72 |
case 2: |
|
73 |
elipse02.Visibility = Visibility.Visible; |
|
74 |
nbelipsesvisible++; |
|
75 |
break; |
|
76 |
case 3: |
|
77 |
elipse03.Visibility = Visibility.Visible; |
|
78 |
nbelipsesvisible++; |
|
79 |
break; |
|
80 |
case 4: |
|
81 |
elipse04.Visibility = Visibility.Visible; |
|
82 |
nbelipsesvisible++; |
|
83 |
break; |
|
84 |
case 5: |
|
85 |
elipse05.Visibility = Visibility.Visible; |
|
86 |
nbelipsesvisible++; |
|
87 |
break; |
|
88 |
case 6: |
|
89 |
elipse06.Visibility = Visibility.Visible; |
|
90 |
nbelipsesvisible++; |
|
91 |
break; |
|
92 |
case 7: |
|
93 |
elipse07.Visibility = Visibility.Visible; |
|
94 |
nbelipsesvisible++; |
|
95 |
break; |
|
96 |
case 8: |
|
97 |
elipse08.Visibility = Visibility.Visible; |
|
98 |
nbelipsesvisible++; |
|
99 |
break; |
|
100 |
case 9: |
|
101 |
elipse09.Visibility = Visibility.Visible; |
|
102 |
nbelipsesvisible++; |
|
103 |
break; |
|
104 |
case 10: |
|
105 |
elipse10.Visibility = Visibility.Visible; |
|
106 |
nbelipsesvisible++; |
|
107 |
break; |
|
108 |
} |
|
188
e642ad0c366b
Tag Visualisation Control Sound (Use Byte Value "01") and Mute all other Players opened
ARIAS Santiago
parents:
180
diff
changeset
|
109 |
} |
199 | 110 |
for (int i = tempsound + 1; i < 11; i++) |
188
e642ad0c366b
Tag Visualisation Control Sound (Use Byte Value "01") and Mute all other Players opened
ARIAS Santiago
parents:
180
diff
changeset
|
111 |
{ |
199 | 112 |
switch (i) |
113 |
{ |
|
114 |
case 1: |
|
115 |
elipse01.Visibility = Visibility.Hidden; |
|
116 |
break; |
|
117 |
case 2: |
|
118 |
elipse02.Visibility = Visibility.Hidden; |
|
119 |
break; |
|
120 |
case 3: |
|
121 |
elipse03.Visibility = Visibility.Hidden; |
|
122 |
break; |
|
123 |
case 4: |
|
124 |
elipse04.Visibility = Visibility.Hidden; |
|
125 |
break; |
|
126 |
case 5: |
|
127 |
elipse05.Visibility = Visibility.Hidden; |
|
128 |
break; |
|
129 |
case 6: |
|
130 |
elipse06.Visibility = Visibility.Hidden; |
|
131 |
break; |
|
132 |
case 7: |
|
133 |
elipse07.Visibility = Visibility.Hidden; |
|
134 |
break; |
|
135 |
case 8: |
|
136 |
elipse08.Visibility = Visibility.Hidden; |
|
137 |
break; |
|
138 |
case 9: |
|
139 |
elipse09.Visibility = Visibility.Hidden; |
|
140 |
break; |
|
141 |
case 10: |
|
142 |
elipse10.Visibility = Visibility.Hidden; |
|
143 |
break; |
|
144 |
} |
|
188
e642ad0c366b
Tag Visualisation Control Sound (Use Byte Value "01") and Mute all other Players opened
ARIAS Santiago
parents:
180
diff
changeset
|
145 |
} |
e642ad0c366b
Tag Visualisation Control Sound (Use Byte Value "01") and Mute all other Players opened
ARIAS Santiago
parents:
180
diff
changeset
|
146 |
} |
e642ad0c366b
Tag Visualisation Control Sound (Use Byte Value "01") and Mute all other Players opened
ARIAS Santiago
parents:
180
diff
changeset
|
147 |
} |
199 | 148 |
return nbelipsesvisible; |
180 | 149 |
} |
150 |
} |
|
188
e642ad0c366b
Tag Visualisation Control Sound (Use Byte Value "01") and Mute all other Players opened
ARIAS Santiago
parents:
180
diff
changeset
|
151 |
|
e642ad0c366b
Tag Visualisation Control Sound (Use Byte Value "01") and Mute all other Players opened
ARIAS Santiago
parents:
180
diff
changeset
|
152 |
|
180 | 153 |
} |