src/FingersDance.Control.UserPanel/TagVisuSoundControl.xaml.cs
author cavaliet
Mon, 09 Nov 2009 12:11:42 +0100
changeset 190 619ca3ae13c7
parent 188 e642ad0c366b
child 198 37c16056c45b
permissions -rw-r--r--
MainViewModel is now well linked to all the users'cuttings. At any moment, the MVM has all annotations. This step prepares data saving.
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);
180
1c4ad413c837 Sound Control Base
ARIAS Santiago
parents:
diff changeset
    38
        }
1c4ad413c837 Sound Control Base
ARIAS Santiago
parents:
diff changeset
    39
1c4ad413c837 Sound Control Base
ARIAS Santiago
parents:
diff changeset
    40
        private void TagVisuSoundControl_Loaded(object sender, RoutedEventArgs e)
1c4ad413c837 Sound Control Base
ARIAS Santiago
parents:
diff changeset
    41
        {
1c4ad413c837 Sound Control Base
ARIAS Santiago
parents:
diff changeset
    42
            //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
    43
           
e642ad0c366b Tag Visualisation Control Sound (Use Byte Value "01") and Mute all other Players opened
ARIAS Santiago
parents: 180
diff changeset
    44
        }
e642ad0c366b Tag Visualisation Control Sound (Use Byte Value "01") and Mute all other Players opened
ARIAS Santiago
parents: 180
diff changeset
    45
e642ad0c366b Tag Visualisation Control Sound (Use Byte Value "01") and Mute all other Players opened
ARIAS Santiago
parents: 180
diff changeset
    46
        //This Method Make the different elipses visible in accordance to the viriable "niveau"
e642ad0c366b Tag Visualisation Control Sound (Use Byte Value "01") and Mute all other Players opened
ARIAS Santiago
parents: 180
diff changeset
    47
        public void TagVisuSoundLevelUpdate(int niveau)
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
           int tempsound = 0;
