// // BwgBurn - CD-R/CD-RW/DVD-R/DVD-RW burning program for Windows XP // // Copyright (C) 2006 by Jack W. Griffin (butchg@comcast.net) // // This program is free software; you can redistribute it and/or modify // it under the terms of the GNU General Public License as published by // the Free Software Foundation; either version 2 of the License, or // (at your option) any later version. // // This program is distributed in the hope that it will be useful, but // WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY // or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License // for more details. // // You should have received a copy of the GNU General Public License along // with this program; if not, write to the // // Free Software Foundation, Inc., // 59 Temple Place, Suite 330, // Boston, MA 02111-1307 USA // using System; using System.Collections.Generic; using System.Text; namespace Bwg.Scsi { /// /// This class contains the header data read from a sector /// public class HeaderData : Result { #region public types /// /// The block type, see SCSI MMC spec /// public enum BlockTypeType : byte { /// /// See SCSI MMC spec /// UserDataBlock = 0x00, /// /// See SCSI MMC spec /// FourthRunInBlock = 0x01, /// /// See SCSI MMC spec /// ThirdRunInBlock = 0x02, /// /// See SCSI MMC spec /// SecondRunInBlock = 0x03, /// /// See SCSI MMC spec /// FirstRunInBlock = 0x04, /// /// See SCSI MMC spec /// LinkBlock = 0x05, /// /// See SCSI MMC spec /// SecondRunOutBlock = 0x06, /// /// See SCSI MMC spec /// FirstRunOutBlock = 0x07 } ; /// /// The data mode for the sector (only applies if track mode is 0x04) /// public enum DataTypeType : byte { /// /// Mode 0 data, 2336 bytes of zero /// Mode0Data = 0x00, /// /// Mode 1 data, 2048 bytes of user data /// Mode1Data = 0x01, /// /// Mode 2 data, multiple forms of data /// Mode2Data = 0x02, /// /// Reserved, should not be returned by a drive /// Reserved = 0x03 } ; #endregion #region public data members /// /// The time data read from the sector /// public readonly MinuteSecondFrame MSF; /// /// The block type, see SCSI MMC spec /// public readonly BlockTypeType BlockType; /// /// The data type, see SCSI MMC spec /// public readonly DataTypeType DataType; #endregion /// /// Create the header data object from a buffer containing the header data /// /// buffer containing the data /// size of the data public HeaderData(IntPtr buf, int size) : base(buf, size) { byte b ; MSF = new MinuteSecondFrame(Get8(0), Get8(1), Get8(2)); b = Get8(3); BlockType = (BlockTypeType)((b >> 5) & 0x07); DataType = (DataTypeType)(b & 0x03); } } }