KineapDevice is a base class for a device implementation into McKineap. Note that a KineapDevice represents only a single instance of a device Therefore it dont allows to access (at least directly) to different instances of a same kind of device at the same time (like to have multiple LeapMotion on your laptop)
Inheritance: KinectStreamConverter.Utils.ObservableObject
Ejemplo n.º 1
0
        /// <summary>
        /// This method is called twice, when the user clicks to start and stop recording
        /// In the case of recording equals false, it will start the device, otherwise it will stop it and extract the scene
        /// </summary>
        /// <param name="device">The Kineap device</param>
        public void RecordWithDevice(KineapDevice device)
        {
            if (Session.CurrentSession == null || !Session.CurrentSession.HasCurrentProject())
            {
                MessageBox.Show("You must select or create a project before capturing an animation.");
                return;
            }

            CurrentDevice = device;
            CurrentDevice.StatusChanged += CurrentDeviceRecording_StatusChanged;

            if (!CurrentDevice.IsRecording)          // If the device is not already recording, starts recording
            {
                if (CurrentDevice.AssimpConverter != null)               // We need to clean the buffer just before we launch the kinect  
                    CurrentDevice.AssimpConverter.CleanBuffer();         // if we dont want to use previously found scenes
                CurrentDevice.StartRecording();
            }
            else
            {
                CurrentDevice.StopRecording();       // Otherwise, stops recording
                KineapScene = CurrentDevice.AssimpConverter.RecordedScene.FirstOrDefault();
                if (KineapScene == null)
                {
                    MessageBox.Show("Nothing was detected. Try again at an appropriate distance");
                    return;
                }
                PromptCaptureName();
            }
        }
Ejemplo n.º 2
0
 /// <summary>
 /// Add a KineapDevice to the UsedDevice list
 /// It does not means that the device will start
 /// </summary>
 /// <param name="device"></param>
 public void AddDevice(KineapDevice device)
 {
     this.usedDevices.Add(device);
 }