Beispiel #1
0
        //reads CSEQ from given binaryreader
        public bool Read(BinaryReaderEx br, CSEQ cs)
        {
            //read header
            if (!header.Read(br))
            {
                return(false);
            }

            //read offsets
            short[] seqOffsets = br.ReadArrayInt16(header.trackNum);

            //padding i guess?
            if (header.trackNum % 2 == 0)
            {
                br.ReadInt16();
            }

            //save current position to read tracks
            int trackData = (int)br.BaseStream.Position;

            //loop through all tracks
            for (int i = 0; i < header.trackNum; i++)
            {
                //jump to track offset
                br.Jump(trackData + seqOffsets[i]);

                //read track
                CTrack t = new CTrack();
                t.Read(br, i);

                //add track to the list
                tracks.Add(t);
            }

            return(true);
        }