//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"; } }
public KinectFrame(KinectReplay replay) { init(); _replay = replay; //_pixelColorDataLength = replay.ColorDataPixelLength; //_pixelDepthDataLength = replay.DepthDataPixelLength; MaxDepth = replay.MaxDepth; MinDepth = replay.MinDepth; }
public DeviceBase(AudioBase audio, VideoBase video, String filePath) { _audio = audio; _video = video; _filePath = filePath; _deviceType = DeviceType.RECORD_FILE_KINECT_1; _name = "RF-" + System.IO.Path.GetFileName(_filePath); replay = new KinectReplay(_filePath); replay.ReplayFinished += Replay_ReplayFinished; }
private void ReplayFile(object sender, RoutedEventArgs e) { if (IsReplaying) { CleanupReplay(); return; } var openFileDialog = new OpenFileDialog { Title = "Select filename", Filter = "Replay files|*.replay" }; if (openFileDialog.ShowDialog() == true) { _replay = new KinectReplay(openFileDialog.FileName); _replay.AllFramesReady += ReplayAllFramesReady; _replay.ReplayFinished += CleanupReplay; Setup(_replay.AudioFilePath); _replay.Start(); IsReplaying = true; } }
private void CleanupReplay() { if (!IsReplaying) return; if (_soundPlayer != null && _startedAudio) _soundPlayer.Stop(); _replay.AllFramesReady -= ReplayAllFramesReady; _replay.Stop(); _replay.Dispose(); _replay = null; IsReplaying = false; }
private void ReplayClick(object sender, RoutedEventArgs e) { if (IsReplaying) { CleanupReplay(); Message = ""; return; } _startedAudio = false; var openFileDialog = new OpenFileDialog { Title = "Select filename", Filter = "Replay files|*.replay" }; if (openFileDialog.ShowDialog() == true) { replay = new KinectReplay(openFileDialog.FileName); Message = string.Format("Replaying {0}", RecordOptions.ToString()); replay.AllFramesReady += ReplayAllFramesReady; replay.ReplayFinished += CleanupReplay; replay.Start(); } IsReplaying = true; }
private void CleanupGeneration() { videoWriter.Close(); IsGenerating = false; replay.AllFramesReady -= ReplayAllFramesReady; replay.Stop(); replay.Dispose(); replay = null; //write xml to disk xmlwriter.write(); System.Console.WriteLine("lastframenumber = " + lastframenumber); System.Console.WriteLine("framecounter = " + framecounter); System.Console.WriteLine("missingFrameCount = " + missingFrameCount); //lastframenumber generationstatus.Content = "Generation finished"; }