From ba9a108a622e1985bad7bd67c92fc203402cca13 Mon Sep 17 00:00:00 2001 From: Natalia Portillo Date: Wed, 25 Dec 2019 16:53:29 +0000 Subject: [PATCH] Add comments to explain CD dumping variables. --- .../Devices/Dumping/CompactDisc.cs | 102 +++++++++--------- 1 file changed, 54 insertions(+), 48 deletions(-) diff --git a/DiscImageChef.Core/Devices/Dumping/CompactDisc.cs b/DiscImageChef.Core/Devices/Dumping/CompactDisc.cs index 7fb941e73..e002cb64a 100644 --- a/DiscImageChef.Core/Devices/Dumping/CompactDisc.cs +++ b/DiscImageChef.Core/Devices/Dumping/CompactDisc.cs @@ -73,55 +73,61 @@ namespace DiscImageChef.Core.Devices.Dumping /// Disc type as detected in MMC layer void CompactDisc(out MediaType dskType) { - DicContext ctx; // Master database context - Device dbDev; // Device database entry - CdOffset cdOffset; // Read offset from database - bool readcd; // Device supports READ CD - bool read6 = false; // Device supports READ(6) - bool read10 = false; // Device supports READ(10) - bool read12 = false; // Device supports READ(12) - bool read16 = false; // Device supports READ(16) - const uint sectorSize = 2352; // Full sector size - MmcSubchannel supportedSubchannel; // Drive's maximum supported subchannel - uint subSize; // Subchannel size in bytes - bool sense; // Sense indicator - byte[] cmdBuf; // Data buffer - byte[] senseBuf; // Sense buffer - byte[] tmpBuf; // Temporary buffer - FullTOC.CDFullTOC? toc = null; // Full CD TOC - TrackSubchannelType subType; // Track subchannel type - uint blockSize; - List trackList = new List(); - long lastSector = 0; - Dictionary trackFlags = new Dictionary(); - TrackType firstTrackType = TrackType.Audio; - Dictionary leadOutStarts = new Dictionary(); - int sessions = 1; - int firstTrackLastSession = 0; - ulong blocks; - Track[] tracks; - var leadOutExtents = new ExtentsULong(); - bool supportsLongSectors = true; - DumpHardwareType currentTry = null; - ExtentsULong extents = null; - DateTime timeSpeedStart; - ulong sectorSpeedStart = 0; - double totalDuration = 0; - double currentSpeed = 0; - double maxSpeed = double.MinValue; - double minSpeed = double.MaxValue; - uint blocksToRead = 64; - bool ret; - double imageWriteDuration = 0; - bool newTrim = false; - MhddLog mhddLog; - IbgLog ibgLog; - DateTime start; - DateTime dumpStart = DateTime.UtcNow; - DateTime end; - double cmdDuration = 0; + ulong blocks; // Total number of positive sectors + uint blockSize; // Size of the read sector in bytes + uint blocksToRead = 64; // How many sectors to read at once + CdOffset cdOffset; // Read offset from database + byte[] cmdBuf; // Data buffer + double cmdDuration = 0; // Command execution time + DicContext ctx; // Master database context + DumpHardwareType currentTry = null; // Current dump hardware try + double currentSpeed = 0; // Current read speed + Device dbDev; // Device database entry + DateTime dumpStart = DateTime.UtcNow; // Time of dump start + DateTime end; // Time of operation end + ExtentsULong extents = null; // Extents + TrackType firstTrackType = TrackType.Audio; // Type of first track + IbgLog ibgLog; // IMGBurn log + double imageWriteDuration = 0; // Duration of image write + long lastSector = 0; // Last sector number + var leadOutExtents = new ExtentsULong(); // Lead-out extents + Dictionary leadOutStarts = new Dictionary(); // Lead-out starts + double maxSpeed = double.MinValue; // Maximum speed + MhddLog mhddLog; // MHDD log + double minSpeed = double.MaxValue; // Minimum speed + bool newTrim = false; // Is trim a new one? + bool read6 = false; // Device supports READ(6) + bool read10 = false; // Device supports READ(10) + bool read12 = false; // Device supports READ(12) + bool read16 = false; // Device supports READ(16) + bool readcd; // Device supports READ CD + bool ret; // Image writing return status + const uint sectorSize = 2352; // Full sector size + ulong sectorSpeedStart = 0; // Used to calculate correct speed + bool sense; // Sense indicator + byte[] senseBuf; // Sense buffer + int sessions = 1; // Number of sessions in disc + DateTime start; // Start of operation + uint subSize; // Subchannel size in bytes + TrackSubchannelType subType; // Track subchannel type + bool supportsLongSectors = true; // Supports reading EDC and ECC + byte[] tmpBuf; // Temporary buffer + FullTOC.CDFullTOC? toc = null; // Full CD TOC + double totalDuration = 0; // Total commands duration + Dictionary trackFlags = new Dictionary(); // Track flags + List trackList = new List(); // Tracks in disc + Track[] tracks; // Tracks in disc as array - Dictionary mediaTags = new Dictionary(); // Media tags + Dictionary + mediaTags = new Dictionary(); // Media tags + + int firstTrackLastSession = + 0; // Number of first track in last session + + MmcSubchannel + supportedSubchannel; // Drive's maximum supported subchannel + + DateTime timeSpeedStart; // Time of start for speed calculation dskType = MediaType.CD;