/// <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(); } }
/// <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); }