src/FingersDance.Control.UserPanel/UserControlUserPanel.xaml.cs
changeset 199 70e93b0bd778
parent 195 48b3139bb182
child 211 50e6fe2c2ea2
equal deleted inserted replaced
198:37c16056c45b 199:70e93b0bd778
    79                 // The visualization stays for 2 seconds after the tag is lifted. 
    79                 // The visualization stays for 2 seconds after the tag is lifted. 
    80                 tagDef.LostTagTimeout = 2000.0;
    80                 tagDef.LostTagTimeout = 2000.0;
    81                 // The orientation offset (default). 
    81                 // The orientation offset (default). 
    82                 tagDef.OrientationOffsetFromTag = 0.0;
    82                 tagDef.OrientationOffsetFromTag = 0.0;
    83                 // The physical offset (horizontal inches, vertical inches). 
    83                 // The physical offset (horizontal inches, vertical inches). 
    84                 tagDef.PhysicalCenterOffsetFromTag = new Vector(0.5, 0.25);
    84                 tagDef.PhysicalCenterOffsetFromTag = new Vector(0, 0);
    85                 // The tag removal behavior (default). 
    85                 // The tag removal behavior (default). 
    86                 tagDef.TagRemovedBehavior = TagRemovedBehavior.Fade;
    86                 tagDef.TagRemovedBehavior = TagRemovedBehavior.Fade;
    87                 // Orient UI to tag? (default). 
    87                 // Orient UI to tag? (default). 
    88                 tagDef.UsesTagOrientation = true;
    88                 tagDef.UsesTagOrientation = true;
    89                 // Add the definition to the collection. 
    89                 // Add the definition to the collection. 
   109             if (((niveau == 9) || (niveau == 8)) && lastSoundlevel == 0)
   109             if (((niveau == 9) || (niveau == 8)) && lastSoundlevel == 0)
   110                 rise = false;
   110                 rise = false;
   111             //else if (((niveau == 1) || (niveau == 2) || (niveau == 3)) && lastSoundlevel == 0)
   111             //else if (((niveau == 1) || (niveau == 2) || (niveau == 3)) && lastSoundlevel == 0)
   112             else if (((niveau == 1) || (niveau == 2)) && lastSoundlevel == 0)
   112             else if (((niveau == 1) || (niveau == 2)) && lastSoundlevel == 0)
   113                 rise = true;
   113                 rise = true;
   114 
       
   115             
   114             
   116             if (!rise)
   115             if (!rise)
   117             {
   116             {
   118                 niveau = (niveau - 10) % 10;
   117                 niveau = (niveau - 10) % 10;
   119             }
   118             }
   120             //ToDo
   119             //--Elipse visibility
   121             //--1 Mute all other Players
   120             int elipseNB = tagsoundcontrol.TagVisuSoundLevelUpdate(niveau);
   122 
       
   123             //--2 Elipse visibility
       
   124             tagsoundcontrol.TagVisuSoundLevelUpdate(niveau);
       
   125             //Set the Sound of the Player.
   121             //Set the Sound of the Player.
   126             if (Math.Abs(lastSoundlevel - niveau) == 1)
   122             if(elipseNB != -1)
   127             {
   123             {
   128                 UserControlSyncSource.setUserPlayerVolume((double)niveau / 10.0);
   124                 UserControlSyncSource.setUserPlayerVolume(elipseNB/10.0);
   129             }
   125             }
   130             lastSoundlevel = niveau;
   126             lastSoundlevel = niveau;
   131             tagsoundcontrol.volumeModel.Content = niveau;//deltaOrientation.ToString();
   127             tagsoundcontrol.volumeModel.Content = elipseNB;//deltaOrientation.ToString();
   132 
   128 
   133         }
   129         }
   134         private void OnVisualizationAdded(object sender, TagVisualizerEventArgs e)
   130         private void OnVisualizationAdded(object sender, TagVisualizerEventArgs e)
   135         {
   131         {
   136             TagVisuSoundControl tagsoundcontrol = (TagVisuSoundControl)e.TagVisualization;
   132             TagVisuSoundControl tagsoundcontrol = (TagVisuSoundControl)e.TagVisualization;