//generate files for analyser private void generate_initialization() { var openFileDialog = new OpenFileDialog { Title = "Select filename", Filter = "Replay files|*.replay" }; if (openFileDialog.ShowDialog() == true) { //get the pure filename(without path and extension) string path = openFileDialog.FileName; string filename = openFileDialog.SafeFileName; System.Console.WriteLine("path = " + path + "purepath= "); string pathwithoutextension = path.Remove(path.IndexOf('.')); replay = new KinectReplay(openFileDialog.FileName); message = string.Format("Replaying {0}", RecordOptions.ToString()); videoWriter.FrameRate = 30; videoWriter.Open(pathwithoutextension + ".avi", 640, 480); //xmlwriter xmlwriter = new XMLWriter(pathwithoutextension + "_jointsdata.xml", pathwithoutextension + "_keyframes.xml", filename); IsGenerating = true; replay.AllFramesReady += ReplayAllFramesReady; replay.ReplayFinished += CleanupGeneration; replay.Start(); generationstatus.Content = "generating analysis files, please wait"; } }
private void RecordClick(object sender, RoutedEventArgs e) { if (IsRecording) { recorder.Stop(); recorder = null; IsRecording = false; Message = ""; return; } var saveFileDialog = new SaveFileDialog { Title = "Select filename", Filter = "Replay files|*.replay" }; if (saveFileDialog.ShowDialog() != true) { return; } recorder = new KinectRecorder(RecordOptions, saveFileDialog.FileName, _kinectSensor); Message = string.Format("Recording {0}", RecordOptions.ToString()); recorder.StartAudioRecording(); IsRecording = true; }