void StopRecord()
    {
        isRecording = false;
        Debug.Log("stop recording");

        //edit by lxjk
        string     filePath = outputFile + fileCount.ToString();
        FileStream output   = new FileStream(@filePath, FileMode.Create);
        //end lxjk
        BinaryFormatter bf = new BinaryFormatter();

        if (skelton)
        {
            SerialSkeletonFrame[] data = new SerialSkeletonFrame[currentSkeltonData.Count];
            for (int ii = 0; ii < currentSkeltonData.Count; ii++)
            {
                data[ii] = new SerialSkeletonFrame((NuiSkeletonFrame)currentSkeltonData[ii]);
            }
            bf.Serialize(output, data);
        }
        if (color || depth)
        {
            Debug.Log("saving...");
            SerialKinectFrameData[] data = new SerialKinectFrameData[currentDepthData.Count];
            for (int i = 0; i < currentDepthData.Count; i++)
            {
                data[i] = new SerialKinectFrameData((short[])currentDepthData[i],
                                                    (Color32[])currentColorData[i]);
            }
            bf.Serialize(output, data);
        }

        output.Close();
        fileCount++;
    }
Beispiel #2
0
    void StopRecord()
    {
        isRecording = false;
        //edit by lxjk
        string filePath = outputFile + fileCount.ToString();

        try
        {
            System.IO.Directory.CreateDirectory(outputDir);
            System.IO.File.Move(outputFile, filePath);
        }
        catch (System.Exception ex)
        {
            Debug.Log(ex.ToString());
        }

        FileStream output = new FileStream(outputFile, FileMode.Create);

        //end lxjk
        BinaryFormatter bf = new BinaryFormatter();

        SerialSkeletonFrame[] data = new SerialSkeletonFrame[currentData.Count];
        for (int ii = 0; ii < currentData.Count; ii++)
        {
            data[ii] = (SerialSkeletonFrame)(currentData[ii]);
        }
        bf.Serialize(output, data);
        output.Close();
        fileCount++;
        Debug.Log("stop recording");
    }
Beispiel #3
0
    public void StopRecord()
    {
        isRecording = false;
        //edit by lxjk
        string     filePath = outputFile + fileCount.ToString();
        FileStream output   = new FileStream(@filePath, FileMode.Create);
        //end lxjk
        BinaryFormatter bf = new BinaryFormatter();

        SerialSkeletonFrame[] data = new SerialSkeletonFrame[currentData.Count];
        for (int ii = 0; ii < currentData.Count; ii++)
        {
            data[ii] = new SerialSkeletonFrame((NuiSkeletonFrame)currentData[ii]);
        }
        bf.Serialize(output, data);
        output.Close();
        fileCount++;
        Debug.Log("stop recording");
    }