src/FingersDance.Control.UserPanel/TagVisuSoundControl.xaml.cs
author cavaliet
Thu, 19 Nov 2009 12:15:12 +0100
changeset 211 50e6fe2c2ea2
parent 199 70e93b0bd778
permissions -rw-r--r--
second step for search. Menu created and UserPanel modified for search mode.
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
180
1c4ad413c837 Sound Control Base
ARIAS Santiago
parents:
diff changeset
     1
using System;
1c4ad413c837 Sound Control Base
ARIAS Santiago
parents:
diff changeset
     2
using System.Collections.Generic;
1c4ad413c837 Sound Control Base
ARIAS Santiago
parents:
diff changeset
     3
using System.Linq;
1c4ad413c837 Sound Control Base
ARIAS Santiago
parents:
diff changeset
     4
using System.Text;
1c4ad413c837 Sound Control Base
ARIAS Santiago
parents:
diff changeset
     5
using System.Windows;
1c4ad413c837 Sound Control Base
ARIAS Santiago
parents:
diff changeset
     6
using System.Windows.Controls;
1c4ad413c837 Sound Control Base
ARIAS Santiago
parents:
diff changeset
     7
using System.Windows.Data;
1c4ad413c837 Sound Control Base
ARIAS Santiago
parents:
diff changeset
     8
using System.Windows.Documents;
1c4ad413c837 Sound Control Base
ARIAS Santiago
parents:
diff changeset
     9
using System.Windows.Input;
1c4ad413c837 Sound Control Base
ARIAS Santiago
parents:
diff changeset
    10
using System.Windows.Media;
1c4ad413c837 Sound Control Base
ARIAS Santiago
parents:
diff changeset
    11
using System.Windows.Media.Imaging;
1c4ad413c837 Sound Control Base
ARIAS Santiago
parents:
diff changeset
    12
using System.Windows.Navigation;
1c4ad413c837 Sound Control Base
ARIAS Santiago
parents:
diff changeset
    13
using System.Windows.Shapes;
1c4ad413c837 Sound Control Base
ARIAS Santiago
parents:
diff changeset
    14
using Microsoft.Surface;
1c4ad413c837 Sound Control Base
ARIAS Santiago
parents:
diff changeset
    15
using Microsoft.Surface.Presentation;
1c4ad413c837 Sound Control Base
ARIAS Santiago
parents:
diff changeset
    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
1c4ad413c837 Sound Control Base
ARIAS Santiago
parents:
diff changeset
    18
1c4ad413c837 Sound Control Base
ARIAS Santiago
parents:
diff changeset
    19