e642ad0c366b Tag Visualisation Control Sound (Use Byte Value "01") and Mute all other Players opened
ARIAS Santiago
parents: 180
diff changeset
    50
           //--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
    51
           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
    52
           {
e642ad0c366b Tag Visualisation Control Sound (Use Byte Value "01") and Mute all other Players opened
ARIAS Santiago
parents: 180
diff changeset
    53
               lastlevel = niveau;
e642ad0c366b Tag Visualisation Control Sound (Use Byte Value "01") and Mute all other Players opened
ARIAS Santiago
parents: 180
diff changeset
    54
               tempsound = sound + niveau;
e642ad0c366b Tag Visualisation Control Sound (Use Byte Value "01") and Mute all other Players opened
ARIAS Santiago
parents: 180
diff changeset
    55
               if (tempsound < 0)
e642ad0c366b Tag Visualisation Control Sound (Use Byte Value "01") and Mute all other Players opened
ARIAS Santiago
parents: 180
diff changeset
    56
                   tempsound = 0;
e642ad0c366b Tag Visualisation Control Sound (Use Byte Value "01") and Mute all other Players opened
ARIAS Santiago
parents: 180
diff changeset
    57
               if (tempsound > 10)
e642ad0c366b Tag Visualisation Control Sound (Use Byte Value "01") and Mute all other Players opened
ARIAS Santiago
parents: 180
diff changeset
    58
                   tempsound = 10;
e642ad0c366b Tag Visualisation Control Sound (Use Byte Value "01") and Mute all other Players opened
ARIAS Santiago
parents: 180
diff changeset
    59
               //--DEBUG listsound.Add(tempsound);
e642ad0c366b Tag Visualisation Control Sound (Use Byte Value "01") and Mute all other Players opened
ARIAS Santiago
parents: 180
diff changeset
    60
               for (int i = 1; i <= tempsound; i++)
e642ad0c366b Tag Visualisation Control Sound (Use Byte Value "01") and Mute all other Players opened
ARIAS Santiago
parents: 180
diff changeset
    61
               {
e642ad0c366b Tag Visualisation Control Sound (Use Byte Value "01") and Mute all other Players opened
ARIAS Santiago
parents: 180
diff changeset
    62
                   switch (i)
e642ad0c366b Tag Visualisation Control Sound (Use Byte Value "01") and Mute all other Players opened
ARIAS Santiago
parents: 180
diff changeset
    63
                   {
e642ad0c366b Tag Visualisation Control Sound (Use Byte Value "01") and Mute all other Players opened
ARIAS Santiago
parents: 180
diff changeset
    64
                       case 1:
e642ad0c366b Tag Visualisation Control Sound (Use Byte Value "01") and Mute all other Players opened
ARIAS Santiago
parents: 180
diff changeset
    65
                           elipse01.Visibility = Visibility.Visible;
e642ad0c366b Tag Visualisation Control Sound (Use Byte Value "01") and Mute all other Players opened
ARIAS Santiago
parents: 180
diff changeset
    66
                           break;
e642ad0c366b Tag Visualisation Control Sound (Use Byte Value "01") and Mute all other Players opened
ARIAS Santiago
parents: 180
diff changeset
    67
                       case 2:
e642ad0c366b Tag Visualisation Control Sound (Use Byte Value "01") and Mute all other Players opened
ARIAS Santiago
parents: 180
diff changeset
    68
                           elipse02.Visibility = Visibility.Visible;
e642ad0c366b Tag Visualisation Control Sound (Use Byte Value "01") and Mute all other Players opened
ARIAS Santiago
parents: 180
diff changeset
    69
                           break;
e642ad0c366b Tag Visualisation Control Sound (Use Byte Value "01") and Mute all other Players opened
ARIAS Santiago
parents: 180
diff changeset
    70
                       case 3:
e642ad0c366b Tag Visualisation Control Sound (Use Byte Value "01") and Mute all other Players opened
ARIAS Santiago
parents: 180
diff changeset
    71
                           elipse03.Visibility = Visibility.Visible;
e642ad0c366b Tag Visualisation Control Sound (Use Byte Value "01") and Mute all other Players opened
ARIAS Santiago
parents: 180
diff changeset
    72
                           break;
e642ad0c366b Tag Visualisation Control Sound (Use Byte Value "01") and Mute all other Players opened
ARIAS Santiago
parents: 180
diff changeset
    73
                       case 4:
e642ad0c366b Tag Visualisation Control Sound (Use Byte Value "01") and Mute all other Players opened
ARIAS Santiago
parents: 180
diff changeset
    74
                           elipse04.Visibility = Visibility.Visible;
e642ad0c366b Tag Visualisation Control Sound (Use Byte Value "01") and Mute all other Players opened
ARIAS Santiago
parents: 180
diff changeset
    75
                           break;
e642ad0c366b Tag Visualisation Control Sound (Use Byte Value "01") and Mute all other Players opened
ARIAS Santiago
parents: 180
diff changeset
    76
                       case 5:
e642ad0c366b Tag Visualisation Control Sound (Use Byte Value "01") and Mute all other Players opened
ARIAS Santiago
parents: 180
diff changeset
    77
                           elipse05.Visibility = Visibility.Visible;
e642ad0c366b Tag Visualisation Control Sound (Use Byte Value "01") and Mute all other Players opened
ARIAS Santiago
parents: 180
diff changeset
    78
                           break;
e642ad0c366b Tag Visualisation Control Sound (Use Byte Value "01") and Mute all other Players opened
ARIAS Santiago
parents: 180
diff changeset
    79
                       case 6:
e642ad0c366b Tag Visualisation Control Sound (Use Byte Value "01") and Mute all other Players opened
ARIAS Santiago
parents: 180
diff changeset
    80
                           elipse06.Visibility = Visibility.Visible;
e642ad0c366b Tag Visualisation Control Sound (Use Byte Value "01") and Mute all other Players opened
ARIAS Santiago
parents: 180
diff changeset
    81
                           break;
e642ad0c366b Tag Visualisation Control Sound (Use Byte Value "01") and Mute all other Players opened
ARIAS Santiago
parents: 180
diff changeset
    82
                       case 7:
e642ad0c366b Tag Visualisation Control Sound (Use Byte Value "01") and Mute all other Players opened
ARIAS Santiago
parents: 180
diff changeset
    83
                           elipse07.Visibility = Visibility.Visible;
e642ad0c366b Tag Visualisation Control Sound (Use Byte Value "01") and Mute all other Players opened
ARIAS Santiago
parents: 180
diff changeset
    84
                           break;
e642ad0c366b Tag Visualisation Control Sound (Use Byte Value "01") and Mute all other Players opened
ARIAS Santiago
parents: 180
diff changeset
    85
                       case 8:
e642ad0c366b Tag Visualisation Control Sound (Use Byte Value "01") and Mute all other Players opened
ARIAS Santiago
parents: 180
diff changeset
    86
                           elipse08.Visibility = Visibility.Visible;
e642ad0c366b Tag Visualisation Control Sound (Use Byte Value "01") and Mute all other Players opened
ARIAS Santiago
parents: 180
diff changeset
    87
                           break;
e642ad0c366b Tag Visualisation Control Sound (Use Byte Value "01") and Mute all other Players opened
ARIAS Santiago
parents: 180
diff changeset
    88
                       case 9:
e642ad0c366b Tag Visualisation Control Sound (Use Byte Value "01") and Mute all other Players opened
ARIAS Santiago
parents: 180
diff changeset
    89
                           elipse09.Visibility = Visibility.Visible;
e642ad0c366b Tag Visualisation Control Sound (Use Byte Value "01") and Mute all other Players opened
ARIAS Santiago
parents: 180
diff changeset
    90
                           break;
e642ad0c366b Tag Visualisation Control Sound (Use Byte Value "01") and Mute all other Players opened
ARIAS Santiago
parents: 180
diff changeset
    91
                       case 10:
e642ad0c366b Tag Visualisation Control Sound (Use Byte Value "01") and Mute all other Players opened
ARIAS Santiago
parents: 180
diff changeset
    92
                           elipse10.Visibility = Visibility.Visible;
e642ad0c366b Tag Visualisation Control Sound (Use Byte Value "01") and Mute all other Players opened
ARIAS Santiago
parents: 180
diff changeset
    93
                           break;
e642ad0c366b Tag Visualisation Control Sound (Use Byte Value "01") and Mute all other Players opened
ARIAS Santiago
parents: 180
diff changeset
    94
                   }
e642ad0c366b Tag Visualisation Control Sound (Use Byte Value "01") and Mute all other Players opened
ARIAS Santiago
parents: 180
diff changeset
    95
               }
e642ad0c366b Tag Visualisation Control Sound (Use Byte Value "01") and Mute all other Players opened
ARIAS Santiago
parents: 180
diff changeset
    96
               for (int i = tempsound + 1; i < 11; i++)
e642ad0c366b Tag Visualisation Control Sound (Use Byte Value "01") and Mute all other Players opened
ARIAS Santiago
parents: 180
diff changeset
    97
               {
e642ad0c366b Tag Visualisation Control Sound (Use Byte Value "01") and Mute all other Players opened
ARIAS Santiago
parents: 180
diff changeset
    98
                   switch (i)
e642ad0c366b Tag Visualisation Control Sound (Use Byte Value "01") and Mute all other Players opened
ARIAS Santiago
parents: 180
diff changeset
    99
                   {
e642ad0c366b Tag Visualisation Control Sound (Use Byte Value "01") and Mute all other Players opened
ARIAS Santiago
parents: 180
diff changeset
   100
                       case 1:
e642ad0c366b Tag Visualisation Control Sound (Use Byte Value "01") and Mute all other Players opened
ARIAS Santiago
parents: 180
diff changeset
   101
                           elipse01.Visibility = Visibility.Hidden;
e642ad0c366b Tag Visualisation Control Sound (Use Byte Value "01") and Mute all other Players opened
ARIAS Santiago
parents: 180
diff changeset
   102
                           break;
e642ad0c366b Tag Visualisation Control Sound (Use Byte Value "01") and Mute all other Players opened
ARIAS Santiago
parents: 180
diff changeset
   103
                       case 2:
e642ad0c366b Tag Visualisation Control Sound (Use Byte Value "01") and Mute all other Players opened
ARIAS Santiago
parents: 180
diff changeset
   104
                           elipse02.Visibility = Visibility.Hidden;
e642ad0c366b Tag Visualisation Control Sound (Use Byte Value "01") and Mute all other Players opened
ARIAS Santiago
parents: 180
diff changeset
   105
                           break;
e642ad0c366b Tag Visualisation Control Sound (Use Byte Value "01") and Mute all other Players opened
ARIAS Santiago
parents: 180
diff changeset
   106
                       case 3:
e642ad0c366b Tag Visualisation Control Sound (Use Byte Value "01") and Mute all other Players opened
ARIAS Santiago
parents: 180
diff changeset
   107
                           elipse03.Visibility = Visibility.Hidden;
e642ad0c366b Tag Visualisation Control Sound (Use Byte Value "01") and Mute all other Players opened
ARIAS Santiago
parents: 180
diff changeset
   108
                           break;
e642ad0c366b Tag Visualisation Control Sound (Use Byte Value "01") and Mute all other Players opened
ARIAS Santiago
parents: 180
diff changeset
   109
                       case 4:
e642ad0c366b Tag Visualisation Control Sound (Use Byte Value "01") and Mute all other Players opened
ARIAS Santiago
parents: 180
diff changeset
   110
                           elipse04.Visibility = Visibility.Hidden;
e642ad0c366b Tag Visualisation Control Sound (Use Byte Value "01") and Mute all other Players opened
ARIAS Santiago
parents: 180
diff changeset
   111
                           break;
e642ad0c366b Tag Visualisation Control Sound (Use Byte Value "01") and Mute all other Players opened
ARIAS Santiago
parents: 180
diff changeset
   112
                       case 5:
e642ad0c366b Tag Visualisation Control Sound (Use Byte Value "01") and Mute all other Players opened
ARIAS Santiago
parents: 180
diff changeset
   113
                           elipse05.Visibility = Visibility.Hidden;
e642ad0c366b Tag Visualisation Control Sound (Use Byte Value "01") and Mute all other Players opened
ARIAS Santiago
parents: 180
diff changeset
   114
                           break;
e642ad0c366b Tag Visualisation Control Sound (Use Byte Value "01") and Mute all other Players opened
ARIAS Santiago
parents: 180
diff changeset
   115
                       case 6:
e642ad0c366b Tag Visualisation Control Sound (Use Byte Value "01") and Mute all other Players opened
ARIAS Santiago
parents: 180
diff changeset
   116
                           elipse06.Visibility = Visibility.Hidden;
e642ad0c366b Tag Visualisation Control Sound (Use Byte Value "01") and Mute all other Players opened
ARIAS Santiago
parents: 180
diff changeset
   117
                           break;
e642ad0c366b Tag Visualisation Control Sound (Use Byte Value "01") and Mute all other Players opened
ARIAS Santiago
parents: 180
diff changeset
   118
                       case 7:
e642ad0c366b Tag Visualisation Control Sound (Use Byte Value "01") and Mute all other Players opened
ARIAS Santiago
parents: 180
diff changeset
   119
                           elipse07.Visibility = Visibility.Hidden;
e642ad0c366b Tag Visualisation Control Sound (Use Byte Value "01") and Mute all other Players opened
ARIAS Santiago
parents: 180
diff changeset
   120
                           break;
e642ad0c366b Tag Visualisation Control Sound (Use Byte Value "01") and Mute all other Players opened
ARIAS Santiago
parents: 180
diff changeset
   121
                       case 8:
e642ad0c366b Tag Visualisation Control Sound (Use Byte Value "01") and Mute all other Players opened
ARIAS Santiago
parents: 180
diff changeset
   122
                           elipse08.Visibility = Visibility.Hidden;
e642ad0c366b Tag Visualisation Control Sound (Use Byte Value "01") and Mute all other Players opened
ARIAS Santiago
parents: 180
diff changeset
   123
                           break;
e642ad0c366b Tag Visualisation Control Sound (Use Byte Value "01") and Mute all other Players opened
ARIAS Santiago
parents: 180
diff changeset
   124
                       case 9:
e642ad0c366b Tag Visualisation Control Sound (Use Byte Value "01") and Mute all other Players opened
ARIAS Santiago
parents: 180
diff changeset
   125
                           elipse09.Visibility = Visibility.Hidden;
e642ad0c366b Tag Visualisation Control Sound (Use Byte Value "01") and Mute all other Players opened
ARIAS Santiago
parents: 180
diff changeset
   126
                           break;
e642ad0c366b Tag Visualisation Control Sound (Use Byte Value "01") and Mute all other Players opened
ARIAS Santiago
parents: 180
diff changeset
   127
                       case 10:
e642ad0c366b Tag Visualisation Control Sound (Use Byte Value "01") and Mute all other Players opened
ARIAS Santiago
parents: 180
diff changeset
   128
                           elipse10.Visibility = Visibility.Hidden;
e642ad0c366b Tag Visualisation Control Sound (Use Byte Value "01") and Mute all other Players opened
ARIAS Santiago
parents: 180
diff changeset
   129
                           break;
e642ad0c366b Tag Visualisation Control Sound (Use Byte Value "01") and Mute all other Players opened
ARIAS Santiago
parents: 180
diff changeset
   130
                   }
e642ad0c366b Tag Visualisation Control Sound (Use Byte Value "01") and Mute all other Players opened
ARIAS Santiago
parents: 180
diff changeset
   131
               }
e642ad0c366b Tag Visualisation Control Sound (Use Byte Value "01") and Mute all other Players opened
ARIAS Santiago
parents: 180
diff changeset
   132
           }
180
1c4ad413c837 Sound Control Base
ARIAS Santiago
parents:
diff changeset
   133
        }
1c4ad413c837 Sound Control Base
ARIAS Santiago
parents:
diff changeset
   134
    }
188
e642ad0c366b Tag Visualisation Control Sound (Use Byte Value "01") and Mute all other Players opened
ARIAS Santiago
parents: 180
diff changeset
   135
e642ad0c366b Tag Visualisation Control Sound (Use Byte Value "01") and Mute all other Players opened
ARIAS Santiago
parents: 180
diff changeset
   136
    
180
1c4ad413c837 Sound Control Base
ARIAS Santiago
parents:
diff changeset
   137
}