From 06fe43067a779e67d252db57343711cb1583eeda Mon Sep 17 00:00:00 2001 From: Natalia Portillo Date: Sat, 14 Dec 2019 22:15:05 +0000 Subject: [PATCH] Move Lead-Out dumping code. --- .../Devices/Dumping/CompactDisc.cs | 95 ++++++++++--------- 1 file changed, 48 insertions(+), 47 deletions(-) diff --git a/DiscImageChef.Core/Devices/Dumping/CompactDisc.cs b/DiscImageChef.Core/Devices/Dumping/CompactDisc.cs index 815c650e8..1c49c2386 100644 --- a/DiscImageChef.Core/Devices/Dumping/CompactDisc.cs +++ b/DiscImageChef.Core/Devices/Dumping/CompactDisc.cs @@ -1488,53 +1488,6 @@ namespace DiscImageChef.Core.Devices.Dumping } EndProgress?.Invoke(); - } - - /// Dumps a compact disc - /// Disc type as detected in MMC layer - internal void CompactDiscOld(ref MediaType dskType) - { - DateTime dumpStart = DateTime.UtcNow; - bool ret; - ulong blocks = 0; - Track[] tracks = new Track[0]; - List trackList = new List(); - long lastSector = 0; - Dictionary trackFlags = new Dictionary(); - TrackType firstTrackType = TrackType.Audio; - Dictionary leadOutStarts = new Dictionary(); - uint subSize = 0; - const uint SECTOR_SIZE = 2352; - uint blockSize = SECTOR_SIZE + subSize; - DateTime start = DateTime.UtcNow; - DateTime end; - bool readcd = false; - bool read6 = false, read10 = false, read12 = false, read16 = false; - bool sense = false; - FullTOC.CDFullTOC? toc = null; - double totalDuration = 0; - double currentSpeed = 0; - double maxSpeed = double.MinValue; - double minSpeed = double.MaxValue; - uint blocksToRead = 64; - Dictionary mediaTags = new Dictionary(); - byte[] cmdBuf = null; - byte[] senseBuf = null; - byte[] tmpBuf; - MmcSubchannel supportedSubchannel = MmcSubchannel.Raw; - TrackSubchannelType subType = TrackSubchannelType.None; // Track subchannel type - bool supportsLongSectors = true; - int sessions = 1; - int firstTrackLastSession = 0; - DumpHardwareType currentTry = null; - ExtentsULong extents = null; - DateTime timeSpeedStart = DateTime.UtcNow; - ulong sectorSpeedStart = 0; - double imageWriteDuration = 0; - bool newTrim = false; - - var mhddLog = new MhddLog(outputPrefix + ".mhddlog.bin", dev, blocks, blockSize, blocksToRead); - var ibgLog = new IbgLog(outputPrefix + ".ibg", 0x0008); // TODO: Enable when underlying images support lead-outs /* @@ -1642,6 +1595,54 @@ namespace DiscImageChef.Core.Devices.Dumping EndProgress?.Invoke(); }*/ + } + + /// Dumps a compact disc + /// Disc type as detected in MMC layer + internal void CompactDiscOld(ref MediaType dskType) + { + DateTime dumpStart = DateTime.UtcNow; + bool ret; + ulong blocks = 0; + Track[] tracks = new Track[0]; + List trackList = new List(); + long lastSector = 0; + Dictionary trackFlags = new Dictionary(); + TrackType firstTrackType = TrackType.Audio; + Dictionary leadOutStarts = new Dictionary(); + uint subSize = 0; + const uint SECTOR_SIZE = 2352; + uint blockSize = SECTOR_SIZE + subSize; + DateTime start = DateTime.UtcNow; + DateTime end; + bool readcd = false; + bool read6 = false, read10 = false, read12 = false, read16 = false; + bool sense = false; + FullTOC.CDFullTOC? toc = null; + double totalDuration = 0; + double currentSpeed = 0; + double maxSpeed = double.MinValue; + double minSpeed = double.MaxValue; + uint blocksToRead = 64; + Dictionary mediaTags = new Dictionary(); + byte[] cmdBuf = null; + byte[] senseBuf = null; + byte[] tmpBuf; + MmcSubchannel supportedSubchannel = MmcSubchannel.Raw; + TrackSubchannelType subType = TrackSubchannelType.None; // Track subchannel type + bool supportsLongSectors = true; + int sessions = 1; + int firstTrackLastSession = 0; + DumpHardwareType currentTry = null; + ExtentsULong extents = null; + DateTime timeSpeedStart = DateTime.UtcNow; + ulong sectorSpeedStart = 0; + double imageWriteDuration = 0; + bool newTrim = false; + + var mhddLog = new MhddLog(outputPrefix + ".mhddlog.bin", dev, blocks, blockSize, blocksToRead); + var ibgLog = new IbgLog(outputPrefix + ".ibg", 0x0008); + end = DateTime.UtcNow; mhddLog.Close();