src/FingersDance.Control.UserPanel/UserControlUserPanel.xaml.cs
author ARIAS Santiago
Tue, 24 Nov 2009 07:50:17 +0100
changeset 224 874de6d84a2e
parent 216 45d2dff788f2
child 229 05aba5def1fc
permissions -rw-r--r--
Panels visibility Pivot Position OnContactLeave UserPanel Close "UserTest" removed
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
35
ed77793b767a Control Pivot,
sarias
parents:
diff changeset
     1
using System;
ed77793b767a Control Pivot,
sarias
parents:
diff changeset
     2
using System.IO;
ed77793b767a Control Pivot,
sarias
parents:
diff changeset
     3
using System.Net;
214
beebae32b1ed third step of search : better integration of search panel and debug from loaded search project and annotated project.
cavaliet
parents: 211
diff changeset
     4
using System.Reflection;
35
ed77793b767a Control Pivot,
sarias
parents:
diff changeset
     5
using System.Windows;
ed77793b767a Control Pivot,
sarias
parents:
diff changeset
     6
using System.Windows.Controls;
ed77793b767a Control Pivot,
sarias
parents:
diff changeset
     7
using System.Windows.Data;
ed77793b767a Control Pivot,
sarias
parents:
diff changeset
     8
using System.Windows.Media;
ed77793b767a Control Pivot,
sarias
parents:
diff changeset
     9
using System.Windows.Media.Animation;
ed77793b767a Control Pivot,
sarias
parents:
diff changeset
    10
using System.Windows.Navigation;
214
beebae32b1ed third step of search : better integration of search panel and debug from loaded search project and annotated project.
cavaliet
parents: 211
diff changeset
    11
using System.Globalization;
180
1c4ad413c837 Sound Control Base
ARIAS Santiago
parents: 162
diff changeset
    12
using Microsoft.Surface.Presentation;
1c4ad413c837 Sound Control Base
ARIAS Santiago
parents: 162
diff changeset
    13
using Microsoft.Surface.Presentation.Controls;
214
beebae32b1ed third step of search : better integration of search panel and debug from loaded search project and annotated project.
cavaliet
parents: 211
diff changeset
    14
beebae32b1ed third step of search : better integration of search panel and debug from loaded search project and annotated project.
cavaliet
parents: 211
diff changeset
    15
using FingersDance.Data;
182
25b49d4f1635 First step of data reorganisation : session is meant to disappear : a "session" is in fact a project and one project owns several cuttings, one per user. WARNING : this commit builds without problems but we can not open more than one UserPanel.
cavaliet
parents: 162
diff changeset
    16
using FingersDance.ViewModels;
35
ed77793b767a Control Pivot,
sarias
parents:
diff changeset
    17
ed77793b767a Control Pivot,
sarias
parents:
diff changeset
    18
