UPDATE SUMMARY
Inheritance: System.EventArgs
コード例 #1
0
        public LeapMotionManager()
        {
            deviceStatusArgs = new KineapStatusChangedArgs();

            if (listener == null)
            {
                if (leapMotionConverter == null)
                {
                    leapMotionConverter = new LeapMotionConverter();
                    listener = new LeapMotionListener(leapMotionConverter, this);
                    AssimpConverter = leapMotionConverter;
                }
                if (controller == null)
                    controller = new Controller();
                controller.AddListener(listener);
            }
        }
コード例 #2
0
        public KinectManager()
        {
            kinectConverter = new KinectConverter();
            AssimpConverter = kinectConverter;
            deviceStatusArgs = new KineapStatusChangedArgs();
            KinectSensor.KinectSensors.StatusChanged += new EventHandler<StatusChangedEventArgs>(Sensor_StatusChanged);
            sensor = KinectSensor.KinectSensors.FirstOrDefault();

            if (sensor != null) // If a Kinect is detected on startup, assigns its current status
            {
                deviceStatusArgs.CurrentStatus = GetStatus(sensor.Status);
                deviceStatusArgs.OriginalDeviceStatus = sensor.Status.ToString();
                Device_StatusChanged(deviceStatusArgs);
                if (sensor.IsRunning) // This verification is important because if the software crashes unexpectedly, the sensor might still be on when relauching the software
                    sensor.Stop();
            }
            else // If not, assigns default status 'Disconnected'
            {
                deviceStatusArgs.CurrentStatus = GetStatus(KinectStatus.Disconnected);
                deviceStatusArgs.OriginalDeviceStatus = "No Kinect was found on startup";
            }
        }
コード例 #3
0
 /// <summary>
 /// Is Called whenever a device's status changes
 /// Updates 
 /// </summary>
 /// <param name="e"></param>
 public void Device_StatusChanged(KineapStatusChangedArgs e)
 {
     EventHandler<KineapStatusChangedArgs> handler = StatusChanged;
     if (handler != null)
         handler(this, e);
 }
コード例 #4
0
 private void LeapMotion_StatusChanged(object sender, KineapStatusChangedArgs e)
 {
     LeapMotionStatus = e.CurrentStatus;
     LeapMotionToolTip = e.OriginalDeviceStatus;
 }
コード例 #5
0
 private void Kinect_StatusChanged(object sender, KineapStatusChangedArgs e)
 {
     KinectStatus = e.CurrentStatus;
     KinectToolTip = e.OriginalDeviceStatus;
 }
コード例 #6
0
ファイル: Capture.cs プロジェクト: loic-lavergne/mckineap
 /// <summary>
 /// Is called if the device is disconnected while running in which case
 /// it calls the Record method that will stop the device
 /// </summary>
 /// <param name="sender"></param>
 /// <param name="e"></param>
 void CurrentDeviceRecording_StatusChanged(object sender, KineapStatusChangedArgs e)
 {
     if (e.CurrentStatus != KineapStatus.CONNECTED)
     { 
         if (CurrentDevice.IsRecording)
         RecordWithDevice(CurrentDevice);
     }
 }