Example #1
0
        /// <summary>
        /// Contruct a read track result object from the raw data.
        /// </summary>
        /// <param name="buf">the raw data buffer</param>
        /// <param name="size">the size of the raw buffer in bytes</param>
        public TrackInformation(IntPtr buf, int size) : base(buf, size)
        {
            TrackNumber   = Get16(32, 2);
            SessionNumber = Get16(33, 3);

            Copy      = GetBit(5, 4);
            Damage    = GetBit(5, 5);
            TrackMode = (byte)(Get8(5) & 0x0f);

            RT       = GetBit(6, 7);
            Blank    = GetBit(6, 6);
            Packet   = GetBit(6, 5);
            FP       = GetBit(6, 4);
            DataMode = (DataModeType)(Get8(6) & 0x0f);

            LRA_V = GetBit(7, 1);
            NWA_V = GetBit(7, 0);

            TrackStartAddress   = (int)Get32(8);
            NextWritableAddress = (int)Get32(12);
            FreeBlocks          = Get32Int(16);
            FixedPacketSize     = Get32Int(20);
            TrackSize           = Get32Int(24);
            LastRecordedAddress = (int)Get32(28);
            ReadCompatLBA       = (int)Get32(36);
        }
        /// <summary>
        /// Contruct a read track result object from the raw data.
        /// </summary>
        /// <param name="buf">the raw data buffer</param>
        /// <param name="size">the size of the raw buffer in bytes</param>
        public TrackInformation(IntPtr buf, int size) : base(buf, size)
        {
            TrackNumber = Get16(32, 2) ;
            SessionNumber = Get16(33, 3) ;

            Copy = GetBit(5,4) ;
            Damage = GetBit(5,5) ;
            TrackMode = (byte)(Get8(5) & 0x0f) ;

            RT = GetBit(6,7) ;
            Blank = GetBit(6,6) ;
            Packet = GetBit(6,5) ;
            FP = GetBit(6,4) ;
            DataMode = (DataModeType)(Get8(6) & 0x0f);

            LRA_V = GetBit(7, 1) ;
            NWA_V = GetBit(7, 0) ;

            TrackStartAddress = (int)Get32(8) ;
            NextWritableAddress = (int)Get32(12) ;
            FreeBlocks = Get32Int(16) ;
            FixedPacketSize = Get32Int(20) ;
            TrackSize = Get32Int(24) ;
            LastRecordedAddress = (int)Get32(28) ;
            ReadCompatLBA = (int)Get32(36) ;
        }