namespace FingersDance.Control.UserPanel
ed77793b767a Control Pivot,
sarias
parents:
diff changeset
    19
{
ed77793b767a Control Pivot,
sarias
parents:
diff changeset
    20
	public partial class UserControlUserPanel
ed77793b767a Control Pivot,
sarias
parents:
diff changeset
    21
	{
162
0b9f989bcb37 Display annotations in all opened UserPanels with the user's color
sarias
parents: 160
diff changeset
    22
        #region Variables
0b9f989bcb37 Display annotations in all opened UserPanels with the user's color
sarias
parents: 160
diff changeset
    23
180
1c4ad413c837 Sound Control Base
ARIAS Santiago
parents: 162
diff changeset
    24
        //public ContactEventHandler ContactDown;
188
e642ad0c366b Tag Visualisation Control Sound (Use Byte Value "01") and Mute all other Players opened
ARIAS Santiago
parents: 186
diff changeset
    25
        public event EventHandler OnSuccessAnnotation;  //Event to display ColorAnnotation from different Users   
e642ad0c366b Tag Visualisation Control Sound (Use Byte Value "01") and Mute all other Players opened
ARIAS Santiago
parents: 186
diff changeset
    26
        public event EventHandler OnTagVisualisation; //Event to Mute all Players
131
9331c3dea175 Close Control
sarias
parents: 121
diff changeset
    27
        public int id = 0;
162
0b9f989bcb37 Display annotations in all opened UserPanels with the user's color
sarias
parents: 160
diff changeset
    28
        public uint idcolor = 0;    //The color of the Pivot Button
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
    29
        private Cutting cut;
182
25b49d4f1635 First step of data reorganisation : session is meant to disappear : a "session" is in fact a project and one project owns several cuttings, one per user. WARNING : this commit builds without problems but we can not open more than one UserPanel.
cavaliet
parents: 162
diff changeset
    30
188
e642ad0c366b Tag Visualisation Control Sound (Use Byte Value "01") and Mute all other Players opened
ARIAS Santiago
parents: 186
diff changeset
    31
        //variables for TagSound Control
e642ad0c366b Tag Visualisation Control Sound (Use Byte Value "01") and Mute all other Players opened
ARIAS Santiago
parents: 186
diff changeset
    32
        double baseOrientation = 0;
e642ad0c366b Tag Visualisation Control Sound (Use Byte Value "01") and Mute all other Players opened
ARIAS Santiago
parents: 186
diff changeset
    33
        double deltaOrientation = 0;
e642ad0c366b Tag Visualisation Control Sound (Use Byte Value "01") and Mute all other Players opened
ARIAS Santiago
parents: 186
diff changeset
    34
        double lastdeltaOrientation = 0;
e642ad0c366b Tag Visualisation Control Sound (Use Byte Value "01") and Mute all other Players opened
ARIAS Santiago
parents: 186
diff changeset
    35
        int lastSoundlevel = 0;
e642ad0c366b Tag Visualisation Control Sound (Use Byte Value "01") and Mute all other Players opened
ARIAS Santiago
parents: 186
diff changeset
    36
        bool rise = true; //rise is true if the curse of the volume is positive
215
d13dbcf861d7 BOutton annotation, tag volume, chargement des annotations sauvegardées du projet dans le dictionnaire de données
PAMPHILE Jonathan <pamphile@efrei.fr>
parents: 214
diff changeset
    37
        int LastElipseNB = 0;
d13dbcf861d7 BOutton annotation, tag volume, chargement des annotations sauvegardées du projet dans le dictionnaire de données
PAMPHILE Jonathan <pamphile@efrei.fr>
parents: 214
diff changeset
    38
162
0b9f989bcb37 Display annotations in all opened UserPanels with the user's color
sarias
parents: 160
diff changeset
    39
        #endregion
143
PAMPHILE Jonathan <pamphile@efrei.fr>
parents: 121
diff changeset
    40
162
0b9f989bcb37 Display annotations in all opened UserPanels with the user's color
sarias
parents: 160
diff changeset
    41
        #region Properties
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
        public Cutting Cutting
143
PAMPHILE Jonathan <pamphile@efrei.fr>
parents: 121
diff changeset
    43
        {
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
    44
            get { return cut; }
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
    45
            set { cut = value; }
143
PAMPHILE Jonathan <pamphile@efrei.fr>
parents: 121
diff changeset
    46
        }
162
0b9f989bcb37 Display annotations in all opened UserPanels with the user's color
sarias
parents: 160
diff changeset
    47
        #endregion
143
PAMPHILE Jonathan <pamphile@efrei.fr>
parents: 121
diff changeset
    48
162
0b9f989bcb37 Display annotations in all opened UserPanels with the user's color
sarias
parents: 160
diff changeset
    49
        #region Constructors
0b9f989bcb37 Display annotations in all opened UserPanels with the user's color
sarias
parents: 160
diff changeset
    50
        public UserControlUserPanel()
35
ed77793b767a Control Pivot,
sarias
parents:
diff changeset
    51
		{
ed77793b767a Control Pivot,
sarias
parents:
diff changeset
    52
			this.InitializeComponent();
ed77793b767a Control Pivot,
sarias
parents:
diff changeset
    53
ed77793b767a Control Pivot,
sarias
parents:
diff changeset
    54
			// Insert code required on object creation below this point.
ed77793b767a Control Pivot,
sarias
parents:
diff changeset
    55
		}
119
PAMPHILE Jonathan <pamphile@efrei.fr>
parents: 35
diff changeset
    56
214
beebae32b1ed third step of search : better integration of search panel and debug from loaded search project and annotated project.
cavaliet
parents: 211
diff changeset
    57
        public UserControlUserPanel(int idPar, Color col, Cutting cutPar, String path, String AnnotationOrSearchMode, Project searchedProj)
119
PAMPHILE Jonathan <pamphile@efrei.fr>
parents: 35
diff changeset
    58
        {
PAMPHILE Jonathan <pamphile@efrei.fr>
parents: 35
diff changeset
    59
            this.InitializeComponent();
150
569925b65604 Annotations are now colored with the same color as the pivot's button
cavaliet
parents: 146
diff changeset
    60
            id = idPar;
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
    61
            cut = cutPar;
211
50e6fe2c2ea2 second step for search. Menu created and UserPanel modified for search mode.
cavaliet
parents: 199
diff changeset
    62
            // We make the syncsrc load the good video and cutting 
216
45d2dff788f2 almost last step of search : menu is active and we listen to the recognised event from the player.
cavaliet
parents: 215
diff changeset
    63
            this.UserControlSyncSource.Load(path, col, cut, AnnotationOrSearchMode, searchedProj);
211
50e6fe2c2ea2 second step for search. Menu created and UserPanel modified for search mode.
cavaliet
parents: 199
diff changeset
    64
            UserControlSyncSource.OnSuccessAnnotation += new EventHandler(UserControlSyncSource_OnSuccessAnnotation);
50e6fe2c2ea2 second step for search. Menu created and UserPanel modified for search mode.
cavaliet
parents: 199
diff changeset
    65
            // We make the menu load the good xml
50e6fe2c2ea2 second step for search. Menu created and UserPanel modified for search mode.
cavaliet
parents: 199
diff changeset
    66
            UCMenu.MenuXmlFile = (AnnotationOrSearchMode == "Search") ? "menu_search.xml" : "menu.xml";
188
e642ad0c366b Tag Visualisation Control Sound (Use Byte Value "01") and Mute all other Players opened
ARIAS Santiago
parents: 186
diff changeset
    67
            //SAR -Initialize Tag Values
180
1c4ad413c837 Sound Control Base
ARIAS Santiago
parents: 162
diff changeset
    68
            InitializeDefinitions();
1c4ad413c837 Sound Control Base
ARIAS Santiago
parents: 162
diff changeset
    69
        }
188
e642ad0c366b Tag Visualisation Control Sound (Use Byte Value "01") and Mute all other Players opened
ARIAS Santiago
parents: 186
diff changeset
    70
        #endregion
180
1c4ad413c837 Sound Control Base
ARIAS Santiago
parents: 162
diff changeset
    71
188
e642ad0c366b Tag Visualisation Control Sound (Use Byte Value "01") and Mute all other Players opened
ARIAS Santiago
parents: 186
diff changeset
    72
        #region Tag Management
e642ad0c366b Tag Visualisation Control Sound (Use Byte Value "01") and Mute all other Players opened
ARIAS Santiago
parents: 186
diff changeset
    73
e642ad0c366b Tag Visualisation Control Sound (Use Byte Value "01") and Mute all other Players opened
ARIAS Santiago
parents: 186
diff changeset
    74
        private void InitializeDefinitions()
e642ad0c366b Tag Visualisation Control Sound (Use Byte Value "01") and Mute all other Players opened
ARIAS Santiago
parents: 186
diff changeset
    75
        {
215
d13dbcf861d7 BOutton annotation, tag volume, chargement des annotations sauvegardées du projet dans le dictionnaire de données
PAMPHILE Jonathan <pamphile@efrei.fr>
parents: 214
diff changeset
    76
            for (byte k = 1; k <= 25; k++)
188
e642ad0c366b Tag Visualisation Control Sound (Use Byte Value "01") and Mute all other Players opened
ARIAS Santiago
parents: 186
diff changeset
    77
            {
e642ad0c366b Tag Visualisation Control Sound (Use Byte Value "01") and Mute all other Players opened
ARIAS Santiago
parents: 186
diff changeset
    78
                ByteTagVisualizationDefinition tagDef = new ByteTagVisualizationDefinition();
180
1c4ad413c837 Sound Control Base
ARIAS Santiago
parents: 162
diff changeset
    79
                // The tag value that this definition will respond to. 
188
e642ad0c366b Tag Visualisation Control Sound (Use Byte Value "01") and Mute all other Players opened
ARIAS Santiago
parents: 186
diff changeset
    80
                tagDef.Value = k;
180
1c4ad413c837 Sound Control Base
ARIAS Santiago
parents: 162
diff changeset
    81
                // The .xaml file for the UI. 
1c4ad413c837 Sound Control Base
ARIAS Santiago
parents: 162
diff changeset
    82
                tagDef.Source = new Uri("FingersDance.Control.UserPanel;Component/TagVisuSoundControl.xaml", UriKind.Relative);
1c4ad413c837 Sound Control Base
ARIAS Santiago
parents: 162
diff changeset
    83
1c4ad413c837 Sound Control Base
ARIAS Santiago
parents: 162
diff changeset
    84
                // The maximum number for this tag value. tagDef.MaxCount = 2; 
1c4ad413c837 Sound Control Base
ARIAS Santiago
parents: 162
diff changeset
    85
                // The visualization stays for 2 seconds after the tag is lifted. 
188
e642ad0c366b Tag Visualisation Control Sound (Use Byte Value "01") and Mute all other Players opened
ARIAS Santiago
parents: 186
diff changeset
    86
                tagDef.LostTagTimeout = 2000.0;
180
1c4ad413c837 Sound Control Base
ARIAS Santiago
parents: 162
diff changeset
    87
                // The orientation offset (default). 
188
e642ad0c366b Tag Visualisation Control Sound (Use Byte Value "01") and Mute all other Players opened
ARIAS Santiago
parents: 186
diff changeset
    88
                tagDef.OrientationOffsetFromTag = 0.0;
180
1c4ad413c837 Sound Control Base
ARIAS Santiago
parents: 162
diff changeset
    89
                // The physical offset (horizontal inches, vertical inches). 
199
70e93b0bd778 DEBUG Tag Visualisation Control
ARIAS Santiago
parents: 195
diff changeset
    90
                tagDef.PhysicalCenterOffsetFromTag = new Vector(0, 0);
180
1c4ad413c837 Sound Control Base
ARIAS Santiago
parents: 162
diff changeset
    91
                // The tag removal behavior (default). 
188
e642ad0c366b Tag Visualisation Control Sound (Use Byte Value "01") and Mute all other Players opened
ARIAS Santiago
parents: 186
diff changeset
    92
                tagDef.TagRemovedBehavior = TagRemovedBehavior.Fade;
180
1c4ad413c837 Sound Control Base
ARIAS Santiago
parents: 162
diff changeset
    93
                // Orient UI to tag? (default). 
188
e642ad0c366b Tag Visualisation Control Sound (Use Byte Value "01") and Mute all other Players opened
ARIAS Santiago
parents: 186
diff changeset
    94
                tagDef.UsesTagOrientation = true;
180
1c4ad413c837 Sound Control Base
ARIAS Santiago
parents: 162
diff changeset
    95
                // Add the definition to the collection. 
188
e642ad0c366b Tag Visualisation Control Sound (Use Byte Value "01") and Mute all other Players opened
ARIAS Santiago
parents: 186
diff changeset
    96
                this.tagVisualizer.Definitions.Add(tagDef);
e642ad0c366b Tag Visualisation Control Sound (Use Byte Value "01") and Mute all other Players opened
ARIAS Santiago
parents: 186
diff changeset
    97
            }
180
1c4ad413c837 Sound Control Base
ARIAS Santiago
parents: 162
diff changeset
    98
        }
1c4ad413c837 Sound Control Base
ARIAS Santiago
parents: 162
diff changeset
    99
188
e642ad0c366b Tag Visualisation Control Sound (Use Byte Value "01") and Mute all other Players opened
ARIAS Santiago
parents: 186
diff changeset
   100
        //SAR - Event Rised when Tag Control is moved or rotated
e642ad0c366b Tag Visualisation Control Sound (Use Byte Value "01") and Mute all other Players opened
ARIAS Santiago
parents: 186
diff changeset
   101
        private void tagVisualizer_VisualizationMoved(object sender, TagVisualizerEventArgs e)
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
            /*TagVisuSoundControl tagsoundcontrol = (TagVisuSoundControl)e.TagVisualization;
e642ad0c366b Tag Visualisation Control Sound (Use Byte Value "01") and Mute all other Players opened
ARIAS Santiago
parents: 186
diff changeset
   104
            BindingExpression be = tagsoundcontrol.volumeModel.GetBindingExpression(Label.ContentProperty);
e642ad0c366b Tag Visualisation Control Sound (Use Byte Value "01") and Mute all other Players opened
ARIAS Santiago
parents: 186
diff changeset
   105
            be.UpdateSource();*/
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
            TagVisuSoundControl tagsoundcontrol = (TagVisuSoundControl)e.TagVisualization;
e642ad0c366b Tag Visualisation Control Sound (Use Byte Value "01") and Mute all other Players opened
ARIAS Santiago
parents: 186
diff changeset
   108
e642ad0c366b Tag Visualisation Control Sound (Use Byte Value "01") and Mute all other Players opened
ARIAS Santiago
parents: 186
diff changeset
   109
            deltaOrientation = (tagsoundcontrol.Orientation - baseOrientation) % 360;
215
d13dbcf861d7 BOutton annotation, tag volume, chargement des annotations sauvegardées du projet dans le dictionnaire de données
PAMPHILE Jonathan <pamphile@efrei.fr>
parents: 214
diff changeset
   110
188
e642ad0c366b Tag Visualisation Control Sound (Use Byte Value "01") and Mute all other Players opened
ARIAS Santiago
parents: 186
diff changeset
   111
            if (deltaOrientation < 0)
e642ad0c366b Tag Visualisation Control Sound (Use Byte Value "01") and Mute all other Players opened
ARIAS Santiago
parents: 186
diff changeset
   112
                deltaOrientation = 360 + deltaOrientation;
e642ad0c366b Tag Visualisation Control Sound (Use Byte Value "01") and Mute all other Players opened
ARIAS Santiago
parents: 186
diff changeset
   113
            int niveau = (int)(deltaOrientation / 36);
e642ad0c366b Tag Visualisation Control Sound (Use Byte Value "01") and Mute all other Players opened
ARIAS Santiago
parents: 186
diff changeset
   114
215
d13dbcf861d7 BOutton annotation, tag volume, chargement des annotations sauvegardées du projet dans le dictionnaire de données
PAMPHILE Jonathan <pamphile@efrei.fr>
parents: 214
diff changeset
   115
d13dbcf861d7 BOutton annotation, tag volume, chargement des annotations sauvegardées du projet dans le dictionnaire de données
PAMPHILE Jonathan <pamphile@efrei.fr>
parents: 214
diff changeset
   116
188
e642ad0c366b Tag Visualisation Control Sound (Use Byte Value "01") and Mute all other Players opened
ARIAS Santiago
parents: 186
diff changeset
   117
            //if (((niveau == 9) || (niveau == 8) || (niveau == 7)) && lastSoundlevel == 0)
e642ad0c366b Tag Visualisation Control Sound (Use Byte Value "01") and Mute all other Players opened
ARIAS Santiago
parents: 186
diff changeset
   118
            if (((niveau == 9) || (niveau == 8)) && lastSoundlevel == 0)
e642ad0c366b Tag Visualisation Control Sound (Use Byte Value "01") and Mute all other Players opened
ARIAS Santiago
parents: 186
diff changeset
   119
                rise = false;
e642ad0c366b Tag Visualisation Control Sound (Use Byte Value "01") and Mute all other Players opened
ARIAS Santiago
parents: 186
diff changeset
   120
            //else if (((niveau == 1) || (niveau == 2) || (niveau == 3)) && lastSoundlevel == 0)
e642ad0c366b Tag Visualisation Control Sound (Use Byte Value "01") and Mute all other Players opened
ARIAS Santiago
parents: 186
diff changeset
   121
            else if (((niveau == 1) || (niveau == 2)) && lastSoundlevel == 0)
e642ad0c366b Tag Visualisation Control Sound (Use Byte Value "01") and Mute all other Players opened
ARIAS Santiago
parents: 186
diff changeset
   122
                rise = true;
215
d13dbcf861d7 BOutton annotation, tag volume, chargement des annotations sauvegardées du projet dans le dictionnaire de données
PAMPHILE Jonathan <pamphile@efrei.fr>
parents: 214
diff changeset
   123
188
e642ad0c366b Tag Visualisation Control Sound (Use Byte Value "01") and Mute all other Players opened
ARIAS Santiago
parents: 186
diff changeset
   124
            if (!rise)
e642ad0c366b Tag Visualisation Control Sound (Use Byte Value "01") and Mute all other Players opened
ARIAS Santiago
parents: 186
diff changeset
   125
            {
e642ad0c366b Tag Visualisation Control Sound (Use Byte Value "01") and Mute all other Players opened
ARIAS Santiago
parents: 186
diff changeset
   126
                niveau = (niveau - 10) % 10;
e642ad0c366b Tag Visualisation Control Sound (Use Byte Value "01") and Mute all other Players opened
ARIAS Santiago
parents: 186
diff changeset
   127
            }
199
70e93b0bd778 DEBUG Tag Visualisation Control
ARIAS Santiago
parents: 195
diff changeset
   128
            //--Elipse visibility
70e93b0bd778 DEBUG Tag Visualisation Control
ARIAS Santiago
parents: 195
diff changeset
   129
            int elipseNB = tagsoundcontrol.TagVisuSoundLevelUpdate(niveau);
188
e642ad0c366b Tag Visualisation Control Sound (Use Byte Value "01") and Mute all other Players opened
ARIAS Santiago
parents: 186
diff changeset
   130
            //Set the Sound of the Player.
215
d13dbcf861d7 BOutton annotation, tag volume, chargement des annotations sauvegardées du projet dans le dictionnaire de données
PAMPHILE Jonathan <pamphile@efrei.fr>
parents: 214
diff changeset
   131
            if ((LastElipseNB <1 && deltaOrientation - lastdeltaOrientation < 0) || (LastElipseNB > 9 && deltaOrientation - lastdeltaOrientation > 0))
d13dbcf861d7 BOutton annotation, tag volume, chargement des annotations sauvegardées du projet dans le dictionnaire de données
PAMPHILE Jonathan <pamphile@efrei.fr>
parents: 214
diff changeset
   132
                baseOrientation += deltaOrientation - lastdeltaOrientation;
d13dbcf861d7 BOutton annotation, tag volume, chargement des annotations sauvegardées du projet dans le dictionnaire de données
PAMPHILE Jonathan <pamphile@efrei.fr>
parents: 214
diff changeset
   133
            else
181
a5b708a9e066 Tag Control Continuation
ARIAS Santiago
parents: 180
diff changeset
   134
            {
215
d13dbcf861d7 BOutton annotation, tag volume, chargement des annotations sauvegardées du projet dans le dictionnaire de données
PAMPHILE Jonathan <pamphile@efrei.fr>
parents: 214
diff changeset
   135
                if (elipseNB != -1)
d13dbcf861d7 BOutton annotation, tag volume, chargement des annotations sauvegardées du projet dans le dictionnaire de données
PAMPHILE Jonathan <pamphile@efrei.fr>
parents: 214
diff changeset
   136
                {
d13dbcf861d7 BOutton annotation, tag volume, chargement des annotations sauvegardées du projet dans le dictionnaire de données
PAMPHILE Jonathan <pamphile@efrei.fr>
parents: 214
diff changeset
   137
                    UserControlSyncSource.setUserPlayerVolume(elipseNB / 10.0);
d13dbcf861d7 BOutton annotation, tag volume, chargement des annotations sauvegardées du projet dans le dictionnaire de données
PAMPHILE Jonathan <pamphile@efrei.fr>
parents: 214
diff changeset
   138
                    lastSoundlevel = niveau;
d13dbcf861d7 BOutton annotation, tag volume, chargement des annotations sauvegardées du projet dans le dictionnaire de données
PAMPHILE Jonathan <pamphile@efrei.fr>
parents: 214
diff changeset
   139
                    LastElipseNB = elipseNB;
d13dbcf861d7 BOutton annotation, tag volume, chargement des annotations sauvegardées du projet dans le dictionnaire de données
PAMPHILE Jonathan <pamphile@efrei.fr>
parents: 214
diff changeset
   140
                    tagsoundcontrol.volumeModel.Content = (elipseNB / 10.0).ToString();
d13dbcf861d7 BOutton annotation, tag volume, chargement des annotations sauvegardées du projet dans le dictionnaire de données
PAMPHILE Jonathan <pamphile@efrei.fr>
parents: 214
diff changeset
   141
                    lastdeltaOrientation = deltaOrientation;
d13dbcf861d7 BOutton annotation, tag volume, chargement des annotations sauvegardées du projet dans le dictionnaire de données
PAMPHILE Jonathan <pamphile@efrei.fr>
parents: 214
diff changeset
   142
                }
188
e642ad0c366b Tag Visualisation Control Sound (Use Byte Value "01") and Mute all other Players opened
ARIAS Santiago
parents: 186
diff changeset
   143
            }
215
d13dbcf861d7 BOutton annotation, tag volume, chargement des annotations sauvegardées du projet dans le dictionnaire de données
PAMPHILE Jonathan <pamphile@efrei.fr>
parents: 214
diff changeset
   144
        }
188
e642ad0c366b Tag Visualisation Control Sound (Use Byte Value "01") and Mute all other Players opened
ARIAS Santiago
parents: 186
diff changeset
   145
e642ad0c366b Tag Visualisation Control Sound (Use Byte Value "01") and Mute all other Players opened
ARIAS Santiago
parents: 186
diff changeset
   146
        private void OnVisualizationAdded(object sender, TagVisualizerEventArgs e)
e642ad0c366b Tag Visualisation Control Sound (Use Byte Value "01") and Mute all other Players opened
ARIAS Santiago
parents: 186
diff changeset
   147
        {
e642ad0c366b Tag Visualisation Control Sound (Use Byte Value "01") and Mute all other Players opened
ARIAS Santiago
parents: 186
diff changeset
   148
            TagVisuSoundControl tagsoundcontrol = (TagVisuSoundControl)e.TagVisualization;
215
d13dbcf861d7 BOutton annotation, tag volume, chargement des annotations sauvegardées du projet dans le dictionnaire de données
PAMPHILE Jonathan <pamphile@efrei.fr>
parents: 214
diff changeset
   149
            LastElipseNB = 5;
d13dbcf861d7 BOutton annotation, tag volume, chargement des annotations sauvegardées du projet dans le dictionnaire de données
PAMPHILE Jonathan <pamphile@efrei.fr>
parents: 214
diff changeset
   150
            lastdeltaOrientation = 0;
d13dbcf861d7 BOutton annotation, tag volume, chargement des annotations sauvegardées du projet dans le dictionnaire de données
PAMPHILE Jonathan <pamphile@efrei.fr>
parents: 214
diff changeset
   151
            
188
e642ad0c366b Tag Visualisation Control Sound (Use Byte Value "01") and Mute all other Players opened
ARIAS Santiago
parents: 186
diff changeset
   152
            switch (tagsoundcontrol.VisualizedTag.Byte.Value)
e642ad0c366b Tag Visualisation Control Sound (Use Byte Value "01") and Mute all other Players opened
ARIAS Santiago
parents: 186
diff changeset
   153
            {
215
d13dbcf861d7 BOutton annotation, tag volume, chargement des annotations sauvegardées du projet dans le dictionnaire de données
PAMPHILE Jonathan <pamphile@efrei.fr>
parents: 214
diff changeset
   154
                case 24:
188
e642ad0c366b Tag Visualisation Control Sound (Use Byte Value "01") and Mute all other Players opened
ARIAS Santiago
parents: 186
diff changeset
   155
                    try
e642ad0c366b Tag Visualisation Control Sound (Use Byte Value "01") and Mute all other Players opened
ARIAS Santiago
parents: 186
diff changeset
   156
                    {
e642ad0c366b Tag Visualisation Control Sound (Use Byte Value "01") and Mute all other Players opened
ARIAS Santiago
parents: 186
diff changeset
   157
                        /*
e642ad0c366b Tag Visualisation Control Sound (Use Byte Value "01") and Mute all other Players opened
ARIAS Santiago
parents: 186
diff changeset
   158
                        Binding mybinding = new Binding("Orientation");
e642ad0c366b Tag Visualisation Control Sound (Use Byte Value "01") and Mute all other Players opened
ARIAS Santiago
parents: 186
diff changeset
   159
                        mybinding.Source = tagsoundcontrol;
e642ad0c366b Tag Visualisation Control Sound (Use Byte Value "01") and Mute all other Players opened
ARIAS Santiago
parents: 186
diff changeset
   160
                        mybinding.UpdateSourceTrigger= UpdateSourceTrigger.PropertyChanged ;
e642ad0c366b Tag Visualisation Control Sound (Use Byte Value "01") and Mute all other Players opened
ARIAS Santiago
parents: 186
diff changeset
   161
                        tagsoundcontrol.volumeModel.SetBinding(Label.ContentProperty,mybinding);
e642ad0c366b Tag Visualisation Control Sound (Use Byte Value "01") and Mute all other Players opened
ARIAS Santiago
parents: 186
diff changeset
   162
                        */
e642ad0c366b Tag Visualisation Control Sound (Use Byte Value "01") and Mute all other Players opened
ARIAS Santiago
parents: 186
diff changeset
   163
e642ad0c366b Tag Visualisation Control Sound (Use Byte Value "01") and Mute all other Players opened
ARIAS Santiago
parents: 186
diff changeset
   164
                        baseOrientation = tagsoundcontrol.Orientation % 360;
e642ad0c366b Tag Visualisation Control Sound (Use Byte Value "01") and Mute all other Players opened
ARIAS Santiago
parents: 186
diff changeset
   165
                        deltaOrientation = ((tagsoundcontrol.Orientation % 360) - baseOrientation) % 360;
e642ad0c366b Tag Visualisation Control Sound (Use Byte Value "01") and Mute all other Players opened
ARIAS Santiago
parents: 186
diff changeset
   166
                        tagsoundcontrol.volumeModel.Content = deltaOrientation;
e642ad0c366b Tag Visualisation Control Sound (Use Byte Value "01") and Mute all other Players opened
ARIAS Santiago
parents: 186
diff changeset
   167
e642ad0c366b Tag Visualisation Control Sound (Use Byte Value "01") and Mute all other Players opened
ARIAS Santiago
parents: 186
diff changeset
   168
                        //RiseEvent To Mute all other Players
e642ad0c366b Tag Visualisation Control Sound (Use Byte Value "01") and Mute all other Players opened
ARIAS Santiago
parents: 186
diff changeset
   169
                        OnTagVisualisation(this, new EventArgs());
e642ad0c366b Tag Visualisation Control Sound (Use Byte Value "01") and Mute all other Players opened
ARIAS Santiago
parents: 186
diff changeset
   170
                        PlayerMute(false);
e642ad0c366b Tag Visualisation Control Sound (Use Byte Value "01") and Mute all other Players opened
ARIAS Santiago
parents: 186
diff changeset
   171
                    }
e642ad0c366b Tag Visualisation Control Sound (Use Byte Value "01") and Mute all other Players opened
ARIAS Santiago
parents: 186
diff changeset
   172
                    catch (Exception ex)
e642ad0c366b Tag Visualisation Control Sound (Use Byte Value "01") and Mute all other Players opened
ARIAS Santiago
parents: 186
diff changeset
   173
                    {
e642ad0c366b Tag Visualisation Control Sound (Use Byte Value "01") and Mute all other Players opened
ARIAS Santiago
parents: 186
diff changeset
   174
                    }
e642ad0c366b Tag Visualisation Control Sound (Use Byte Value "01") and Mute all other Players opened
ARIAS Santiago
parents: 186
diff changeset
   175
                    break;
e642ad0c366b Tag Visualisation Control Sound (Use Byte Value "01") and Mute all other Players opened
ARIAS Santiago
parents: 186
diff changeset
   176
                case 2: tagsoundcontrol.volumeModel.Content = "Tag Value 2";
e642ad0c366b Tag Visualisation Control Sound (Use Byte Value "01") and Mute all other Players opened
ARIAS Santiago
parents: 186
diff changeset
   177
                    break;
e642ad0c366b Tag Visualisation Control Sound (Use Byte Value "01") and Mute all other Players opened
ARIAS Santiago
parents: 186
diff changeset
   178
                case 3: tagsoundcontrol.volumeModel.Content = "Tag Value 3";
e642ad0c366b Tag Visualisation Control Sound (Use Byte Value "01") and Mute all other Players opened
ARIAS Santiago
parents: 186
diff changeset
   179
                    break;
e642ad0c366b Tag Visualisation Control Sound (Use Byte Value "01") and Mute all other Players opened
ARIAS Santiago
parents: 186
diff changeset
   180
                case 4: tagsoundcontrol.volumeModel.Content = "Tag Value 4";
e642ad0c366b Tag Visualisation Control Sound (Use Byte Value "01") and Mute all other Players opened
ARIAS Santiago
parents: 186
diff changeset
   181
                    break;
e642ad0c366b Tag Visualisation Control Sound (Use Byte Value "01") and Mute all other Players opened
ARIAS Santiago
parents: 186
diff changeset
   182
                case 5: tagsoundcontrol.volumeModel.Content = "Tag Value 5";
e642ad0c366b Tag Visualisation Control Sound (Use Byte Value "01") and Mute all other Players opened
ARIAS Santiago
parents: 186
diff changeset
   183
                    break;
e642ad0c366b Tag Visualisation Control Sound (Use Byte Value "01") and Mute all other Players opened
ARIAS Santiago
parents: 186
diff changeset
   184
                default: tagsoundcontrol.volumeModel.Content = "UNKNOWN MODEL";
e642ad0c366b Tag Visualisation Control Sound (Use Byte Value "01") and Mute all other Players opened
ARIAS Santiago
parents: 186
diff changeset
   185
                    break;
e642ad0c366b Tag Visualisation Control Sound (Use Byte Value "01") and Mute all other Players opened
ARIAS Santiago
parents: 186
diff changeset
   186
            }
e642ad0c366b Tag Visualisation Control Sound (Use Byte Value "01") and Mute all other Players opened
ARIAS Santiago
parents: 186
diff changeset
   187
        }
e642ad0c366b Tag Visualisation Control Sound (Use Byte Value "01") and Mute all other Players opened
ARIAS Santiago
parents: 186
diff changeset
   188
162
0b9f989bcb37 Display annotations in all opened UserPanels with the user's color
sarias
parents: 160
diff changeset
   189
        #endregion
152
46577fd0a294 PlayerPause en resize
PAMPHILE Jonathan <pamphile@efrei.fr>
parents: 150
diff changeset
   190
46577fd0a294 PlayerPause en resize
PAMPHILE Jonathan <pamphile@efrei.fr>
parents: 150
diff changeset
   191
        public void PlayerPause()
46577fd0a294 PlayerPause en resize
PAMPHILE Jonathan <pamphile@efrei.fr>
parents: 150
diff changeset
   192
        {
46577fd0a294 PlayerPause en resize
PAMPHILE Jonathan <pamphile@efrei.fr>
parents: 150
diff changeset
   193
            UserControlSyncSource.PlayerPause();
46577fd0a294 PlayerPause en resize
PAMPHILE Jonathan <pamphile@efrei.fr>
parents: 150
diff changeset
   194
        }
188
e642ad0c366b Tag Visualisation Control Sound (Use Byte Value "01") and Mute all other Players opened
ARIAS Santiago
parents: 186
diff changeset
   195
        public void PlayerMute(bool b)
e642ad0c366b Tag Visualisation Control Sound (Use Byte Value "01") and Mute all other Players opened
ARIAS Santiago
parents: 186
diff changeset
   196
        {
e642ad0c366b Tag Visualisation Control Sound (Use Byte Value "01") and Mute all other Players opened
ARIAS Santiago
parents: 186
diff changeset
   197
            UserControlSyncSource.setUserPlayerMute(b);
e642ad0c366b Tag Visualisation Control Sound (Use Byte Value "01") and Mute all other Players opened
ARIAS Santiago
parents: 186
diff changeset
   198
        }
162
0b9f989bcb37 Display annotations in all opened UserPanels with the user's color
sarias
parents: 160
diff changeset
   199
224
874de6d84a2e Panels visibility
ARIAS Santiago
parents: 216
diff changeset
   200
        public void PanelVisibility(Visibility v)
874de6d84a2e Panels visibility
ARIAS Santiago
parents: 216
diff changeset
   201
        {
874de6d84a2e Panels visibility
ARIAS Santiago
parents: 216
diff changeset
   202
            this.Visibility = v;
874de6d84a2e Panels visibility
ARIAS Santiago
parents: 216
diff changeset
   203
        }
874de6d84a2e Panels visibility
ARIAS Santiago
parents: 216
diff changeset
   204
874de6d84a2e Panels visibility
ARIAS Santiago
parents: 216
diff changeset
   205
        public void PanelClose()
874de6d84a2e Panels visibility
ARIAS Santiago
parents: 216
diff changeset
   206
        {
874de6d84a2e Panels visibility
ARIAS Santiago
parents: 216
diff changeset
   207
            UserControlSyncSource.SyncSourceClose();
874de6d84a2e Panels visibility
ARIAS Santiago
parents: 216
diff changeset
   208
            UserControlSyncSource = null;
874de6d84a2e Panels visibility
ARIAS Santiago
parents: 216
diff changeset
   209
        }
874de6d84a2e Panels visibility
ARIAS Santiago
parents: 216
diff changeset
   210
162
0b9f989bcb37 Display annotations in all opened UserPanels with the user's color
sarias
parents: 160
diff changeset
   211
        private void UserControlSyncSource_OnSuccessAnnotation(object sender, EventArgs e)
0b9f989bcb37 Display annotations in all opened UserPanels with the user's color
sarias
parents: 160
diff changeset
   212
        {
0b9f989bcb37 Display annotations in all opened UserPanels with the user's color
sarias
parents: 160
diff changeset
   213
            OnSuccessAnnotation(this, new EventArgs());
188
e642ad0c366b Tag Visualisation Control Sound (Use Byte Value "01") and Mute all other Players opened
ARIAS Santiago
parents: 186
diff changeset
   214
        }  
180
1c4ad413c837 Sound Control Base
ARIAS Santiago
parents: 162
diff changeset
   215
    }
35
ed77793b767a Control Pivot,
sarias
parents:
diff changeset
   216
}