From 138830652de132971a2d435c31b7c2f784afb387 Mon Sep 17 00:00:00 2001 From: Natalia Portillo Date: Fri, 19 Apr 2019 18:54:25 +0100 Subject: [PATCH] Move all dumpers to Dump class. --- .../Devices/Dumping/CompactDisc.cs | 6 +-- DiscImageChef.Core/Devices/Dumping/MMC.cs | 44 ++++++++-------- DiscImageChef.Core/Devices/Dumping/NVMe.cs | 21 ++++---- .../Devices/Dumping/PlayStationPortable.cs | 50 +++++++++---------- DiscImageChef.Core/Devices/Dumping/SBC.cs | 34 ++++++------- DiscImageChef.Core/Devices/Dumping/SCSI.cs | 37 +++++++------- DiscImageChef.Core/Devices/Dumping/SSC.cs | 11 ++-- .../Devices/Dumping/SecureDigital.cs | 21 ++++---- DiscImageChef.Core/Devices/Dumping/XGD.cs | 28 +++++------ DiscImageChef.Gui/Forms/frmDump.xeto.cs | 39 +++++++-------- DiscImageChef/Commands/DumpMedia.cs | 25 +++++----- 11 files changed, 159 insertions(+), 157 deletions(-) diff --git a/DiscImageChef.Core/Devices/Dumping/CompactDisc.cs b/DiscImageChef.Core/Devices/Dumping/CompactDisc.cs index ed8171952..5c65fcacf 100644 --- a/DiscImageChef.Core/Devices/Dumping/CompactDisc.cs +++ b/DiscImageChef.Core/Devices/Dumping/CompactDisc.cs @@ -61,7 +61,7 @@ namespace DiscImageChef.Core.Devices.Dumping /// Implement dumping Compact Discs /// // TODO: Barcode and pregaps - static class CompactDisc + partial class Dump { /// /// Dumps a compact disc @@ -85,7 +85,7 @@ namespace DiscImageChef.Core.Devices.Dumping /// If trying to dump scrambled sectors /// If the resume file is invalid /// If the track type is unknown (never) - internal static void Dump(Device dev, string devicePath, + internal void CompactDisc(Device dev, string devicePath, IWritableOpticalImage outputPlugin, ushort retryPasses, bool force, bool dumpRaw, bool persistent, bool stopOnError, @@ -1826,7 +1826,7 @@ namespace DiscImageChef.Core.Devices.Dumping foreach(KeyValuePair tag in mediaTags) if(outputPlugin.SupportedMediaTags.Contains(tag.Key)) - Mmc.AddMediaTagToSidecar(outputPath, tag, ref sidecar); + AddMediaTagToSidecar(outputPath, tag, ref sidecar); DicConsole.WriteLine("Writing metadata sidecar"); diff --git a/DiscImageChef.Core/Devices/Dumping/MMC.cs b/DiscImageChef.Core/Devices/Dumping/MMC.cs index f41b162ac..7e3c697ef 100644 --- a/DiscImageChef.Core/Devices/Dumping/MMC.cs +++ b/DiscImageChef.Core/Devices/Dumping/MMC.cs @@ -54,7 +54,7 @@ namespace DiscImageChef.Core.Devices.Dumping /// /// Implement dumping optical discs from MultiMedia devices /// - static class Mmc + partial class Dump { /// /// Dumps an optical disc @@ -76,16 +76,16 @@ namespace DiscImageChef.Core.Devices.Dumping /// Path to output file /// Formats to pass to output file plugin /// If trying to dump GOD or WOD, or XGDs without a Kreon drive - internal static void Dump(Device dev, string devicePath, - IWritableOpticalImage outputPlugin, ushort retryPasses, - bool force, bool dumpRaw, - bool persistent, bool stopOnError, ref MediaType dskType, - ref Resume resume, ref DumpLog dumpLog, - bool dumpLeadIn, Encoding encoding, - string outputPrefix, string outputPath, - Dictionary formatOptions, - CICMMetadataType preSidecar, uint skip, - bool nometadata, bool notrim) + internal void Mmc(Device dev, string devicePath, + IWritableOpticalImage outputPlugin, ushort retryPasses, + bool force, bool dumpRaw, bool persistent, + bool stopOnError, ref MediaType dskType, + ref Resume resume, ref DumpLog dumpLog, bool dumpLeadIn, + Encoding encoding, + string outputPrefix, string outputPath, + Dictionary formatOptions, + CICMMetadataType preSidecar, uint skip, bool nometadata, + bool notrim) { bool sense; byte[] tmpBuf; @@ -197,9 +197,10 @@ namespace DiscImageChef.Core.Devices.Dumping if(compactDisc) { - CompactDisc.Dump(dev, devicePath, outputPlugin, retryPasses, force, dumpRaw, persistent, stopOnError, - ref dskType, ref resume, ref dumpLog, dumpLeadIn, encoding, outputPrefix, outputPath, - formatOptions, preSidecar, skip, nometadata, notrim); + CompactDisc(dev, devicePath, outputPlugin, retryPasses, force, dumpRaw, persistent, + stopOnError, + ref dskType, ref resume, ref dumpLog, dumpLeadIn, encoding, outputPrefix, outputPath, + formatOptions, preSidecar, skip, nometadata, notrim); return; } @@ -599,15 +600,18 @@ namespace DiscImageChef.Core.Devices.Dumping if(isXbox) { - Xgd.Dump(dev, devicePath, outputPlugin, retryPasses, force, dumpRaw, persistent, stopOnError, mediaTags, - ref dskType, ref resume, ref dumpLog, encoding, outputPrefix, outputPath, formatOptions, - preSidecar, skip, nometadata, notrim); + Xgd(dev, devicePath, outputPlugin, retryPasses, force, dumpRaw, persistent, + stopOnError, mediaTags, + ref dskType, ref resume, ref dumpLog, encoding, outputPrefix, outputPath, formatOptions, + preSidecar, + skip, nometadata, notrim); return; } - Sbc.Dump(dev, devicePath, outputPlugin, retryPasses, force, dumpRaw, persistent, stopOnError, mediaTags, - ref dskType, true, ref resume, ref dumpLog, encoding, outputPrefix, outputPath, formatOptions, - preSidecar, skip, nometadata, notrim); + Sbc(dev, devicePath, outputPlugin, retryPasses, force, dumpRaw, persistent, stopOnError, + mediaTags, + ref dskType, true, ref resume, ref dumpLog, encoding, outputPrefix, outputPath, formatOptions, + preSidecar, skip, nometadata, notrim); } internal static void AddMediaTagToSidecar(string outputPath, diff --git a/DiscImageChef.Core/Devices/Dumping/NVMe.cs b/DiscImageChef.Core/Devices/Dumping/NVMe.cs index 146c23cae..9175b46a5 100644 --- a/DiscImageChef.Core/Devices/Dumping/NVMe.cs +++ b/DiscImageChef.Core/Devices/Dumping/NVMe.cs @@ -39,19 +39,20 @@ using DiscImageChef.Core.Logging; using DiscImageChef.Devices; using Schemas; +// ReSharper disable InconsistentNaming + namespace DiscImageChef.Core.Devices.Dumping { - public static class NvMe + public partial class Dump { - public static void Dump(Device dev, string devicePath, - IWritableImage outputPlugin, ushort retryPasses, - bool force, bool dumpRaw, - bool persistent, bool stopOnError, ref Resume resume, - ref DumpLog dumpLog, Encoding encoding, - string outputPrefix, string outputPath, - Dictionary formatOptions, CICMMetadataType preSidecar, - uint skip, - bool nometadata, bool notrim) + public void NVMe(Device dev, string devicePath, + IWritableImage outputPlugin, ushort retryPasses, bool force, + bool dumpRaw, bool persistent, + bool stopOnError, ref Resume resume, ref DumpLog dumpLog, + Encoding encoding, string outputPrefix, + string outputPath, + Dictionary formatOptions, CICMMetadataType preSidecar, uint skip, + bool nometadata, bool notrim) { throw new NotImplementedException("NVMe devices not yet supported."); } diff --git a/DiscImageChef.Core/Devices/Dumping/PlayStationPortable.cs b/DiscImageChef.Core/Devices/Dumping/PlayStationPortable.cs index 8058134d1..ac3ec5d8c 100644 --- a/DiscImageChef.Core/Devices/Dumping/PlayStationPortable.cs +++ b/DiscImageChef.Core/Devices/Dumping/PlayStationPortable.cs @@ -21,7 +21,7 @@ using Version = DiscImageChef.CommonTypes.Interop.Version; namespace DiscImageChef.Core.Devices.Dumping { - public static class PlayStationPortable + public partial class Dump { static readonly byte[] FatSignature = {0x46, 0x41, 0x54, 0x31, 0x36, 0x20, 0x20, 0x20}; static readonly byte[] IsoExtension = {0x49, 0x53, 0x4F}; @@ -47,15 +47,15 @@ namespace DiscImageChef.Core.Devices.Dumping /// Don't create metadata sidecar /// Don't trim errors /// If you asked to dump long sectors from a SCSI Streaming device - public static void Dump(Device dev, string devicePath, - IWritableImage outputPlugin, ushort retryPasses, - bool force, bool persistent, - bool stopOnError, ref Resume resume, ref DumpLog dumpLog, - Encoding encoding, string outputPrefix, - string outputPath, - Dictionary formatOptions, CICMMetadataType preSidecar, - uint skip, - bool nometadata, bool notrim) + public void PlayStationPortable(Device dev, string devicePath, + IWritableImage outputPlugin, ushort retryPasses, + bool force, bool persistent, + bool stopOnError, ref Resume resume, + ref DumpLog dumpLog, Encoding encoding, + string outputPrefix, string outputPath, + Dictionary formatOptions, CICMMetadataType preSidecar, + uint skip, bool nometadata, + bool notrim) { if(!outputPlugin.SupportedMediaTypes.Contains(MediaType.MemoryStickDuo) && !outputPlugin.SupportedMediaTypes.Contains(MediaType.MemoryStickProDuo) && @@ -217,15 +217,13 @@ namespace DiscImageChef.Core.Devices.Dumping else DicConsole.ErrorWriteLine("The specified plugin does not support storing optical disc images."); } - static void DumpUmd(Device dev, string devicePath, - IWritableOpticalImage outputPlugin, ushort retryPasses, - bool force, bool persistent, - bool stopOnError, ref Resume resume, ref DumpLog dumpLog, - Encoding encoding, string outputPrefix, - string outputPath, - Dictionary formatOptions, CICMMetadataType preSidecar, - uint skip, - bool nometadata, bool notrim) + void DumpUmd(Device dev, string devicePath, IWritableOpticalImage outputPlugin, + ushort retryPasses, bool force, + bool persistent, bool stopOnError, ref Resume resume, + ref DumpLog dumpLog, Encoding encoding, + string outputPrefix, string outputPath, Dictionary formatOptions, + CICMMetadataType preSidecar, uint skip, bool nometadata, + bool notrim) { const uint BLOCK_SIZE = 2048; const MediaType DSK_TYPE = MediaType.UMD; @@ -682,13 +680,13 @@ namespace DiscImageChef.Core.Devices.Dumping Statistics.AddMedia(DSK_TYPE, true); } - static void DumpMs(Device dev, string devicePath, IWritableImage outputPlugin, - ushort retryPasses, bool force, - bool persistent, bool stopOnError, ref Resume resume, - ref DumpLog dumpLog, Encoding encoding, - string outputPrefix, string outputPath, Dictionary formatOptions, - CICMMetadataType preSidecar, uint skip, bool nometadata, - bool notrim) + void DumpMs(Device dev, string devicePath, IWritableImage outputPlugin, + ushort retryPasses, bool force, + bool persistent, bool stopOnError, ref Resume resume, + ref DumpLog dumpLog, Encoding encoding, + string outputPrefix, string outputPath, Dictionary formatOptions, + CICMMetadataType preSidecar, uint skip, bool nometadata, + bool notrim) { const ushort SBC_PROFILE = 0x0001; const uint BLOCK_SIZE = 512; diff --git a/DiscImageChef.Core/Devices/Dumping/SBC.cs b/DiscImageChef.Core/Devices/Dumping/SBC.cs index 616fc1b80..68b418477 100644 --- a/DiscImageChef.Core/Devices/Dumping/SBC.cs +++ b/DiscImageChef.Core/Devices/Dumping/SBC.cs @@ -55,7 +55,7 @@ namespace DiscImageChef.Core.Devices.Dumping /// /// Implements dumping SCSI Block Commands and Reduced Block Commands devices /// - static class Sbc + partial class Dump { /// /// Dumps a SCSI Block Commands device or a Reduced Block Commands devices @@ -78,17 +78,16 @@ namespace DiscImageChef.Core.Devices.Dumping /// Path to output file /// Formats to pass to output file plugin /// If the resume file is invalid - internal static void Dump(Device dev, string devicePath, - IWritableImage outputPlugin, ushort retryPasses, - bool force, bool dumpRaw, - bool persistent, bool stopOnError, - Dictionary mediaTags, ref MediaType dskType, - bool opticalDisc, - ref Resume resume, ref DumpLog dumpLog, - Encoding encoding, string outputPrefix, - string outputPath, Dictionary formatOptions, - CICMMetadataType preSidecar, uint skip, - bool nometadata, bool notrim) + internal void Sbc(Device dev, string devicePath, + IWritableImage outputPlugin, ushort retryPasses, bool force, + bool dumpRaw, bool persistent, + bool stopOnError, Dictionary mediaTags, + ref MediaType dskType, bool opticalDisc, + ref Resume resume, ref DumpLog dumpLog, + Encoding encoding, string outputPrefix, + string outputPath, + Dictionary formatOptions, CICMMetadataType preSidecar, uint skip, + bool nometadata, bool notrim) { bool sense; byte scsiMediumType = 0; @@ -827,7 +826,7 @@ namespace DiscImageChef.Core.Devices.Dumping foreach(KeyValuePair tag in mediaTags) if(outputPlugin.SupportedMediaTags.Contains(tag.Key)) - Mmc.AddMediaTagToSidecar(outputPath, tag, ref sidecar); + AddMediaTagToSidecar(outputPath, tag, ref sidecar); } else { @@ -974,11 +973,10 @@ namespace DiscImageChef.Core.Devices.Dumping sidecar.BlockMedia[0].DiskSubType = xmlDskSubTyp; // TODO: Implement device firmware revision if(!dev.IsRemovable || dev.IsUsb) - if(dev.Type == DeviceType.ATAPI) - sidecar.BlockMedia[0].Interface = "ATAPI"; - else if(dev.IsUsb) sidecar.BlockMedia[0].Interface = "USB"; - else if(dev.IsFireWire) sidecar.BlockMedia[0].Interface = "FireWire"; - else sidecar.BlockMedia[0].Interface = "SCSI"; + if(dev.Type == DeviceType.ATAPI) sidecar.BlockMedia[0].Interface = "ATAPI"; + else if(dev.IsUsb) sidecar.BlockMedia[0].Interface = "USB"; + else if(dev.IsFireWire) sidecar.BlockMedia[0].Interface = "FireWire"; + else sidecar.BlockMedia[0].Interface = "SCSI"; sidecar.BlockMedia[0].LogicalBlocks = (long)blocks; sidecar.BlockMedia[0].PhysicalBlockSize = (int)physicalBlockSize; sidecar.BlockMedia[0].LogicalBlockSize = (int)logicalBlockSize; diff --git a/DiscImageChef.Core/Devices/Dumping/SCSI.cs b/DiscImageChef.Core/Devices/Dumping/SCSI.cs index 070485415..56551de77 100644 --- a/DiscImageChef.Core/Devices/Dumping/SCSI.cs +++ b/DiscImageChef.Core/Devices/Dumping/SCSI.cs @@ -48,7 +48,7 @@ namespace DiscImageChef.Core.Devices.Dumping /// /// Implements dumping SCSI and ATAPI devices /// - public static class Scsi + public partial class Dump { // TODO: Get cartridge serial number from Certance vendor EVPD /// @@ -70,15 +70,15 @@ namespace DiscImageChef.Core.Devices.Dumping /// Path to output file /// Formats to pass to output file plugin /// If you asked to dump long sectors from a SCSI Streaming device - public static void Dump(Device dev, string devicePath, - IWritableImage outputPlugin, ushort retryPasses, - bool force, bool dumpRaw, - bool persistent, bool stopOnError, ref Resume resume, - ref DumpLog dumpLog, bool dumpFirstTrackPregap, - Encoding encoding, string outputPrefix, - string outputPath, Dictionary formatOptions, - CICMMetadataType preSidecar, uint skip, bool nometadata, - bool notrim) + public void Scsi(Device dev, string devicePath, + IWritableImage outputPlugin, ushort retryPasses, bool force, + bool dumpRaw, bool persistent, + bool stopOnError, ref Resume resume, ref DumpLog dumpLog, + bool dumpFirstTrackPregap, Encoding encoding, + string outputPrefix, string outputPath, + Dictionary formatOptions, CICMMetadataType preSidecar, + uint skip, + bool nometadata, bool notrim) { MediaType dskType = MediaType.Unknown; int resets = 0; @@ -206,20 +206,23 @@ namespace DiscImageChef.Core.Devices.Dumping case PeripheralDeviceTypes.SequentialAccess: if(dumpRaw) throw new ArgumentException("Tapes cannot be dumped raw."); - Ssc.Dump(dev, outputPrefix, devicePath, ref resume, ref dumpLog, preSidecar); + Ssc(dev, outputPrefix, devicePath, ref resume, ref dumpLog, preSidecar); return; case PeripheralDeviceTypes.MultiMediaDevice: if(outputPlugin is IWritableOpticalImage opticalPlugin) - Mmc.Dump(dev, devicePath, opticalPlugin, retryPasses, force, dumpRaw, persistent, stopOnError, - ref dskType, ref resume, ref dumpLog, dumpFirstTrackPregap, encoding, outputPrefix, - outputPath, formatOptions, preSidecar, skip, nometadata, notrim); + Mmc(dev, devicePath, opticalPlugin, retryPasses, force, dumpRaw, + persistent, stopOnError, + ref dskType, ref resume, ref dumpLog, dumpFirstTrackPregap, encoding, outputPrefix, + outputPath, formatOptions, preSidecar, skip, nometadata, notrim); else DicConsole.ErrorWriteLine("The specified plugin does not support storing optical disc images."); return; default: - Sbc.Dump(dev, devicePath, outputPlugin, retryPasses, force, dumpRaw, persistent, stopOnError, null, - ref dskType, false, ref resume, ref dumpLog, encoding, outputPrefix, outputPath, - formatOptions, preSidecar, skip, nometadata, notrim); + Sbc(dev, devicePath, outputPlugin, retryPasses, force, dumpRaw, persistent, + stopOnError, null, + ref dskType, false, ref resume, ref dumpLog, encoding, outputPrefix, outputPath, + formatOptions, + preSidecar, skip, nometadata, notrim); break; } } diff --git a/DiscImageChef.Core/Devices/Dumping/SSC.cs b/DiscImageChef.Core/Devices/Dumping/SSC.cs index 334057d01..d4be9e35a 100644 --- a/DiscImageChef.Core/Devices/Dumping/SSC.cs +++ b/DiscImageChef.Core/Devices/Dumping/SSC.cs @@ -48,7 +48,7 @@ using Version = DiscImageChef.CommonTypes.Metadata.Version; namespace DiscImageChef.Core.Devices.Dumping { // TODO: Add support for images - static class Ssc + partial class Dump { /// /// Dumps the tape from a SCSI Streaming device @@ -58,9 +58,9 @@ namespace DiscImageChef.Core.Devices.Dumping /// Prefix for output data files /// Information for dump resuming /// Dump logger - internal static void Dump(Device dev, string outputPrefix, string devicePath, - ref Resume resume, - ref DumpLog dumpLog, CICMMetadataType preSidecar) + internal void Ssc(Device dev, string outputPrefix, string devicePath, ref Resume resume, + ref DumpLog dumpLog, + CICMMetadataType preSidecar) { FixedSense? fxSense; bool aborted; @@ -506,8 +506,7 @@ namespace DiscImageChef.Core.Devices.Dumping DicConsole.WriteLine("Blocksize changed to {0} bytes at block {1}", blockSize, currentBlock); dumpLog.WriteLine("Blocksize changed to {0} bytes at block {1}", blockSize, currentBlock); - sense = dev.Space(out senseBuf, SscSpaceCodes.LogicalBlock, -1, dev.Timeout, - out duration); + sense = dev.Space(out senseBuf, SscSpaceCodes.LogicalBlock, -1, dev.Timeout, out duration); totalDuration += duration; if(sense) diff --git a/DiscImageChef.Core/Devices/Dumping/SecureDigital.cs b/DiscImageChef.Core/Devices/Dumping/SecureDigital.cs index d2e0b7974..a541462c7 100644 --- a/DiscImageChef.Core/Devices/Dumping/SecureDigital.cs +++ b/DiscImageChef.Core/Devices/Dumping/SecureDigital.cs @@ -53,7 +53,7 @@ namespace DiscImageChef.Core.Devices.Dumping /// /// Implements dumping a MultiMediaCard or SecureDigital flash card /// - public class SecureDigital + public partial class Dump { /// /// Dumps a MultiMediaCard or SecureDigital flash card @@ -73,15 +73,15 @@ namespace DiscImageChef.Core.Devices.Dumping /// Path to output file /// Formats to pass to output file plugin /// If you asked to dump long sectors from a SCSI Streaming device - public static void Dump(Device dev, string devicePath, - IWritableImage outputPlugin, ushort retryPasses, - bool force, bool dumpRaw, - bool persistent, bool stopOnError, ref Resume resume, - ref DumpLog dumpLog, Encoding encoding, - string outputPrefix, string outputPath, - Dictionary formatOptions, CICMMetadataType preSidecar, - uint skip, - bool nometadata, bool notrim) + public void SecureDigital(Device dev, string devicePath, + IWritableImage outputPlugin, ushort retryPasses, + bool force, bool dumpRaw, + bool persistent, bool stopOnError, ref Resume resume, + ref DumpLog dumpLog, Encoding encoding, + string outputPrefix, string outputPath, + Dictionary formatOptions, CICMMetadataType preSidecar, + uint skip, + bool nometadata, bool notrim) { bool aborted; @@ -156,6 +156,7 @@ namespace DiscImageChef.Core.Devices.Dumping break; } + case DeviceType.SecureDigital: { dumpLog.WriteLine("Reading CSD"); diff --git a/DiscImageChef.Core/Devices/Dumping/XGD.cs b/DiscImageChef.Core/Devices/Dumping/XGD.cs index f092870d8..769ce91ff 100644 --- a/DiscImageChef.Core/Devices/Dumping/XGD.cs +++ b/DiscImageChef.Core/Devices/Dumping/XGD.cs @@ -57,7 +57,7 @@ namespace DiscImageChef.Core.Devices.Dumping /// /// Implements dumping an Xbox Game Disc using a Kreon drive /// - static class Xgd + partial class Dump { /// /// Dumps an Xbox Game Disc using a Kreon drive @@ -82,17 +82,17 @@ namespace DiscImageChef.Core.Devices.Dumping /// If the provided resume does not correspond with the current in progress /// dump /// - internal static void Dump(Device dev, string devicePath, - IWritableOpticalImage outputPlugin, ushort retryPasses, - bool force, bool dumpRaw, - bool persistent, bool stopOnError, - Dictionary mediaTags, ref MediaType dskType, - ref Resume resume, - ref DumpLog dumpLog, Encoding encoding, - string outputPrefix, string outputPath, - Dictionary formatOptions, CICMMetadataType preSidecar, - uint skip, - bool nometadata, bool notrim) + internal void Xgd(Device dev, string devicePath, + IWritableOpticalImage outputPlugin, ushort retryPasses, + bool force, bool dumpRaw, + bool persistent, bool stopOnError, + Dictionary mediaTags, ref MediaType dskType, + ref Resume resume, + ref DumpLog dumpLog, Encoding encoding, + string outputPrefix, string outputPath, + Dictionary formatOptions, CICMMetadataType preSidecar, + uint skip, + bool nometadata, bool notrim) { bool sense; const uint BLOCK_SIZE = 2048; @@ -905,7 +905,7 @@ namespace DiscImageChef.Core.Devices.Dumping (double)BLOCK_SIZE * (double)(blocks + 1) / 1024 / (totalChkDuration / 1000)); foreach(KeyValuePair tag in mediaTags) - Mmc.AddMediaTagToSidecar(outputPath, tag, ref sidecar); + AddMediaTagToSidecar(outputPath, tag, ref sidecar); List<(ulong start, string type)> filesystems = new List<(ulong start, string type)>(); if(sidecar.OpticalDisc[0].Track != null) @@ -934,7 +934,7 @@ namespace DiscImageChef.Core.Devices.Dumping foreach(KeyValuePair tag in mediaTags) if(outputPlugin.SupportedMediaTags.Contains(tag.Key)) - Mmc.AddMediaTagToSidecar(outputPath, tag, ref sidecar); + AddMediaTagToSidecar(outputPath, tag, ref sidecar); DicConsole.WriteLine("Writing metadata sidecar"); diff --git a/DiscImageChef.Gui/Forms/frmDump.xeto.cs b/DiscImageChef.Gui/Forms/frmDump.xeto.cs index b4d1d7546..d30bbb90b 100644 --- a/DiscImageChef.Gui/Forms/frmDump.xeto.cs +++ b/DiscImageChef.Gui/Forms/frmDump.xeto.cs @@ -52,7 +52,6 @@ using Eto.Serialization.Xaml; using Schemas; using DeviceInfo = DiscImageChef.Core.Devices.Info.DeviceInfo; using MediaType = DiscImageChef.CommonTypes.MediaType; -using Scsi = DiscImageChef.Core.Devices.Dumping.Scsi; namespace DiscImageChef.Gui.Forms { @@ -459,30 +458,30 @@ namespace DiscImageChef.Gui.Forms break; case DeviceType.MMC: case DeviceType.SecureDigital: - SecureDigital.Dump(dev, devicePath, outputFormat, (ushort)stpRetries.Value, - chkForce.Checked == true, false, /*options.Raw,*/ - chkPersistent.Checked == true, chkStopOnError.Checked == true, ref resume, - ref dumpLog, encoding, outputPrefix, txtDestination.Text, parsedOptions, sidecar, - (uint)stpSkipped.Value, chkExistingMetadata.Checked == false, - chkTrim.Checked == false); + dumper.SecureDigital(dev, devicePath, outputFormat, (ushort)stpRetries.Value, + chkForce.Checked == true, false, /*options.Raw,*/ + chkPersistent.Checked == true, chkStopOnError.Checked == true, ref resume, + ref dumpLog, encoding, outputPrefix, txtDestination.Text, parsedOptions, + sidecar, (uint)stpSkipped.Value, chkExistingMetadata.Checked == false, + chkTrim.Checked == false); break; case DeviceType.NVMe: - NvMe.Dump(dev, devicePath, outputFormat, (ushort)stpRetries.Value, chkForce.Checked == true, - false, /*options.Raw,*/ - chkPersistent.Checked == true, chkStopOnError.Checked == true, ref resume, ref dumpLog, - encoding, outputPrefix, txtDestination.Text, parsedOptions, sidecar, - (uint)stpSkipped.Value, chkExistingMetadata.Checked == false, chkTrim.Checked == false); + dumper.NVMe(dev, devicePath, outputFormat, (ushort)stpRetries.Value, chkForce.Checked == true, + false, /*options.Raw,*/ + chkPersistent.Checked == true, chkStopOnError.Checked == true, ref resume, ref dumpLog, + encoding, outputPrefix, txtDestination.Text, parsedOptions, sidecar, + (uint)stpSkipped.Value, chkExistingMetadata.Checked == false, chkTrim.Checked == false); break; case DeviceType.ATAPI: case DeviceType.SCSI: - Scsi.Dump(dev, devicePath, outputFormat, (ushort)stpRetries.Value, chkForce.Checked == true, - false, /*options.Raw,*/ - chkPersistent.Checked == true, - chkStopOnError.Checked == true, ref resume, ref dumpLog, - chkTrack1Pregap.Checked == true, - encoding, outputPrefix, txtDestination.Text, - parsedOptions, sidecar, (uint)stpSkipped.Value, chkExistingMetadata.Checked == false, - chkTrim.Checked == false); + dumper.Scsi(dev, devicePath, outputFormat, (ushort)stpRetries.Value, chkForce.Checked == true, + false, /*options.Raw,*/ + chkPersistent.Checked == true, + chkStopOnError.Checked == true, ref resume, ref dumpLog, + chkTrack1Pregap.Checked == true, + encoding, outputPrefix, txtDestination.Text, + parsedOptions, sidecar, (uint)stpSkipped.Value, chkExistingMetadata.Checked == false, + chkTrim.Checked == false); break; default: dumpLog.WriteLine("Unknown device type."); diff --git a/DiscImageChef/Commands/DumpMedia.cs b/DiscImageChef/Commands/DumpMedia.cs index c26ff8a0c..7788b3168 100644 --- a/DiscImageChef/Commands/DumpMedia.cs +++ b/DiscImageChef/Commands/DumpMedia.cs @@ -49,7 +49,6 @@ using DiscImageChef.Devices; using Mono.Options; using Schemas; using PlatformID = DiscImageChef.CommonTypes.Interop.PlatformID; -using Scsi = DiscImageChef.Core.Devices.Dumping.Scsi; namespace DiscImageChef.Commands { @@ -306,9 +305,9 @@ namespace DiscImageChef.Commands if(dev.IsUsb && dev.UsbVendorId == 0x054C && (dev.UsbProductId == 0x01C8 || dev.UsbProductId == 0x01C9 || dev.UsbProductId == 0x02D2)) - PlayStationPortable.Dump(dev, devicePath, outputFormat, retryPasses, force, persistent, stopOnError, - ref resume, ref dumpLog, encoding, outputPrefix, outputFile, parsedOptions, - sidecar, (uint)skip, noMetadata, noTrim); + dumper.PlayStationPortable(dev, devicePath, outputFormat, retryPasses, force, persistent, stopOnError, + ref resume, ref dumpLog, encoding, outputPrefix, outputFile, parsedOptions, + sidecar, (uint)skip, noMetadata, noTrim); else switch(dev.Type) { @@ -319,20 +318,20 @@ namespace DiscImageChef.Commands break; case DeviceType.MMC: case DeviceType.SecureDigital: - SecureDigital.Dump(dev, devicePath, outputFormat, retryPasses, force, false, /*raw,*/ - persistent, stopOnError, ref resume, ref dumpLog, encoding, outputPrefix, - outputFile, parsedOptions, sidecar, (uint)skip, noMetadata, noTrim); + dumper.SecureDigital(dev, devicePath, outputFormat, retryPasses, force, false, /*raw,*/ + persistent, stopOnError, ref resume, ref dumpLog, encoding, outputPrefix, + outputFile, parsedOptions, sidecar, (uint)skip, noMetadata, noTrim); break; case DeviceType.NVMe: - NvMe.Dump(dev, devicePath, outputFormat, retryPasses, force, false, /*raw,*/ - persistent, stopOnError, ref resume, ref dumpLog, encoding, outputPrefix, outputFile, - parsedOptions, sidecar, (uint)skip, noMetadata, noTrim); + dumper.NVMe(dev, devicePath, outputFormat, retryPasses, force, false, /*raw,*/ + persistent, stopOnError, ref resume, ref dumpLog, encoding, outputPrefix, + outputFile, parsedOptions, sidecar, (uint)skip, noMetadata, noTrim); break; case DeviceType.ATAPI: case DeviceType.SCSI: - Scsi.Dump(dev, devicePath, outputFormat, retryPasses, force, false, /*raw,*/ - persistent, stopOnError, ref resume, ref dumpLog, firstTrackPregap, encoding, - outputPrefix, outputFile, parsedOptions, sidecar, (uint)skip, noMetadata, noTrim); + dumper.Scsi(dev, devicePath, outputFormat, retryPasses, force, false, /*raw,*/ + persistent, stopOnError, ref resume, ref dumpLog, firstTrackPregap, encoding, + outputPrefix, outputFile, parsedOptions, sidecar, (uint)skip, noMetadata, noTrim); break; default: dumpLog.WriteLine("Unknown device type.");