Esempio n. 1
0
        private void CloseVideoWriters()
        {
            lock (lockObj)
            {
                if (videoWriterKinectColor != null && videoWriterKinectColor.IsOpen)
                {
                    videoWriterKinectColor.Close();
                    filesLastRecording.Add(currFilePathBase + "_Color.avi");
                }
                if (videoWriterKinectDepth != null && videoWriterKinectDepth.IsOpen)
                {
                    videoWriterKinectDepth.Close();
                    //videoWriterKinectDepthTmp.Close();
                    filesLastRecording.Add(currFilePathBase + "_Depth.avi");
                }
                if (bufferBody != null)
                {
                    float[][] bodyData = bufferBody.ToArray();
                    csmatio.types.MLSingle       bodyDataMat    = new csmatio.types.MLSingle("bodyData", bodyData);
                    List <csmatio.types.MLArray> lstBodyDataMat = new List <csmatio.types.MLArray>();
                    lstBodyDataMat.Add(bodyDataMat);
                    csmatio.io.MatFileWriter writer = new csmatio.io.MatFileWriter(currFilePathBase + "_Body.mat", lstBodyDataMat, true);
                    bufferBody = null;      // clear memory
                    filesLastRecording.Add(currFilePathBase + "_Body.mat");
                }

                if (videoWriterPS3Eye != null && videoWriterPS3Eye.IsOpen)
                {
                    videoWriterPS3Eye.Close();
                    filesLastRecording.Add(currFilePathBase + "_PS3Eye.avi");
                }
            }
        }
        private void CloseVideoWriters()
        {
            lock (lockObj)
            {
                if (videoWriterKinectColor != null && videoWriterKinectColor.IsOpen)
                {
                    videoWriterKinectColor.Close();
                    filesLastRecording.Add(currFilePathBase + "_Color.avi");
                }
                if (videoWriterKinectDepth != null && videoWriterKinectDepth.IsOpen)
                {
                    videoWriterKinectDepth.Close();
                    //videoWriterKinectDepthTmp.Close();
                    filesLastRecording.Add(currFilePathBase + "_Depth.avi");
                }
                if (bufferBody != null)
                {
                    float[][] bodyData = bufferBody.ToArray();
                    csmatio.types.MLSingle bodyDataMat = new csmatio.types.MLSingle("bodyData", bodyData);
                    List<csmatio.types.MLArray> lstBodyDataMat = new List<csmatio.types.MLArray>();
                    lstBodyDataMat.Add(bodyDataMat);
                    csmatio.io.MatFileWriter writer = new csmatio.io.MatFileWriter(currFilePathBase + "_Body.mat", lstBodyDataMat, true);
                    bufferBody = null;      // clear memory
                    filesLastRecording.Add(currFilePathBase + "_Body.mat");
                }

                if (videoWriterPS3Eye != null && videoWriterPS3Eye.IsOpen)
                {
                    videoWriterPS3Eye.Close();
                    filesLastRecording.Add(currFilePathBase + "_PS3Eye.avi");
                }
            }
        }