public void Start()
{
if (Started)
{
throw new Exception("KinectReplay already started");
}
Started = true;
if (colorReplay != null)
{
colorReplay.Start(); colorReplay.FrameReady += frame => synchronizationContext.Send(state =>
{
if (ColorImageFrameReady != null)
{
ColorImageFrameReady(this, new KinectRecorder.Replay.ToolBox.ReplayColorImageFrameReadyEventArgs {
ColorImageFrame = frame
});
}
}, null);
}
if (depthReplay != null)
{
depthReplay.Start(); depthReplay.FrameReady += frame => synchronizationContext.Send(state =>
{
if (DepthImageFrameReady != null)
{
DepthImageFrameReady(this, new ToolBox.ReplayDepthImageFrameReadyEventArgs {
DepthImageFrame = frame
});
}
}, null);
}
if (skeletonReplay != null)
{
skeletonReplay.Start(); skeletonReplay.FrameReady += frame => synchronizationContext.Send(state =>
{
if (SkeletonFrameReady != null)
{
SkeletonFrameReady(this, new ToolBox.ReplaySkeletonFrameReadyEventArgs {
SkeletonFrame = frame
});
}
}, null);
}
}