public void SimplePipeline() { bool sts = true; MyUtilMPipeline pp = null; disconnected = false; /* Set Source & Landmark Profile Index */ if (form.GetRecordState()) { pp = new MyUtilMPipeline(0, form.GetFileName(), true); pp.QueryCapture().SetFilter(form.GetCheckedDevice()); } else if (form.GetPlaybackState()) { pp = new MyUtilMPipeline(0, form.GetFileName(), false); } else { pp = new MyUtilMPipeline(0); pp.QueryCapture().SetFilter(form.GetCheckedDevice()); } /* Set Module */ pp.EnableEmotion(form.GetCheckedModule()); /* Initialization */ form.UpdateStatus("Init Started"); if (pp.Init()) { form.UpdateStatus("Streaming"); while (!form.stop) { if (!pp.AcquireFrame(true)) { break; } if (!DisplayDeviceConnection(pp.IsDisconnected())) { /* Display Results */ PXCMEmotion ft = pp.QueryEmotion(); DisplayPicture(pp.QueryImage(PXCMImage.ImageType.IMAGE_TYPE_COLOR)); DisplayLocation(ft); form.UpdatePanel(); } pp.ReleaseFrame(); } } else { form.UpdateStatus("Init Failed"); sts = false; } pp.Close(); pp.Dispose(); if (sts) { form.UpdateStatus("Stopped"); } }
public void SimplePipeline() { bool sts = true; MyUtilMPipeline pp = null; disconnected = false; /* Set Source & Landmark Profile Index */ if (form.GetRecordState()) { pp = new MyUtilMPipeline(0, form.GetFileName(), true); pp.QueryCapture().SetFilter(form.GetCheckedDevice()); } else if (form.GetPlaybackState()) { pp = new MyUtilMPipeline(0, form.GetFileName(), false); } else { pp = new MyUtilMPipeline(0); pp.QueryCapture().SetFilter(form.GetCheckedDevice()); } /* Set Module */ pp.EnableEmotion(form.GetCheckedModule()); /* Initialization */ form.UpdateStatus("Init Started"); if (pp.Init()) { form.UpdateStatus("Streaming"); while (!form.stop) { if (!pp.AcquireFrame(true)) break; if (!DisplayDeviceConnection(pp.IsDisconnected())) { /* Display Results */ PXCMEmotion ft = pp.QueryEmotion(); DisplayPicture(pp.QueryImage(PXCMImage.ImageType.IMAGE_TYPE_COLOR)); DisplayLocation(ft); form.UpdatePanel(); } pp.ReleaseFrame(); } } else { form.UpdateStatus("Init Failed"); sts = false; } pp.Close(); pp.Dispose(); if (sts) form.UpdateStatus("Stopped"); }