Exemple #1
0
        /// <summary>
        /// The event handler for the OnCameraControlPropertyChanged event
        /// of the camera settings class.
        /// Updates the PlayStation Camera with the new properties.
        /// </summary>
        /// <param name="property">The <see cref="DirectShowLib.CameraControlProperty"/>
        /// to be updated.</param>
        /// <param name="value">An <see cref="Int32"/> with the new value.</param>
        private void CameraSettings_OnCameraControlPropertyChanged(DirectShowLib.CameraControlProperty property, int value)
        {
            switch (property)
            {
            case DirectShowLib.CameraControlProperty.Exposure:
                ((PS3GazeTracker)this.tracker).PlayStationEyeCamera.Exposure = value;
                break;

            case DirectShowLib.CameraControlProperty.Focus:
                break;

            case DirectShowLib.CameraControlProperty.Iris:
                break;

            case DirectShowLib.CameraControlProperty.Pan:
                break;

            case DirectShowLib.CameraControlProperty.Roll:
                break;

            case DirectShowLib.CameraControlProperty.Tilt:
                break;

            case DirectShowLib.CameraControlProperty.Zoom:
                ((PS3GazeTracker)this.tracker).PlayStationEyeCamera.Zoom = value;
                break;
            }
        }
Exemple #2
0
 void LoadProxyConfig()
 {
     if (Proxy != null)
     {
         try
         {
             DSCameraProxy cam = (DSCameraProxy)Proxy;
             XmlDocument   doc = new XmlDocument();
             doc.Load(ConfigPath);
             XmlNode node = doc.SelectSingleNode("Config");
             if (node != null)
             {
                 if (node.Attributes["Type"] != null)
                 {
                     string typestr = node.Attributes["Type"].Value;
                     if (Proxy.GetType() != Type.GetType(typestr))
                     {
                         return;
                     }
                     if (Proxy.HardwareId != node.Attributes["HardwareId"].Value)
                     {
                         return;
                     }
                     XmlNodeList proplist = node.SelectNodes("Prop");
                     foreach (XmlNode popNode in proplist)
                     {
                         DirectShowLib.CameraControlProperty prop = (DirectShowLib.CameraControlProperty)Enum.Parse(typeof(DirectShowLib.CameraControlProperty), popNode.Attributes["Name"].Value);
                         cam.SetControlProperty(prop, Int32.Parse(popNode.Attributes["Value"].Value));
                     }
                 }
             }
         }
         catch
         {
         }
     }
 }