namespace FingersDance.Control.UserPanel
1c4ad413c837 Sound Control Base
ARIAS Santiago
parents:
diff changeset
    20
{
1c4ad413c837 Sound Control Base
ARIAS Santiago
parents:
diff changeset
    21
    /// <summary>
1c4ad413c837 Sound Control Base
ARIAS Santiago
parents:
diff changeset
    22
    /// Interaction logic for TagVisuSoundControl.xaml
1c4ad413c837 Sound Control Base
ARIAS Santiago
parents:
diff changeset
    23
    /// </summary>
1c4ad413c837 Sound Control Base
ARIAS Santiago
parents:
diff changeset
    24
    public partial class TagVisuSoundControl : TagVisualization
1c4ad413c837 Sound Control Base
ARIAS Santiago
parents:
diff changeset
    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
1c4ad413c837 Sound Control Base
ARIAS Santiago
parents:
diff changeset
    33
        public TagVisuSoundControl()
1c4ad413c837 Sound Control Base
ARIAS Santiago
parents:
diff changeset
    34
        {
1c4ad413c837 Sound Control Base
ARIAS Santiago
parents:
diff changeset
    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
37c16056c45b Resize InkCanevas Gesture Control
ARIAS Santiago
parents: 188
diff changeset
    38
            volumeModel.Visibility = Visibility.Hidden;
37c16056c45b Resize InkCanevas Gesture Control
ARIAS Santiago
parents: 188
diff changeset
    39
            #if DEBUG
37c16056c45b Resize InkCanevas Gesture Control
ARIAS Santiago
parents: 188
diff changeset
    40
            volumeModel.Visibility = Visibility.Visible;
37c16056c45b Resize InkCanevas Gesture Control
ARIAS Santiago
parents: 188
diff changeset
    41
            #endif
180
1c4ad413c837 Sound Control Base
ARIAS Santiago
parents:
diff changeset
    42
        }
1c4ad413c837 Sound Control Base
ARIAS Santiago
parents:
diff changeset
    43
1c4ad413c837 Sound Control Base
ARIAS Santiago
parents:
diff changeset
    44
        private void TagVisuSoundControl_Loaded(object sender, RoutedEventArgs e)
1c4ad413c837 Sound Control Base
ARIAS Santiago
parents:
diff changeset
    45
        {
1c4ad413c837 Sound Control Base
ARIAS Santiago
parents:
diff changeset
    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
70e93b0bd778 DEBUG Tag Visualisation Control
ARIAS Santiago
parents: 198
diff changeset
    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
70e93b0bd778 DEBUG Tag Visualisation Control
ARIAS Santiago
parents: 198
diff changeset
    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
70e93b0bd778 DEBUG Tag Visualisation Control
ARIAS Santiago
parents: 198
diff changeset
    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
70e93b0bd778 DEBUG Tag Visualisation Control
ARIAS Santiago
parents: 198
diff changeset
    62
                   nbelipsesvisible = 0;
70e93b0bd778 DEBUG Tag Visualisation Control
ARIAS Santiago
parents: 198
diff changeset
    63
                   //--DEBUG listsound.Add(tempsound);
70e93b0bd778 DEBUG Tag Visualisation Control
ARIAS Santiago
parents: 198
diff changeset
    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
70e93b0bd778 DEBUG Tag Visualisation Control
ARIAS Santiago
parents: 198
diff changeset
    66
                       switch (i)
70e93b0bd778 DEBUG Tag Visualisation Control
ARIAS Santiago
parents: 198
diff changeset
    67
                       {
70e93b0bd778 DEBUG Tag Visualisation Control
ARIAS Santiago
parents: 198
diff changeset
    68
                           case 1:
70e93b0bd778 DEBUG Tag Visualisation Control
ARIAS Santiago
parents: 198
diff changeset
    69
                               elipse01.Visibility = Visibility.Visible;
70e93b0bd778 DEBUG Tag Visualisation Control
ARIAS Santiago
parents: 198
diff changeset
    70
                               nbelipsesvisible++;
70e93b0bd778 DEBUG Tag Visualisation Control
ARIAS Santiago
parents: 198
diff changeset
    71
                               break;
70e93b0bd778 DEBUG Tag Visualisation Control
ARIAS Santiago
parents: 198
diff changeset
    72
                           case 2:
70e93b0bd778 DEBUG Tag Visualisation Control
ARIAS Santiago
parents: 198
diff changeset
    73
                               elipse02.Visibility = Visibility.Visible;
70e93b0bd778 DEBUG Tag Visualisation Control
ARIAS Santiago
parents: 198
diff changeset
    74
                               nbelipsesvisible++;
70e93b0bd778 DEBUG Tag Visualisation Control
ARIAS Santiago
parents: 198
diff changeset
    75
                               break;
70e93b0bd778 DEBUG Tag Visualisation Control
ARIAS Santiago
parents: 198
diff changeset
    76
                           case 3:
70e93b0bd778 DEBUG Tag Visualisation Control
ARIAS Santiago
parents: 198
diff changeset
    77
                               elipse03.Visibility = Visibility.Visible;
70e93b0bd778 DEBUG Tag Visualisation Control
ARIAS Santiago
parents: 198
diff changeset
    78
                               nbelipsesvisible++;
70e93b0bd778 DEBUG Tag Visualisation Control
ARIAS Santiago
parents: 198
diff changeset
    79
                               break;
70e93b0bd778 DEBUG Tag Visualisation Control
ARIAS Santiago
parents: 198
diff changeset
    80
                           case 4:
70e93b0bd778 DEBUG Tag Visualisation Control
ARIAS Santiago
parents: 198
diff changeset
    81
                               elipse04.Visibility = Visibility.Visible;
70e93b0bd778 DEBUG Tag Visualisation Control
ARIAS Santiago
parents: 198
diff changeset
    82
                               nbelipsesvisible++;
70e93b0bd778 DEBUG Tag Visualisation Control
ARIAS Santiago
parents: 198
diff changeset
    83
                               break;
70e93b0bd778 DEBUG Tag Visualisation Control
ARIAS Santiago
parents: 198
diff changeset
    84
                           case 5:
70e93b0bd778 DEBUG Tag Visualisation Control
ARIAS Santiago
parents: 198
diff changeset
    85
                               elipse05.Visibility = Visibility.Visible;
70e93b0bd778 DEBUG Tag Visualisation Control
ARIAS Santiago
parents: 198
diff changeset
    86
                               nbelipsesvisible++;
70e93b0bd778 DEBUG Tag Visualisation Control
ARIAS Santiago
parents: 198
diff changeset
    87
                               break;
70e93b0bd778 DEBUG Tag Visualisation Control
ARIAS Santiago
parents: 198
diff changeset
    88
                           case 6:
70e93b0bd778 DEBUG Tag Visualisation Control
ARIAS Santiago
parents: 198
diff changeset
    89
                               elipse06.Visibility = Visibility.Visible;
70e93b0bd778 DEBUG Tag Visualisation Control
ARIAS Santiago
parents: 198
diff changeset
    90
                               nbelipsesvisible++;
70e93b0bd778 DEBUG Tag Visualisation Control
ARIAS Santiago
parents: 198
diff changeset
    91
                               break;
70e93b0bd778 DEBUG Tag Visualisation Control
ARIAS Santiago
parents: 198
diff changeset
    92
                           case 7:
70e93b0bd778 DEBUG Tag Visualisation Control
ARIAS Santiago
parents: 198
diff changeset
    93
                               elipse07.Visibility = Visibility.Visible;
70e93b0bd778 DEBUG Tag Visualisation Control
ARIAS Santiago
parents: 198
diff changeset
    94
                               nbelipsesvisible++;
70e93b0bd778 DEBUG Tag Visualisation Control
ARIAS Santiago
parents: 198
diff changeset
    95
                               break;
70e93b0bd778 DEBUG Tag Visualisation Control
ARIAS Santiago
parents: 198
diff changeset
    96
                           case 8:
70e93b0bd778 DEBUG Tag Visualisation Control
ARIAS Santiago
parents: 198
diff changeset
    97
                               elipse08.Visibility = Visibility.Visible;
70e93b0bd778 DEBUG Tag Visualisation Control
ARIAS Santiago
parents: 198
diff changeset
    98
                               nbelipsesvisible++;
70e93b0bd778 DEBUG Tag Visualisation Control
ARIAS Santiago
parents: 198
diff changeset
    99
                               break;
70e93b0bd778 DEBUG Tag Visualisation Control
ARIAS Santiago
parents: 198
diff changeset
   100
                           case 9:
70e93b0bd778 DEBUG Tag Visualisation Control
ARIAS Santiago
parents: 198
diff changeset
   101
                               elipse09.Visibility = Visibility.Visible;
70e93b0bd778 DEBUG Tag Visualisation Control
ARIAS Santiago
parents: 198
diff changeset
   102
                               nbelipsesvisible++;
70e93b0bd778 DEBUG Tag Visualisation Control
ARIAS Santiago
parents: 198
diff changeset
   103
                               break;
70e93b0bd778 DEBUG Tag Visualisation Control
ARIAS Santiago
parents: 198
diff changeset
   104
                           case 10:
70e93b0bd778 DEBUG Tag Visualisation Control
ARIAS Santiago
parents: 198
diff changeset
   105
                               elipse10.Visibility = Visibility.Visible;
70e93b0bd778 DEBUG Tag Visualisation Control
ARIAS Santiago
parents: 198
diff changeset
   106
                               nbelipsesvisible++;
70e93b0bd778 DEBUG Tag Visualisation Control
ARIAS Santiago
parents: 198
diff changeset
   107
                               break;
70e93b0bd778 DEBUG Tag Visualisation Control
ARIAS Santiago
parents: 198
diff changeset
   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
70e93b0bd778 DEBUG Tag Visualisation Control
ARIAS Santiago
parents: 198
diff changeset
   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
70e93b0bd778 DEBUG Tag Visualisation Control
ARIAS Santiago
parents: 198
diff changeset
   112
                       switch (i)
70e93b0bd778 DEBUG Tag Visualisation Control
ARIAS Santiago
parents: 198
diff changeset
   113
                       {
70e93b0bd778 DEBUG Tag Visualisation Control
ARIAS Santiago
parents: 198
diff changeset
   114
                           case 1:
70e93b0bd778 DEBUG Tag Visualisation Control
ARIAS Santiago
parents: 198
diff changeset
   115
                               elipse01.Visibility = Visibility.Hidden;
70e93b0bd778 DEBUG Tag Visualisation Control
ARIAS Santiago
parents: 198
diff changeset
   116
                               break;
70e93b0bd778 DEBUG Tag Visualisation Control
ARIAS Santiago
parents: 198
diff changeset
   117
                           case 2:
70e93b0bd778 DEBUG Tag Visualisation Control
ARIAS Santiago
parents: 198
diff changeset
   118
                               elipse02.Visibility = Visibility.Hidden;
70e93b0bd778 DEBUG Tag Visualisation Control
ARIAS Santiago
parents: 198
diff changeset
   119
                               break;
70e93b0bd778 DEBUG Tag Visualisation Control
ARIAS Santiago
parents: 198
diff changeset
   120
                           case 3:
70e93b0bd778 DEBUG Tag Visualisation Control
ARIAS Santiago
parents: 198
diff changeset
   121
                               elipse03.Visibility = Visibility.Hidden;
70e93b0bd778 DEBUG Tag Visualisation Control
ARIAS Santiago
parents: 198
diff changeset
   122
                               break;
70e93b0bd778 DEBUG Tag Visualisation Control
ARIAS Santiago
parents: 198
diff changeset
   123
                           case 4:
70e93b0bd778 DEBUG Tag Visualisation Control
ARIAS Santiago
parents: 198
diff changeset
   124
                               elipse04.Visibility = Visibility.Hidden;
70e93b0bd778 DEBUG Tag Visualisation Control
ARIAS Santiago
parents: 198
diff changeset
   125
                               break;
70e93b0bd778 DEBUG Tag Visualisation Control
ARIAS Santiago
parents: 198
diff changeset
   126
                           case 5:
70e93b0bd778 DEBUG Tag Visualisation Control
ARIAS Santiago
parents: 198
diff changeset
   127
                               elipse05.Visibility = Visibility.Hidden;
70e93b0bd778 DEBUG Tag Visualisation Control
ARIAS Santiago
parents: 198
diff changeset
   128
                               break;
70e93b0bd778 DEBUG Tag Visualisation Control
ARIAS Santiago
parents: 198
diff changeset
   129
                           case 6:
70e93b0bd778 DEBUG Tag Visualisation Control
ARIAS Santiago
parents: 198
diff changeset
   130
                               elipse06.Visibility = Visibility.Hidden;
70e93b0bd778 DEBUG Tag Visualisation Control
ARIAS Santiago
parents: 198
diff changeset
   131
                               break;
70e93b0bd778 DEBUG Tag Visualisation Control
ARIAS Santiago
parents: 198
diff changeset
   132
                           case 7:
70e93b0bd778 DEBUG Tag Visualisation Control
ARIAS Santiago
parents: 198
diff changeset
   133
                               elipse07.Visibility = Visibility.Hidden;
70e93b0bd778 DEBUG Tag Visualisation Control
ARIAS Santiago
parents: 198
diff changeset
   134
                               break;
70e93b0bd778 DEBUG Tag Visualisation Control
ARIAS Santiago
parents: 198
diff changeset
   135
                           case 8:
70e93b0bd778 DEBUG Tag Visualisation Control
ARIAS Santiago
parents: 198
diff changeset
   136
                               elipse08.Visibility = Visibility.Hidden;
70e93b0bd778 DEBUG Tag Visualisation Control
ARIAS Santiago
parents: 198
diff changeset
   137
                               break;
70e93b0bd778 DEBUG Tag Visualisation Control
ARIAS Santiago
parents: 198
diff changeset
   138
                           case 9:
70e93b0bd778 DEBUG Tag Visualisation Control
ARIAS Santiago
parents: 198
diff changeset
   139
                               elipse09.Visibility = Visibility.Hidden;
70e93b0bd778 DEBUG Tag Visualisation Control
ARIAS Santiago
parents: 198
diff changeset
   140
                               break;
70e93b0bd778 DEBUG Tag Visualisation Control
ARIAS Santiago
parents: 198
diff changeset
   141
                           case 10:
70e93b0bd778 DEBUG Tag Visualisation Control
ARIAS Santiago
parents: 198
diff changeset
   142
                               elipse10.Visibility = Visibility.Hidden;
70e93b0bd778 DEBUG Tag Visualisation Control
ARIAS Santiago
parents: 198
diff changeset
   143
                               break;
70e93b0bd778 DEBUG Tag Visualisation Control
ARIAS Santiago
parents: 198
diff changeset
   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
70e93b0bd778 DEBUG Tag Visualisation Control
ARIAS Santiago
parents: 198
diff changeset
   148
           return nbelipsesvisible;
180
1c4ad413c837 Sound Control Base
ARIAS Santiago
parents:
diff changeset
   149
        }
1c4ad413c837 Sound Control Base
ARIAS Santiago
parents:
diff changeset
   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
1c4ad413c837 Sound Control Base
ARIAS Santiago
parents:
diff changeset
   153
}