Renaming some of our usage tables.
authorsl
Sun, 14 Dec 2014 18:17:40 +0100
changeset 308ce9bdc9c5b5
parent 29 7679a5ab194b
child 31 958ed29f977c
Renaming some of our usage tables.
Form1.cs
HidUsageTables.cs
RemoteControlDevice.cs
     1.1 --- a/Form1.cs	Sat Dec 06 23:34:02 2014 +0100
     1.2 +++ b/Form1.cs	Sun Dec 14 18:17:40 2014 +0100
     1.3 @@ -131,7 +131,7 @@
     1.4                  label1.Text = e.Button.ToString();
     1.5                  processed = true;
     1.6              }
     1.7 -            else if (e.MceButton != Hid.UsageTables.MceButton.Null)
     1.8 +            else if (e.MceButton != Hid.UsageTables.WindowsMediaCenterRemoteControl.Null)
     1.9              {
    1.10                  //Display MCE button name
    1.11                  label1.Text = e.MceButton.ToString();
     2.1 --- a/HidUsageTables.cs	Sat Dec 06 23:34:02 2014 +0100
     2.2 +++ b/HidUsageTables.cs	Sun Dec 14 18:17:40 2014 +0100
     2.3 @@ -44,7 +44,7 @@
     2.4          CameraControl,
     2.5          Arcade,
     2.6          // http://msdn.microsoft.com/en-us/library/windows/desktop/bb417079.aspx
     2.7 -        MceRemote = 0xffbc,
     2.8 +        WindowsMediaCenterRemoteControl = 0xffbc,
     2.9          TerraTecRemote = 0xffcc
    2.10      }
    2.11  
    2.12 @@ -91,9 +91,9 @@
    2.13      }
    2.14  
    2.15      
    2.16 -    public enum UsageIdMce: ushort
    2.17 +    public enum UsageCollectionWindowsMediaCenter: ushort
    2.18      {
    2.19 -        MceRemote = 0x88        
    2.20 +        WindowsMediaCenterRemoteControl = 0x88        
    2.21      }
    2.22  
    2.23  
    2.24 @@ -103,7 +103,7 @@
    2.25          /// <summary>
    2.26          ///
    2.27          /// </summary>
    2.28 -        public enum MceButton: ushort
    2.29 +        public enum WindowsMediaCenterRemoteControl: ushort
    2.30          {
    2.31              /// <summary>
    2.32              /// Not defined by the Microsoft specs.
    2.33 @@ -243,7 +243,7 @@
    2.34              /// <para />
    2.35              /// According to HP specs it displays visual imagery that is synchronized to the sound of your music tracks.
    2.36              /// </summary>
    2.37 -            Visualization = MceButton.Ext0,
    2.38 +            Visualization = WindowsMediaCenterRemoteControl.Ext0,
    2.39              /// <summary>
    2.40              /// Plays a slide show of all the pictures on your hard disk drive.
    2.41              /// <para />
    2.42 @@ -255,7 +255,7 @@
    2.43              /// <para />
    2.44              /// According to HP specs it plays a slide show of all the pictures on your hard disk drive.
    2.45              /// </summary>
    2.46 -            SlideShow = MceButton.Ext1,
    2.47 +            SlideShow = WindowsMediaCenterRemoteControl.Ext1,
    2.48              /// <summary>
    2.49              /// Eject optical drive.
    2.50              /// <para />
    2.51 @@ -266,7 +266,7 @@
    2.52              /// Notably sent by the 'Eject' button of HP Windows Media Center Remote (TSGH-IR08).
    2.53              /// Also interpreted as 'Eject' action by SoundGraph iMON Manager in MCE mode (OrigenAE VF310).
    2.54              /// </summary>
    2.55 -            Eject = MceButton.Ext2,
    2.56 +            Eject = WindowsMediaCenterRemoteControl.Ext2,
    2.57              /// <summary>
    2.58              /// Not sure what this should do.
    2.59              /// <para />
    2.60 @@ -276,7 +276,7 @@
    2.61              /// <para />
    2.62              /// Notably sent by the 'Input selection' button of HP Windows Media Center Remote (TSGH-IR08).
    2.63              /// </summary>
    2.64 -            InputSelection = MceButton.Ext3,
    2.65 +            InputSelection = WindowsMediaCenterRemoteControl.Ext3,
    2.66          }
    2.67  
    2.68          /// <summary>
     3.1 --- a/RemoteControlDevice.cs	Sat Dec 06 23:34:02 2014 +0100
     3.2 +++ b/RemoteControlDevice.cs	Sun Dec 14 18:17:40 2014 +0100
     3.3 @@ -84,7 +84,7 @@
     3.4      {
     3.5          RemoteControlButton _rcb;
     3.6          InputDevice _device;
     3.7 -        MceButton iMceButton;
     3.8 +        WindowsMediaCenterRemoteControl iMceButton;
     3.9          ConsumerControl iConsumerControl;
    3.10  
    3.11          public RemoteControlEventArgs(RemoteControlButton rcb, InputDevice device)
    3.12 @@ -104,7 +104,7 @@
    3.13          }
    3.14  
    3.15  
    3.16 -        public RemoteControlEventArgs(MceButton mce, InputDevice device)
    3.17 +        public RemoteControlEventArgs(WindowsMediaCenterRemoteControl mce, InputDevice device)
    3.18          {
    3.19              SetNullButtons();
    3.20              //
    3.21 @@ -115,13 +115,13 @@
    3.22          private void SetNullButtons()
    3.23          {
    3.24              iConsumerControl = ConsumerControl.Null;
    3.25 -            iMceButton = MceButton.Null;
    3.26 +            iMceButton = WindowsMediaCenterRemoteControl.Null;
    3.27              _rcb = RemoteControlButton.Unknown;
    3.28          }
    3.29  
    3.30          public RemoteControlEventArgs()
    3.31          {
    3.32 -            iMceButton = MceButton.Null;
    3.33 +            iMceButton = WindowsMediaCenterRemoteControl.Null;
    3.34              _rcb = RemoteControlButton.Unknown;
    3.35              _device = InputDevice.Key;
    3.36          }
    3.37 @@ -132,7 +132,7 @@
    3.38              set { _rcb = value; }
    3.39          }
    3.40  
    3.41 -        public MceButton MceButton
    3.42 +        public WindowsMediaCenterRemoteControl MceButton
    3.43          {
    3.44              get { return iMceButton; }
    3.45              set { iMceButton = value; }
    3.46 @@ -182,8 +182,8 @@
    3.47              RAWINPUTDEVICE[] rid = new RAWINPUTDEVICE[4];
    3.48  
    3.49              int i = 0;
    3.50 -            rid[i].usUsagePage = (ushort)Hid.UsagePage.MceRemote;
    3.51 -            rid[i].usUsage = (ushort)Hid.UsageIdMce.MceRemote;
    3.52 +            rid[i].usUsagePage = (ushort)Hid.UsagePage.WindowsMediaCenterRemoteControl;
    3.53 +            rid[i].usUsage = (ushort)Hid.UsageCollectionWindowsMediaCenter.WindowsMediaCenterRemoteControl;
    3.54              rid[i].dwFlags = Const.RIDEV_EXINPUTSINK;
    3.55              rid[i].hwndTarget = aHWND;
    3.56  
    3.57 @@ -356,11 +356,11 @@
    3.58              }
    3.59  
    3.60  
    3.61 -            if (Enum.IsDefined(typeof(MceButton), aUsage) && aUsage != 0) //Our button is a known MCE button
    3.62 +            if (Enum.IsDefined(typeof(WindowsMediaCenterRemoteControl), aUsage) && aUsage != 0) //Our button is a known MCE button
    3.63              {
    3.64                  if (this.ButtonPressed != null)
    3.65                  {
    3.66 -                    return this.ButtonPressed(this, new RemoteControlEventArgs((MceButton)aUsage, InputDevice.OEM));
    3.67 +                    return this.ButtonPressed(this, new RemoteControlEventArgs((WindowsMediaCenterRemoteControl)aUsage, InputDevice.OEM));
    3.68                  }
    3.69                  return false;
    3.70              }
    3.71 @@ -394,7 +394,7 @@
    3.72              HidUsageHandler usagePageHandler = null;
    3.73  
    3.74              //Check if this an MCE remote HID message
    3.75 -            if (aHidEvent.UsagePage == (ushort)Hid.UsagePage.MceRemote && aHidEvent.UsageCollection == (ushort)Hid.UsageIdMce.MceRemote)
    3.76 +            if (aHidEvent.UsagePage == (ushort)Hid.UsagePage.WindowsMediaCenterRemoteControl && aHidEvent.UsageCollection == (ushort)Hid.UsageCollectionWindowsMediaCenter.WindowsMediaCenterRemoteControl)
    3.77              {
    3.78                  usagePageHandler = HidMceRemoteHandler;
    3.79              }