From 640c57b87a1642bfe972a822fa3292ffc92ce70f Mon Sep 17 00:00:00 2001 From: Natalia Portillo Date: Sun, 20 Jan 2019 20:11:10 +0000 Subject: [PATCH] Move optical disc exclusive methods to new interfaces. --- .../.idea/contentModel.xml | 4 +- .../DiscImageChef.CommonTypes.csproj | 3 + .../Interfaces/IMediaImage.cs | 107 +---- .../Interfaces/IOpticalMediaImage.cs | 140 +++++++ .../Interfaces/IPartitionableMediaImage.cs | 54 +++ .../Interfaces/IWritableImage.cs | 7 - .../Interfaces/IWritableOpticalImage.cs | 53 +++ .../Devices/Dumping/CompactDisc.cs | 2 +- DiscImageChef.Core/Devices/Dumping/MMC.cs | 2 +- .../Devices/Dumping/PlayStationPortable.cs | 20 +- DiscImageChef.Core/Devices/Dumping/SBC.cs | 33 +- DiscImageChef.Core/Devices/Dumping/SCSI.cs | 9 +- DiscImageChef.Core/Devices/Dumping/XGD.cs | 2 +- DiscImageChef.Core/Entropy.cs | 10 +- DiscImageChef.Core/ImageInfo.cs | 71 ++-- DiscImageChef.Core/Partitions.cs | 12 +- DiscImageChef.Core/Sidecar/OpticalDisc.cs | 8 +- DiscImageChef.Core/Sidecar/Sidecar.cs | 12 +- .../Alcohol120/Alcohol120.cs | 2 +- DiscImageChef.DiscImages/Anex86/Properties.cs | 9 - .../Anex86/Unsupported.cs | 33 -- DiscImageChef.DiscImages/Anex86/Write.cs | 6 - .../Apple2MG/Properties.cs | 10 - .../Apple2MG/Unsupported.cs | 32 -- DiscImageChef.DiscImages/Apple2MG/Write.cs | 6 - .../AppleDOS/Properties.cs | 12 +- .../AppleDOS/Unsupported.cs | 38 -- DiscImageChef.DiscImages/AppleDOS/Write.cs | 6 - .../AppleNIB/Properties.cs | 19 +- .../AppleNIB/Unsupported.cs | 32 -- .../Apridisk/Properties.cs | 9 - .../Apridisk/Unsupported.cs | 32 -- DiscImageChef.DiscImages/Apridisk/Write.cs | 6 - DiscImageChef.DiscImages/BLU/Properties.cs | 17 +- DiscImageChef.DiscImages/BLU/Unsupported.cs | 39 -- DiscImageChef.DiscImages/BLU/Write.cs | 6 - .../BlindWrite4/BlindWrite4.cs | 2 +- .../BlindWrite5/BlindWrite5.cs | 2 +- DiscImageChef.DiscImages/CDRDAO/CDRDAO.cs | 2 +- DiscImageChef.DiscImages/CDRWin/CDRWin.cs | 2 +- DiscImageChef.DiscImages/CHD/CHD.cs | 2 +- DiscImageChef.DiscImages/CPCDSK/Properties.cs | 18 +- .../CPCDSK/Unsupported.cs | 32 +- .../CisCopy/Properties.cs | 15 +- .../CisCopy/Unsupported.cs | 38 -- DiscImageChef.DiscImages/CisCopy/Write.cs | 6 - DiscImageChef.DiscImages/CloneCD/CloneCD.cs | 2 +- DiscImageChef.DiscImages/CopyQM/Properties.cs | 18 +- .../CopyQM/Unsupported.cs | 38 -- DiscImageChef.DiscImages/D88/Properties.cs | 18 +- DiscImageChef.DiscImages/D88/Unsupported.cs | 32 -- DiscImageChef.DiscImages/DART/Properties.cs | 18 +- DiscImageChef.DiscImages/DART/Unsupported.cs | 32 -- DiscImageChef.DiscImages/DIM/Unsupported.cs | 32 -- .../DiscFerret/Properties.cs | 18 +- .../DiscFerret/Unsupported.cs | 34 -- .../DiscImageChef.DiscImages.csproj | 1 - .../DiscImageChef/DiscImageChef.cs | 2 +- .../DiskCopy42/Properties.cs | 25 +- .../DiskCopy42/Unsupported.cs | 38 -- DiscImageChef.DiscImages/DiskCopy42/Write.cs | 6 - .../DriDiskCopy/Properties.cs | 18 +- .../DriDiskCopy/Unsupported.cs | 38 -- DiscImageChef.DiscImages/DriDiskCopy/Write.cs | 6 - DiscImageChef.DiscImages/GDI/GDI.cs | 2 +- DiscImageChef.DiscImages/HDCopy/Properties.cs | 19 +- .../HDCopy/Unsupported.cs | 32 -- DiscImageChef.DiscImages/IMD/Properties.cs | 22 +- DiscImageChef.DiscImages/IMD/Unsupported.cs | 38 -- .../KryoFlux/Properties.cs | 20 +- .../KryoFlux/Unsupported.cs | 34 -- .../MaxiDisk/Properties.cs | 21 +- .../MaxiDisk/Unsupported.cs | 43 +- DiscImageChef.DiscImages/MaxiDisk/Write.cs | 6 - DiscImageChef.DiscImages/NDIF/Properties.cs | 22 +- DiscImageChef.DiscImages/NDIF/Unsupported.cs | 32 -- DiscImageChef.DiscImages/NHDr0/Properties.cs | 21 +- DiscImageChef.DiscImages/NHDr0/Unsupported.cs | 32 -- DiscImageChef.DiscImages/NHDr0/Write.cs | 6 - DiscImageChef.DiscImages/Nero/Nero.cs | 2 +- .../Parallels/Properties.cs | 21 +- .../Parallels/Unsupported.cs | 32 -- DiscImageChef.DiscImages/Parallels/Write.cs | 6 - .../PartClone/Properties.cs | 22 +- .../PartClone/Unsupported.cs | 32 -- .../Partimage/Properties.cs | 20 +- .../Partimage/Unsupported.cs | 32 -- DiscImageChef.DiscImages/QCOW/Properties.cs | 18 +- DiscImageChef.DiscImages/QCOW/Unsupported.cs | 32 -- DiscImageChef.DiscImages/QCOW/Write.cs | 6 - DiscImageChef.DiscImages/QCOW2/Properties.cs | 19 +- DiscImageChef.DiscImages/QCOW2/Unsupported.cs | 32 -- DiscImageChef.DiscImages/QCOW2/Write.cs | 6 - DiscImageChef.DiscImages/QED/Properties.cs | 19 +- DiscImageChef.DiscImages/QED/Unsupported.cs | 32 -- DiscImageChef.DiscImages/QED/Write.cs | 6 - DiscImageChef.DiscImages/RayDIM/Properties.cs | 21 +- .../RayDIM/Unsupported.cs | 38 -- DiscImageChef.DiscImages/RayDIM/Write.cs | 6 - DiscImageChef.DiscImages/RsIde/Properties.cs | 21 +- DiscImageChef.DiscImages/RsIde/Unsupported.cs | 32 -- DiscImageChef.DiscImages/RsIde/Write.cs | 6 - .../SaveDskF/Properties.cs | 21 +- .../SaveDskF/Unsupported.cs | 38 -- DiscImageChef.DiscImages/SaveDskF/Write.cs | 6 - .../SuperCardPro/Properties.cs | 22 +- .../SuperCardPro/Unsupported.cs | 73 ---- DiscImageChef.DiscImages/T98/Properties.cs | 20 +- DiscImageChef.DiscImages/T98/Unsupported.cs | 32 -- DiscImageChef.DiscImages/T98/Write.cs | 6 - .../TeleDisk/Properties.cs | 20 +- DiscImageChef.DiscImages/TeleDisk/Read.cs | 13 - .../TeleDisk/Unsupported.cs | 26 -- DiscImageChef.DiscImages/UDIF/Properties.cs | 19 +- DiscImageChef.DiscImages/UDIF/Unsupported.cs | 32 -- DiscImageChef.DiscImages/UDIF/Write.cs | 6 - DiscImageChef.DiscImages/UkvFdi/Properties.cs | 22 +- .../UkvFdi/Unsupported.cs | 32 -- DiscImageChef.DiscImages/VDI/Properties.cs | 19 +- DiscImageChef.DiscImages/VDI/Unsupported.cs | 32 -- DiscImageChef.DiscImages/VDI/Write.cs | 6 - DiscImageChef.DiscImages/VHD/Properties.cs | 12 - DiscImageChef.DiscImages/VHD/Unsupported.cs | 32 -- DiscImageChef.DiscImages/VHD/Write.cs | 6 - DiscImageChef.DiscImages/VHDX/Properties.cs | 20 +- DiscImageChef.DiscImages/VHDX/Unsupported.cs | 32 -- DiscImageChef.DiscImages/VMware/Properties.cs | 21 +- .../VMware/Unsupported.cs | 32 -- DiscImageChef.DiscImages/VMware/Write.cs | 6 - .../Virtual98/Properties.cs | 20 +- .../Virtual98/Unsupported.cs | 32 -- DiscImageChef.DiscImages/Virtual98/Write.cs | 6 - .../WCDiskImage/Properties.cs | 19 +- .../WCDiskImage/Unsupported.cs | 32 -- .../ZZZRawImage/ZZZRawImage.cs | 2 +- .../Forms/frmImageChecksum.xeto.cs | 36 +- .../Forms/frmImageConvert.xeto.cs | 9 +- .../Forms/frmImageEntropy.xeto.cs | 4 +- .../Forms/frmImageVerify.xeto.cs | 22 +- DiscImageChef.Gui/Panels/pnlImageInfo.xeto.cs | 139 ++++--- DiscImageChef/Commands/Checksum.cs | 16 +- DiscImageChef/Commands/Compare.cs | 68 +--- DiscImageChef/Commands/ConvertImage.cs | 375 +++++++++--------- DiscImageChef/Commands/Verify.cs | 22 +- 144 files changed, 869 insertions(+), 2708 deletions(-) create mode 100644 DiscImageChef.CommonTypes/Interfaces/IOpticalMediaImage.cs create mode 100644 DiscImageChef.CommonTypes/Interfaces/IPartitionableMediaImage.cs create mode 100644 DiscImageChef.CommonTypes/Interfaces/IWritableOpticalImage.cs delete mode 100644 DiscImageChef.DiscImages/SuperCardPro/Unsupported.cs diff --git a/.idea/.idea.DiscImageChef/.idea/contentModel.xml b/.idea/.idea.DiscImageChef/.idea/contentModel.xml index 0ca8d8024..570672a31 100644 --- a/.idea/.idea.DiscImageChef/.idea/contentModel.xml +++ b/.idea/.idea.DiscImageChef/.idea/contentModel.xml @@ -120,11 +120,14 @@ + + + @@ -1026,7 +1029,6 @@ - diff --git a/DiscImageChef.CommonTypes/DiscImageChef.CommonTypes.csproj b/DiscImageChef.CommonTypes/DiscImageChef.CommonTypes.csproj index 089cf06cc..03d3dafbf 100644 --- a/DiscImageChef.CommonTypes/DiscImageChef.CommonTypes.csproj +++ b/DiscImageChef.CommonTypes/DiscImageChef.CommonTypes.csproj @@ -69,11 +69,14 @@ + + + diff --git a/DiscImageChef.CommonTypes/Interfaces/IMediaImage.cs b/DiscImageChef.CommonTypes/Interfaces/IMediaImage.cs index abf87ee4f..16ff53c39 100644 --- a/DiscImageChef.CommonTypes/Interfaces/IMediaImage.cs +++ b/DiscImageChef.CommonTypes/Interfaces/IMediaImage.cs @@ -9,7 +9,8 @@ // // --[ Description ] ---------------------------------------------------------- // -// Defines interface to be implemented by disc image plugins. +// Defines interface to be implemented by block addressable disk image +// plugins. // // --[ License ] -------------------------------------------------------------- // @@ -62,23 +63,6 @@ namespace DiscImageChef.CommonTypes.Interfaces /// /// The image format. string Format { get; } - /// - /// Gets an array partitions. Typically only useful for optical disc - /// images where each track and index means a different partition, as - /// reads can be relative to them. - /// - /// The partitions. - List Partitions { get; } - /// - /// Gets the disc track extents (start, length). - /// - /// The track extents. - List Tracks { get; } - /// - /// Gets the sessions (optical discs only). - /// - /// The sessions. - List Sessions { get; } /// List of dump hardware used to create the image from real media List DumpHardware { get; } /// Gets the CICM XML metadata for the image @@ -120,23 +104,6 @@ namespace DiscImageChef.CommonTypes.Interfaces /// Tag type. byte[] ReadSectorTag(ulong sectorAddress, SectorTagType tag); - /// - /// Reads a sector's user data, relative to track. - /// - /// The sector's user data. - /// Sector address (relative LBA). - /// Track. - byte[] ReadSector(ulong sectorAddress, uint track); - - /// - /// Reads a sector's tag, relative to track. - /// - /// The sector's tag. - /// Sector address (relative LBA). - /// Track. - /// Tag type. - byte[] ReadSectorTag(ulong sectorAddress, uint track, SectorTagType tag); - /// /// Reads user data from several sectors. /// @@ -154,25 +121,6 @@ namespace DiscImageChef.CommonTypes.Interfaces /// Tag type. byte[] ReadSectorsTag(ulong sectorAddress, uint length, SectorTagType tag); - /// - /// Reads user data from several sectors, relative to track. - /// - /// The sectors user data. - /// Starting sector address (relative LBA). - /// How many sectors to read. - /// Track. - byte[] ReadSectors(ulong sectorAddress, uint length, uint track); - - /// - /// Reads tag from several sectors, relative to track. - /// - /// The sectors tag. - /// Starting sector address (relative LBA). - /// How many sectors to read. - /// Track. - /// Tag type. - byte[] ReadSectorsTag(ulong sectorAddress, uint length, uint track, SectorTagType tag); - /// /// Reads a complete sector (user data + all tags). /// @@ -180,14 +128,6 @@ namespace DiscImageChef.CommonTypes.Interfaces /// Sector address (LBA). byte[] ReadSectorLong(ulong sectorAddress); - /// - /// Reads a complete sector (user data + all tags), relative to track. - /// - /// The complete sector. Format depends on disk type. - /// Sector address (relative LBA). - /// Track. - byte[] ReadSectorLong(ulong sectorAddress, uint track); - /// /// Reads several complete sector (user data + all tags). /// @@ -196,29 +136,6 @@ namespace DiscImageChef.CommonTypes.Interfaces /// How many sectors to read. byte[] ReadSectorsLong(ulong sectorAddress, uint length); - /// - /// Reads several complete sector (user data + all tags), relative to track. - /// - /// The complete sectors. Format depends on disk type. - /// Starting sector address (relative LBA). - /// How many sectors to read. - /// Track. - byte[] ReadSectorsLong(ulong sectorAddress, uint length, uint track); - - /// - /// Gets the disc track extents for a specified session. - /// - /// The track exents for that session. - /// Session. - List GetSessionTracks(Session session); - - /// - /// Gets the disc track extents for a specified session. - /// - /// The track exents for that session. - /// Session. - List GetSessionTracks(ushort session); - /// /// Verifies a sector. /// @@ -226,14 +143,6 @@ namespace DiscImageChef.CommonTypes.Interfaces /// Sector address (LBA). bool? VerifySector(ulong sectorAddress); - /// - /// Verifies a sector, relative to track. - /// - /// True if correct, false if incorrect, null if uncheckable. - /// Sector address (relative LBA). - /// Track. - bool? VerifySector(ulong sectorAddress, uint track); - /// /// Verifies several sectors. /// @@ -244,18 +153,6 @@ namespace DiscImageChef.CommonTypes.Interfaces /// List of uncheckable sectors bool? VerifySectors(ulong sectorAddress, uint length, out List failingLbas, out List unknownLbas); - /// - /// Verifies several sectors, relative to track. - /// - /// True if all are correct, false if any is incorrect, null if any is uncheckable. - /// Starting sector address (relative LBA). - /// How many sectors to read. - /// Track. - /// List of incorrect sectors - /// List of uncheckable sectors - bool? VerifySectors(ulong sectorAddress, uint length, uint track, out List failingLbas, - out List unknownLbas); - /// /// Verifies media image internal checksum. /// diff --git a/DiscImageChef.CommonTypes/Interfaces/IOpticalMediaImage.cs b/DiscImageChef.CommonTypes/Interfaces/IOpticalMediaImage.cs new file mode 100644 index 000000000..a99beab79 --- /dev/null +++ b/DiscImageChef.CommonTypes/Interfaces/IOpticalMediaImage.cs @@ -0,0 +1,140 @@ +// /*************************************************************************** +// The Disc Image Chef +// ---------------------------------------------------------------------------- +// +// Filename : IOpticalMediaImage.cs +// Author(s) : Natalia Portillo +// +// Component : Disc image plugins. +// +// --[ Description ] ---------------------------------------------------------- +// +// Defines interface to be implemented by optical disc image plugins. +// +// --[ License ] -------------------------------------------------------------- +// +// Permission is hereby granted, free of charge, to any person obtaining a +// copy of this software and associated documentation files (the +// "Software"), to deal in the Software without restriction, including +// without limitation the rights to use, copy, modify, merge, publish, +// distribute, sublicense, and/or sell copies of the Software, and to +// permit persons to whom the Software is furnished to do so, subject to +// the following conditions: +// +// The above copyright notice and this permission notice shall be included +// in all copies or substantial portions of the Software. +// +// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS +// OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF +// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. +// IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY +// CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, +// TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE +// SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. +// +// ---------------------------------------------------------------------------- +// Copyright © 2011-2019 Natalia Portillo +// ****************************************************************************/ + +using System.Collections.Generic; +using DiscImageChef.CommonTypes.Enums; +using DiscImageChef.CommonTypes.Structs; + +namespace DiscImageChef.CommonTypes.Interfaces +{ + /// + /// Abstract class to implement disk image reading plugins. + /// + public interface IOpticalMediaImage : IMediaImage, IPartitionableMediaImage + { + /// + /// Gets the disc track extents (start, length). + /// + /// The track extents. + List Tracks { get; } + /// + /// Gets the sessions (optical discs only). + /// + /// The sessions. + List Sessions { get; } + + /// + /// Reads a sector's user data, relative to track. + /// + /// The sector's user data. + /// Sector address (relative LBA). + /// Track. + byte[] ReadSector(ulong sectorAddress, uint track); + + /// + /// Reads a sector's tag, relative to track. + /// + /// The sector's tag. + /// Sector address (relative LBA). + /// Track. + /// Tag type. + byte[] ReadSectorTag(ulong sectorAddress, uint track, SectorTagType tag); + + /// + /// Reads user data from several sectors, relative to track. + /// + /// The sectors user data. + /// Starting sector address (relative LBA). + /// How many sectors to read. + /// Track. + byte[] ReadSectors(ulong sectorAddress, uint length, uint track); + + /// + /// Reads tag from several sectors, relative to track. + /// + /// The sectors tag. + /// Starting sector address (relative LBA). + /// How many sectors to read. + /// Track. + /// Tag type. + byte[] ReadSectorsTag(ulong sectorAddress, uint length, uint track, SectorTagType tag); + + /// + /// Reads a complete sector (user data + all tags), relative to track. + /// + /// The complete sector. Format depends on disk type. + /// Sector address (relative LBA). + /// Track. + byte[] ReadSectorLong(ulong sectorAddress, uint track); + + /// + /// Reads several complete sector (user data + all tags), relative to track. + /// + /// The complete sectors. Format depends on disk type. + /// Starting sector address (relative LBA). + /// How many sectors to read. + /// Track. + byte[] ReadSectorsLong(ulong sectorAddress, uint length, uint track); + + /// + /// Gets the disc track extents for a specified session. + /// + /// The track exents for that session. + /// Session. + List GetSessionTracks(Session session); + + /// + /// Gets the disc track extents for a specified session. + /// + /// The track exents for that session. + /// Session. + List GetSessionTracks(ushort session); + + /// + /// Verifies several sectors, relative to track. + /// + /// True if all are correct, false if any is incorrect, null if any is uncheckable. + /// Starting sector address (relative LBA). + /// How many sectors to read. + /// Track. + /// List of incorrect sectors + /// List of uncheckable sectors + bool? VerifySectors(ulong sectorAddress, uint length, uint track, out List failingLbas, + out List unknownLbas); + } +} \ No newline at end of file diff --git a/DiscImageChef.CommonTypes/Interfaces/IPartitionableMediaImage.cs b/DiscImageChef.CommonTypes/Interfaces/IPartitionableMediaImage.cs new file mode 100644 index 000000000..f342e339d --- /dev/null +++ b/DiscImageChef.CommonTypes/Interfaces/IPartitionableMediaImage.cs @@ -0,0 +1,54 @@ +// /*************************************************************************** +// The Disc Image Chef +// ---------------------------------------------------------------------------- +// +// Filename : IPartitionableMediaImage.cs +// Author(s) : Natalia Portillo +// +// Component : Media image plugins. +// +// --[ Description ] ---------------------------------------------------------- +// +// Defines interface to be implemented by image plugins that can contain +// partitioned medias, usually optical discs and some newer tapes. +// +// --[ License ] -------------------------------------------------------------- +// +// Permission is hereby granted, free of charge, to any person obtaining a +// copy of this software and associated documentation files (the +// "Software"), to deal in the Software without restriction, including +// without limitation the rights to use, copy, modify, merge, publish, +// distribute, sublicense, and/or sell copies of the Software, and to +// permit persons to whom the Software is furnished to do so, subject to +// the following conditions: +// +// The above copyright notice and this permission notice shall be included +// in all copies or substantial portions of the Software. +// +// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS +// OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF +// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. +// IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY +// CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, +// TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE +// SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. +// +// ---------------------------------------------------------------------------- +// Copyright © 2011-2019 Natalia Portillo +// ****************************************************************************/ + +using System.Collections.Generic; + +namespace DiscImageChef.CommonTypes.Interfaces +{ + public interface IPartitionableMediaImage + { + /// + /// Gets an array partitions. Typically only useful for optical disc + /// images where each track and index means a different partition, as + /// reads can be relative to them. + /// + /// The partitions. + List Partitions { get; } + } +} \ No newline at end of file diff --git a/DiscImageChef.CommonTypes/Interfaces/IWritableImage.cs b/DiscImageChef.CommonTypes/Interfaces/IWritableImage.cs index 14477b2e9..d7777de1a 100644 --- a/DiscImageChef.CommonTypes/Interfaces/IWritableImage.cs +++ b/DiscImageChef.CommonTypes/Interfaces/IWritableImage.cs @@ -131,13 +131,6 @@ namespace DiscImageChef.CommonTypes.Interfaces /// true if operating completed successfully, false otherwise bool WriteSectorsLong(byte[] data, ulong sectorAddress, uint length); - /// - /// Sets tracks for optical media - /// - /// List of tracks - /// true if operating completed successfully, false otherwise - bool SetTracks(List tracks); - /// /// Closes and flushes to disk the image /// diff --git a/DiscImageChef.CommonTypes/Interfaces/IWritableOpticalImage.cs b/DiscImageChef.CommonTypes/Interfaces/IWritableOpticalImage.cs new file mode 100644 index 000000000..072815c7f --- /dev/null +++ b/DiscImageChef.CommonTypes/Interfaces/IWritableOpticalImage.cs @@ -0,0 +1,53 @@ +// /*************************************************************************** +// The Disc Image Chef +// ---------------------------------------------------------------------------- +// +// Filename : IWritableOpticalImage.cs +// Author(s) : Natalia Portillo +// +// Component : Disc image plugins. +// +// --[ Description ] ---------------------------------------------------------- +// +// Defines interface to be implemented by writable image plugins. +// +// --[ License ] -------------------------------------------------------------- +// +// Permission is hereby granted, free of charge, to any person obtaining a +// copy of this software and associated documentation files (the +// "Software"), to deal in the Software without restriction, including +// without limitation the rights to use, copy, modify, merge, publish, +// distribute, sublicense, and/or sell copies of the Software, and to +// permit persons to whom the Software is furnished to do so, subject to +// the following conditions: +// +// The above copyright notice and this permission notice shall be included +// in all copies or substantial portions of the Software. +// +// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS +// OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF +// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. +// IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY +// CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, +// TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE +// SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. +// +// ---------------------------------------------------------------------------- +// Copyright © 2011-2019 Natalia Portillo +// ****************************************************************************/ + +using System.Collections.Generic; +using DiscImageChef.CommonTypes.Structs; + +namespace DiscImageChef.CommonTypes.Interfaces +{ + public interface IWritableOpticalImage : IWritableImage, IOpticalMediaImage + { + /// + /// Sets tracks for optical media + /// + /// List of tracks + /// true if operating completed successfully, false otherwise + bool SetTracks(List tracks); + } +} \ No newline at end of file diff --git a/DiscImageChef.Core/Devices/Dumping/CompactDisc.cs b/DiscImageChef.Core/Devices/Dumping/CompactDisc.cs index 118238148..08051fc3e 100644 --- a/DiscImageChef.Core/Devices/Dumping/CompactDisc.cs +++ b/DiscImageChef.Core/Devices/Dumping/CompactDisc.cs @@ -85,7 +85,7 @@ namespace DiscImageChef.Core.Devices.Dumping /// If the resume file is invalid /// If the track type is unknown (never) internal static void Dump(Device dev, string devicePath, - IWritableImage outputPlugin, ushort retryPasses, + IWritableOpticalImage outputPlugin, ushort retryPasses, bool force, bool dumpRaw, bool persistent, bool stopOnError, ref MediaType dskType, diff --git a/DiscImageChef.Core/Devices/Dumping/MMC.cs b/DiscImageChef.Core/Devices/Dumping/MMC.cs index 11b83ca2e..f41b162ac 100644 --- a/DiscImageChef.Core/Devices/Dumping/MMC.cs +++ b/DiscImageChef.Core/Devices/Dumping/MMC.cs @@ -77,7 +77,7 @@ namespace DiscImageChef.Core.Devices.Dumping /// 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, - IWritableImage outputPlugin, ushort retryPasses, + IWritableOpticalImage outputPlugin, ushort retryPasses, bool force, bool dumpRaw, bool persistent, bool stopOnError, ref MediaType dskType, ref Resume resume, ref DumpLog dumpLog, diff --git a/DiscImageChef.Core/Devices/Dumping/PlayStationPortable.cs b/DiscImageChef.Core/Devices/Dumping/PlayStationPortable.cs index 6edec2951..940328173 100644 --- a/DiscImageChef.Core/Devices/Dumping/PlayStationPortable.cs +++ b/DiscImageChef.Core/Devices/Dumping/PlayStationPortable.cs @@ -208,16 +208,20 @@ namespace DiscImageChef.Core.Devices.Dumping return; } - DumpUmd(dev, devicePath, outputPlugin, retryPasses, force, persistent, stopOnError, - ref resume, ref dumpLog, - encoding, outputPrefix, outputPath, formatOptions, preSidecar, skip, nometadata, notrim); + if(outputPlugin is IWritableOpticalImage opticalPlugin) + DumpUmd(dev, devicePath, opticalPlugin, retryPasses, force, persistent, stopOnError, + ref resume, + ref dumpLog, encoding, outputPrefix, outputPath, formatOptions, preSidecar, skip, + nometadata, + notrim); + else DicConsole.ErrorWriteLine("The specified plugin does not support storing optical disc images."); } - static void DumpUmd(Device dev, string devicePath, - IWritableImage outputPlugin, ushort retryPasses, bool force, - bool persistent, bool stopOnError, - ref Resume resume, ref DumpLog dumpLog, - Encoding encoding, string outputPrefix, + 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, diff --git a/DiscImageChef.Core/Devices/Dumping/SBC.cs b/DiscImageChef.Core/Devices/Dumping/SBC.cs index 394212e97..4e1a7ee2b 100644 --- a/DiscImageChef.Core/Devices/Dumping/SBC.cs +++ b/DiscImageChef.Core/Devices/Dumping/SBC.cs @@ -283,19 +283,28 @@ namespace DiscImageChef.Core.Devices.Dumping double imageWriteDuration = 0; if(opticalDisc) - outputPlugin.SetTracks(new List - { - new Track + { + if(outputPlugin is IWritableOpticalImage opticalPlugin) + opticalPlugin.SetTracks(new List { - TrackBytesPerSector = (int)blockSize, - TrackEndSector = blocks - 1, - TrackSequence = 1, - TrackRawBytesPerSector = (int)blockSize, - TrackSubchannelType = TrackSubchannelType.None, - TrackSession = 1, - TrackType = TrackType.Data - } - }); + new Track + { + TrackBytesPerSector = (int)blockSize, + TrackEndSector = blocks - 1, + TrackSequence = 1, + TrackRawBytesPerSector = (int)blockSize, + TrackSubchannelType = TrackSubchannelType.None, + TrackSession = 1, + TrackType = TrackType.Data + } + }); + else + { + dumpLog.WriteLine("The specified plugin does not support storing optical disc images.."); + DicConsole.ErrorWriteLine("The specified plugin does not support storing optical disc images."); + return; + } + } else if(decMode.HasValue) { bool setGeometry = false; diff --git a/DiscImageChef.Core/Devices/Dumping/SCSI.cs b/DiscImageChef.Core/Devices/Dumping/SCSI.cs index 0ed270127..070485415 100644 --- a/DiscImageChef.Core/Devices/Dumping/SCSI.cs +++ b/DiscImageChef.Core/Devices/Dumping/SCSI.cs @@ -209,9 +209,12 @@ namespace DiscImageChef.Core.Devices.Dumping Ssc.Dump(dev, outputPrefix, devicePath, ref resume, ref dumpLog, preSidecar); return; case PeripheralDeviceTypes.MultiMediaDevice: - Mmc.Dump(dev, devicePath, outputPlugin, retryPasses, force, dumpRaw, persistent, stopOnError, - ref dskType, ref resume, ref dumpLog, dumpFirstTrackPregap, encoding, outputPrefix, - outputPath, formatOptions, preSidecar, skip, nometadata, notrim); + 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); + 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, diff --git a/DiscImageChef.Core/Devices/Dumping/XGD.cs b/DiscImageChef.Core/Devices/Dumping/XGD.cs index 97a7dc601..f008f3848 100644 --- a/DiscImageChef.Core/Devices/Dumping/XGD.cs +++ b/DiscImageChef.Core/Devices/Dumping/XGD.cs @@ -83,7 +83,7 @@ namespace DiscImageChef.Core.Devices.Dumping /// dump /// internal static void Dump(Device dev, string devicePath, - IWritableImage outputPlugin, ushort retryPasses, + IWritableOpticalImage outputPlugin, ushort retryPasses, bool force, bool dumpRaw, bool persistent, bool stopOnError, Dictionary mediaTags, ref MediaType dskType, diff --git a/DiscImageChef.Core/Entropy.cs b/DiscImageChef.Core/Entropy.cs index f85351071..ecda43156 100644 --- a/DiscImageChef.Core/Entropy.cs +++ b/DiscImageChef.Core/Entropy.cs @@ -64,9 +64,15 @@ namespace DiscImageChef.Core { List entropyResultses = new List(); + if(!(inputFormat is IOpticalMediaImage opticalMediaImage)) + { + DicConsole.ErrorWriteLine("The selected image does not support tracks."); + return entropyResultses.ToArray(); + } + try { - List inputTracks = inputFormat.Tracks; + List inputTracks = opticalMediaImage.Tracks; InitProgressEvent?.Invoke(); @@ -93,7 +99,7 @@ namespace DiscImageChef.Core ?.Invoke($"Entropying sector {i + 1} of track {currentTrack.TrackSequence}", (long)(currentTrack.TrackEndSector - (i + 1)), (long)trackEntropy.Sectors); - byte[] sector = inputFormat.ReadSector(i, currentTrack.TrackSequence); + byte[] sector = opticalMediaImage.ReadSector(i, currentTrack.TrackSequence); if(duplicatedSectors) { diff --git a/DiscImageChef.Core/ImageInfo.cs b/DiscImageChef.Core/ImageInfo.cs index df45de3ea..1dd94d341 100644 --- a/DiscImageChef.Core/ImageInfo.cs +++ b/DiscImageChef.Core/ImageInfo.cs @@ -550,46 +550,49 @@ namespace DiscImageChef.Core DicConsole.WriteLine(); } - try + if(imageFormat is IOpticalMediaImage opticalImage) { - if(imageFormat.Sessions != null && imageFormat.Sessions.Count > 0) + try { - DicConsole.WriteLine("Image sessions:"); - DicConsole.WriteLine("{0,-9}{1,-13}{2,-12}{3,-12}{4,-12}", "Session", "First track", "Last track", - "Start", "End"); - DicConsole.WriteLine("========================================================="); - foreach(Session session in imageFormat.Sessions) - DicConsole.WriteLine("{0,-9}{1,-13}{2,-12}{3,-12}{4,-12}", session.SessionSequence, - session.StartTrack, session.EndTrack, session.StartSector, - session.EndSector); - DicConsole.WriteLine(); + if(opticalImage.Sessions != null && opticalImage.Sessions.Count > 0) + { + DicConsole.WriteLine("Image sessions:"); + DicConsole.WriteLine("{0,-9}{1,-13}{2,-12}{3,-12}{4,-12}", "Session", "First track", + "Last track", "Start", "End"); + DicConsole.WriteLine("========================================================="); + foreach(Session session in opticalImage.Sessions) + DicConsole.WriteLine("{0,-9}{1,-13}{2,-12}{3,-12}{4,-12}", session.SessionSequence, + session.StartTrack, session.EndTrack, session.StartSector, + session.EndSector); + DicConsole.WriteLine(); + } + } + catch + { + // ignored } - } - catch - { - // ignored - } - try - { - if(imageFormat.Tracks != null && imageFormat.Tracks.Count > 0) + try { - DicConsole.WriteLine("Image tracks:"); - DicConsole.WriteLine("{0,-7}{1,-17}{2,-6}{3,-8}{4,-12}{5,-8}{6,-12}{7,-12}", "Track", "Type", "Bps", - "Raw bps", "Subchannel", "Pregap", "Start", "End"); - DicConsole - .WriteLine("================================================================================="); - foreach(Track track in imageFormat.Tracks) - DicConsole.WriteLine("{0,-7}{1,-17}{2,-6}{3,-8}{4,-12}{5,-8}{6,-12}{7,-12}", - track.TrackSequence, track.TrackType, track.TrackBytesPerSector, - track.TrackRawBytesPerSector, track.TrackSubchannelType, track.TrackPregap, - track.TrackStartSector, track.TrackEndSector); - DicConsole.WriteLine(); + if(opticalImage.Tracks != null && opticalImage.Tracks.Count > 0) + { + DicConsole.WriteLine("Image tracks:"); + DicConsole.WriteLine("{0,-7}{1,-17}{2,-6}{3,-8}{4,-12}{5,-8}{6,-12}{7,-12}", "Track", "Type", + "Bps", "Raw bps", "Subchannel", "Pregap", "Start", "End"); + DicConsole + .WriteLine("================================================================================="); + foreach(Track track in opticalImage.Tracks) + DicConsole.WriteLine("{0,-7}{1,-17}{2,-6}{3,-8}{4,-12}{5,-8}{6,-12}{7,-12}", + track.TrackSequence, track.TrackType, track.TrackBytesPerSector, + track.TrackRawBytesPerSector, track.TrackSubchannelType, + track.TrackPregap, track.TrackStartSector, track.TrackEndSector); + DicConsole.WriteLine(); + } + } + catch + { + // ignored } - } - catch - { - // ignored } if(imageFormat.DumpHardware == null) return; diff --git a/DiscImageChef.Core/Partitions.cs b/DiscImageChef.Core/Partitions.cs index 57b66509a..763b6ab01 100644 --- a/DiscImageChef.Core/Partitions.cs +++ b/DiscImageChef.Core/Partitions.cs @@ -57,8 +57,8 @@ namespace DiscImageChef.Core List checkedLocations = new List(); // Getting all partitions from device (e.g. tracks) - if(image.Info.HasPartitions) - foreach(Partition imagePartition in image.Partitions) + if(image is IPartitionableMediaImage partitionableImage) + foreach(Partition imagePartition in partitionableImage.Partitions) { foreach(IPartition partitionPlugin in plugins.PartPluginsList.Values) if(partitionPlugin.GetInformation(image, out List partitions, imagePartition.Start)) @@ -131,13 +131,15 @@ namespace DiscImageChef.Core } // Be sure that device partitions are not excluded if not mapped by any scheme... - if(image.Info.HasPartitions) + partitionableImage = image as IPartitionableMediaImage; + if(!(partitionableImage is null)) { List startLocations = childPartitions.Select(detectedPartition => detectedPartition.Start).ToList(); - childPartitions.AddRange(image.Partitions.Where(imagePartition => - !startLocations.Contains(imagePartition.Start))); + childPartitions.AddRange(partitionableImage.Partitions.Where(imagePartition => + !startLocations.Contains(imagePartition + .Start))); } Partition[] childArray = childPartitions diff --git a/DiscImageChef.Core/Sidecar/OpticalDisc.cs b/DiscImageChef.Core/Sidecar/OpticalDisc.cs index f9667854e..6f9710f15 100644 --- a/DiscImageChef.Core/Sidecar/OpticalDisc.cs +++ b/DiscImageChef.Core/Sidecar/OpticalDisc.cs @@ -62,9 +62,11 @@ namespace DiscImageChef.Core /// Image plugins /// List of image checksums /// Metadata sidecar - static void OpticalDisc(IMediaImage image, Guid filterId, string imagePath, - FileInfo fi, PluginBase plugins, - List imgChecksums, ref CICMMetadataType sidecar, Encoding encoding) + static void OpticalDisc(IOpticalMediaImage image, Guid filterId, + string imagePath, FileInfo fi, + PluginBase plugins, List imgChecksums, + ref CICMMetadataType sidecar, + Encoding encoding) { sidecar.OpticalDisc = new[] { diff --git a/DiscImageChef.Core/Sidecar/Sidecar.cs b/DiscImageChef.Core/Sidecar/Sidecar.cs index b388f94f1..d63805fd1 100644 --- a/DiscImageChef.Core/Sidecar/Sidecar.cs +++ b/DiscImageChef.Core/Sidecar/Sidecar.cs @@ -37,6 +37,7 @@ using System.Text; using DiscImageChef.CommonTypes; using DiscImageChef.CommonTypes.Enums; using DiscImageChef.CommonTypes.Interfaces; +using DiscImageChef.Console; using Schemas; namespace DiscImageChef.Core @@ -102,7 +103,16 @@ namespace DiscImageChef.Core switch(image.Info.XmlMediaType) { case XmlMediaType.OpticalDisc: - OpticalDisc(image, filterId, imagePath, fi, plugins, imgChecksums, ref sidecar, encoding); + if(image is IOpticalMediaImage opticalImage) + OpticalDisc(opticalImage, filterId, imagePath, fi, plugins, imgChecksums, ref sidecar, + encoding); + else + { + DicConsole + .ErrorWriteLine("The specified image says it contains an optical media but at the same time says it does not support them."); + DicConsole.ErrorWriteLine("Please open an issue at Github."); + } + break; case XmlMediaType.BlockMedia: BlockMedia(image, filterId, imagePath, fi, plugins, imgChecksums, ref sidecar, encoding); diff --git a/DiscImageChef.DiscImages/Alcohol120/Alcohol120.cs b/DiscImageChef.DiscImages/Alcohol120/Alcohol120.cs index 5128e3d8c..b0acbc571 100644 --- a/DiscImageChef.DiscImages/Alcohol120/Alcohol120.cs +++ b/DiscImageChef.DiscImages/Alcohol120/Alcohol120.cs @@ -38,7 +38,7 @@ using DiscImageChef.CommonTypes.Structs; namespace DiscImageChef.DiscImages { - public partial class Alcohol120 : IWritableImage + public partial class Alcohol120 : IWritableOpticalImage { AlcoholFooter alcFooter; IFilter alcImage; diff --git a/DiscImageChef.DiscImages/Anex86/Properties.cs b/DiscImageChef.DiscImages/Anex86/Properties.cs index d622bca4c..3c6fb8d83 100644 --- a/DiscImageChef.DiscImages/Anex86/Properties.cs +++ b/DiscImageChef.DiscImages/Anex86/Properties.cs @@ -34,7 +34,6 @@ using System; using System.Collections.Generic; using DiscImageChef.CommonTypes; using DiscImageChef.CommonTypes.Enums; -using DiscImageChef.CommonTypes.Exceptions; using DiscImageChef.CommonTypes.Structs; using Schemas; @@ -49,14 +48,6 @@ namespace DiscImageChef.DiscImages public string Author => "Natalia Portillo"; public string Format => "Anex86 disk image"; - public List Partitions => - throw new FeatureUnsupportedImageException("Feature not supported by image format"); - - public List Tracks => - throw new FeatureUnsupportedImageException("Feature not supported by image format"); - - public List Sessions => - throw new FeatureUnsupportedImageException("Feature not supported by image format"); public List DumpHardware => null; public CICMMetadataType CicmMetadata => null; diff --git a/DiscImageChef.DiscImages/Anex86/Unsupported.cs b/DiscImageChef.DiscImages/Anex86/Unsupported.cs index 5162a2976..99799289e 100644 --- a/DiscImageChef.DiscImages/Anex86/Unsupported.cs +++ b/DiscImageChef.DiscImages/Anex86/Unsupported.cs @@ -30,11 +30,9 @@ // Copyright © 2011-2019 Natalia Portillo // ****************************************************************************/ -using System.Collections.Generic; using DiscImageChef.CommonTypes.Enums; using DiscImageChef.CommonTypes.Exceptions; using DiscImageChef.CommonTypes.Interfaces; -using DiscImageChef.CommonTypes.Structs; namespace DiscImageChef.DiscImages { @@ -46,44 +44,13 @@ namespace DiscImageChef.DiscImages public byte[] ReadSectorTag(ulong sectorAddress, SectorTagType tag) => throw new FeatureUnsupportedImageException("Feature not supported by image format"); - public byte[] ReadSector(ulong sectorAddress, uint track) => - throw new FeatureUnsupportedImageException("Feature not supported by image format"); - - public byte[] ReadSectorTag(ulong sectorAddress, uint track, SectorTagType tag) => - throw new FeatureUnsupportedImageException("Feature not supported by image format"); - public byte[] ReadSectorsTag(ulong sectorAddress, uint length, SectorTagType tag) => throw new FeatureUnsupportedImageException("Feature not supported by image format"); - public byte[] ReadSectors(ulong sectorAddress, uint length, uint track) => - throw new FeatureUnsupportedImageException("Feature not supported by image format"); - - public byte[] ReadSectorsTag(ulong sectorAddress, uint length, uint track, SectorTagType tag) => - throw new FeatureUnsupportedImageException("Feature not supported by image format"); - public byte[] ReadSectorLong(ulong sectorAddress) => throw new FeatureUnsupportedImageException("Feature not supported by image format"); - public byte[] ReadSectorLong(ulong sectorAddress, uint track) => - throw new FeatureUnsupportedImageException("Feature not supported by image format"); - public byte[] ReadSectorsLong(ulong sectorAddress, uint length) => throw new FeatureUnsupportedImageException("Feature not supported by image format"); - - public byte[] ReadSectorsLong(ulong sectorAddress, uint length, uint track) => - throw new FeatureUnsupportedImageException("Feature not supported by image format"); - - public List GetSessionTracks(Session session) => - throw new FeatureUnsupportedImageException("Feature not supported by image format"); - - public List GetSessionTracks(ushort session) => - throw new FeatureUnsupportedImageException("Feature not supported by image format"); - - public bool? VerifySector(ulong sectorAddress, uint track) => - throw new FeatureUnsupportedImageException("Feature not supported by image format"); - - public bool? VerifySectors(ulong sectorAddress, uint length, uint track, out List failingLbas, - out List unknownLbas) => - throw new FeatureUnsupportedImageException("Feature not supported by image format"); } } \ No newline at end of file diff --git a/DiscImageChef.DiscImages/Anex86/Write.cs b/DiscImageChef.DiscImages/Anex86/Write.cs index c1a98e7be..096c3e40a 100644 --- a/DiscImageChef.DiscImages/Anex86/Write.cs +++ b/DiscImageChef.DiscImages/Anex86/Write.cs @@ -153,12 +153,6 @@ namespace DiscImageChef.DiscImages return false; } - public bool SetTracks(List tracks) - { - ErrorMessage = "Unsupported feature"; - return false; - } - public bool Close() { if(!IsWriting) diff --git a/DiscImageChef.DiscImages/Apple2MG/Properties.cs b/DiscImageChef.DiscImages/Apple2MG/Properties.cs index 720b32e66..81474de32 100644 --- a/DiscImageChef.DiscImages/Apple2MG/Properties.cs +++ b/DiscImageChef.DiscImages/Apple2MG/Properties.cs @@ -34,7 +34,6 @@ using System; using System.Collections.Generic; using DiscImageChef.CommonTypes; using DiscImageChef.CommonTypes.Enums; -using DiscImageChef.CommonTypes.Exceptions; using DiscImageChef.CommonTypes.Structs; using Schemas; @@ -49,15 +48,6 @@ namespace DiscImageChef.DiscImages public string Author => "Natalia Portillo"; public string Format => "Apple 2IMG"; - public List Partitions => - throw new FeatureUnsupportedImageException("Feature not supported by image format"); - - public List Tracks => - throw new FeatureUnsupportedImageException("Feature not supported by image format"); - - public List Sessions => - throw new FeatureUnsupportedImageException("Feature not supported by image format"); - public List DumpHardware => null; public CICMMetadataType CicmMetadata => null; diff --git a/DiscImageChef.DiscImages/Apple2MG/Unsupported.cs b/DiscImageChef.DiscImages/Apple2MG/Unsupported.cs index 817408185..0263c66ed 100644 --- a/DiscImageChef.DiscImages/Apple2MG/Unsupported.cs +++ b/DiscImageChef.DiscImages/Apple2MG/Unsupported.cs @@ -33,7 +33,6 @@ using System.Collections.Generic; using DiscImageChef.CommonTypes.Enums; using DiscImageChef.CommonTypes.Exceptions; -using DiscImageChef.CommonTypes.Structs; namespace DiscImageChef.DiscImages { @@ -45,44 +44,17 @@ namespace DiscImageChef.DiscImages public byte[] ReadSectorTag(ulong sectorAddress, SectorTagType tag) => throw new FeatureUnsupportedImageException("Feature not supported by image format"); - public byte[] ReadSector(ulong sectorAddress, uint track) => - throw new FeatureUnsupportedImageException("Feature not supported by image format"); - - public byte[] ReadSectorTag(ulong sectorAddress, uint track, SectorTagType tag) => - throw new FeatureUnsupportedImageException("Feature not supported by image format"); - public byte[] ReadSectorsTag(ulong sectorAddress, uint length, SectorTagType tag) => throw new FeatureUnsupportedImageException("Feature not supported by image format"); - public byte[] ReadSectors(ulong sectorAddress, uint length, uint track) => - throw new FeatureUnsupportedImageException("Feature not supported by image format"); - - public byte[] ReadSectorsTag(ulong sectorAddress, uint length, uint track, SectorTagType tag) => - throw new FeatureUnsupportedImageException("Feature not supported by image format"); - public byte[] ReadSectorLong(ulong sectorAddress) => throw new FeatureUnsupportedImageException("Feature not supported by image format"); - public byte[] ReadSectorLong(ulong sectorAddress, uint track) => - throw new FeatureUnsupportedImageException("Feature not supported by image format"); - public byte[] ReadSectorsLong(ulong sectorAddress, uint length) => throw new FeatureUnsupportedImageException("Feature not supported by image format"); - public byte[] ReadSectorsLong(ulong sectorAddress, uint length, uint track) => - throw new FeatureUnsupportedImageException("Feature not supported by image format"); - - public List GetSessionTracks(Session session) => - throw new FeatureUnsupportedImageException("Feature not supported by image format"); - - public List GetSessionTracks(ushort session) => - throw new FeatureUnsupportedImageException("Feature not supported by image format"); - public bool? VerifySector(ulong sectorAddress) => null; - public bool? VerifySector(ulong sectorAddress, uint track) => - throw new FeatureUnsupportedImageException("Feature not supported by image format"); - public bool? VerifySectors(ulong sectorAddress, uint length, out List failingLbas, out List unknownLbas) { @@ -93,10 +65,6 @@ namespace DiscImageChef.DiscImages return null; } - public bool? VerifySectors(ulong sectorAddress, uint length, uint track, out List failingLbas, - out List unknownLbas) => - throw new FeatureUnsupportedImageException("Feature not supported by image format"); - public bool? VerifyMediaImage() => null; } } \ No newline at end of file diff --git a/DiscImageChef.DiscImages/Apple2MG/Write.cs b/DiscImageChef.DiscImages/Apple2MG/Write.cs index 6e8875a63..67bfaa914 100644 --- a/DiscImageChef.DiscImages/Apple2MG/Write.cs +++ b/DiscImageChef.DiscImages/Apple2MG/Write.cs @@ -153,12 +153,6 @@ namespace DiscImageChef.DiscImages return false; } - public bool SetTracks(List tracks) - { - ErrorMessage = "Unsupported feature"; - return false; - } - public bool Close() { if(!IsWriting) diff --git a/DiscImageChef.DiscImages/AppleDOS/Properties.cs b/DiscImageChef.DiscImages/AppleDOS/Properties.cs index aa9701690..4bc5e6fe0 100644 --- a/DiscImageChef.DiscImages/AppleDOS/Properties.cs +++ b/DiscImageChef.DiscImages/AppleDOS/Properties.cs @@ -34,7 +34,6 @@ using System; using System.Collections.Generic; using DiscImageChef.CommonTypes; using DiscImageChef.CommonTypes.Enums; -using DiscImageChef.CommonTypes.Exceptions; using DiscImageChef.CommonTypes.Structs; using Schemas; @@ -52,15 +51,8 @@ namespace DiscImageChef.DiscImages ? "Apple ][ Interleaved Disk Image (ProDOS order)" : "Apple ][ Interleaved Disk Image (DOS order)"; - public List Tracks => - throw new FeatureUnsupportedImageException("Feature not supported by image format"); - - public List Sessions => - throw new FeatureUnsupportedImageException("Feature not supported by image format"); - public List DumpHardware => null; - public CICMMetadataType CicmMetadata => null; - public List Partitions => - throw new FeatureUnsupportedImageException("Feature not supported by image format"); + public List DumpHardware => null; + public CICMMetadataType CicmMetadata => null; public IEnumerable SupportedMediaTags => new MediaTagType[] { }; public IEnumerable SupportedSectorTags => new SectorTagType[] { }; public IEnumerable SupportedMediaTypes => new[] {MediaType.Apple33SS}; diff --git a/DiscImageChef.DiscImages/AppleDOS/Unsupported.cs b/DiscImageChef.DiscImages/AppleDOS/Unsupported.cs index 359abcc90..8d0db3470 100644 --- a/DiscImageChef.DiscImages/AppleDOS/Unsupported.cs +++ b/DiscImageChef.DiscImages/AppleDOS/Unsupported.cs @@ -33,7 +33,6 @@ using System.Collections.Generic; using DiscImageChef.CommonTypes.Enums; using DiscImageChef.CommonTypes.Exceptions; -using DiscImageChef.CommonTypes.Structs; namespace DiscImageChef.DiscImages { @@ -41,8 +40,6 @@ namespace DiscImageChef.DiscImages { public bool? VerifySector(ulong sectorAddress) => null; - public bool? VerifySector(ulong sectorAddress, uint track) => null; - public bool? VerifySectors(ulong sectorAddress, uint length, out List failingLbas, out List unknownLbas) { @@ -54,37 +51,8 @@ namespace DiscImageChef.DiscImages return null; } - public bool? VerifySectors(ulong sectorAddress, uint length, uint track, out List failingLbas, - out List unknownLbas) - { - failingLbas = new List(); - unknownLbas = new List(); - - for(ulong i = sectorAddress; i < sectorAddress + length; i++) unknownLbas.Add(i); - - return null; - } - public bool? VerifyMediaImage() => null; - public List GetSessionTracks(Session session) => - throw new FeatureUnsupportedImageException("Feature not supported by image format"); - - public List GetSessionTracks(ushort session) => - throw new FeatureUnsupportedImageException("Feature not supported by image format"); - - public byte[] ReadSector(ulong sectorAddress, uint track) => - throw new FeatureUnsupportedImageException("Feature not supported by image format"); - - public byte[] ReadSectors(ulong sectorAddress, uint length, uint track) => - throw new FeatureUnsupportedImageException("Feature not supported by image format"); - - public byte[] ReadSectorLong(ulong sectorAddress, uint track) => - throw new FeatureUnsupportedImageException("Feature not supported by image format"); - - public byte[] ReadSectorsLong(ulong sectorAddress, uint length, uint track) => - throw new FeatureUnsupportedImageException("Feature not supported by image format"); - public byte[] ReadSectorTag(ulong sectorAddress, SectorTagType tag) => throw new FeatureUnsupportedImageException("Feature not supported by image format"); @@ -99,11 +67,5 @@ namespace DiscImageChef.DiscImages public byte[] ReadDiskTag(MediaTagType tag) => throw new FeatureUnsupportedImageException("Feature not supported by image format"); - - public byte[] ReadSectorTag(ulong sectorAddress, uint track, SectorTagType tag) => - throw new FeatureUnsupportedImageException("Feature not supported by image format"); - - public byte[] ReadSectorsTag(ulong sectorAddress, uint length, uint track, SectorTagType tag) => - throw new FeatureUnsupportedImageException("Feature not supported by image format"); } } \ No newline at end of file diff --git a/DiscImageChef.DiscImages/AppleDOS/Write.cs b/DiscImageChef.DiscImages/AppleDOS/Write.cs index bd081af1d..a613e6d8f 100644 --- a/DiscImageChef.DiscImages/AppleDOS/Write.cs +++ b/DiscImageChef.DiscImages/AppleDOS/Write.cs @@ -126,12 +126,6 @@ namespace DiscImageChef.DiscImages return false; } - public bool SetTracks(List tracks) - { - ErrorMessage = "Unsupported feature"; - return false; - } - public bool Close() { if(!IsWriting) diff --git a/DiscImageChef.DiscImages/AppleNIB/Properties.cs b/DiscImageChef.DiscImages/AppleNIB/Properties.cs index 1aa2f4e54..6da02952f 100644 --- a/DiscImageChef.DiscImages/AppleNIB/Properties.cs +++ b/DiscImageChef.DiscImages/AppleNIB/Properties.cs @@ -32,8 +32,6 @@ using System; using System.Collections.Generic; -using DiscImageChef.CommonTypes; -using DiscImageChef.CommonTypes.Exceptions; using DiscImageChef.CommonTypes.Structs; using Schemas; @@ -43,19 +41,10 @@ namespace DiscImageChef.DiscImages { public ImageInfo Info => imageInfo; - public string Name => "Apple NIB"; - public Guid Id => new Guid("AE171AE8-6747-49CC-B861-9D450B7CD42E"); - public string Author => "Natalia Portillo"; - public string Format => "Apple nibbles"; - - public List Partitions => - throw new FeatureUnsupportedImageException("Feature not supported by image format"); - - public List Tracks => - throw new FeatureUnsupportedImageException("Feature not supported by image format"); - - public List Sessions => - throw new FeatureUnsupportedImageException("Feature not supported by image format"); + public string Name => "Apple NIB"; + public Guid Id => new Guid("AE171AE8-6747-49CC-B861-9D450B7CD42E"); + public string Author => "Natalia Portillo"; + public string Format => "Apple nibbles"; public List DumpHardware => null; public CICMMetadataType CicmMetadata => null; } diff --git a/DiscImageChef.DiscImages/AppleNIB/Unsupported.cs b/DiscImageChef.DiscImages/AppleNIB/Unsupported.cs index d33483251..d1d20429f 100644 --- a/DiscImageChef.DiscImages/AppleNIB/Unsupported.cs +++ b/DiscImageChef.DiscImages/AppleNIB/Unsupported.cs @@ -33,7 +33,6 @@ using System.Collections.Generic; using DiscImageChef.CommonTypes.Enums; using DiscImageChef.CommonTypes.Exceptions; -using DiscImageChef.CommonTypes.Structs; namespace DiscImageChef.DiscImages { @@ -42,35 +41,8 @@ namespace DiscImageChef.DiscImages public byte[] ReadDiskTag(MediaTagType tag) => throw new FeatureUnsupportedImageException("Feature not supported by image format"); - public byte[] ReadSector(ulong sectorAddress, uint track) => - throw new FeatureUnsupportedImageException("Feature not supported by image format"); - - public byte[] ReadSectorTag(ulong sectorAddress, uint track, SectorTagType tag) => - throw new FeatureUnsupportedImageException("Feature not supported by image format"); - - public byte[] ReadSectors(ulong sectorAddress, uint length, uint track) => - throw new FeatureUnsupportedImageException("Feature not supported by image format"); - - public byte[] ReadSectorsTag(ulong sectorAddress, uint length, uint track, SectorTagType tag) => - throw new FeatureUnsupportedImageException("Feature not supported by image format"); - - public byte[] ReadSectorLong(ulong sectorAddress, uint track) => - throw new FeatureUnsupportedImageException("Feature not supported by image format"); - - public byte[] ReadSectorsLong(ulong sectorAddress, uint length, uint track) => - throw new FeatureUnsupportedImageException("Feature not supported by image format"); - - public List GetSessionTracks(Session session) => - throw new FeatureUnsupportedImageException("Feature not supported by image format"); - - public List GetSessionTracks(ushort session) => - throw new FeatureUnsupportedImageException("Feature not supported by image format"); - public bool? VerifySector(ulong sectorAddress) => null; - public bool? VerifySector(ulong sectorAddress, uint track) => - throw new FeatureUnsupportedImageException("Feature not supported by image format"); - public bool? VerifySectors(ulong sectorAddress, uint length, out List failingLbas, out List unknownLbas) { @@ -81,10 +53,6 @@ namespace DiscImageChef.DiscImages return null; } - public bool? VerifySectors(ulong sectorAddress, uint length, uint track, out List failingLbas, - out List unknownLbas) => - throw new FeatureUnsupportedImageException("Feature not supported by image format"); - public bool? VerifyMediaImage() => null; } } \ No newline at end of file diff --git a/DiscImageChef.DiscImages/Apridisk/Properties.cs b/DiscImageChef.DiscImages/Apridisk/Properties.cs index ed8d576ee..2526adcfd 100644 --- a/DiscImageChef.DiscImages/Apridisk/Properties.cs +++ b/DiscImageChef.DiscImages/Apridisk/Properties.cs @@ -34,7 +34,6 @@ using System; using System.Collections.Generic; using DiscImageChef.CommonTypes; using DiscImageChef.CommonTypes.Enums; -using DiscImageChef.CommonTypes.Exceptions; using DiscImageChef.CommonTypes.Structs; using Schemas; @@ -49,14 +48,6 @@ namespace DiscImageChef.DiscImages public string Author => "Natalia Portillo"; public string Format => "ACT Apricot disk image"; - public List Partitions => - throw new FeatureUnsupportedImageException("Feature not supported by image format"); - - public List Tracks => - throw new FeatureUnsupportedImageException("Feature not supported by image format"); - - public List Sessions => - throw new FeatureUnsupportedImageException("Feature not supported by image format"); public List DumpHardware => null; public CICMMetadataType CicmMetadata => null; diff --git a/DiscImageChef.DiscImages/Apridisk/Unsupported.cs b/DiscImageChef.DiscImages/Apridisk/Unsupported.cs index f7783d796..3bb3aa6f9 100644 --- a/DiscImageChef.DiscImages/Apridisk/Unsupported.cs +++ b/DiscImageChef.DiscImages/Apridisk/Unsupported.cs @@ -33,7 +33,6 @@ using System.Collections.Generic; using DiscImageChef.CommonTypes.Enums; using DiscImageChef.CommonTypes.Exceptions; -using DiscImageChef.CommonTypes.Structs; namespace DiscImageChef.DiscImages { @@ -45,44 +44,17 @@ namespace DiscImageChef.DiscImages public byte[] ReadSectorTag(ulong sectorAddress, SectorTagType tag) => throw new FeatureUnsupportedImageException("Feature not supported by image format"); - public byte[] ReadSector(ulong sectorAddress, uint track) => - throw new FeatureUnsupportedImageException("Feature not supported by image format"); - - public byte[] ReadSectorTag(ulong sectorAddress, uint track, SectorTagType tag) => - throw new FeatureUnsupportedImageException("Feature not supported by image format"); - public byte[] ReadSectorsTag(ulong sectorAddress, uint length, SectorTagType tag) => throw new FeatureUnsupportedImageException("Feature not supported by image format"); - public byte[] ReadSectors(ulong sectorAddress, uint length, uint track) => - throw new FeatureUnsupportedImageException("Feature not supported by image format"); - - public byte[] ReadSectorsTag(ulong sectorAddress, uint length, uint track, SectorTagType tag) => - throw new FeatureUnsupportedImageException("Feature not supported by image format"); - public byte[] ReadSectorLong(ulong sectorAddress) => throw new FeatureUnsupportedImageException("Feature not supported by image format"); - public byte[] ReadSectorLong(ulong sectorAddress, uint track) => - throw new FeatureUnsupportedImageException("Feature not supported by image format"); - public byte[] ReadSectorsLong(ulong sectorAddress, uint length) => throw new FeatureUnsupportedImageException("Feature not supported by image format"); - public byte[] ReadSectorsLong(ulong sectorAddress, uint length, uint track) => - throw new FeatureUnsupportedImageException("Feature not supported by image format"); - - public List GetSessionTracks(Session session) => - throw new FeatureUnsupportedImageException("Feature not supported by image format"); - - public List GetSessionTracks(ushort session) => - throw new FeatureUnsupportedImageException("Feature not supported by image format"); - public bool? VerifySector(ulong sectorAddress) => null; - public bool? VerifySector(ulong sectorAddress, uint track) => - throw new FeatureUnsupportedImageException("Feature not supported by image format"); - public bool? VerifySectors(ulong sectorAddress, uint length, out List failingLbas, out List unknownLbas) { @@ -93,10 +65,6 @@ namespace DiscImageChef.DiscImages return null; } - public bool? VerifySectors(ulong sectorAddress, uint length, uint track, out List failingLbas, - out List unknownLbas) => - throw new FeatureUnsupportedImageException("Feature not supported by image format"); - public bool? VerifyMediaImage() => null; } } \ No newline at end of file diff --git a/DiscImageChef.DiscImages/Apridisk/Write.cs b/DiscImageChef.DiscImages/Apridisk/Write.cs index e4f046a33..c8955dcad 100644 --- a/DiscImageChef.DiscImages/Apridisk/Write.cs +++ b/DiscImageChef.DiscImages/Apridisk/Write.cs @@ -143,12 +143,6 @@ namespace DiscImageChef.DiscImages return false; } - public bool SetTracks(List tracks) - { - ErrorMessage = "Unsupported feature"; - return false; - } - // TODO: Try if apridisk software supports finding other chunks, to extend metadata support public bool Close() { diff --git a/DiscImageChef.DiscImages/BLU/Properties.cs b/DiscImageChef.DiscImages/BLU/Properties.cs index db9b4b5c4..f3e5ab7c8 100644 --- a/DiscImageChef.DiscImages/BLU/Properties.cs +++ b/DiscImageChef.DiscImages/BLU/Properties.cs @@ -34,7 +34,6 @@ using System; using System.Collections.Generic; using DiscImageChef.CommonTypes; using DiscImageChef.CommonTypes.Enums; -using DiscImageChef.CommonTypes.Exceptions; using DiscImageChef.CommonTypes.Structs; using Schemas; @@ -42,17 +41,11 @@ namespace DiscImageChef.DiscImages { public partial class Blu { - public ImageInfo Info => imageInfo; - public string Name => "Basic Lisa Utility"; - public Guid Id => new Guid("A153E2F8-4235-432D-9A7F-20807B0BCD74"); - public string Author => "Natalia Portillo"; - public string Format => "Basic Lisa Utility"; - public List Partitions => - throw new FeatureUnsupportedImageException("Feature not supported by image format"); - public List Tracks => - throw new FeatureUnsupportedImageException("Feature not supported by image format"); - public List Sessions => - throw new FeatureUnsupportedImageException("Feature not supported by image format"); + public ImageInfo Info => imageInfo; + public string Name => "Basic Lisa Utility"; + public Guid Id => new Guid("A153E2F8-4235-432D-9A7F-20807B0BCD74"); + public string Author => "Natalia Portillo"; + public string Format => "Basic Lisa Utility"; public List DumpHardware => null; public CICMMetadataType CicmMetadata => null; public IEnumerable SupportedMediaTags => new MediaTagType[] { }; diff --git a/DiscImageChef.DiscImages/BLU/Unsupported.cs b/DiscImageChef.DiscImages/BLU/Unsupported.cs index d704494bf..ea2f4da10 100644 --- a/DiscImageChef.DiscImages/BLU/Unsupported.cs +++ b/DiscImageChef.DiscImages/BLU/Unsupported.cs @@ -30,10 +30,8 @@ // Copyright © 2011-2019 Natalia Portillo // ****************************************************************************/ -using System.Collections.Generic; using DiscImageChef.CommonTypes.Enums; using DiscImageChef.CommonTypes.Exceptions; -using DiscImageChef.CommonTypes.Structs; namespace DiscImageChef.DiscImages { @@ -42,43 +40,6 @@ namespace DiscImageChef.DiscImages public byte[] ReadDiskTag(MediaTagType tag) => throw new FeatureUnsupportedImageException("Feature not supported by image format"); - public List GetSessionTracks(Session session) => - throw new FeatureUnsupportedImageException("Feature not supported by image format"); - - public List GetSessionTracks(ushort session) => - throw new FeatureUnsupportedImageException("Feature not supported by image format"); - - public byte[] ReadSector(ulong sectorAddress, uint track) => - throw new FeatureUnsupportedImageException("Feature not supported by image format"); - - public byte[] ReadSectorTag(ulong sectorAddress, uint track, SectorTagType tag) => - throw new FeatureUnsupportedImageException("Feature not supported by image format"); - - public byte[] ReadSectors(ulong sectorAddress, uint length, uint track) => - throw new FeatureUnsupportedImageException("Feature not supported by image format"); - - public byte[] ReadSectorsTag(ulong sectorAddress, uint length, uint track, SectorTagType tag) => - throw new FeatureUnsupportedImageException("Feature not supported by image format"); - - public byte[] ReadSectorLong(ulong sectorAddress, uint track) => - throw new FeatureUnsupportedImageException("Feature not supported by image format"); - - public byte[] ReadSectorsLong(ulong sectorAddress, uint length, uint track) => - throw new FeatureUnsupportedImageException("Feature not supported by image format"); - - public bool? VerifySector(ulong sectorAddress, uint track) => null; - - public bool? VerifySectors(ulong sectorAddress, uint length, uint track, out List failingLbas, - out List unknownLbas) - { - failingLbas = new List(); - unknownLbas = new List(); - - for(ulong i = sectorAddress; i < sectorAddress + length; i++) unknownLbas.Add(i); - - return null; - } - public bool? VerifyMediaImage() => null; } } \ No newline at end of file diff --git a/DiscImageChef.DiscImages/BLU/Write.cs b/DiscImageChef.DiscImages/BLU/Write.cs index 4861ad4c2..e6ef2878a 100644 --- a/DiscImageChef.DiscImages/BLU/Write.cs +++ b/DiscImageChef.DiscImages/BLU/Write.cs @@ -306,12 +306,6 @@ namespace DiscImageChef.DiscImages return true; } - public bool SetTracks(List tracks) - { - ErrorMessage = "Unsupported feature"; - return false; - } - public bool Close() { if(!IsWriting) diff --git a/DiscImageChef.DiscImages/BlindWrite4/BlindWrite4.cs b/DiscImageChef.DiscImages/BlindWrite4/BlindWrite4.cs index f614243eb..ca923de5e 100644 --- a/DiscImageChef.DiscImages/BlindWrite4/BlindWrite4.cs +++ b/DiscImageChef.DiscImages/BlindWrite4/BlindWrite4.cs @@ -39,7 +39,7 @@ using DiscImageChef.CommonTypes.Structs; namespace DiscImageChef.DiscImages { // TODO: Too many unknowns, plus a completely unknown footer, to make this writable - public partial class BlindWrite4 : IMediaImage + public partial class BlindWrite4 : IOpticalMediaImage { List bwTracks; IFilter dataFilter, subFilter; diff --git a/DiscImageChef.DiscImages/BlindWrite5/BlindWrite5.cs b/DiscImageChef.DiscImages/BlindWrite5/BlindWrite5.cs index b9b890db8..05bc7634b 100644 --- a/DiscImageChef.DiscImages/BlindWrite5/BlindWrite5.cs +++ b/DiscImageChef.DiscImages/BlindWrite5/BlindWrite5.cs @@ -39,7 +39,7 @@ using DiscImageChef.CommonTypes.Structs; namespace DiscImageChef.DiscImages { // TODO: Too many unknowns to make this writable - public partial class BlindWrite5 : IMediaImage + public partial class BlindWrite5 : IOpticalMediaImage { byte[] atip; byte[] bca; diff --git a/DiscImageChef.DiscImages/CDRDAO/CDRDAO.cs b/DiscImageChef.DiscImages/CDRDAO/CDRDAO.cs index 0c121c2d4..326b64dc3 100644 --- a/DiscImageChef.DiscImages/CDRDAO/CDRDAO.cs +++ b/DiscImageChef.DiscImages/CDRDAO/CDRDAO.cs @@ -40,7 +40,7 @@ namespace DiscImageChef.DiscImages { // TODO: Doesn't support compositing from several files // TODO: Doesn't support silences that are not in files - public partial class Cdrdao : IWritableImage + public partial class Cdrdao : IWritableOpticalImage { IFilter cdrdaoFilter; StreamWriter descriptorStream; diff --git a/DiscImageChef.DiscImages/CDRWin/CDRWin.cs b/DiscImageChef.DiscImages/CDRWin/CDRWin.cs index e0f663205..0db8acfc5 100644 --- a/DiscImageChef.DiscImages/CDRWin/CDRWin.cs +++ b/DiscImageChef.DiscImages/CDRWin/CDRWin.cs @@ -39,7 +39,7 @@ using DiscImageChef.CommonTypes.Structs; namespace DiscImageChef.DiscImages { // TODO: Implement track flags - public partial class CdrWin : IWritableImage + public partial class CdrWin : IWritableOpticalImage { IFilter cdrwinFilter; StreamReader cueStream; diff --git a/DiscImageChef.DiscImages/CHD/CHD.cs b/DiscImageChef.DiscImages/CHD/CHD.cs index 34fb8117c..3f056f672 100644 --- a/DiscImageChef.DiscImages/CHD/CHD.cs +++ b/DiscImageChef.DiscImages/CHD/CHD.cs @@ -40,7 +40,7 @@ using DiscImageChef.CommonTypes.Structs; namespace DiscImageChef.DiscImages { // TODO: Implement PCMCIA support - public partial class Chd : IMediaImage + public partial class Chd : IOpticalMediaImage { /// "MComprHD" readonly byte[] chdTag = {0x4D, 0x43, 0x6F, 0x6D, 0x70, 0x72, 0x48, 0x44}; diff --git a/DiscImageChef.DiscImages/CPCDSK/Properties.cs b/DiscImageChef.DiscImages/CPCDSK/Properties.cs index b1e39a4cb..84f9b9c9a 100644 --- a/DiscImageChef.DiscImages/CPCDSK/Properties.cs +++ b/DiscImageChef.DiscImages/CPCDSK/Properties.cs @@ -32,8 +32,6 @@ using System; using System.Collections.Generic; -using DiscImageChef.CommonTypes; -using DiscImageChef.CommonTypes.Exceptions; using DiscImageChef.CommonTypes.Structs; using Schemas; @@ -41,17 +39,11 @@ namespace DiscImageChef.DiscImages { public partial class Cpcdsk { - public ImageInfo Info => imageInfo; - public string Name => "CPCEMU Disk-File and Extended CPC Disk-File"; - public Guid Id => new Guid("724B16CC-ADB9-492E-BA07-CAEEC1012B16"); - public string Format => extended ? "CPCEMU Extended disk image" : "CPCEMU disk image"; - public string Author => "Natalia Portillo"; - public List Partitions => - throw new FeatureUnsupportedImageException("Feature not supported by image format"); - public List Tracks => - throw new FeatureUnsupportedImageException("Feature not supported by image format"); - public List Sessions => - throw new FeatureUnsupportedImageException("Feature not supported by image format"); + public ImageInfo Info => imageInfo; + public string Name => "CPCEMU Disk-File and Extended CPC Disk-File"; + public Guid Id => new Guid("724B16CC-ADB9-492E-BA07-CAEEC1012B16"); + public string Format => extended ? "CPCEMU Extended disk image" : "CPCEMU disk image"; + public string Author => "Natalia Portillo"; public List DumpHardware => null; public CICMMetadataType CicmMetadata => null; } diff --git a/DiscImageChef.DiscImages/CPCDSK/Unsupported.cs b/DiscImageChef.DiscImages/CPCDSK/Unsupported.cs index fe8e3da90..b2ba527ce 100644 --- a/DiscImageChef.DiscImages/CPCDSK/Unsupported.cs +++ b/DiscImageChef.DiscImages/CPCDSK/Unsupported.cs @@ -33,7 +33,6 @@ using System.Collections.Generic; using DiscImageChef.CommonTypes.Enums; using DiscImageChef.CommonTypes.Exceptions; -using DiscImageChef.CommonTypes.Structs; namespace DiscImageChef.DiscImages { @@ -42,41 +41,14 @@ namespace DiscImageChef.DiscImages public byte[] ReadDiskTag(MediaTagType tag) => throw new FeatureUnsupportedImageException("Feature not supported by image format"); - public byte[] ReadSector(ulong sectorAddress, uint track) => - throw new FeatureUnsupportedImageException("Feature not supported by image format"); - - public byte[] ReadSectorTag(ulong sectorAddress, uint track, SectorTagType tag) => - throw new FeatureUnsupportedImageException("Feature not supported by image format"); - - public byte[] ReadSectors(ulong sectorAddress, uint length, uint track) => - throw new FeatureUnsupportedImageException("Feature not supported by image format"); - - public byte[] ReadSectorsTag(ulong sectorAddress, uint length, uint track, SectorTagType tag) => - throw new FeatureUnsupportedImageException("Feature not supported by image format"); - public byte[] ReadSectorLong(ulong sectorAddress) => throw new FeatureUnsupportedImageException("Feature not supported by image format"); - public byte[] ReadSectorLong(ulong sectorAddress, uint track) => - throw new FeatureUnsupportedImageException("Feature not supported by image format"); - public byte[] ReadSectorsLong(ulong sectorAddress, uint length) => throw new FeatureUnsupportedImageException("Feature not supported by image format"); - public byte[] ReadSectorsLong(ulong sectorAddress, uint length, uint track) => - throw new FeatureUnsupportedImageException("Feature not supported by image format"); - - public List GetSessionTracks(Session session) => - throw new FeatureUnsupportedImageException("Feature not supported by image format"); - - public List GetSessionTracks(ushort session) => - throw new FeatureUnsupportedImageException("Feature not supported by image format"); - public bool? VerifySector(ulong sectorAddress) => null; - public bool? VerifySector(ulong sectorAddress, uint track) => - throw new FeatureUnsupportedImageException("Feature not supported by image format"); - public bool? VerifySectors(ulong sectorAddress, uint length, out List failingLbas, out List unknownLbas) { @@ -87,10 +59,10 @@ namespace DiscImageChef.DiscImages return null; } + public bool? VerifyMediaImage() => null; + public bool? VerifySectors(ulong sectorAddress, uint length, uint track, out List failingLbas, out List unknownLbas) => throw new FeatureUnsupportedImageException("Feature not supported by image format"); - - public bool? VerifyMediaImage() => null; } } \ No newline at end of file diff --git a/DiscImageChef.DiscImages/CisCopy/Properties.cs b/DiscImageChef.DiscImages/CisCopy/Properties.cs index d611fd89c..6c6ded939 100644 --- a/DiscImageChef.DiscImages/CisCopy/Properties.cs +++ b/DiscImageChef.DiscImages/CisCopy/Properties.cs @@ -34,7 +34,6 @@ using System; using System.Collections.Generic; using DiscImageChef.CommonTypes; using DiscImageChef.CommonTypes.Enums; -using DiscImageChef.CommonTypes.Exceptions; using DiscImageChef.CommonTypes.Structs; using Schemas; @@ -42,16 +41,10 @@ namespace DiscImageChef.DiscImages { public partial class CisCopy { - public string Name => "CisCopy Disk Image (DC-File)"; - public Guid Id => new Guid("EDF20CC7-6012-49E2-9E92-663A53E42130"); - public string Format => "CisCopy"; - public string Author => "Natalia Portillo"; - public List Partitions => - throw new FeatureUnsupportedImageException("Feature not supported by image format"); - public List Tracks => - throw new FeatureUnsupportedImageException("Feature not supported by image format"); - public List Sessions => - throw new FeatureUnsupportedImageException("Feature not supported by image format"); + public string Name => "CisCopy Disk Image (DC-File)"; + public Guid Id => new Guid("EDF20CC7-6012-49E2-9E92-663A53E42130"); + public string Format => "CisCopy"; + public string Author => "Natalia Portillo"; public ImageInfo Info => imageInfo; public List DumpHardware => null; public CICMMetadataType CicmMetadata => null; diff --git a/DiscImageChef.DiscImages/CisCopy/Unsupported.cs b/DiscImageChef.DiscImages/CisCopy/Unsupported.cs index ca219bc0a..cfc56a397 100644 --- a/DiscImageChef.DiscImages/CisCopy/Unsupported.cs +++ b/DiscImageChef.DiscImages/CisCopy/Unsupported.cs @@ -33,7 +33,6 @@ using System.Collections.Generic; using DiscImageChef.CommonTypes.Enums; using DiscImageChef.CommonTypes.Exceptions; -using DiscImageChef.CommonTypes.Structs; namespace DiscImageChef.DiscImages { @@ -54,34 +53,8 @@ namespace DiscImageChef.DiscImages public byte[] ReadDiskTag(MediaTagType tag) => throw new FeatureUnsupportedImageException("Feature not supported by image format"); - public List GetSessionTracks(Session session) => - throw new FeatureUnsupportedImageException("Feature not supported by image format"); - - public List GetSessionTracks(ushort session) => - throw new FeatureUnsupportedImageException("Feature not supported by image format"); - - public byte[] ReadSector(ulong sectorAddress, uint track) => - throw new FeatureUnsupportedImageException("Feature not supported by image format"); - - public byte[] ReadSectorTag(ulong sectorAddress, uint track, SectorTagType tag) => - throw new FeatureUnsupportedImageException("Feature not supported by image format"); - - public byte[] ReadSectors(ulong sectorAddress, uint length, uint track) => - throw new FeatureUnsupportedImageException("Feature not supported by image format"); - - public byte[] ReadSectorsTag(ulong sectorAddress, uint length, uint track, SectorTagType tag) => - throw new FeatureUnsupportedImageException("Feature not supported by image format"); - - public byte[] ReadSectorLong(ulong sectorAddress, uint track) => - throw new FeatureUnsupportedImageException("Feature not supported by image format"); - - public byte[] ReadSectorsLong(ulong sectorAddress, uint length, uint track) => - throw new FeatureUnsupportedImageException("Feature not supported by image format"); - public bool? VerifySector(ulong sectorAddress) => null; - public bool? VerifySector(ulong sectorAddress, uint track) => null; - public bool? VerifySectors(ulong sectorAddress, uint length, out List failingLbas, out List unknownLbas) { @@ -93,17 +66,6 @@ namespace DiscImageChef.DiscImages return null; } - public bool? VerifySectors(ulong sectorAddress, uint length, uint track, out List failingLbas, - out List unknownLbas) - { - failingLbas = new List(); - unknownLbas = new List(); - - for(ulong i = sectorAddress; i < sectorAddress + length; i++) unknownLbas.Add(i); - - return null; - } - public bool? VerifyMediaImage() => null; } } \ No newline at end of file diff --git a/DiscImageChef.DiscImages/CisCopy/Write.cs b/DiscImageChef.DiscImages/CisCopy/Write.cs index b8e9a7b26..d3e7dab8f 100644 --- a/DiscImageChef.DiscImages/CisCopy/Write.cs +++ b/DiscImageChef.DiscImages/CisCopy/Write.cs @@ -203,12 +203,6 @@ namespace DiscImageChef.DiscImages return false; } - public bool SetTracks(List tracks) - { - ErrorMessage = "Unsupported feature"; - return false; - } - public bool Close() { if(!IsWriting) diff --git a/DiscImageChef.DiscImages/CloneCD/CloneCD.cs b/DiscImageChef.DiscImages/CloneCD/CloneCD.cs index 077b6f841..71d92f325 100644 --- a/DiscImageChef.DiscImages/CloneCD/CloneCD.cs +++ b/DiscImageChef.DiscImages/CloneCD/CloneCD.cs @@ -39,7 +39,7 @@ using DiscImageChef.CommonTypes.Structs; namespace DiscImageChef.DiscImages { // TODO: CloneCD stores subchannel deinterleaved - public partial class CloneCd : IWritableImage + public partial class CloneCd : IWritableOpticalImage { string catalog; // TODO: Use it IFilter ccdFilter; diff --git a/DiscImageChef.DiscImages/CopyQM/Properties.cs b/DiscImageChef.DiscImages/CopyQM/Properties.cs index e10349ecd..5dbde1d10 100644 --- a/DiscImageChef.DiscImages/CopyQM/Properties.cs +++ b/DiscImageChef.DiscImages/CopyQM/Properties.cs @@ -32,8 +32,6 @@ using System; using System.Collections.Generic; -using DiscImageChef.CommonTypes; -using DiscImageChef.CommonTypes.Exceptions; using DiscImageChef.CommonTypes.Structs; using Schemas; @@ -41,17 +39,11 @@ namespace DiscImageChef.DiscImages { public partial class CopyQm { - public ImageInfo Info => imageInfo; - public string Name => "Sydex CopyQM"; - public Guid Id => new Guid("147E927D-3A92-4E0C-82CD-142F5A4FA76D"); - public string Format => "Sydex CopyQM"; - public string Author => "Natalia Portillo"; - public List Partitions => - throw new FeatureUnsupportedImageException("Feature not supported by image format"); - public List Tracks => - throw new FeatureUnsupportedImageException("Feature not supported by image format"); - public List Sessions => - throw new FeatureUnsupportedImageException("Feature not supported by image format"); + public ImageInfo Info => imageInfo; + public string Name => "Sydex CopyQM"; + public Guid Id => new Guid("147E927D-3A92-4E0C-82CD-142F5A4FA76D"); + public string Format => "Sydex CopyQM"; + public string Author => "Natalia Portillo"; public List DumpHardware => null; public CICMMetadataType CicmMetadata => null; } diff --git a/DiscImageChef.DiscImages/CopyQM/Unsupported.cs b/DiscImageChef.DiscImages/CopyQM/Unsupported.cs index 9805f6ae5..ac1e9eb22 100644 --- a/DiscImageChef.DiscImages/CopyQM/Unsupported.cs +++ b/DiscImageChef.DiscImages/CopyQM/Unsupported.cs @@ -33,7 +33,6 @@ using System.Collections.Generic; using DiscImageChef.CommonTypes.Enums; using DiscImageChef.CommonTypes.Exceptions; -using DiscImageChef.CommonTypes.Structs; namespace DiscImageChef.DiscImages { @@ -54,34 +53,8 @@ namespace DiscImageChef.DiscImages public byte[] ReadDiskTag(MediaTagType tag) => throw new FeatureUnsupportedImageException("Feature not supported by image format"); - public List GetSessionTracks(Session session) => - throw new FeatureUnsupportedImageException("Feature not supported by image format"); - - public List GetSessionTracks(ushort session) => - throw new FeatureUnsupportedImageException("Feature not supported by image format"); - - public byte[] ReadSector(ulong sectorAddress, uint track) => - throw new FeatureUnsupportedImageException("Feature not supported by image format"); - - public byte[] ReadSectorTag(ulong sectorAddress, uint track, SectorTagType tag) => - throw new FeatureUnsupportedImageException("Feature not supported by image format"); - - public byte[] ReadSectors(ulong sectorAddress, uint length, uint track) => - throw new FeatureUnsupportedImageException("Feature not supported by image format"); - - public byte[] ReadSectorsTag(ulong sectorAddress, uint length, uint track, SectorTagType tag) => - throw new FeatureUnsupportedImageException("Feature not supported by image format"); - - public byte[] ReadSectorLong(ulong sectorAddress, uint track) => - throw new FeatureUnsupportedImageException("Feature not supported by image format"); - - public byte[] ReadSectorsLong(ulong sectorAddress, uint length, uint track) => - throw new FeatureUnsupportedImageException("Feature not supported by image format"); - public bool? VerifySector(ulong sectorAddress) => null; - public bool? VerifySector(ulong sectorAddress, uint track) => null; - public bool? VerifySectors(ulong sectorAddress, uint length, out List failingLbas, out List unknownLbas) { @@ -92,16 +65,5 @@ namespace DiscImageChef.DiscImages return null; } - - public bool? VerifySectors(ulong sectorAddress, uint length, uint track, out List failingLbas, - out List unknownLbas) - { - failingLbas = new List(); - unknownLbas = new List(); - - for(ulong i = sectorAddress; i < sectorAddress + length; i++) unknownLbas.Add(i); - - return null; - } } } \ No newline at end of file diff --git a/DiscImageChef.DiscImages/D88/Properties.cs b/DiscImageChef.DiscImages/D88/Properties.cs index 3fdc45773..b0ac813fe 100644 --- a/DiscImageChef.DiscImages/D88/Properties.cs +++ b/DiscImageChef.DiscImages/D88/Properties.cs @@ -32,8 +32,6 @@ using System; using System.Collections.Generic; -using DiscImageChef.CommonTypes; -using DiscImageChef.CommonTypes.Exceptions; using DiscImageChef.CommonTypes.Structs; using Schemas; @@ -41,17 +39,11 @@ namespace DiscImageChef.DiscImages { public partial class D88 { - public string Name => "D88 Disk Image"; - public Guid Id => new Guid("669EDC77-EC41-4720-A88C-49C38CFFBAA0"); - public ImageInfo Info => imageInfo; - public string Format => "D88 disk image"; - public string Author => "Natalia Portillo"; - public List Partitions => - throw new FeatureUnsupportedImageException("Feature not supported by image format"); - public List Tracks => - throw new FeatureUnsupportedImageException("Feature not supported by image format"); - public List Sessions => - throw new FeatureUnsupportedImageException("Feature not supported by image format"); + public string Name => "D88 Disk Image"; + public Guid Id => new Guid("669EDC77-EC41-4720-A88C-49C38CFFBAA0"); + public ImageInfo Info => imageInfo; + public string Format => "D88 disk image"; + public string Author => "Natalia Portillo"; public List DumpHardware => null; public CICMMetadataType CicmMetadata => null; } diff --git a/DiscImageChef.DiscImages/D88/Unsupported.cs b/DiscImageChef.DiscImages/D88/Unsupported.cs index 9fab6c60c..452ca1b4e 100644 --- a/DiscImageChef.DiscImages/D88/Unsupported.cs +++ b/DiscImageChef.DiscImages/D88/Unsupported.cs @@ -33,7 +33,6 @@ using System.Collections.Generic; using DiscImageChef.CommonTypes.Enums; using DiscImageChef.CommonTypes.Exceptions; -using DiscImageChef.CommonTypes.Structs; namespace DiscImageChef.DiscImages { @@ -45,44 +44,17 @@ namespace DiscImageChef.DiscImages public byte[] ReadSectorTag(ulong sectorAddress, SectorTagType tag) => throw new FeatureUnsupportedImageException("Feature not supported by image format"); - public byte[] ReadSector(ulong sectorAddress, uint track) => - throw new FeatureUnsupportedImageException("Feature not supported by image format"); - - public byte[] ReadSectorTag(ulong sectorAddress, uint track, SectorTagType tag) => - throw new FeatureUnsupportedImageException("Feature not supported by image format"); - public byte[] ReadSectorsTag(ulong sectorAddress, uint length, SectorTagType tag) => throw new FeatureUnsupportedImageException("Feature not supported by image format"); - public byte[] ReadSectors(ulong sectorAddress, uint length, uint track) => - throw new FeatureUnsupportedImageException("Feature not supported by image format"); - - public byte[] ReadSectorsTag(ulong sectorAddress, uint length, uint track, SectorTagType tag) => - throw new FeatureUnsupportedImageException("Feature not supported by image format"); - public byte[] ReadSectorLong(ulong sectorAddress) => throw new FeatureUnsupportedImageException("Feature not supported by image format"); - public byte[] ReadSectorLong(ulong sectorAddress, uint track) => - throw new FeatureUnsupportedImageException("Feature not supported by image format"); - public byte[] ReadSectorsLong(ulong sectorAddress, uint length) => throw new FeatureUnsupportedImageException("Feature not supported by image format"); - public byte[] ReadSectorsLong(ulong sectorAddress, uint length, uint track) => - throw new FeatureUnsupportedImageException("Feature not supported by image format"); - - public List GetSessionTracks(Session session) => - throw new FeatureUnsupportedImageException("Feature not supported by image format"); - - public List GetSessionTracks(ushort session) => - throw new FeatureUnsupportedImageException("Feature not supported by image format"); - public bool? VerifySector(ulong sectorAddress) => null; - public bool? VerifySector(ulong sectorAddress, uint track) => - throw new FeatureUnsupportedImageException("Feature not supported by image format"); - public bool? VerifySectors(ulong sectorAddress, uint length, out List failingLbas, out List unknownLbas) { @@ -93,10 +65,6 @@ namespace DiscImageChef.DiscImages return null; } - public bool? VerifySectors(ulong sectorAddress, uint length, uint track, out List failingLbas, - out List unknownLbas) => - throw new FeatureUnsupportedImageException("Feature not supported by image format"); - public bool? VerifyMediaImage() => null; } } \ No newline at end of file diff --git a/DiscImageChef.DiscImages/DART/Properties.cs b/DiscImageChef.DiscImages/DART/Properties.cs index 5b54f239a..c48f4b20c 100644 --- a/DiscImageChef.DiscImages/DART/Properties.cs +++ b/DiscImageChef.DiscImages/DART/Properties.cs @@ -32,8 +32,6 @@ using System; using System.Collections.Generic; -using DiscImageChef.CommonTypes; -using DiscImageChef.CommonTypes.Exceptions; using DiscImageChef.CommonTypes.Structs; using Schemas; @@ -41,17 +39,11 @@ namespace DiscImageChef.DiscImages { public partial class Dart { - public string Name => "Apple Disk Archival/Retrieval Tool"; - public Guid Id => new Guid("B3E06BF8-F98D-4F9B-BBE2-342C373BAF3E"); - public ImageInfo Info => imageInfo; - public string Author => "Natalia Portillo"; - public string Format => "Apple Disk Archival/Retrieval Tool"; - public List Partitions => - throw new FeatureUnsupportedImageException("Feature not supported by image format"); - public List Tracks => - throw new FeatureUnsupportedImageException("Feature not supported by image format"); - public List Sessions => - throw new FeatureUnsupportedImageException("Feature not supported by image format"); + public string Name => "Apple Disk Archival/Retrieval Tool"; + public Guid Id => new Guid("B3E06BF8-F98D-4F9B-BBE2-342C373BAF3E"); + public ImageInfo Info => imageInfo; + public string Author => "Natalia Portillo"; + public string Format => "Apple Disk Archival/Retrieval Tool"; public List DumpHardware => null; public CICMMetadataType CicmMetadata => null; } diff --git a/DiscImageChef.DiscImages/DART/Unsupported.cs b/DiscImageChef.DiscImages/DART/Unsupported.cs index 25dd4dc1b..daf7bc6f0 100644 --- a/DiscImageChef.DiscImages/DART/Unsupported.cs +++ b/DiscImageChef.DiscImages/DART/Unsupported.cs @@ -33,7 +33,6 @@ using System.Collections.Generic; using DiscImageChef.CommonTypes.Enums; using DiscImageChef.CommonTypes.Exceptions; -using DiscImageChef.CommonTypes.Structs; namespace DiscImageChef.DiscImages { @@ -42,35 +41,8 @@ namespace DiscImageChef.DiscImages public byte[] ReadDiskTag(MediaTagType tag) => throw new FeatureUnsupportedImageException("Feature not supported by image format"); - public byte[] ReadSector(ulong sectorAddress, uint track) => - throw new FeatureUnsupportedImageException("Feature not supported by image format"); - - public byte[] ReadSectorTag(ulong sectorAddress, uint track, SectorTagType tag) => - throw new FeatureUnsupportedImageException("Feature not supported by image format"); - - public byte[] ReadSectors(ulong sectorAddress, uint length, uint track) => - throw new FeatureUnsupportedImageException("Feature not supported by image format"); - - public byte[] ReadSectorsTag(ulong sectorAddress, uint length, uint track, SectorTagType tag) => - throw new FeatureUnsupportedImageException("Feature not supported by image format"); - - public byte[] ReadSectorLong(ulong sectorAddress, uint track) => - throw new FeatureUnsupportedImageException("Feature not supported by image format"); - - public byte[] ReadSectorsLong(ulong sectorAddress, uint length, uint track) => - throw new FeatureUnsupportedImageException("Feature not supported by image format"); - - public List GetSessionTracks(Session session) => - throw new FeatureUnsupportedImageException("Feature not supported by image format"); - - public List GetSessionTracks(ushort session) => - throw new FeatureUnsupportedImageException("Feature not supported by image format"); - public bool? VerifySector(ulong sectorAddress) => null; - public bool? VerifySector(ulong sectorAddress, uint track) => - throw new FeatureUnsupportedImageException("Feature not supported by image format"); - public bool? VerifySectors(ulong sectorAddress, uint length, out List failingLbas, out List unknownLbas) { @@ -81,10 +53,6 @@ namespace DiscImageChef.DiscImages return null; } - public bool? VerifySectors(ulong sectorAddress, uint length, uint track, out List failingLbas, - out List unknownLbas) => - throw new FeatureUnsupportedImageException("Feature not supported by image format"); - public bool? VerifyMediaImage() => null; } } \ No newline at end of file diff --git a/DiscImageChef.DiscImages/DIM/Unsupported.cs b/DiscImageChef.DiscImages/DIM/Unsupported.cs index 1e17101f3..f017ba964 100644 --- a/DiscImageChef.DiscImages/DIM/Unsupported.cs +++ b/DiscImageChef.DiscImages/DIM/Unsupported.cs @@ -33,7 +33,6 @@ using System.Collections.Generic; using DiscImageChef.CommonTypes.Enums; using DiscImageChef.CommonTypes.Exceptions; -using DiscImageChef.CommonTypes.Structs; namespace DiscImageChef.DiscImages { @@ -45,44 +44,17 @@ namespace DiscImageChef.DiscImages public byte[] ReadSectorTag(ulong sectorAddress, SectorTagType tag) => throw new FeatureUnsupportedImageException("Feature not supported by image format"); - public byte[] ReadSector(ulong sectorAddress, uint track) => - throw new FeatureUnsupportedImageException("Feature not supported by image format"); - - public byte[] ReadSectorTag(ulong sectorAddress, uint track, SectorTagType tag) => - throw new FeatureUnsupportedImageException("Feature not supported by image format"); - public byte[] ReadSectorsTag(ulong sectorAddress, uint length, SectorTagType tag) => throw new FeatureUnsupportedImageException("Feature not supported by image format"); - public byte[] ReadSectors(ulong sectorAddress, uint length, uint track) => - throw new FeatureUnsupportedImageException("Feature not supported by image format"); - - public byte[] ReadSectorsTag(ulong sectorAddress, uint length, uint track, SectorTagType tag) => - throw new FeatureUnsupportedImageException("Feature not supported by image format"); - public byte[] ReadSectorLong(ulong sectorAddress) => throw new FeatureUnsupportedImageException("Feature not supported by image format"); - public byte[] ReadSectorLong(ulong sectorAddress, uint track) => - throw new FeatureUnsupportedImageException("Feature not supported by image format"); - public byte[] ReadSectorsLong(ulong sectorAddress, uint length) => throw new FeatureUnsupportedImageException("Feature not supported by image format"); - public byte[] ReadSectorsLong(ulong sectorAddress, uint length, uint track) => - throw new FeatureUnsupportedImageException("Feature not supported by image format"); - - public List GetSessionTracks(Session session) => - throw new FeatureUnsupportedImageException("Feature not supported by image format"); - - public List GetSessionTracks(ushort session) => - throw new FeatureUnsupportedImageException("Feature not supported by image format"); - public bool? VerifySector(ulong sectorAddress) => null; - public bool? VerifySector(ulong sectorAddress, uint track) => - throw new FeatureUnsupportedImageException("Feature not supported by image format"); - public bool? VerifySectors(ulong sectorAddress, uint length, out List failingLbas, out List unknownLbas) { @@ -93,10 +65,6 @@ namespace DiscImageChef.DiscImages return null; } - public bool? VerifySectors(ulong sectorAddress, uint length, uint track, out List failingLbas, - out List unknownLbas) => - throw new FeatureUnsupportedImageException("Feature not supported by image format"); - public bool? VerifyMediaImage() => null; } } \ No newline at end of file diff --git a/DiscImageChef.DiscImages/DiscFerret/Properties.cs b/DiscImageChef.DiscImages/DiscFerret/Properties.cs index b749b5f07..2a5d4c67c 100644 --- a/DiscImageChef.DiscImages/DiscFerret/Properties.cs +++ b/DiscImageChef.DiscImages/DiscFerret/Properties.cs @@ -32,8 +32,6 @@ using System; using System.Collections.Generic; -using DiscImageChef.CommonTypes; -using DiscImageChef.CommonTypes.Exceptions; using DiscImageChef.CommonTypes.Structs; using Schemas; @@ -41,17 +39,11 @@ namespace DiscImageChef.DiscImages { public partial class DiscFerret { - public string Name => "DiscFerret"; - public Guid Id => new Guid("70EA7B9B-5323-42EB-9B40-8DDA37C5EB4D"); - public ImageInfo Info => imageInfo; - public string Format => "DiscFerret"; - public string Author => "Natalia Portillo"; - public List Partitions => - throw new FeatureUnsupportedImageException("Feature not supported by image format"); - public List Tracks => - throw new FeatureUnsupportedImageException("Feature not supported by image format"); - public List Sessions => - throw new FeatureUnsupportedImageException("Feature not supported by image format"); + public string Name => "DiscFerret"; + public Guid Id => new Guid("70EA7B9B-5323-42EB-9B40-8DDA37C5EB4D"); + public ImageInfo Info => imageInfo; + public string Format => "DiscFerret"; + public string Author => "Natalia Portillo"; public List DumpHardware => null; public CICMMetadataType CicmMetadata => null; } diff --git a/DiscImageChef.DiscImages/DiscFerret/Unsupported.cs b/DiscImageChef.DiscImages/DiscFerret/Unsupported.cs index 74707689d..21903c34f 100644 --- a/DiscImageChef.DiscImages/DiscFerret/Unsupported.cs +++ b/DiscImageChef.DiscImages/DiscFerret/Unsupported.cs @@ -30,46 +30,12 @@ // Copyright © 2011-2019 Natalia Portillo // ****************************************************************************/ -using System.Collections.Generic; -using DiscImageChef.CommonTypes.Enums; using DiscImageChef.CommonTypes.Exceptions; -using DiscImageChef.CommonTypes.Structs; namespace DiscImageChef.DiscImages { public partial class DiscFerret { - public byte[] ReadSectorLong(ulong sectorAddress, uint track) => - throw new FeatureUnsupportedImageException("Feature not supported by image format"); - - public byte[] ReadSector(ulong sectorAddress, uint track) => - throw new FeatureUnsupportedImageException("Feature not supported by image format"); - - public byte[] ReadSectorTag(ulong sectorAddress, uint track, SectorTagType tag) => - throw new FeatureUnsupportedImageException("Feature not supported by image format"); - - public byte[] ReadSectors(ulong sectorAddress, uint length, uint track) => - throw new FeatureUnsupportedImageException("Feature not supported by image format"); - - public byte[] ReadSectorsTag(ulong sectorAddress, uint length, uint track, SectorTagType tag) => - throw new FeatureUnsupportedImageException("Feature not supported by image format"); - - public byte[] ReadSectorsLong(ulong sectorAddress, uint length, uint track) => - throw new FeatureUnsupportedImageException("Feature not supported by image format"); - - public List GetSessionTracks(Session session) => - throw new FeatureUnsupportedImageException("Feature not supported by image format"); - - public List GetSessionTracks(ushort session) => - throw new FeatureUnsupportedImageException("Feature not supported by image format"); - - public bool? VerifySector(ulong sectorAddress, uint track) => - throw new FeatureUnsupportedImageException("Feature not supported by image format"); - - public bool? VerifySectors(ulong sectorAddress, uint length, uint track, out List failingLbas, - out List unknownLbas) => - throw new FeatureUnsupportedImageException("Feature not supported by image format"); - public bool? VerifyMediaImage() => throw new FeatureUnsupportedImageException("Feature not supported by image format"); } diff --git a/DiscImageChef.DiscImages/DiscImageChef.DiscImages.csproj b/DiscImageChef.DiscImages/DiscImageChef.DiscImages.csproj index e86573a65..a81b5beb7 100644 --- a/DiscImageChef.DiscImages/DiscImageChef.DiscImages.csproj +++ b/DiscImageChef.DiscImages/DiscImageChef.DiscImages.csproj @@ -366,7 +366,6 @@ - diff --git a/DiscImageChef.DiscImages/DiscImageChef/DiscImageChef.cs b/DiscImageChef.DiscImages/DiscImageChef/DiscImageChef.cs index 77f0d8e44..6492d63cb 100644 --- a/DiscImageChef.DiscImages/DiscImageChef/DiscImageChef.cs +++ b/DiscImageChef.DiscImages/DiscImageChef/DiscImageChef.cs @@ -81,7 +81,7 @@ using SharpCompress.Compressors.LZMA; namespace DiscImageChef.DiscImages { - public partial class DiscImageChef : IWritableImage + public partial class DiscImageChef : IWritableOpticalImage { bool alreadyWrittenZero; /// Cache of uncompressed blocks. diff --git a/DiscImageChef.DiscImages/DiskCopy42/Properties.cs b/DiscImageChef.DiscImages/DiskCopy42/Properties.cs index 01f697ac9..64f0db684 100644 --- a/DiscImageChef.DiscImages/DiskCopy42/Properties.cs +++ b/DiscImageChef.DiscImages/DiskCopy42/Properties.cs @@ -34,7 +34,6 @@ using System; using System.Collections.Generic; using DiscImageChef.CommonTypes; using DiscImageChef.CommonTypes.Enums; -using DiscImageChef.CommonTypes.Exceptions; using DiscImageChef.CommonTypes.Structs; using Schemas; @@ -42,23 +41,13 @@ namespace DiscImageChef.DiscImages { public partial class DiskCopy42 { - public ImageInfo Info => imageInfo; - public string Name => "Apple DiskCopy 4.2"; - public Guid Id => new Guid("0240B7B1-E959-4CDC-B0BD-386D6E467B88"); - public string Author => "Natalia Portillo"; - public List DumpHardware => null; - public CICMMetadataType CicmMetadata => null; - public string Format => "Apple DiskCopy 4.2"; - - public List Partitions => - throw new FeatureUnsupportedImageException("Feature not supported by image format"); - - public List Tracks => - throw new FeatureUnsupportedImageException("Feature not supported by image format"); - - public List Sessions => - throw new FeatureUnsupportedImageException("Feature not supported by image format"); - + public ImageInfo Info => imageInfo; + public string Name => "Apple DiskCopy 4.2"; + public Guid Id => new Guid("0240B7B1-E959-4CDC-B0BD-386D6E467B88"); + public string Author => "Natalia Portillo"; + public List DumpHardware => null; + public CICMMetadataType CicmMetadata => null; + public string Format => "Apple DiskCopy 4.2"; public IEnumerable SupportedMediaTags => new MediaTagType[] { }; public IEnumerable SupportedSectorTags => new[] {SectorTagType.AppleSectorTag}; public IEnumerable SupportedMediaTypes => diff --git a/DiscImageChef.DiscImages/DiskCopy42/Unsupported.cs b/DiscImageChef.DiscImages/DiskCopy42/Unsupported.cs index 0e0acf38e..b07cf39dc 100644 --- a/DiscImageChef.DiscImages/DiskCopy42/Unsupported.cs +++ b/DiscImageChef.DiscImages/DiskCopy42/Unsupported.cs @@ -33,7 +33,6 @@ using System.Collections.Generic; using DiscImageChef.CommonTypes.Enums; using DiscImageChef.CommonTypes.Exceptions; -using DiscImageChef.CommonTypes.Structs; namespace DiscImageChef.DiscImages { @@ -41,8 +40,6 @@ namespace DiscImageChef.DiscImages { public bool? VerifySector(ulong sectorAddress) => null; - public bool? VerifySector(ulong sectorAddress, uint track) => null; - public bool? VerifySectors(ulong sectorAddress, uint length, out List failingLbas, out List unknownLbas) { @@ -54,42 +51,7 @@ namespace DiscImageChef.DiscImages return null; } - public bool? VerifySectors(ulong sectorAddress, uint length, uint track, out List failingLbas, - out List unknownLbas) - { - failingLbas = new List(); - unknownLbas = new List(); - - for(ulong i = sectorAddress; i < sectorAddress + length; i++) unknownLbas.Add(i); - - return null; - } - public byte[] ReadDiskTag(MediaTagType tag) => throw new FeatureUnsupportedImageException("Feature not supported by image format"); - - public List GetSessionTracks(Session session) => - throw new FeatureUnsupportedImageException("Feature not supported by image format"); - - public List GetSessionTracks(ushort session) => - throw new FeatureUnsupportedImageException("Feature not supported by image format"); - - public byte[] ReadSector(ulong sectorAddress, uint track) => - throw new FeatureUnsupportedImageException("Feature not supported by image format"); - - public byte[] ReadSectorTag(ulong sectorAddress, uint track, SectorTagType tag) => - throw new FeatureUnsupportedImageException("Feature not supported by image format"); - - public byte[] ReadSectors(ulong sectorAddress, uint length, uint track) => - throw new FeatureUnsupportedImageException("Feature not supported by image format"); - - public byte[] ReadSectorsTag(ulong sectorAddress, uint length, uint track, SectorTagType tag) => - throw new FeatureUnsupportedImageException("Feature not supported by image format"); - - public byte[] ReadSectorLong(ulong sectorAddress, uint track) => - throw new FeatureUnsupportedImageException("Feature not supported by image format"); - - public byte[] ReadSectorsLong(ulong sectorAddress, uint length, uint track) => - throw new FeatureUnsupportedImageException("Feature not supported by image format"); } } \ No newline at end of file diff --git a/DiscImageChef.DiscImages/DiskCopy42/Write.cs b/DiscImageChef.DiscImages/DiskCopy42/Write.cs index 2ce3aa0dc..ca92a533b 100644 --- a/DiscImageChef.DiscImages/DiskCopy42/Write.cs +++ b/DiscImageChef.DiscImages/DiskCopy42/Write.cs @@ -313,12 +313,6 @@ namespace DiscImageChef.DiscImages return true; } - public bool SetTracks(List tracks) - { - ErrorMessage = "Unsupported feature"; - return false; - } - public bool Close() { if(!IsWriting) diff --git a/DiscImageChef.DiscImages/DriDiskCopy/Properties.cs b/DiscImageChef.DiscImages/DriDiskCopy/Properties.cs index 1cfa5816f..3fc284ab0 100644 --- a/DiscImageChef.DiscImages/DriDiskCopy/Properties.cs +++ b/DiscImageChef.DiscImages/DriDiskCopy/Properties.cs @@ -34,7 +34,6 @@ using System; using System.Collections.Generic; using DiscImageChef.CommonTypes; using DiscImageChef.CommonTypes.Enums; -using DiscImageChef.CommonTypes.Exceptions; using DiscImageChef.CommonTypes.Structs; using Schemas; @@ -44,19 +43,10 @@ namespace DiscImageChef.DiscImages { public ImageInfo Info => imageInfo; - public string Name => "Digital Research DiskCopy"; - public Guid Id => new Guid("9F0BE551-8BAB-4038-8B5A-691F1BF5FFF3"); - public string Author => "Natalia Portillo"; - public string Format => "Digital Research DiskCopy"; - - public List Partitions => - throw new FeatureUnsupportedImageException("Feature not supported by image format"); - - public List Tracks => - throw new FeatureUnsupportedImageException("Feature not supported by image format"); - - public List Sessions => - throw new FeatureUnsupportedImageException("Feature not supported by image format"); + public string Name => "Digital Research DiskCopy"; + public Guid Id => new Guid("9F0BE551-8BAB-4038-8B5A-691F1BF5FFF3"); + public string Author => "Natalia Portillo"; + public string Format => "Digital Research DiskCopy"; public List DumpHardware => null; public CICMMetadataType CicmMetadata => null; public IEnumerable SupportedMediaTags => new MediaTagType[] { }; diff --git a/DiscImageChef.DiscImages/DriDiskCopy/Unsupported.cs b/DiscImageChef.DiscImages/DriDiskCopy/Unsupported.cs index 366f4e87b..01a83280a 100644 --- a/DiscImageChef.DiscImages/DriDiskCopy/Unsupported.cs +++ b/DiscImageChef.DiscImages/DriDiskCopy/Unsupported.cs @@ -33,7 +33,6 @@ using System.Collections.Generic; using DiscImageChef.CommonTypes.Enums; using DiscImageChef.CommonTypes.Exceptions; -using DiscImageChef.CommonTypes.Structs; namespace DiscImageChef.DiscImages { @@ -54,34 +53,8 @@ namespace DiscImageChef.DiscImages public byte[] ReadDiskTag(MediaTagType tag) => throw new FeatureUnsupportedImageException("Feature not supported by image format"); - public List GetSessionTracks(Session session) => - throw new FeatureUnsupportedImageException("Feature not supported by image format"); - - public List GetSessionTracks(ushort session) => - throw new FeatureUnsupportedImageException("Feature not supported by image format"); - - public byte[] ReadSector(ulong sectorAddress, uint track) => - throw new FeatureUnsupportedImageException("Feature not supported by image format"); - - public byte[] ReadSectorTag(ulong sectorAddress, uint track, SectorTagType tag) => - throw new FeatureUnsupportedImageException("Feature not supported by image format"); - - public byte[] ReadSectors(ulong sectorAddress, uint length, uint track) => - throw new FeatureUnsupportedImageException("Feature not supported by image format"); - - public byte[] ReadSectorsTag(ulong sectorAddress, uint length, uint track, SectorTagType tag) => - throw new FeatureUnsupportedImageException("Feature not supported by image format"); - - public byte[] ReadSectorLong(ulong sectorAddress, uint track) => - throw new FeatureUnsupportedImageException("Feature not supported by image format"); - - public byte[] ReadSectorsLong(ulong sectorAddress, uint length, uint track) => - throw new FeatureUnsupportedImageException("Feature not supported by image format"); - public bool? VerifySector(ulong sectorAddress) => null; - public bool? VerifySector(ulong sectorAddress, uint track) => null; - public bool? VerifySectors(ulong sectorAddress, uint length, out List failingLbas, out List unknownLbas) { @@ -93,17 +66,6 @@ namespace DiscImageChef.DiscImages return null; } - public bool? VerifySectors(ulong sectorAddress, uint length, uint track, out List failingLbas, - out List unknownLbas) - { - failingLbas = new List(); - unknownLbas = new List(); - - for(ulong i = sectorAddress; i < sectorAddress + length; i++) unknownLbas.Add(i); - - return null; - } - public bool? VerifyMediaImage() => null; } } \ No newline at end of file diff --git a/DiscImageChef.DiscImages/DriDiskCopy/Write.cs b/DiscImageChef.DiscImages/DriDiskCopy/Write.cs index 446f60e82..91af0e0b7 100644 --- a/DiscImageChef.DiscImages/DriDiskCopy/Write.cs +++ b/DiscImageChef.DiscImages/DriDiskCopy/Write.cs @@ -176,12 +176,6 @@ namespace DiscImageChef.DiscImages return false; } - public bool SetTracks(List tracks) - { - ErrorMessage = "Unsupported feature"; - return false; - } - public bool Close() { if(!IsWriting) diff --git a/DiscImageChef.DiscImages/GDI/GDI.cs b/DiscImageChef.DiscImages/GDI/GDI.cs index c7f26dfa8..293bd8a47 100644 --- a/DiscImageChef.DiscImages/GDI/GDI.cs +++ b/DiscImageChef.DiscImages/GDI/GDI.cs @@ -40,7 +40,7 @@ namespace DiscImageChef.DiscImages { // TODO: There seems no be no clear definition on how to treat pregaps that are not included in the file, so this is just appending it to start of track // TODO: This format doesn't support to specify pregaps that are included in the file (like Redump ones) - public partial class Gdi : IMediaImage + public partial class Gdi : IOpticalMediaImage { ulong densitySeparationSectors; GdiDisc discimage; diff --git a/DiscImageChef.DiscImages/HDCopy/Properties.cs b/DiscImageChef.DiscImages/HDCopy/Properties.cs index 977319f36..4127cd6ac 100644 --- a/DiscImageChef.DiscImages/HDCopy/Properties.cs +++ b/DiscImageChef.DiscImages/HDCopy/Properties.cs @@ -33,8 +33,6 @@ using System; using System.Collections.Generic; -using DiscImageChef.CommonTypes; -using DiscImageChef.CommonTypes.Exceptions; using DiscImageChef.CommonTypes.Structs; using Schemas; @@ -44,19 +42,10 @@ namespace DiscImageChef.DiscImages { public ImageInfo Info => imageInfo; - public string Name => "HD-Copy disk image"; - public Guid Id => new Guid("8D57483F-71A5-42EC-9B87-66AEC439C792"); - public string Author => "Michael Drüing"; - public string Format => "HD-Copy image"; - public List Partitions => - throw new FeatureUnsupportedImageException("Feature not supported by image format"); - - public List Tracks => - throw new FeatureUnsupportedImageException("Feature not supported by image format"); - - public List Sessions => - throw new FeatureUnsupportedImageException("Feature not supported by image format"); - + public string Name => "HD-Copy disk image"; + public Guid Id => new Guid("8D57483F-71A5-42EC-9B87-66AEC439C792"); + public string Author => "Michael Drüing"; + public string Format => "HD-Copy image"; public List DumpHardware => null; public CICMMetadataType CicmMetadata => null; } diff --git a/DiscImageChef.DiscImages/HDCopy/Unsupported.cs b/DiscImageChef.DiscImages/HDCopy/Unsupported.cs index 35fe94c96..4500ec1c0 100644 --- a/DiscImageChef.DiscImages/HDCopy/Unsupported.cs +++ b/DiscImageChef.DiscImages/HDCopy/Unsupported.cs @@ -34,7 +34,6 @@ using System.Collections.Generic; using DiscImageChef.CommonTypes.Enums; using DiscImageChef.CommonTypes.Exceptions; -using DiscImageChef.CommonTypes.Structs; namespace DiscImageChef.DiscImages { @@ -46,44 +45,17 @@ namespace DiscImageChef.DiscImages public byte[] ReadSectorTag(ulong sectorAddress, SectorTagType tag) => throw new FeatureUnsupportedImageException("Feature not supported by image format"); - public byte[] ReadSector(ulong sectorAddress, uint track) => - throw new FeatureUnsupportedImageException("Feature not supported by image format"); - - public byte[] ReadSectorTag(ulong sectorAddress, uint track, SectorTagType tag) => - throw new FeatureUnsupportedImageException("Feature not supported by image format"); - public byte[] ReadSectorsTag(ulong sectorAddress, uint length, SectorTagType tag) => throw new FeatureUnsupportedImageException("Feature not supported by image format"); - public byte[] ReadSectors(ulong sectorAddress, uint length, uint track) => - throw new FeatureUnsupportedImageException("Feature not supported by image format"); - - public byte[] ReadSectorsTag(ulong sectorAddress, uint length, uint track, SectorTagType tag) => - throw new FeatureUnsupportedImageException("Feature not supported by image format"); - public byte[] ReadSectorLong(ulong sectorAddress) => throw new FeatureUnsupportedImageException("Feature not supported by image format"); - public byte[] ReadSectorLong(ulong sectorAddress, uint track) => - throw new FeatureUnsupportedImageException("Feature not supported by image format"); - public byte[] ReadSectorsLong(ulong sectorAddress, uint length) => throw new FeatureUnsupportedImageException("Feature not supported by image format"); - public byte[] ReadSectorsLong(ulong sectorAddress, uint length, uint track) => - throw new FeatureUnsupportedImageException("Feature not supported by image format"); - - public List GetSessionTracks(Session session) => - throw new FeatureUnsupportedImageException("Feature not supported by image format"); - - public List GetSessionTracks(ushort session) => - throw new FeatureUnsupportedImageException("Feature not supported by image format"); - public bool? VerifySector(ulong sectorAddress) => null; - public bool? VerifySector(ulong sectorAddress, uint track) => - throw new FeatureUnsupportedImageException("Feature not supported by image format"); - public bool? VerifySectors(ulong sectorAddress, uint length, out List failingLbas, out List unknownLbas) { @@ -94,10 +66,6 @@ namespace DiscImageChef.DiscImages return null; } - public bool? VerifySectors(ulong sectorAddress, uint length, uint track, out List failingLbas, - out List unknownLbas) => - throw new FeatureUnsupportedImageException("Feature not supported by image format"); - public bool? VerifyMediaImage() => null; } } \ No newline at end of file diff --git a/DiscImageChef.DiscImages/IMD/Properties.cs b/DiscImageChef.DiscImages/IMD/Properties.cs index 0323b1639..ddecb0db4 100644 --- a/DiscImageChef.DiscImages/IMD/Properties.cs +++ b/DiscImageChef.DiscImages/IMD/Properties.cs @@ -32,8 +32,6 @@ using System; using System.Collections.Generic; -using DiscImageChef.CommonTypes; -using DiscImageChef.CommonTypes.Exceptions; using DiscImageChef.CommonTypes.Structs; using Schemas; @@ -41,21 +39,11 @@ namespace DiscImageChef.DiscImages { public partial class Imd { - public string Name => "Dunfield's IMD"; - public Guid Id => new Guid("0D67162E-38A3-407D-9B1A-CF40080A48CB"); - public ImageInfo Info => imageInfo; - public string Author => "Natalia Portillo"; - public string Format => "IMageDisk"; - - public List Partitions => - throw new FeatureUnsupportedImageException("Feature not supported by image format"); - - public List Tracks => - throw new FeatureUnsupportedImageException("Feature not supported by image format"); - - public List Sessions => - throw new FeatureUnsupportedImageException("Feature not supported by image format"); - + public string Name => "Dunfield's IMD"; + public Guid Id => new Guid("0D67162E-38A3-407D-9B1A-CF40080A48CB"); + public ImageInfo Info => imageInfo; + public string Author => "Natalia Portillo"; + public string Format => "IMageDisk"; public List DumpHardware => null; public CICMMetadataType CicmMetadata => null; } diff --git a/DiscImageChef.DiscImages/IMD/Unsupported.cs b/DiscImageChef.DiscImages/IMD/Unsupported.cs index 696b1dc16..ca652d0c1 100644 --- a/DiscImageChef.DiscImages/IMD/Unsupported.cs +++ b/DiscImageChef.DiscImages/IMD/Unsupported.cs @@ -33,7 +33,6 @@ using System.Collections.Generic; using DiscImageChef.CommonTypes.Enums; using DiscImageChef.CommonTypes.Exceptions; -using DiscImageChef.CommonTypes.Structs; namespace DiscImageChef.DiscImages { @@ -54,34 +53,8 @@ namespace DiscImageChef.DiscImages public byte[] ReadDiskTag(MediaTagType tag) => throw new FeatureUnsupportedImageException("Feature not supported by image format"); - public List GetSessionTracks(Session session) => - throw new FeatureUnsupportedImageException("Feature not supported by image format"); - - public List GetSessionTracks(ushort session) => - throw new FeatureUnsupportedImageException("Feature not supported by image format"); - - public byte[] ReadSector(ulong sectorAddress, uint track) => - throw new FeatureUnsupportedImageException("Feature not supported by image format"); - - public byte[] ReadSectorTag(ulong sectorAddress, uint track, SectorTagType tag) => - throw new FeatureUnsupportedImageException("Feature not supported by image format"); - - public byte[] ReadSectors(ulong sectorAddress, uint length, uint track) => - throw new FeatureUnsupportedImageException("Feature not supported by image format"); - - public byte[] ReadSectorsTag(ulong sectorAddress, uint length, uint track, SectorTagType tag) => - throw new FeatureUnsupportedImageException("Feature not supported by image format"); - - public byte[] ReadSectorLong(ulong sectorAddress, uint track) => - throw new FeatureUnsupportedImageException("Feature not supported by image format"); - - public byte[] ReadSectorsLong(ulong sectorAddress, uint length, uint track) => - throw new FeatureUnsupportedImageException("Feature not supported by image format"); - public bool? VerifySector(ulong sectorAddress) => null; - public bool? VerifySector(ulong sectorAddress, uint track) => null; - public bool? VerifySectors(ulong sectorAddress, uint length, out List failingLbas, out List unknownLbas) { @@ -93,17 +66,6 @@ namespace DiscImageChef.DiscImages return null; } - public bool? VerifySectors(ulong sectorAddress, uint length, uint track, out List failingLbas, - out List unknownLbas) - { - failingLbas = new List(); - unknownLbas = new List(); - - for(ulong i = sectorAddress; i < sectorAddress + length; i++) unknownLbas.Add(i); - - return null; - } - public bool? VerifyMediaImage() => null; } } \ No newline at end of file diff --git a/DiscImageChef.DiscImages/KryoFlux/Properties.cs b/DiscImageChef.DiscImages/KryoFlux/Properties.cs index 0ae3050ce..4f97471fc 100644 --- a/DiscImageChef.DiscImages/KryoFlux/Properties.cs +++ b/DiscImageChef.DiscImages/KryoFlux/Properties.cs @@ -32,8 +32,6 @@ using System; using System.Collections.Generic; -using DiscImageChef.CommonTypes; -using DiscImageChef.CommonTypes.Exceptions; using DiscImageChef.CommonTypes.Structs; using Schemas; @@ -41,18 +39,12 @@ namespace DiscImageChef.DiscImages { public partial class KryoFlux { - public ImageInfo imageInfo; - public ImageInfo Info => imageInfo; - public string Author => "Natalia Portillo"; - public string Name => "KryoFlux STREAM"; - public Guid Id => new Guid("4DBC95E4-93EE-4F7A-9492-919887E60EFE"); - public string Format => "KryoFlux STREAM"; - public List Partitions => - throw new FeatureUnsupportedImageException("Feature not supported by image format"); - public List Sessions => - throw new FeatureUnsupportedImageException("Feature not supported by image format"); - public List Tracks => - throw new FeatureUnsupportedImageException("Feature not supported by image format"); + public ImageInfo imageInfo; + public ImageInfo Info => imageInfo; + public string Author => "Natalia Portillo"; + public string Name => "KryoFlux STREAM"; + public Guid Id => new Guid("4DBC95E4-93EE-4F7A-9492-919887E60EFE"); + public string Format => "KryoFlux STREAM"; public List DumpHardware => null; public CICMMetadataType CicmMetadata => null; } diff --git a/DiscImageChef.DiscImages/KryoFlux/Unsupported.cs b/DiscImageChef.DiscImages/KryoFlux/Unsupported.cs index 12423a835..1937696cd 100644 --- a/DiscImageChef.DiscImages/KryoFlux/Unsupported.cs +++ b/DiscImageChef.DiscImages/KryoFlux/Unsupported.cs @@ -30,46 +30,12 @@ // Copyright © 2011-2019 Natalia Portillo // ****************************************************************************/ -using System.Collections.Generic; -using DiscImageChef.CommonTypes.Enums; using DiscImageChef.CommonTypes.Exceptions; -using DiscImageChef.CommonTypes.Structs; namespace DiscImageChef.DiscImages { public partial class KryoFlux { - public byte[] ReadSectorLong(ulong sectorAddress, uint track) => - throw new FeatureUnsupportedImageException("Feature not supported by image format"); - - public byte[] ReadSector(ulong sectorAddress, uint track) => - throw new FeatureUnsupportedImageException("Feature not supported by image format"); - - public byte[] ReadSectors(ulong sectorAddress, uint length, uint track) => - throw new FeatureUnsupportedImageException("Feature not supported by image format"); - - public byte[] ReadSectorsTag(ulong sectorAddress, uint length, uint track, SectorTagType tag) => - throw new FeatureUnsupportedImageException("Feature not supported by image format"); - - public byte[] ReadSectorsLong(ulong sectorAddress, uint length, uint track) => - throw new FeatureUnsupportedImageException("Feature not supported by image format"); - - public byte[] ReadSectorTag(ulong sectorAddress, uint track, SectorTagType tag) => - throw new FeatureUnsupportedImageException("Feature not supported by image format"); - - public List GetSessionTracks(Session session) => - throw new FeatureUnsupportedImageException("Feature not supported by image format"); - - public List GetSessionTracks(ushort session) => - throw new FeatureUnsupportedImageException("Feature not supported by image format"); - - public bool? VerifySector(ulong sectorAddress, uint track) => - throw new FeatureUnsupportedImageException("Feature not supported by image format"); - - public bool? VerifySectors(ulong sectorAddress, uint length, uint track, out List failingLbas, - out List unknownLbas) => - throw new FeatureUnsupportedImageException("Feature not supported by image format"); - public bool? VerifyMediaImage() => throw new FeatureUnsupportedImageException("Feature not supported by image format"); } diff --git a/DiscImageChef.DiscImages/MaxiDisk/Properties.cs b/DiscImageChef.DiscImages/MaxiDisk/Properties.cs index a2ef092e7..a220f7ccc 100644 --- a/DiscImageChef.DiscImages/MaxiDisk/Properties.cs +++ b/DiscImageChef.DiscImages/MaxiDisk/Properties.cs @@ -34,7 +34,6 @@ using System; using System.Collections.Generic; using DiscImageChef.CommonTypes; using DiscImageChef.CommonTypes.Enums; -using DiscImageChef.CommonTypes.Exceptions; using DiscImageChef.CommonTypes.Structs; using Schemas; @@ -42,21 +41,11 @@ namespace DiscImageChef.DiscImages { public partial class MaxiDisk { - public ImageInfo Info => imageInfo; - public string Author => "Natalia Portillo"; - public string Name => "MAXI Disk image"; - public Guid Id => new Guid("D27D924A-7034-466E-ADE1-B81EF37E469E"); - public string Format => "MAXI Disk"; - - public List Partitions => - throw new FeatureUnsupportedImageException("Feature not supported by image format"); - - public List Tracks => - throw new FeatureUnsupportedImageException("Feature not supported by image format"); - - public List Sessions => - throw new FeatureUnsupportedImageException("Feature not supported by image format"); - + public ImageInfo Info => imageInfo; + public string Author => "Natalia Portillo"; + public string Name => "MAXI Disk image"; + public Guid Id => new Guid("D27D924A-7034-466E-ADE1-B81EF37E469E"); + public string Format => "MAXI Disk"; public List DumpHardware => null; public CICMMetadataType CicmMetadata => null; public IEnumerable SupportedMediaTags => new MediaTagType[] { }; diff --git a/DiscImageChef.DiscImages/MaxiDisk/Unsupported.cs b/DiscImageChef.DiscImages/MaxiDisk/Unsupported.cs index 9d304484a..9bd79b7af 100644 --- a/DiscImageChef.DiscImages/MaxiDisk/Unsupported.cs +++ b/DiscImageChef.DiscImages/MaxiDisk/Unsupported.cs @@ -54,34 +54,8 @@ namespace DiscImageChef.DiscImages public byte[] ReadDiskTag(MediaTagType tag) => throw new FeatureUnsupportedImageException("Feature not supported by image format"); - public List GetSessionTracks(Session session) => - throw new FeatureUnsupportedImageException("Feature not supported by image format"); - - public List GetSessionTracks(ushort session) => - throw new FeatureUnsupportedImageException("Feature not supported by image format"); - - public byte[] ReadSector(ulong sectorAddress, uint track) => - throw new FeatureUnsupportedImageException("Feature not supported by image format"); - - public byte[] ReadSectorTag(ulong sectorAddress, uint track, SectorTagType tag) => - throw new FeatureUnsupportedImageException("Feature not supported by image format"); - - public byte[] ReadSectors(ulong sectorAddress, uint length, uint track) => - throw new FeatureUnsupportedImageException("Feature not supported by image format"); - - public byte[] ReadSectorsTag(ulong sectorAddress, uint length, uint track, SectorTagType tag) => - throw new FeatureUnsupportedImageException("Feature not supported by image format"); - - public byte[] ReadSectorLong(ulong sectorAddress, uint track) => - throw new FeatureUnsupportedImageException("Feature not supported by image format"); - - public byte[] ReadSectorsLong(ulong sectorAddress, uint length, uint track) => - throw new FeatureUnsupportedImageException("Feature not supported by image format"); - public bool? VerifySector(ulong sectorAddress) => null; - public bool? VerifySector(ulong sectorAddress, uint track) => null; - public bool? VerifySectors(ulong sectorAddress, uint length, out List failingLbas, out List unknownLbas) { @@ -93,17 +67,12 @@ namespace DiscImageChef.DiscImages return null; } - public bool? VerifySectors(ulong sectorAddress, uint length, uint track, out List failingLbas, - out List unknownLbas) - { - failingLbas = new List(); - unknownLbas = new List(); - - for(ulong i = sectorAddress; i < sectorAddress + length; i++) unknownLbas.Add(i); - - return null; - } - public bool? VerifyMediaImage() => null; + + public List GetSessionTracks(Session session) => + throw new FeatureUnsupportedImageException("Feature not supported by image format"); + + public List GetSessionTracks(ushort session) => + throw new FeatureUnsupportedImageException("Feature not supported by image format"); } } \ No newline at end of file diff --git a/DiscImageChef.DiscImages/MaxiDisk/Write.cs b/DiscImageChef.DiscImages/MaxiDisk/Write.cs index f22c065f1..aceaa4a35 100644 --- a/DiscImageChef.DiscImages/MaxiDisk/Write.cs +++ b/DiscImageChef.DiscImages/MaxiDisk/Write.cs @@ -176,12 +176,6 @@ namespace DiscImageChef.DiscImages return false; } - public bool SetTracks(List tracks) - { - ErrorMessage = "Unsupported feature"; - return false; - } - public bool Close() { if(!IsWriting) diff --git a/DiscImageChef.DiscImages/NDIF/Properties.cs b/DiscImageChef.DiscImages/NDIF/Properties.cs index 1234a11a8..c65b72fb8 100644 --- a/DiscImageChef.DiscImages/NDIF/Properties.cs +++ b/DiscImageChef.DiscImages/NDIF/Properties.cs @@ -32,8 +32,6 @@ using System; using System.Collections.Generic; -using DiscImageChef.CommonTypes; -using DiscImageChef.CommonTypes.Exceptions; using DiscImageChef.CommonTypes.Structs; using Schemas; @@ -41,21 +39,11 @@ namespace DiscImageChef.DiscImages { public partial class Ndif { - public ImageInfo Info => imageInfo; - public string Name => "Apple New Disk Image Format"; - public Guid Id => new Guid("5A7FF7D8-491E-458D-8674-5B5EADBECC24"); - public string Format => "Apple New Disk Image Format"; - public string Author => "Natalia Portillo"; - - public List Partitions => - throw new FeatureUnsupportedImageException("Feature not supported by image format"); - - public List Tracks => - throw new FeatureUnsupportedImageException("Feature not supported by image format"); - - public List Sessions => - throw new FeatureUnsupportedImageException("Feature not supported by image format"); - + public ImageInfo Info => imageInfo; + public string Name => "Apple New Disk Image Format"; + public Guid Id => new Guid("5A7FF7D8-491E-458D-8674-5B5EADBECC24"); + public string Format => "Apple New Disk Image Format"; + public string Author => "Natalia Portillo"; public List DumpHardware => null; public CICMMetadataType CicmMetadata => null; } diff --git a/DiscImageChef.DiscImages/NDIF/Unsupported.cs b/DiscImageChef.DiscImages/NDIF/Unsupported.cs index 01ed04f4a..0e3a3402e 100644 --- a/DiscImageChef.DiscImages/NDIF/Unsupported.cs +++ b/DiscImageChef.DiscImages/NDIF/Unsupported.cs @@ -33,7 +33,6 @@ using System.Collections.Generic; using DiscImageChef.CommonTypes.Enums; using DiscImageChef.CommonTypes.Exceptions; -using DiscImageChef.CommonTypes.Structs; namespace DiscImageChef.DiscImages { @@ -48,41 +47,14 @@ namespace DiscImageChef.DiscImages public byte[] ReadDiskTag(MediaTagType tag) => throw new FeatureUnsupportedImageException("Feature not supported by image format"); - public byte[] ReadSector(ulong sectorAddress, uint track) => - throw new FeatureUnsupportedImageException("Feature not supported by image format"); - - public byte[] ReadSectorTag(ulong sectorAddress, uint track, SectorTagType tag) => - throw new FeatureUnsupportedImageException("Feature not supported by image format"); - - public byte[] ReadSectors(ulong sectorAddress, uint length, uint track) => - throw new FeatureUnsupportedImageException("Feature not supported by image format"); - - public byte[] ReadSectorsTag(ulong sectorAddress, uint length, uint track, SectorTagType tag) => - throw new FeatureUnsupportedImageException("Feature not supported by image format"); - public byte[] ReadSectorLong(ulong sectorAddress) => throw new FeatureUnsupportedImageException("Feature not supported by image format"); - public byte[] ReadSectorLong(ulong sectorAddress, uint track) => - throw new FeatureUnsupportedImageException("Feature not supported by image format"); - public byte[] ReadSectorsLong(ulong sectorAddress, uint length) => throw new FeatureUnsupportedImageException("Feature not supported by image format"); - public byte[] ReadSectorsLong(ulong sectorAddress, uint length, uint track) => - throw new FeatureUnsupportedImageException("Feature not supported by image format"); - - public List GetSessionTracks(Session session) => - throw new FeatureUnsupportedImageException("Feature not supported by image format"); - - public List GetSessionTracks(ushort session) => - throw new FeatureUnsupportedImageException("Feature not supported by image format"); - public bool? VerifySector(ulong sectorAddress) => null; - public bool? VerifySector(ulong sectorAddress, uint track) => - throw new FeatureUnsupportedImageException("Feature not supported by image format"); - public bool? VerifySectors(ulong sectorAddress, uint length, out List failingLbas, out List unknownLbas) { @@ -93,10 +65,6 @@ namespace DiscImageChef.DiscImages return null; } - public bool? VerifySectors(ulong sectorAddress, uint length, uint track, out List failingLbas, - out List unknownLbas) => - throw new FeatureUnsupportedImageException("Feature not supported by image format"); - public bool? VerifyMediaImage() => null; } } \ No newline at end of file diff --git a/DiscImageChef.DiscImages/NHDr0/Properties.cs b/DiscImageChef.DiscImages/NHDr0/Properties.cs index 598607b8d..445df4151 100644 --- a/DiscImageChef.DiscImages/NHDr0/Properties.cs +++ b/DiscImageChef.DiscImages/NHDr0/Properties.cs @@ -34,7 +34,6 @@ using System; using System.Collections.Generic; using DiscImageChef.CommonTypes; using DiscImageChef.CommonTypes.Enums; -using DiscImageChef.CommonTypes.Exceptions; using DiscImageChef.CommonTypes.Structs; using Schemas; @@ -42,21 +41,11 @@ namespace DiscImageChef.DiscImages { public partial class Nhdr0 { - public string Name => "T98-Next NHD r0 Disk Image"; - public Guid Id => new Guid("6ECACD0A-8F4D-4465-8815-AEA000D370E3"); - public ImageInfo Info => imageInfo; - public string Author => "Natalia Portillo"; - public string Format => "NHDr0 disk image"; - - public List Partitions => - throw new FeatureUnsupportedImageException("Feature not supported by image format"); - - public List Tracks => - throw new FeatureUnsupportedImageException("Feature not supported by image format"); - - public List Sessions => - throw new FeatureUnsupportedImageException("Feature not supported by image format"); - + public string Name => "T98-Next NHD r0 Disk Image"; + public Guid Id => new Guid("6ECACD0A-8F4D-4465-8815-AEA000D370E3"); + public ImageInfo Info => imageInfo; + public string Author => "Natalia Portillo"; + public string Format => "NHDr0 disk image"; public List DumpHardware => null; public CICMMetadataType CicmMetadata => null; public IEnumerable SupportedMediaTags => new MediaTagType[] { }; diff --git a/DiscImageChef.DiscImages/NHDr0/Unsupported.cs b/DiscImageChef.DiscImages/NHDr0/Unsupported.cs index 254e1daec..d7b49418a 100644 --- a/DiscImageChef.DiscImages/NHDr0/Unsupported.cs +++ b/DiscImageChef.DiscImages/NHDr0/Unsupported.cs @@ -33,7 +33,6 @@ using System.Collections.Generic; using DiscImageChef.CommonTypes.Enums; using DiscImageChef.CommonTypes.Exceptions; -using DiscImageChef.CommonTypes.Structs; namespace DiscImageChef.DiscImages { @@ -45,44 +44,17 @@ namespace DiscImageChef.DiscImages public byte[] ReadSectorTag(ulong sectorAddress, SectorTagType tag) => throw new FeatureUnsupportedImageException("Feature not supported by image format"); - public byte[] ReadSector(ulong sectorAddress, uint track) => - throw new FeatureUnsupportedImageException("Feature not supported by image format"); - - public byte[] ReadSectorTag(ulong sectorAddress, uint track, SectorTagType tag) => - throw new FeatureUnsupportedImageException("Feature not supported by image format"); - public byte[] ReadSectorsTag(ulong sectorAddress, uint length, SectorTagType tag) => throw new FeatureUnsupportedImageException("Feature not supported by image format"); - public byte[] ReadSectors(ulong sectorAddress, uint length, uint track) => - throw new FeatureUnsupportedImageException("Feature not supported by image format"); - - public byte[] ReadSectorsTag(ulong sectorAddress, uint length, uint track, SectorTagType tag) => - throw new FeatureUnsupportedImageException("Feature not supported by image format"); - public byte[] ReadSectorLong(ulong sectorAddress) => throw new FeatureUnsupportedImageException("Feature not supported by image format"); - public byte[] ReadSectorLong(ulong sectorAddress, uint track) => - throw new FeatureUnsupportedImageException("Feature not supported by image format"); - public byte[] ReadSectorsLong(ulong sectorAddress, uint length) => throw new FeatureUnsupportedImageException("Feature not supported by image format"); - public byte[] ReadSectorsLong(ulong sectorAddress, uint length, uint track) => - throw new FeatureUnsupportedImageException("Feature not supported by image format"); - - public List GetSessionTracks(Session session) => - throw new FeatureUnsupportedImageException("Feature not supported by image format"); - - public List GetSessionTracks(ushort session) => - throw new FeatureUnsupportedImageException("Feature not supported by image format"); - public bool? VerifySector(ulong sectorAddress) => null; - public bool? VerifySector(ulong sectorAddress, uint track) => - throw new FeatureUnsupportedImageException("Feature not supported by image format"); - public bool? VerifySectors(ulong sectorAddress, uint length, out List failingLbas, out List unknownLbas) { @@ -93,10 +65,6 @@ namespace DiscImageChef.DiscImages return null; } - public bool? VerifySectors(ulong sectorAddress, uint length, uint track, out List failingLbas, - out List unknownLbas) => - throw new FeatureUnsupportedImageException("Feature not supported by image format"); - public bool? VerifyMediaImage() => null; } } \ No newline at end of file diff --git a/DiscImageChef.DiscImages/NHDr0/Write.cs b/DiscImageChef.DiscImages/NHDr0/Write.cs index 8389cf3f2..d1412cdd5 100644 --- a/DiscImageChef.DiscImages/NHDr0/Write.cs +++ b/DiscImageChef.DiscImages/NHDr0/Write.cs @@ -150,12 +150,6 @@ namespace DiscImageChef.DiscImages return false; } - public bool SetTracks(List tracks) - { - ErrorMessage = "Unsupported feature"; - return false; - } - public bool Close() { if(!IsWriting) diff --git a/DiscImageChef.DiscImages/Nero/Nero.cs b/DiscImageChef.DiscImages/Nero/Nero.cs index 2d9f032fb..6c42c3323 100644 --- a/DiscImageChef.DiscImages/Nero/Nero.cs +++ b/DiscImageChef.DiscImages/Nero/Nero.cs @@ -45,7 +45,7 @@ namespace DiscImageChef.DiscImages { [SuppressMessage("ReSharper", "NotAccessedField.Local")] [SuppressMessage("ReSharper", "CollectionNeverQueried.Local")] - public partial class Nero : IMediaImage + public partial class Nero : IOpticalMediaImage { bool imageNewFormat; Stream imageStream; diff --git a/DiscImageChef.DiscImages/Parallels/Properties.cs b/DiscImageChef.DiscImages/Parallels/Properties.cs index d22645801..3efb18969 100644 --- a/DiscImageChef.DiscImages/Parallels/Properties.cs +++ b/DiscImageChef.DiscImages/Parallels/Properties.cs @@ -34,7 +34,6 @@ using System; using System.Collections.Generic; using DiscImageChef.CommonTypes; using DiscImageChef.CommonTypes.Enums; -using DiscImageChef.CommonTypes.Exceptions; using DiscImageChef.CommonTypes.Structs; using Schemas; @@ -42,21 +41,11 @@ namespace DiscImageChef.DiscImages { public partial class Parallels { - public string Name => "Parallels disk image"; - public Guid Id => new Guid("E314DE35-C103-48A3-AD36-990F68523C46"); - public ImageInfo Info => imageInfo; - public string Author => "Natalia Portillo"; - public string Format => "Parallels"; - - public List Partitions => - throw new FeatureUnsupportedImageException("Feature not supported by image format"); - - public List Tracks => - throw new FeatureUnsupportedImageException("Feature not supported by image format"); - - public List Sessions => - throw new FeatureUnsupportedImageException("Feature not supported by image format"); - + public string Name => "Parallels disk image"; + public Guid Id => new Guid("E314DE35-C103-48A3-AD36-990F68523C46"); + public ImageInfo Info => imageInfo; + public string Author => "Natalia Portillo"; + public string Format => "Parallels"; public List DumpHardware => null; public CICMMetadataType CicmMetadata => null; public IEnumerable SupportedMediaTags => new MediaTagType[] { }; diff --git a/DiscImageChef.DiscImages/Parallels/Unsupported.cs b/DiscImageChef.DiscImages/Parallels/Unsupported.cs index c08c7de91..1b4ff8887 100644 --- a/DiscImageChef.DiscImages/Parallels/Unsupported.cs +++ b/DiscImageChef.DiscImages/Parallels/Unsupported.cs @@ -33,7 +33,6 @@ using System.Collections.Generic; using DiscImageChef.CommonTypes.Enums; using DiscImageChef.CommonTypes.Exceptions; -using DiscImageChef.CommonTypes.Structs; namespace DiscImageChef.DiscImages { @@ -48,41 +47,14 @@ namespace DiscImageChef.DiscImages public byte[] ReadDiskTag(MediaTagType tag) => throw new FeatureUnsupportedImageException("Feature not supported by image format"); - public byte[] ReadSector(ulong sectorAddress, uint track) => - throw new FeatureUnsupportedImageException("Feature not supported by image format"); - - public byte[] ReadSectorTag(ulong sectorAddress, uint track, SectorTagType tag) => - throw new FeatureUnsupportedImageException("Feature not supported by image format"); - - public byte[] ReadSectors(ulong sectorAddress, uint length, uint track) => - throw new FeatureUnsupportedImageException("Feature not supported by image format"); - - public byte[] ReadSectorsTag(ulong sectorAddress, uint length, uint track, SectorTagType tag) => - throw new FeatureUnsupportedImageException("Feature not supported by image format"); - public byte[] ReadSectorLong(ulong sectorAddress) => throw new FeatureUnsupportedImageException("Feature not supported by image format"); - public byte[] ReadSectorLong(ulong sectorAddress, uint track) => - throw new FeatureUnsupportedImageException("Feature not supported by image format"); - public byte[] ReadSectorsLong(ulong sectorAddress, uint length) => throw new FeatureUnsupportedImageException("Feature not supported by image format"); - public byte[] ReadSectorsLong(ulong sectorAddress, uint length, uint track) => - throw new FeatureUnsupportedImageException("Feature not supported by image format"); - - public List GetSessionTracks(Session session) => - throw new FeatureUnsupportedImageException("Feature not supported by image format"); - - public List GetSessionTracks(ushort session) => - throw new FeatureUnsupportedImageException("Feature not supported by image format"); - public bool? VerifySector(ulong sectorAddress) => null; - public bool? VerifySector(ulong sectorAddress, uint track) => - throw new FeatureUnsupportedImageException("Feature not supported by image format"); - public bool? VerifySectors(ulong sectorAddress, uint length, out List failingLbas, out List unknownLbas) { @@ -93,10 +65,6 @@ namespace DiscImageChef.DiscImages return null; } - public bool? VerifySectors(ulong sectorAddress, uint length, uint track, out List failingLbas, - out List unknownLbas) => - throw new FeatureUnsupportedImageException("Feature not supported by image format"); - public bool? VerifyMediaImage() => null; } } \ No newline at end of file diff --git a/DiscImageChef.DiscImages/Parallels/Write.cs b/DiscImageChef.DiscImages/Parallels/Write.cs index 240a2c488..2f6325552 100644 --- a/DiscImageChef.DiscImages/Parallels/Write.cs +++ b/DiscImageChef.DiscImages/Parallels/Write.cs @@ -197,12 +197,6 @@ namespace DiscImageChef.DiscImages return false; } - public bool SetTracks(List tracks) - { - ErrorMessage = "Unsupported feature"; - return false; - } - public bool Close() { if(!IsWriting) diff --git a/DiscImageChef.DiscImages/PartClone/Properties.cs b/DiscImageChef.DiscImages/PartClone/Properties.cs index 24dc172cb..a89cbc3d2 100644 --- a/DiscImageChef.DiscImages/PartClone/Properties.cs +++ b/DiscImageChef.DiscImages/PartClone/Properties.cs @@ -32,8 +32,6 @@ using System; using System.Collections.Generic; -using DiscImageChef.CommonTypes; -using DiscImageChef.CommonTypes.Exceptions; using DiscImageChef.CommonTypes.Structs; using Schemas; @@ -41,21 +39,11 @@ namespace DiscImageChef.DiscImages { public partial class PartClone { - public string Name => "PartClone disk image"; - public Guid Id => new Guid("AB1D7518-B548-4099-A4E2-C29C53DDE0C3"); - public ImageInfo Info => imageInfo; - public string Author => "Natalia Portillo"; - public string Format => "PartClone"; - - public List Partitions => - throw new FeatureUnsupportedImageException("Feature not supported by image format"); - - public List Tracks => - throw new FeatureUnsupportedImageException("Feature not supported by image format"); - - public List Sessions => - throw new FeatureUnsupportedImageException("Feature not supported by image format"); - + public string Name => "PartClone disk image"; + public Guid Id => new Guid("AB1D7518-B548-4099-A4E2-C29C53DDE0C3"); + public ImageInfo Info => imageInfo; + public string Author => "Natalia Portillo"; + public string Format => "PartClone"; public List DumpHardware => null; public CICMMetadataType CicmMetadata => null; } diff --git a/DiscImageChef.DiscImages/PartClone/Unsupported.cs b/DiscImageChef.DiscImages/PartClone/Unsupported.cs index b659d93f0..d3e145541 100644 --- a/DiscImageChef.DiscImages/PartClone/Unsupported.cs +++ b/DiscImageChef.DiscImages/PartClone/Unsupported.cs @@ -33,7 +33,6 @@ using System.Collections.Generic; using DiscImageChef.CommonTypes.Enums; using DiscImageChef.CommonTypes.Exceptions; -using DiscImageChef.CommonTypes.Structs; namespace DiscImageChef.DiscImages { @@ -48,41 +47,14 @@ namespace DiscImageChef.DiscImages public byte[] ReadDiskTag(MediaTagType tag) => throw new FeatureUnsupportedImageException("Feature not supported by image format"); - public byte[] ReadSector(ulong sectorAddress, uint track) => - throw new FeatureUnsupportedImageException("Feature not supported by image format"); - - public byte[] ReadSectorTag(ulong sectorAddress, uint track, SectorTagType tag) => - throw new FeatureUnsupportedImageException("Feature not supported by image format"); - - public byte[] ReadSectors(ulong sectorAddress, uint length, uint track) => - throw new FeatureUnsupportedImageException("Feature not supported by image format"); - - public byte[] ReadSectorsTag(ulong sectorAddress, uint length, uint track, SectorTagType tag) => - throw new FeatureUnsupportedImageException("Feature not supported by image format"); - public byte[] ReadSectorLong(ulong sectorAddress) => throw new FeatureUnsupportedImageException("Feature not supported by image format"); - public byte[] ReadSectorLong(ulong sectorAddress, uint track) => - throw new FeatureUnsupportedImageException("Feature not supported by image format"); - public byte[] ReadSectorsLong(ulong sectorAddress, uint length) => throw new FeatureUnsupportedImageException("Feature not supported by image format"); - public byte[] ReadSectorsLong(ulong sectorAddress, uint length, uint track) => - throw new FeatureUnsupportedImageException("Feature not supported by image format"); - - public List GetSessionTracks(Session session) => - throw new FeatureUnsupportedImageException("Feature not supported by image format"); - - public List GetSessionTracks(ushort session) => - throw new FeatureUnsupportedImageException("Feature not supported by image format"); - public bool? VerifySector(ulong sectorAddress) => null; - public bool? VerifySector(ulong sectorAddress, uint track) => - throw new FeatureUnsupportedImageException("Feature not supported by image format"); - public bool? VerifySectors(ulong sectorAddress, uint length, out List failingLbas, out List unknownLbas) { @@ -93,10 +65,6 @@ namespace DiscImageChef.DiscImages return null; } - public bool? VerifySectors(ulong sectorAddress, uint length, uint track, out List failingLbas, - out List unknownLbas) => - throw new FeatureUnsupportedImageException("Feature not supported by image format"); - // TODO: All blocks contain a CRC32 that's incompatible with current implementation. Need to check for compatibility. public bool? VerifyMediaImage() => null; } diff --git a/DiscImageChef.DiscImages/Partimage/Properties.cs b/DiscImageChef.DiscImages/Partimage/Properties.cs index e9ff9fd07..4015d0adf 100644 --- a/DiscImageChef.DiscImages/Partimage/Properties.cs +++ b/DiscImageChef.DiscImages/Partimage/Properties.cs @@ -32,8 +32,6 @@ using System; using System.Collections.Generic; -using DiscImageChef.CommonTypes; -using DiscImageChef.CommonTypes.Exceptions; using DiscImageChef.CommonTypes.Structs; using Schemas; @@ -43,20 +41,10 @@ namespace DiscImageChef.DiscImages { public ImageInfo Info => imageInfo; - public string Name => "Partimage disk image"; - public Guid Id => new Guid("AAFDB99D-2B77-49EA-831C-C9BB58C68C95"); - public string Author => "Natalia Portillo"; - public string Format => "Partimage"; - - public List Partitions => - throw new FeatureUnsupportedImageException("Feature not supported by image format"); - - public List Tracks => - throw new FeatureUnsupportedImageException("Feature not supported by image format"); - - public List Sessions => - throw new FeatureUnsupportedImageException("Feature not supported by image format"); - + public string Name => "Partimage disk image"; + public Guid Id => new Guid("AAFDB99D-2B77-49EA-831C-C9BB58C68C95"); + public string Author => "Natalia Portillo"; + public string Format => "Partimage"; public List DumpHardware => null; public CICMMetadataType CicmMetadata => null; } diff --git a/DiscImageChef.DiscImages/Partimage/Unsupported.cs b/DiscImageChef.DiscImages/Partimage/Unsupported.cs index 5c29ba140..60263adca 100644 --- a/DiscImageChef.DiscImages/Partimage/Unsupported.cs +++ b/DiscImageChef.DiscImages/Partimage/Unsupported.cs @@ -33,7 +33,6 @@ using System.Collections.Generic; using DiscImageChef.CommonTypes.Enums; using DiscImageChef.CommonTypes.Exceptions; -using DiscImageChef.CommonTypes.Structs; namespace DiscImageChef.DiscImages { @@ -48,41 +47,14 @@ namespace DiscImageChef.DiscImages public byte[] ReadDiskTag(MediaTagType tag) => throw new FeatureUnsupportedImageException("Feature not supported by image format"); - public byte[] ReadSector(ulong sectorAddress, uint track) => - throw new FeatureUnsupportedImageException("Feature not supported by image format"); - - public byte[] ReadSectorTag(ulong sectorAddress, uint track, SectorTagType tag) => - throw new FeatureUnsupportedImageException("Feature not supported by image format"); - - public byte[] ReadSectors(ulong sectorAddress, uint length, uint track) => - throw new FeatureUnsupportedImageException("Feature not supported by image format"); - - public byte[] ReadSectorsTag(ulong sectorAddress, uint length, uint track, SectorTagType tag) => - throw new FeatureUnsupportedImageException("Feature not supported by image format"); - public byte[] ReadSectorLong(ulong sectorAddress) => throw new FeatureUnsupportedImageException("Feature not supported by image format"); - public byte[] ReadSectorLong(ulong sectorAddress, uint track) => - throw new FeatureUnsupportedImageException("Feature not supported by image format"); - public byte[] ReadSectorsLong(ulong sectorAddress, uint length) => throw new FeatureUnsupportedImageException("Feature not supported by image format"); - public byte[] ReadSectorsLong(ulong sectorAddress, uint length, uint track) => - throw new FeatureUnsupportedImageException("Feature not supported by image format"); - - public List GetSessionTracks(Session session) => - throw new FeatureUnsupportedImageException("Feature not supported by image format"); - - public List GetSessionTracks(ushort session) => - throw new FeatureUnsupportedImageException("Feature not supported by image format"); - public bool? VerifySector(ulong sectorAddress) => null; - public bool? VerifySector(ulong sectorAddress, uint track) => - throw new FeatureUnsupportedImageException("Feature not supported by image format"); - public bool? VerifySectors(ulong sectorAddress, uint length, out List failingLbas, out List unknownLbas) { @@ -93,10 +65,6 @@ namespace DiscImageChef.DiscImages return null; } - public bool? VerifySectors(ulong sectorAddress, uint length, uint track, out List failingLbas, - out List unknownLbas) => - throw new FeatureUnsupportedImageException("Feature not supported by image format"); - // TODO: All blocks contain a CRC32 that's incompatible with current implementation. Need to check for compatibility. public bool? VerifyMediaImage() => null; } diff --git a/DiscImageChef.DiscImages/QCOW/Properties.cs b/DiscImageChef.DiscImages/QCOW/Properties.cs index 8e2ef112c..bbd99f144 100644 --- a/DiscImageChef.DiscImages/QCOW/Properties.cs +++ b/DiscImageChef.DiscImages/QCOW/Properties.cs @@ -34,7 +34,6 @@ using System; using System.Collections.Generic; using DiscImageChef.CommonTypes; using DiscImageChef.CommonTypes.Enums; -using DiscImageChef.CommonTypes.Exceptions; using DiscImageChef.CommonTypes.Structs; using Schemas; @@ -44,19 +43,10 @@ namespace DiscImageChef.DiscImages { public ImageInfo Info => imageInfo; - public string Name => "QEMU Copy-On-Write disk image"; - public Guid Id => new Guid("A5C35765-9FE2-469D-BBBF-ACDEBDB7B954"); - public string Author => "Natalia Portillo"; - public string Format => "QEMU Copy-On-Write"; - - public List Partitions => - throw new FeatureUnsupportedImageException("Feature not supported by image format"); - - public List Tracks => - throw new FeatureUnsupportedImageException("Feature not supported by image format"); - - public List Sessions => - throw new FeatureUnsupportedImageException("Feature not supported by image format"); + public string Name => "QEMU Copy-On-Write disk image"; + public Guid Id => new Guid("A5C35765-9FE2-469D-BBBF-ACDEBDB7B954"); + public string Author => "Natalia Portillo"; + public string Format => "QEMU Copy-On-Write"; public List DumpHardware => null; public CICMMetadataType CicmMetadata => null; public IEnumerable SupportedMediaTags => new MediaTagType[] { }; diff --git a/DiscImageChef.DiscImages/QCOW/Unsupported.cs b/DiscImageChef.DiscImages/QCOW/Unsupported.cs index ad905a60c..d086c3f7e 100644 --- a/DiscImageChef.DiscImages/QCOW/Unsupported.cs +++ b/DiscImageChef.DiscImages/QCOW/Unsupported.cs @@ -33,7 +33,6 @@ using System.Collections.Generic; using DiscImageChef.CommonTypes.Enums; using DiscImageChef.CommonTypes.Exceptions; -using DiscImageChef.CommonTypes.Structs; namespace DiscImageChef.DiscImages { @@ -48,41 +47,14 @@ namespace DiscImageChef.DiscImages public byte[] ReadDiskTag(MediaTagType tag) => throw new FeatureUnsupportedImageException("Feature not supported by image format"); - public byte[] ReadSector(ulong sectorAddress, uint track) => - throw new FeatureUnsupportedImageException("Feature not supported by image format"); - - public byte[] ReadSectorTag(ulong sectorAddress, uint track, SectorTagType tag) => - throw new FeatureUnsupportedImageException("Feature not supported by image format"); - - public byte[] ReadSectors(ulong sectorAddress, uint length, uint track) => - throw new FeatureUnsupportedImageException("Feature not supported by image format"); - - public byte[] ReadSectorsTag(ulong sectorAddress, uint length, uint track, SectorTagType tag) => - throw new FeatureUnsupportedImageException("Feature not supported by image format"); - public byte[] ReadSectorLong(ulong sectorAddress) => throw new FeatureUnsupportedImageException("Feature not supported by image format"); - public byte[] ReadSectorLong(ulong sectorAddress, uint track) => - throw new FeatureUnsupportedImageException("Feature not supported by image format"); - public byte[] ReadSectorsLong(ulong sectorAddress, uint length) => throw new FeatureUnsupportedImageException("Feature not supported by image format"); - public byte[] ReadSectorsLong(ulong sectorAddress, uint length, uint track) => - throw new FeatureUnsupportedImageException("Feature not supported by image format"); - - public List GetSessionTracks(Session session) => - throw new FeatureUnsupportedImageException("Feature not supported by image format"); - - public List GetSessionTracks(ushort session) => - throw new FeatureUnsupportedImageException("Feature not supported by image format"); - public bool? VerifySector(ulong sectorAddress) => null; - public bool? VerifySector(ulong sectorAddress, uint track) => - throw new FeatureUnsupportedImageException("Feature not supported by image format"); - public bool? VerifySectors(ulong sectorAddress, uint length, out List failingLbas, out List unknownLbas) { @@ -93,10 +65,6 @@ namespace DiscImageChef.DiscImages return null; } - public bool? VerifySectors(ulong sectorAddress, uint length, uint track, out List failingLbas, - out List unknownLbas) => - throw new FeatureUnsupportedImageException("Feature not supported by image format"); - public bool? VerifyMediaImage() => null; } } \ No newline at end of file diff --git a/DiscImageChef.DiscImages/QCOW/Write.cs b/DiscImageChef.DiscImages/QCOW/Write.cs index 986ff5d9a..ea4ef78a1 100644 --- a/DiscImageChef.DiscImages/QCOW/Write.cs +++ b/DiscImageChef.DiscImages/QCOW/Write.cs @@ -246,12 +246,6 @@ namespace DiscImageChef.DiscImages return false; } - public bool SetTracks(List tracks) - { - ErrorMessage = "Unsupported feature"; - return false; - } - public bool Close() { if(!IsWriting) diff --git a/DiscImageChef.DiscImages/QCOW2/Properties.cs b/DiscImageChef.DiscImages/QCOW2/Properties.cs index 0e2c327ee..6875767e1 100644 --- a/DiscImageChef.DiscImages/QCOW2/Properties.cs +++ b/DiscImageChef.DiscImages/QCOW2/Properties.cs @@ -34,7 +34,6 @@ using System; using System.Collections.Generic; using DiscImageChef.CommonTypes; using DiscImageChef.CommonTypes.Enums; -using DiscImageChef.CommonTypes.Exceptions; using DiscImageChef.CommonTypes.Structs; using Schemas; @@ -44,20 +43,10 @@ namespace DiscImageChef.DiscImages { public ImageInfo Info => imageInfo; - public string Name => "QEMU Copy-On-Write disk image v2"; - public Guid Id => new Guid("F20107CB-95B3-4398-894B-975261F1E8C5"); - public string Author => "Natalia Portillo"; - public string Format => "QEMU Copy-On-Write"; - - public List Partitions => - throw new FeatureUnsupportedImageException("Feature not supported by image format"); - - public List Tracks => - throw new FeatureUnsupportedImageException("Feature not supported by image format"); - - public List Sessions => - throw new FeatureUnsupportedImageException("Feature not supported by image format"); - + public string Name => "QEMU Copy-On-Write disk image v2"; + public Guid Id => new Guid("F20107CB-95B3-4398-894B-975261F1E8C5"); + public string Author => "Natalia Portillo"; + public string Format => "QEMU Copy-On-Write"; public List DumpHardware => null; public CICMMetadataType CicmMetadata => null; public IEnumerable SupportedMediaTags => new MediaTagType[] { }; diff --git a/DiscImageChef.DiscImages/QCOW2/Unsupported.cs b/DiscImageChef.DiscImages/QCOW2/Unsupported.cs index f72907ec9..4a6c91001 100644 --- a/DiscImageChef.DiscImages/QCOW2/Unsupported.cs +++ b/DiscImageChef.DiscImages/QCOW2/Unsupported.cs @@ -33,7 +33,6 @@ using System.Collections.Generic; using DiscImageChef.CommonTypes.Enums; using DiscImageChef.CommonTypes.Exceptions; -using DiscImageChef.CommonTypes.Structs; namespace DiscImageChef.DiscImages { @@ -48,41 +47,14 @@ namespace DiscImageChef.DiscImages public byte[] ReadDiskTag(MediaTagType tag) => throw new FeatureUnsupportedImageException("Feature not supported by image format"); - public byte[] ReadSector(ulong sectorAddress, uint track) => - throw new FeatureUnsupportedImageException("Feature not supported by image format"); - - public byte[] ReadSectorTag(ulong sectorAddress, uint track, SectorTagType tag) => - throw new FeatureUnsupportedImageException("Feature not supported by image format"); - - public byte[] ReadSectors(ulong sectorAddress, uint length, uint track) => - throw new FeatureUnsupportedImageException("Feature not supported by image format"); - - public byte[] ReadSectorsTag(ulong sectorAddress, uint length, uint track, SectorTagType tag) => - throw new FeatureUnsupportedImageException("Feature not supported by image format"); - public byte[] ReadSectorLong(ulong sectorAddress) => throw new FeatureUnsupportedImageException("Feature not supported by image format"); - public byte[] ReadSectorLong(ulong sectorAddress, uint track) => - throw new FeatureUnsupportedImageException("Feature not supported by image format"); - public byte[] ReadSectorsLong(ulong sectorAddress, uint length) => throw new FeatureUnsupportedImageException("Feature not supported by image format"); - public byte[] ReadSectorsLong(ulong sectorAddress, uint length, uint track) => - throw new FeatureUnsupportedImageException("Feature not supported by image format"); - - public List GetSessionTracks(Session session) => - throw new FeatureUnsupportedImageException("Feature not supported by image format"); - - public List GetSessionTracks(ushort session) => - throw new FeatureUnsupportedImageException("Feature not supported by image format"); - public bool? VerifySector(ulong sectorAddress) => null; - public bool? VerifySector(ulong sectorAddress, uint track) => - throw new FeatureUnsupportedImageException("Feature not supported by image format"); - public bool? VerifySectors(ulong sectorAddress, uint length, out List failingLbas, out List unknownLbas) { @@ -93,10 +65,6 @@ namespace DiscImageChef.DiscImages return null; } - public bool? VerifySectors(ulong sectorAddress, uint length, uint track, out List failingLbas, - out List unknownLbas) => - throw new FeatureUnsupportedImageException("Feature not supported by image format"); - public bool? VerifyMediaImage() => null; } } \ No newline at end of file diff --git a/DiscImageChef.DiscImages/QCOW2/Write.cs b/DiscImageChef.DiscImages/QCOW2/Write.cs index cc4942dad..c1182059d 100644 --- a/DiscImageChef.DiscImages/QCOW2/Write.cs +++ b/DiscImageChef.DiscImages/QCOW2/Write.cs @@ -280,12 +280,6 @@ namespace DiscImageChef.DiscImages return false; } - public bool SetTracks(List tracks) - { - ErrorMessage = "Unsupported feature"; - return false; - } - public bool Close() { if(!IsWriting) diff --git a/DiscImageChef.DiscImages/QED/Properties.cs b/DiscImageChef.DiscImages/QED/Properties.cs index 6ef0e894a..0f82c4f8c 100644 --- a/DiscImageChef.DiscImages/QED/Properties.cs +++ b/DiscImageChef.DiscImages/QED/Properties.cs @@ -34,7 +34,6 @@ using System; using System.Collections.Generic; using DiscImageChef.CommonTypes; using DiscImageChef.CommonTypes.Enums; -using DiscImageChef.CommonTypes.Exceptions; using DiscImageChef.CommonTypes.Structs; using Schemas; @@ -44,20 +43,10 @@ namespace DiscImageChef.DiscImages { public ImageInfo Info => imageInfo; - public string Name => "QEMU Enhanced Disk image"; - public Guid Id => new Guid("B9DBB155-A69A-4C10-BF91-96BF431B9BB6"); - public string Author => "Natalia Portillo"; - public string Format => "QEMU Enhanced Disk"; - - public List Partitions => - throw new FeatureUnsupportedImageException("Feature not supported by image format"); - - public List Tracks => - throw new FeatureUnsupportedImageException("Feature not supported by image format"); - - public List Sessions => - throw new FeatureUnsupportedImageException("Feature not supported by image format"); - + public string Name => "QEMU Enhanced Disk image"; + public Guid Id => new Guid("B9DBB155-A69A-4C10-BF91-96BF431B9BB6"); + public string Author => "Natalia Portillo"; + public string Format => "QEMU Enhanced Disk"; public List DumpHardware => null; public CICMMetadataType CicmMetadata => null; diff --git a/DiscImageChef.DiscImages/QED/Unsupported.cs b/DiscImageChef.DiscImages/QED/Unsupported.cs index b6b1c9e5f..e8da84bbf 100644 --- a/DiscImageChef.DiscImages/QED/Unsupported.cs +++ b/DiscImageChef.DiscImages/QED/Unsupported.cs @@ -33,7 +33,6 @@ using System.Collections.Generic; using DiscImageChef.CommonTypes.Enums; using DiscImageChef.CommonTypes.Exceptions; -using DiscImageChef.CommonTypes.Structs; namespace DiscImageChef.DiscImages { @@ -48,41 +47,14 @@ namespace DiscImageChef.DiscImages public byte[] ReadDiskTag(MediaTagType tag) => throw new FeatureUnsupportedImageException("Feature not supported by image format"); - public byte[] ReadSector(ulong sectorAddress, uint track) => - throw new FeatureUnsupportedImageException("Feature not supported by image format"); - - public byte[] ReadSectorTag(ulong sectorAddress, uint track, SectorTagType tag) => - throw new FeatureUnsupportedImageException("Feature not supported by image format"); - - public byte[] ReadSectors(ulong sectorAddress, uint length, uint track) => - throw new FeatureUnsupportedImageException("Feature not supported by image format"); - - public byte[] ReadSectorsTag(ulong sectorAddress, uint length, uint track, SectorTagType tag) => - throw new FeatureUnsupportedImageException("Feature not supported by image format"); - public byte[] ReadSectorLong(ulong sectorAddress) => throw new FeatureUnsupportedImageException("Feature not supported by image format"); - public byte[] ReadSectorLong(ulong sectorAddress, uint track) => - throw new FeatureUnsupportedImageException("Feature not supported by image format"); - public byte[] ReadSectorsLong(ulong sectorAddress, uint length) => throw new FeatureUnsupportedImageException("Feature not supported by image format"); - public byte[] ReadSectorsLong(ulong sectorAddress, uint length, uint track) => - throw new FeatureUnsupportedImageException("Feature not supported by image format"); - - public List GetSessionTracks(Session session) => - throw new FeatureUnsupportedImageException("Feature not supported by image format"); - - public List GetSessionTracks(ushort session) => - throw new FeatureUnsupportedImageException("Feature not supported by image format"); - public bool? VerifySector(ulong sectorAddress) => null; - public bool? VerifySector(ulong sectorAddress, uint track) => - throw new FeatureUnsupportedImageException("Feature not supported by image format"); - public bool? VerifySectors(ulong sectorAddress, uint length, out List failingLbas, out List unknownLbas) { @@ -93,10 +65,6 @@ namespace DiscImageChef.DiscImages return null; } - public bool? VerifySectors(ulong sectorAddress, uint length, uint track, out List failingLbas, - out List unknownLbas) => - throw new FeatureUnsupportedImageException("Feature not supported by image format"); - public bool? VerifyMediaImage() => null; } } \ No newline at end of file diff --git a/DiscImageChef.DiscImages/QED/Write.cs b/DiscImageChef.DiscImages/QED/Write.cs index 1d5f5ab6d..07ca03e8f 100644 --- a/DiscImageChef.DiscImages/QED/Write.cs +++ b/DiscImageChef.DiscImages/QED/Write.cs @@ -237,12 +237,6 @@ namespace DiscImageChef.DiscImages return false; } - public bool SetTracks(List tracks) - { - ErrorMessage = "Unsupported feature"; - return false; - } - public bool Close() { if(!IsWriting) diff --git a/DiscImageChef.DiscImages/RayDIM/Properties.cs b/DiscImageChef.DiscImages/RayDIM/Properties.cs index 6fdb78b5b..4372601be 100644 --- a/DiscImageChef.DiscImages/RayDIM/Properties.cs +++ b/DiscImageChef.DiscImages/RayDIM/Properties.cs @@ -34,7 +34,6 @@ using System; using System.Collections.Generic; using DiscImageChef.CommonTypes; using DiscImageChef.CommonTypes.Enums; -using DiscImageChef.CommonTypes.Exceptions; using DiscImageChef.CommonTypes.Structs; using Schemas; @@ -42,21 +41,11 @@ namespace DiscImageChef.DiscImages { public partial class RayDim { - public string Name => "Ray Arachelian's Disk IMage"; - public Guid Id => new Guid("F541F4E7-C1E3-4A2D-B07F-D863E87AB961"); - public ImageInfo Info => imageInfo; - public string Author => "Natalia Portillo"; - public string Format => "Ray Arachelian's Disk IMage"; - - public List Partitions => - throw new FeatureUnsupportedImageException("Feature not supported by image format"); - - public List Tracks => - throw new FeatureUnsupportedImageException("Feature not supported by image format"); - - public List Sessions => - throw new FeatureUnsupportedImageException("Feature not supported by image format"); - + public string Name => "Ray Arachelian's Disk IMage"; + public Guid Id => new Guid("F541F4E7-C1E3-4A2D-B07F-D863E87AB961"); + public ImageInfo Info => imageInfo; + public string Author => "Natalia Portillo"; + public string Format => "Ray Arachelian's Disk IMage"; public List DumpHardware => null; public CICMMetadataType CicmMetadata => null; public IEnumerable SupportedMediaTags => new MediaTagType[] { }; diff --git a/DiscImageChef.DiscImages/RayDIM/Unsupported.cs b/DiscImageChef.DiscImages/RayDIM/Unsupported.cs index 7580d2d45..a9afb9b1e 100644 --- a/DiscImageChef.DiscImages/RayDIM/Unsupported.cs +++ b/DiscImageChef.DiscImages/RayDIM/Unsupported.cs @@ -33,7 +33,6 @@ using System.Collections.Generic; using DiscImageChef.CommonTypes.Enums; using DiscImageChef.CommonTypes.Exceptions; -using DiscImageChef.CommonTypes.Structs; namespace DiscImageChef.DiscImages { @@ -41,8 +40,6 @@ namespace DiscImageChef.DiscImages { public bool? VerifySector(ulong sectorAddress) => null; - public bool? VerifySector(ulong sectorAddress, uint track) => null; - public bool? VerifySectors(ulong sectorAddress, uint length, out List failingLbas, out List unknownLbas) { @@ -54,17 +51,6 @@ namespace DiscImageChef.DiscImages return null; } - public bool? VerifySectors(ulong sectorAddress, uint length, uint track, out List failingLbas, - out List unknownLbas) - { - failingLbas = new List(); - unknownLbas = new List(); - - for(ulong i = sectorAddress; i < sectorAddress + length; i++) unknownLbas.Add(i); - - return null; - } - public bool? VerifyMediaImage() => null; public byte[] ReadSectorTag(ulong sectorAddress, SectorTagType tag) => @@ -81,29 +67,5 @@ namespace DiscImageChef.DiscImages public byte[] ReadDiskTag(MediaTagType tag) => throw new FeatureUnsupportedImageException("Feature not supported by image format"); - - public List GetSessionTracks(Session session) => - throw new FeatureUnsupportedImageException("Feature not supported by image format"); - - public List GetSessionTracks(ushort session) => - throw new FeatureUnsupportedImageException("Feature not supported by image format"); - - public byte[] ReadSector(ulong sectorAddress, uint track) => - throw new FeatureUnsupportedImageException("Feature not supported by image format"); - - public byte[] ReadSectorTag(ulong sectorAddress, uint track, SectorTagType tag) => - throw new FeatureUnsupportedImageException("Feature not supported by image format"); - - public byte[] ReadSectors(ulong sectorAddress, uint length, uint track) => - throw new FeatureUnsupportedImageException("Feature not supported by image format"); - - public byte[] ReadSectorsTag(ulong sectorAddress, uint length, uint track, SectorTagType tag) => - throw new FeatureUnsupportedImageException("Feature not supported by image format"); - - public byte[] ReadSectorLong(ulong sectorAddress, uint track) => - throw new FeatureUnsupportedImageException("Feature not supported by image format"); - - public byte[] ReadSectorsLong(ulong sectorAddress, uint length, uint track) => - throw new FeatureUnsupportedImageException("Feature not supported by image format"); } } \ No newline at end of file diff --git a/DiscImageChef.DiscImages/RayDIM/Write.cs b/DiscImageChef.DiscImages/RayDIM/Write.cs index 09f77e94b..460503ec4 100644 --- a/DiscImageChef.DiscImages/RayDIM/Write.cs +++ b/DiscImageChef.DiscImages/RayDIM/Write.cs @@ -164,12 +164,6 @@ namespace DiscImageChef.DiscImages return false; } - public bool SetTracks(List tracks) - { - ErrorMessage = "Unsupported feature"; - return false; - } - public bool SetGeometry(uint cylinders, uint heads, uint sectorsPerTrack) => true; public bool WriteSectorTag(byte[] data, ulong sectorAddress, SectorTagType tag) diff --git a/DiscImageChef.DiscImages/RsIde/Properties.cs b/DiscImageChef.DiscImages/RsIde/Properties.cs index 57fe0cefa..8f648a013 100644 --- a/DiscImageChef.DiscImages/RsIde/Properties.cs +++ b/DiscImageChef.DiscImages/RsIde/Properties.cs @@ -34,7 +34,6 @@ using System; using System.Collections.Generic; using DiscImageChef.CommonTypes; using DiscImageChef.CommonTypes.Enums; -using DiscImageChef.CommonTypes.Exceptions; using DiscImageChef.CommonTypes.Structs; using Schemas; @@ -42,21 +41,11 @@ namespace DiscImageChef.DiscImages { public partial class RsIde { - public string Name => "RS-IDE Hard Disk Image"; - public Guid Id => new Guid("47C3E78D-2BE2-4BA5-AA6B-FEE27C86FC65"); - public ImageInfo Info => imageInfo; - public string Author => "Natalia Portillo"; - public string Format => "RS-IDE disk image"; - - public List Partitions => - throw new FeatureUnsupportedImageException("Feature not supported by image format"); - - public List Tracks => - throw new FeatureUnsupportedImageException("Feature not supported by image format"); - - public List Sessions => - throw new FeatureUnsupportedImageException("Feature not supported by image format"); - + public string Name => "RS-IDE Hard Disk Image"; + public Guid Id => new Guid("47C3E78D-2BE2-4BA5-AA6B-FEE27C86FC65"); + public ImageInfo Info => imageInfo; + public string Author => "Natalia Portillo"; + public string Format => "RS-IDE disk image"; public List DumpHardware => null; public CICMMetadataType CicmMetadata => null; public IEnumerable SupportedMediaTags => new[] {MediaTagType.ATA_IDENTIFY}; diff --git a/DiscImageChef.DiscImages/RsIde/Unsupported.cs b/DiscImageChef.DiscImages/RsIde/Unsupported.cs index 00c7fdcad..bddf8a432 100644 --- a/DiscImageChef.DiscImages/RsIde/Unsupported.cs +++ b/DiscImageChef.DiscImages/RsIde/Unsupported.cs @@ -33,7 +33,6 @@ using System.Collections.Generic; using DiscImageChef.CommonTypes.Enums; using DiscImageChef.CommonTypes.Exceptions; -using DiscImageChef.CommonTypes.Structs; namespace DiscImageChef.DiscImages { @@ -42,44 +41,17 @@ namespace DiscImageChef.DiscImages public byte[] ReadSectorTag(ulong sectorAddress, SectorTagType tag) => throw new FeatureUnsupportedImageException("Feature not supported by image format"); - public byte[] ReadSector(ulong sectorAddress, uint track) => - throw new FeatureUnsupportedImageException("Feature not supported by image format"); - - public byte[] ReadSectorTag(ulong sectorAddress, uint track, SectorTagType tag) => - throw new FeatureUnsupportedImageException("Feature not supported by image format"); - public byte[] ReadSectorsTag(ulong sectorAddress, uint length, SectorTagType tag) => throw new FeatureUnsupportedImageException("Feature not supported by image format"); - public byte[] ReadSectors(ulong sectorAddress, uint length, uint track) => - throw new FeatureUnsupportedImageException("Feature not supported by image format"); - - public byte[] ReadSectorsTag(ulong sectorAddress, uint length, uint track, SectorTagType tag) => - throw new FeatureUnsupportedImageException("Feature not supported by image format"); - public byte[] ReadSectorLong(ulong sectorAddress) => throw new FeatureUnsupportedImageException("Feature not supported by image format"); - public byte[] ReadSectorLong(ulong sectorAddress, uint track) => - throw new FeatureUnsupportedImageException("Feature not supported by image format"); - public byte[] ReadSectorsLong(ulong sectorAddress, uint length) => throw new FeatureUnsupportedImageException("Feature not supported by image format"); - public byte[] ReadSectorsLong(ulong sectorAddress, uint length, uint track) => - throw new FeatureUnsupportedImageException("Feature not supported by image format"); - - public List GetSessionTracks(Session session) => - throw new FeatureUnsupportedImageException("Feature not supported by image format"); - - public List GetSessionTracks(ushort session) => - throw new FeatureUnsupportedImageException("Feature not supported by image format"); - public bool? VerifySector(ulong sectorAddress) => null; - public bool? VerifySector(ulong sectorAddress, uint track) => - throw new FeatureUnsupportedImageException("Feature not supported by image format"); - public bool? VerifySectors(ulong sectorAddress, uint length, out List failingLbas, out List unknownLbas) { @@ -90,10 +62,6 @@ namespace DiscImageChef.DiscImages return null; } - public bool? VerifySectors(ulong sectorAddress, uint length, uint track, out List failingLbas, - out List unknownLbas) => - throw new FeatureUnsupportedImageException("Feature not supported by image format"); - public bool? VerifyMediaImage() => null; } } \ No newline at end of file diff --git a/DiscImageChef.DiscImages/RsIde/Write.cs b/DiscImageChef.DiscImages/RsIde/Write.cs index a27c230d2..c444f623b 100644 --- a/DiscImageChef.DiscImages/RsIde/Write.cs +++ b/DiscImageChef.DiscImages/RsIde/Write.cs @@ -170,12 +170,6 @@ namespace DiscImageChef.DiscImages return false; } - public bool SetTracks(List tracks) - { - ErrorMessage = "Unsupported feature"; - return false; - } - public bool Close() { if(!IsWriting) diff --git a/DiscImageChef.DiscImages/SaveDskF/Properties.cs b/DiscImageChef.DiscImages/SaveDskF/Properties.cs index 260b779de..a6e515cba 100644 --- a/DiscImageChef.DiscImages/SaveDskF/Properties.cs +++ b/DiscImageChef.DiscImages/SaveDskF/Properties.cs @@ -34,7 +34,6 @@ using System; using System.Collections.Generic; using DiscImageChef.CommonTypes; using DiscImageChef.CommonTypes.Enums; -using DiscImageChef.CommonTypes.Exceptions; using DiscImageChef.CommonTypes.Structs; using Schemas; @@ -42,21 +41,11 @@ namespace DiscImageChef.DiscImages { public partial class SaveDskF { - public string Name => "IBM SaveDskF"; - public Guid Id => new Guid("288CE058-1A51-4034-8C45-5A256CAE1461"); - public ImageInfo Info => imageInfo; - public string Author => "Natalia Portillo"; - public string Format => "IBM SaveDskF"; - - public List Partitions => - throw new FeatureUnsupportedImageException("Feature not supported by image format"); - - public List Tracks => - throw new FeatureUnsupportedImageException("Feature not supported by image format"); - - public List Sessions => - throw new FeatureUnsupportedImageException("Feature not supported by image format"); - + public string Name => "IBM SaveDskF"; + public Guid Id => new Guid("288CE058-1A51-4034-8C45-5A256CAE1461"); + public ImageInfo Info => imageInfo; + public string Author => "Natalia Portillo"; + public string Format => "IBM SaveDskF"; public List DumpHardware => null; public CICMMetadataType CicmMetadata => null; public IEnumerable SupportedMediaTags => new MediaTagType[] { }; diff --git a/DiscImageChef.DiscImages/SaveDskF/Unsupported.cs b/DiscImageChef.DiscImages/SaveDskF/Unsupported.cs index 70f7fee3a..bf7799bba 100644 --- a/DiscImageChef.DiscImages/SaveDskF/Unsupported.cs +++ b/DiscImageChef.DiscImages/SaveDskF/Unsupported.cs @@ -33,7 +33,6 @@ using System.Collections.Generic; using DiscImageChef.CommonTypes.Enums; using DiscImageChef.CommonTypes.Exceptions; -using DiscImageChef.CommonTypes.Structs; namespace DiscImageChef.DiscImages { @@ -41,8 +40,6 @@ namespace DiscImageChef.DiscImages { public bool? VerifySector(ulong sectorAddress) => null; - public bool? VerifySector(ulong sectorAddress, uint track) => null; - public bool? VerifySectors(ulong sectorAddress, uint length, out List failingLbas, out List unknownLbas) { @@ -54,17 +51,6 @@ namespace DiscImageChef.DiscImages return null; } - public bool? VerifySectors(ulong sectorAddress, uint length, uint track, out List failingLbas, - out List unknownLbas) - { - failingLbas = new List(); - unknownLbas = new List(); - - for(ulong i = sectorAddress; i < sectorAddress + length; i++) unknownLbas.Add(i); - - return null; - } - public byte[] ReadSectorTag(ulong sectorAddress, SectorTagType tag) => throw new FeatureUnsupportedImageException("Feature not supported by image format"); @@ -79,29 +65,5 @@ namespace DiscImageChef.DiscImages public byte[] ReadDiskTag(MediaTagType tag) => throw new FeatureUnsupportedImageException("Feature not supported by image format"); - - public List GetSessionTracks(Session session) => - throw new FeatureUnsupportedImageException("Feature not supported by image format"); - - public List GetSessionTracks(ushort session) => - throw new FeatureUnsupportedImageException("Feature not supported by image format"); - - public byte[] ReadSector(ulong sectorAddress, uint track) => - throw new FeatureUnsupportedImageException("Feature not supported by image format"); - - public byte[] ReadSectorTag(ulong sectorAddress, uint track, SectorTagType tag) => - throw new FeatureUnsupportedImageException("Feature not supported by image format"); - - public byte[] ReadSectors(ulong sectorAddress, uint length, uint track) => - throw new FeatureUnsupportedImageException("Feature not supported by image format"); - - public byte[] ReadSectorsTag(ulong sectorAddress, uint length, uint track, SectorTagType tag) => - throw new FeatureUnsupportedImageException("Feature not supported by image format"); - - public byte[] ReadSectorLong(ulong sectorAddress, uint track) => - throw new FeatureUnsupportedImageException("Feature not supported by image format"); - - public byte[] ReadSectorsLong(ulong sectorAddress, uint length, uint track) => - throw new FeatureUnsupportedImageException("Feature not supported by image format"); } } \ No newline at end of file diff --git a/DiscImageChef.DiscImages/SaveDskF/Write.cs b/DiscImageChef.DiscImages/SaveDskF/Write.cs index bcc0a4b12..66d36c822 100644 --- a/DiscImageChef.DiscImages/SaveDskF/Write.cs +++ b/DiscImageChef.DiscImages/SaveDskF/Write.cs @@ -117,12 +117,6 @@ namespace DiscImageChef.DiscImages return false; } - public bool SetTracks(List tracks) - { - ErrorMessage = "Unsupported feature"; - return false; - } - public bool Close() { if(!IsWriting) diff --git a/DiscImageChef.DiscImages/SuperCardPro/Properties.cs b/DiscImageChef.DiscImages/SuperCardPro/Properties.cs index 41953b461..7eb04c565 100644 --- a/DiscImageChef.DiscImages/SuperCardPro/Properties.cs +++ b/DiscImageChef.DiscImages/SuperCardPro/Properties.cs @@ -32,8 +32,6 @@ using System; using System.Collections.Generic; -using DiscImageChef.CommonTypes; -using DiscImageChef.CommonTypes.Exceptions; using DiscImageChef.CommonTypes.Structs; using Schemas; @@ -41,21 +39,11 @@ namespace DiscImageChef.DiscImages { public partial class SuperCardPro { - public ImageInfo Info => imageInfo; - public string Name => "SuperCardPro"; - public Guid Id => new Guid("C5D3182E-1D45-4767-A205-E6E5C83444DC"); - public string Author => "Natalia Portillo"; - public string Format => "SuperCardPro"; - - public List Partitions => - throw new FeatureUnsupportedImageException("Feature not supported by image format"); - - public List Tracks => - throw new FeatureUnsupportedImageException("Feature not supported by image format"); - - public List Sessions => - throw new FeatureUnsupportedImageException("Feature not supported by image format"); - + public ImageInfo Info => imageInfo; + public string Name => "SuperCardPro"; + public Guid Id => new Guid("C5D3182E-1D45-4767-A205-E6E5C83444DC"); + public string Author => "Natalia Portillo"; + public string Format => "SuperCardPro"; public List DumpHardware => null; public CICMMetadataType CicmMetadata => null; } diff --git a/DiscImageChef.DiscImages/SuperCardPro/Unsupported.cs b/DiscImageChef.DiscImages/SuperCardPro/Unsupported.cs deleted file mode 100644 index 20237eb68..000000000 --- a/DiscImageChef.DiscImages/SuperCardPro/Unsupported.cs +++ /dev/null @@ -1,73 +0,0 @@ -// /*************************************************************************** -// The Disc Image Chef -// ---------------------------------------------------------------------------- -// -// Filename : Unsupported.cs -// Author(s) : Natalia Portillo -// -// Component : Disk image plugins. -// -// --[ Description ] ---------------------------------------------------------- -// -// Contains features unsupported by SuperCardPro flux images. -// -// --[ License ] -------------------------------------------------------------- -// -// This library is free software; you can redistribute it and/or modify -// it under the terms of the GNU Lesser General Public License as -// published by the Free Software Foundation; either version 2.1 of the -// License, or (at your option) any later version. -// -// This library 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 -// Lesser General Public License for more details. -// -// You should have received a copy of the GNU Lesser General Public -// License along with this library; if not, see . -// -// ---------------------------------------------------------------------------- -// Copyright © 2011-2019 Natalia Portillo -// ****************************************************************************/ - -using System.Collections.Generic; -using DiscImageChef.CommonTypes.Enums; -using DiscImageChef.CommonTypes.Exceptions; -using DiscImageChef.CommonTypes.Structs; - -namespace DiscImageChef.DiscImages -{ - public partial class SuperCardPro - { - public byte[] ReadSectorLong(ulong sectorAddress, uint track) => - throw new FeatureUnsupportedImageException("Feature not supported by image format"); - - public byte[] ReadSector(ulong sectorAddress, uint track) => - throw new FeatureUnsupportedImageException("Feature not supported by image format"); - - public byte[] ReadSectorTag(ulong sectorAddress, uint track, SectorTagType tag) => - throw new FeatureUnsupportedImageException("Feature not supported by image format"); - - public byte[] ReadSectors(ulong sectorAddress, uint length, uint track) => - throw new FeatureUnsupportedImageException("Feature not supported by image format"); - - public byte[] ReadSectorsTag(ulong sectorAddress, uint length, uint track, SectorTagType tag) => - throw new FeatureUnsupportedImageException("Feature not supported by image format"); - - public byte[] ReadSectorsLong(ulong sectorAddress, uint length, uint track) => - throw new FeatureUnsupportedImageException("Feature not supported by image format"); - - public List GetSessionTracks(Session session) => - throw new FeatureUnsupportedImageException("Feature not supported by image format"); - - public List GetSessionTracks(ushort session) => - throw new FeatureUnsupportedImageException("Feature not supported by image format"); - - public bool? VerifySector(ulong sectorAddress, uint track) => - throw new FeatureUnsupportedImageException("Feature not supported by image format"); - - public bool? VerifySectors(ulong sectorAddress, uint length, uint track, out List failingLbas, - out List unknownLbas) => - throw new FeatureUnsupportedImageException("Feature not supported by image format"); - } -} \ No newline at end of file diff --git a/DiscImageChef.DiscImages/T98/Properties.cs b/DiscImageChef.DiscImages/T98/Properties.cs index fd27bdce6..ba6222878 100644 --- a/DiscImageChef.DiscImages/T98/Properties.cs +++ b/DiscImageChef.DiscImages/T98/Properties.cs @@ -34,7 +34,6 @@ using System; using System.Collections.Generic; using DiscImageChef.CommonTypes; using DiscImageChef.CommonTypes.Enums; -using DiscImageChef.CommonTypes.Exceptions; using DiscImageChef.CommonTypes.Structs; using Schemas; @@ -42,20 +41,11 @@ namespace DiscImageChef.DiscImages { public partial class T98 { - public string Name => "T98 Hard Disk Image"; - public Guid Id => new Guid("0410003E-6E7B-40E6-9328-BA5651ADF6B7"); - public ImageInfo Info => imageInfo; - public string Author => "Natalia Portillo"; - public string Format => "T98 disk image"; - - public List Partitions => - throw new FeatureUnsupportedImageException("Feature not supported by image format"); - - public List Tracks => - throw new FeatureUnsupportedImageException("Feature not supported by image format"); - - public List Sessions => - throw new FeatureUnsupportedImageException("Feature not supported by image format"); + public string Name => "T98 Hard Disk Image"; + public Guid Id => new Guid("0410003E-6E7B-40E6-9328-BA5651ADF6B7"); + public ImageInfo Info => imageInfo; + public string Author => "Natalia Portillo"; + public string Format => "T98 disk image"; public List DumpHardware => null; public CICMMetadataType CicmMetadata => null; public IEnumerable SupportedMediaTags => new MediaTagType[] { }; diff --git a/DiscImageChef.DiscImages/T98/Unsupported.cs b/DiscImageChef.DiscImages/T98/Unsupported.cs index 4416665f0..c3510daf1 100644 --- a/DiscImageChef.DiscImages/T98/Unsupported.cs +++ b/DiscImageChef.DiscImages/T98/Unsupported.cs @@ -33,7 +33,6 @@ using System.Collections.Generic; using DiscImageChef.CommonTypes.Enums; using DiscImageChef.CommonTypes.Exceptions; -using DiscImageChef.CommonTypes.Structs; namespace DiscImageChef.DiscImages { @@ -45,44 +44,17 @@ namespace DiscImageChef.DiscImages public byte[] ReadSectorTag(ulong sectorAddress, SectorTagType tag) => throw new FeatureUnsupportedImageException("Feature not supported by image format"); - public byte[] ReadSector(ulong sectorAddress, uint track) => - throw new FeatureUnsupportedImageException("Feature not supported by image format"); - - public byte[] ReadSectorTag(ulong sectorAddress, uint track, SectorTagType tag) => - throw new FeatureUnsupportedImageException("Feature not supported by image format"); - public byte[] ReadSectorsTag(ulong sectorAddress, uint length, SectorTagType tag) => throw new FeatureUnsupportedImageException("Feature not supported by image format"); - public byte[] ReadSectors(ulong sectorAddress, uint length, uint track) => - throw new FeatureUnsupportedImageException("Feature not supported by image format"); - - public byte[] ReadSectorsTag(ulong sectorAddress, uint length, uint track, SectorTagType tag) => - throw new FeatureUnsupportedImageException("Feature not supported by image format"); - public byte[] ReadSectorLong(ulong sectorAddress) => throw new FeatureUnsupportedImageException("Feature not supported by image format"); - public byte[] ReadSectorLong(ulong sectorAddress, uint track) => - throw new FeatureUnsupportedImageException("Feature not supported by image format"); - public byte[] ReadSectorsLong(ulong sectorAddress, uint length) => throw new FeatureUnsupportedImageException("Feature not supported by image format"); - public byte[] ReadSectorsLong(ulong sectorAddress, uint length, uint track) => - throw new FeatureUnsupportedImageException("Feature not supported by image format"); - - public List GetSessionTracks(Session session) => - throw new FeatureUnsupportedImageException("Feature not supported by image format"); - - public List GetSessionTracks(ushort session) => - throw new FeatureUnsupportedImageException("Feature not supported by image format"); - public bool? VerifySector(ulong sectorAddress) => null; - public bool? VerifySector(ulong sectorAddress, uint track) => - throw new FeatureUnsupportedImageException("Feature not supported by image format"); - public bool? VerifySectors(ulong sectorAddress, uint length, out List failingLbas, out List unknownLbas) { @@ -93,10 +65,6 @@ namespace DiscImageChef.DiscImages return null; } - public bool? VerifySectors(ulong sectorAddress, uint length, uint track, out List failingLbas, - out List unknownLbas) => - throw new FeatureUnsupportedImageException("Feature not supported by image format"); - public bool? VerifyMediaImage() => null; } } \ No newline at end of file diff --git a/DiscImageChef.DiscImages/T98/Write.cs b/DiscImageChef.DiscImages/T98/Write.cs index 4c739bbb8..80f3e9817 100644 --- a/DiscImageChef.DiscImages/T98/Write.cs +++ b/DiscImageChef.DiscImages/T98/Write.cs @@ -144,12 +144,6 @@ namespace DiscImageChef.DiscImages return false; } - public bool SetTracks(List tracks) - { - ErrorMessage = "Unsupported feature"; - return false; - } - public bool Close() { if(!IsWriting) diff --git a/DiscImageChef.DiscImages/TeleDisk/Properties.cs b/DiscImageChef.DiscImages/TeleDisk/Properties.cs index 5f221c0f2..2769e9e09 100644 --- a/DiscImageChef.DiscImages/TeleDisk/Properties.cs +++ b/DiscImageChef.DiscImages/TeleDisk/Properties.cs @@ -32,8 +32,6 @@ using System; using System.Collections.Generic; -using DiscImageChef.CommonTypes; -using DiscImageChef.CommonTypes.Exceptions; using DiscImageChef.CommonTypes.Structs; using Schemas; @@ -43,20 +41,10 @@ namespace DiscImageChef.DiscImages { public ImageInfo Info => imageInfo; - public string Name => "Sydex TeleDisk"; - public Guid Id => new Guid("0240B7B1-E959-4CDC-B0BD-386D6E467B88"); - public string Author => "Natalia Portillo"; - public string Format => "Sydex TeleDisk"; - - public List Partitions => - throw new FeatureUnsupportedImageException("Feature not supported by image format"); - - public List Tracks => - throw new FeatureUnsupportedImageException("Feature not supported by image format"); - - public List Sessions => - throw new FeatureUnsupportedImageException("Feature not supported by image format"); - + public string Name => "Sydex TeleDisk"; + public Guid Id => new Guid("0240B7B1-E959-4CDC-B0BD-386D6E467B88"); + public string Author => "Natalia Portillo"; + public string Format => "Sydex TeleDisk"; public List DumpHardware => null; public CICMMetadataType CicmMetadata => null; } diff --git a/DiscImageChef.DiscImages/TeleDisk/Read.cs b/DiscImageChef.DiscImages/TeleDisk/Read.cs index e55299f20..7f5351831 100644 --- a/DiscImageChef.DiscImages/TeleDisk/Read.cs +++ b/DiscImageChef.DiscImages/TeleDisk/Read.cs @@ -525,8 +525,6 @@ namespace DiscImageChef.DiscImages public bool? VerifySector(ulong sectorAddress) => !sectorsWhereCrcHasFailed.Contains(sectorAddress); - public bool? VerifySector(ulong sectorAddress, uint track) => null; - public bool? VerifySectors(ulong sectorAddress, uint length, out List failingLbas, out List unknownLbas) { @@ -540,17 +538,6 @@ namespace DiscImageChef.DiscImages return failingLbas.Count <= 0; } - public bool? VerifySectors(ulong sectorAddress, uint length, uint track, out List failingLbas, - out List unknownLbas) - { - failingLbas = new List(); - unknownLbas = new List(); - - for(ulong i = sectorAddress; i < sectorAddress + length; i++) unknownLbas.Add(i); - - return null; - } - public bool? VerifyMediaImage() => aDiskCrcHasFailed; public byte[] ReadDiskTag(MediaTagType tag) diff --git a/DiscImageChef.DiscImages/TeleDisk/Unsupported.cs b/DiscImageChef.DiscImages/TeleDisk/Unsupported.cs index c23afdd78..b964fee71 100644 --- a/DiscImageChef.DiscImages/TeleDisk/Unsupported.cs +++ b/DiscImageChef.DiscImages/TeleDisk/Unsupported.cs @@ -30,10 +30,8 @@ // Copyright © 2011-2019 Natalia Portillo // ****************************************************************************/ -using System.Collections.Generic; using DiscImageChef.CommonTypes.Enums; using DiscImageChef.CommonTypes.Exceptions; -using DiscImageChef.CommonTypes.Structs; namespace DiscImageChef.DiscImages { @@ -44,29 +42,5 @@ namespace DiscImageChef.DiscImages public byte[] ReadSectorsTag(ulong sectorAddress, uint length, SectorTagType tag) => throw new FeatureUnsupportedImageException("Feature not supported by image format"); - - public List GetSessionTracks(Session session) => - throw new FeatureUnsupportedImageException("Feature not supported by image format"); - - public List GetSessionTracks(ushort session) => - throw new FeatureUnsupportedImageException("Feature not supported by image format"); - - public byte[] ReadSector(ulong sectorAddress, uint track) => - throw new FeatureUnsupportedImageException("Feature not supported by image format"); - - public byte[] ReadSectorTag(ulong sectorAddress, uint track, SectorTagType tag) => - throw new FeatureUnsupportedImageException("Feature not supported by image format"); - - public byte[] ReadSectors(ulong sectorAddress, uint length, uint track) => - throw new FeatureUnsupportedImageException("Feature not supported by image format"); - - public byte[] ReadSectorsTag(ulong sectorAddress, uint length, uint track, SectorTagType tag) => - throw new FeatureUnsupportedImageException("Feature not supported by image format"); - - public byte[] ReadSectorLong(ulong sectorAddress, uint track) => - throw new FeatureUnsupportedImageException("Feature not supported by image format"); - - public byte[] ReadSectorsLong(ulong sectorAddress, uint length, uint track) => - throw new FeatureUnsupportedImageException("Feature not supported by image format"); } } \ No newline at end of file diff --git a/DiscImageChef.DiscImages/UDIF/Properties.cs b/DiscImageChef.DiscImages/UDIF/Properties.cs index e4f4c39be..3528145bd 100644 --- a/DiscImageChef.DiscImages/UDIF/Properties.cs +++ b/DiscImageChef.DiscImages/UDIF/Properties.cs @@ -34,7 +34,6 @@ using System; using System.Collections.Generic; using DiscImageChef.CommonTypes; using DiscImageChef.CommonTypes.Enums; -using DiscImageChef.CommonTypes.Exceptions; using DiscImageChef.CommonTypes.Structs; using Schemas; @@ -44,20 +43,10 @@ namespace DiscImageChef.DiscImages { public ImageInfo Info => imageInfo; - public string Name => "Apple Universal Disk Image Format"; - public Guid Id => new Guid("5BEB9002-CF3D-429C-8E06-9A96F49203FF"); - public string Author => "Natalia Portillo"; - public string Format => "Apple Universal Disk Image Format"; - - public List Partitions => - throw new FeatureUnsupportedImageException("Feature not supported by image format"); - - public List Tracks => - throw new FeatureUnsupportedImageException("Feature not supported by image format"); - - public List Sessions => - throw new FeatureUnsupportedImageException("Feature not supported by image format"); - + public string Name => "Apple Universal Disk Image Format"; + public Guid Id => new Guid("5BEB9002-CF3D-429C-8E06-9A96F49203FF"); + public string Author => "Natalia Portillo"; + public string Format => "Apple Universal Disk Image Format"; public List DumpHardware => null; public CICMMetadataType CicmMetadata => null; public IEnumerable SupportedMediaTags => new MediaTagType[] { }; diff --git a/DiscImageChef.DiscImages/UDIF/Unsupported.cs b/DiscImageChef.DiscImages/UDIF/Unsupported.cs index bf33fc77c..397d9c727 100644 --- a/DiscImageChef.DiscImages/UDIF/Unsupported.cs +++ b/DiscImageChef.DiscImages/UDIF/Unsupported.cs @@ -33,7 +33,6 @@ using System.Collections.Generic; using DiscImageChef.CommonTypes.Enums; using DiscImageChef.CommonTypes.Exceptions; -using DiscImageChef.CommonTypes.Structs; namespace DiscImageChef.DiscImages { @@ -48,41 +47,14 @@ namespace DiscImageChef.DiscImages public byte[] ReadDiskTag(MediaTagType tag) => throw new FeatureUnsupportedImageException("Feature not supported by image format"); - public byte[] ReadSector(ulong sectorAddress, uint track) => - throw new FeatureUnsupportedImageException("Feature not supported by image format"); - - public byte[] ReadSectorTag(ulong sectorAddress, uint track, SectorTagType tag) => - throw new FeatureUnsupportedImageException("Feature not supported by image format"); - - public byte[] ReadSectors(ulong sectorAddress, uint length, uint track) => - throw new FeatureUnsupportedImageException("Feature not supported by image format"); - - public byte[] ReadSectorsTag(ulong sectorAddress, uint length, uint track, SectorTagType tag) => - throw new FeatureUnsupportedImageException("Feature not supported by image format"); - public byte[] ReadSectorLong(ulong sectorAddress) => throw new FeatureUnsupportedImageException("Feature not supported by image format"); - public byte[] ReadSectorLong(ulong sectorAddress, uint track) => - throw new FeatureUnsupportedImageException("Feature not supported by image format"); - public byte[] ReadSectorsLong(ulong sectorAddress, uint length) => throw new FeatureUnsupportedImageException("Feature not supported by image format"); - public byte[] ReadSectorsLong(ulong sectorAddress, uint length, uint track) => - throw new FeatureUnsupportedImageException("Feature not supported by image format"); - - public List GetSessionTracks(Session session) => - throw new FeatureUnsupportedImageException("Feature not supported by image format"); - - public List GetSessionTracks(ushort session) => - throw new FeatureUnsupportedImageException("Feature not supported by image format"); - public bool? VerifySector(ulong sectorAddress) => null; - public bool? VerifySector(ulong sectorAddress, uint track) => - throw new FeatureUnsupportedImageException("Feature not supported by image format"); - public bool? VerifySectors(ulong sectorAddress, uint length, out List failingLbas, out List unknownLbas) { @@ -93,10 +65,6 @@ namespace DiscImageChef.DiscImages return null; } - public bool? VerifySectors(ulong sectorAddress, uint length, uint track, out List failingLbas, - out List unknownLbas) => - throw new FeatureUnsupportedImageException("Feature not supported by image format"); - public bool? VerifyMediaImage() => null; } } \ No newline at end of file diff --git a/DiscImageChef.DiscImages/UDIF/Write.cs b/DiscImageChef.DiscImages/UDIF/Write.cs index e02146d4b..9e6899d51 100644 --- a/DiscImageChef.DiscImages/UDIF/Write.cs +++ b/DiscImageChef.DiscImages/UDIF/Write.cs @@ -209,12 +209,6 @@ namespace DiscImageChef.DiscImages return false; } - public bool SetTracks(List tracks) - { - ErrorMessage = "Unsupported feature"; - return false; - } - public bool Close() { if(!IsWriting) diff --git a/DiscImageChef.DiscImages/UkvFdi/Properties.cs b/DiscImageChef.DiscImages/UkvFdi/Properties.cs index 448439239..0204af46c 100644 --- a/DiscImageChef.DiscImages/UkvFdi/Properties.cs +++ b/DiscImageChef.DiscImages/UkvFdi/Properties.cs @@ -32,8 +32,6 @@ using System; using System.Collections.Generic; -using DiscImageChef.CommonTypes; -using DiscImageChef.CommonTypes.Exceptions; using DiscImageChef.CommonTypes.Structs; using Schemas; @@ -41,21 +39,11 @@ namespace DiscImageChef.DiscImages { public partial class UkvFdi { - public string Name => "Spectrum Floppy Disk Image"; - public Guid Id => new Guid("DADFC9B2-67C1-42A3-B124-825528163FC0"); - public string Format => "Spectrum floppy disk image"; - public string Author => "Natalia Portillo"; - - public List Partitions => - throw new FeatureUnsupportedImageException("Feature not supported by image format"); - - public List Tracks => - throw new FeatureUnsupportedImageException("Feature not supported by image format"); - public ImageInfo Info => imageInfo; - - public List Sessions => - throw new FeatureUnsupportedImageException("Feature not supported by image format"); - + public string Name => "Spectrum Floppy Disk Image"; + public Guid Id => new Guid("DADFC9B2-67C1-42A3-B124-825528163FC0"); + public string Format => "Spectrum floppy disk image"; + public string Author => "Natalia Portillo"; + public ImageInfo Info => imageInfo; public List DumpHardware => null; public CICMMetadataType CicmMetadata => null; } diff --git a/DiscImageChef.DiscImages/UkvFdi/Unsupported.cs b/DiscImageChef.DiscImages/UkvFdi/Unsupported.cs index ce993f6b4..072de8214 100644 --- a/DiscImageChef.DiscImages/UkvFdi/Unsupported.cs +++ b/DiscImageChef.DiscImages/UkvFdi/Unsupported.cs @@ -33,7 +33,6 @@ using System.Collections.Generic; using DiscImageChef.CommonTypes.Enums; using DiscImageChef.CommonTypes.Exceptions; -using DiscImageChef.CommonTypes.Structs; namespace DiscImageChef.DiscImages { @@ -45,44 +44,17 @@ namespace DiscImageChef.DiscImages public byte[] ReadSectorTag(ulong sectorAddress, SectorTagType tag) => throw new FeatureUnsupportedImageException("Feature not supported by image format"); - public byte[] ReadSector(ulong sectorAddress, uint track) => - throw new FeatureUnsupportedImageException("Feature not supported by image format"); - - public byte[] ReadSectorTag(ulong sectorAddress, uint track, SectorTagType tag) => - throw new FeatureUnsupportedImageException("Feature not supported by image format"); - public byte[] ReadSectorsTag(ulong sectorAddress, uint length, SectorTagType tag) => throw new FeatureUnsupportedImageException("Feature not supported by image format"); - public byte[] ReadSectors(ulong sectorAddress, uint length, uint track) => - throw new FeatureUnsupportedImageException("Feature not supported by image format"); - - public byte[] ReadSectorsTag(ulong sectorAddress, uint length, uint track, SectorTagType tag) => - throw new FeatureUnsupportedImageException("Feature not supported by image format"); - public byte[] ReadSectorLong(ulong sectorAddress) => throw new FeatureUnsupportedImageException("Feature not supported by image format"); - public byte[] ReadSectorLong(ulong sectorAddress, uint track) => - throw new FeatureUnsupportedImageException("Feature not supported by image format"); - public byte[] ReadSectorsLong(ulong sectorAddress, uint length) => throw new FeatureUnsupportedImageException("Feature not supported by image format"); - public byte[] ReadSectorsLong(ulong sectorAddress, uint length, uint track) => - throw new FeatureUnsupportedImageException("Feature not supported by image format"); - - public List GetSessionTracks(Session session) => - throw new FeatureUnsupportedImageException("Feature not supported by image format"); - - public List GetSessionTracks(ushort session) => - throw new FeatureUnsupportedImageException("Feature not supported by image format"); - public bool? VerifySector(ulong sectorAddress) => null; - public bool? VerifySector(ulong sectorAddress, uint track) => - throw new FeatureUnsupportedImageException("Feature not supported by image format"); - public bool? VerifySectors(ulong sectorAddress, uint length, out List failingLbas, out List unknownLbas) { @@ -93,10 +65,6 @@ namespace DiscImageChef.DiscImages return null; } - public bool? VerifySectors(ulong sectorAddress, uint length, uint track, out List failingLbas, - out List unknownLbas) => - throw new FeatureUnsupportedImageException("Feature not supported by image format"); - public bool? VerifyMediaImage() => null; } } \ No newline at end of file diff --git a/DiscImageChef.DiscImages/VDI/Properties.cs b/DiscImageChef.DiscImages/VDI/Properties.cs index a3a5ae63f..27cb2e37f 100644 --- a/DiscImageChef.DiscImages/VDI/Properties.cs +++ b/DiscImageChef.DiscImages/VDI/Properties.cs @@ -34,7 +34,6 @@ using System; using System.Collections.Generic; using DiscImageChef.CommonTypes; using DiscImageChef.CommonTypes.Enums; -using DiscImageChef.CommonTypes.Exceptions; using DiscImageChef.CommonTypes.Structs; using Schemas; @@ -44,20 +43,10 @@ namespace DiscImageChef.DiscImages { public ImageInfo Info => imageInfo; - public string Name => "VirtualBox Disk Image"; - public Guid Id => new Guid("E314DE35-C103-48A3-AD36-990F68523C46"); - public string Author => "Natalia Portillo"; - public string Format => "VDI"; - - public List Partitions => - throw new FeatureUnsupportedImageException("Feature not supported by image format"); - - public List Tracks => - throw new FeatureUnsupportedImageException("Feature not supported by image format"); - - public List Sessions => - throw new FeatureUnsupportedImageException("Feature not supported by image format"); - + public string Name => "VirtualBox Disk Image"; + public Guid Id => new Guid("E314DE35-C103-48A3-AD36-990F68523C46"); + public string Author => "Natalia Portillo"; + public string Format => "VDI"; public List DumpHardware => null; public CICMMetadataType CicmMetadata => null; public IEnumerable SupportedMediaTags => new MediaTagType[] { }; diff --git a/DiscImageChef.DiscImages/VDI/Unsupported.cs b/DiscImageChef.DiscImages/VDI/Unsupported.cs index 7d13ee68e..bf986e44c 100644 --- a/DiscImageChef.DiscImages/VDI/Unsupported.cs +++ b/DiscImageChef.DiscImages/VDI/Unsupported.cs @@ -33,7 +33,6 @@ using System.Collections.Generic; using DiscImageChef.CommonTypes.Enums; using DiscImageChef.CommonTypes.Exceptions; -using DiscImageChef.CommonTypes.Structs; namespace DiscImageChef.DiscImages { @@ -48,41 +47,14 @@ namespace DiscImageChef.DiscImages public byte[] ReadDiskTag(MediaTagType tag) => throw new FeatureUnsupportedImageException("Feature not supported by image format"); - public byte[] ReadSector(ulong sectorAddress, uint track) => - throw new FeatureUnsupportedImageException("Feature not supported by image format"); - - public byte[] ReadSectorTag(ulong sectorAddress, uint track, SectorTagType tag) => - throw new FeatureUnsupportedImageException("Feature not supported by image format"); - - public byte[] ReadSectors(ulong sectorAddress, uint length, uint track) => - throw new FeatureUnsupportedImageException("Feature not supported by image format"); - - public byte[] ReadSectorsTag(ulong sectorAddress, uint length, uint track, SectorTagType tag) => - throw new FeatureUnsupportedImageException("Feature not supported by image format"); - public byte[] ReadSectorLong(ulong sectorAddress) => throw new FeatureUnsupportedImageException("Feature not supported by image format"); - public byte[] ReadSectorLong(ulong sectorAddress, uint track) => - throw new FeatureUnsupportedImageException("Feature not supported by image format"); - public byte[] ReadSectorsLong(ulong sectorAddress, uint length) => throw new FeatureUnsupportedImageException("Feature not supported by image format"); - public byte[] ReadSectorsLong(ulong sectorAddress, uint length, uint track) => - throw new FeatureUnsupportedImageException("Feature not supported by image format"); - - public List GetSessionTracks(Session session) => - throw new FeatureUnsupportedImageException("Feature not supported by image format"); - - public List GetSessionTracks(ushort session) => - throw new FeatureUnsupportedImageException("Feature not supported by image format"); - public bool? VerifySector(ulong sectorAddress) => null; - public bool? VerifySector(ulong sectorAddress, uint track) => - throw new FeatureUnsupportedImageException("Feature not supported by image format"); - public bool? VerifySectors(ulong sectorAddress, uint length, out List failingLbas, out List unknownLbas) { @@ -93,10 +65,6 @@ namespace DiscImageChef.DiscImages return null; } - public bool? VerifySectors(ulong sectorAddress, uint length, uint track, out List failingLbas, - out List unknownLbas) => - throw new FeatureUnsupportedImageException("Feature not supported by image format"); - public bool? VerifyMediaImage() => null; } } \ No newline at end of file diff --git a/DiscImageChef.DiscImages/VDI/Write.cs b/DiscImageChef.DiscImages/VDI/Write.cs index 7d72edb68..6aad4efba 100644 --- a/DiscImageChef.DiscImages/VDI/Write.cs +++ b/DiscImageChef.DiscImages/VDI/Write.cs @@ -206,12 +206,6 @@ namespace DiscImageChef.DiscImages return false; } - public bool SetTracks(List tracks) - { - ErrorMessage = "Unsupported feature"; - return false; - } - public bool Close() { if(!IsWriting) diff --git a/DiscImageChef.DiscImages/VHD/Properties.cs b/DiscImageChef.DiscImages/VHD/Properties.cs index 882b2e0cd..b1c06a2d1 100644 --- a/DiscImageChef.DiscImages/VHD/Properties.cs +++ b/DiscImageChef.DiscImages/VHD/Properties.cs @@ -34,7 +34,6 @@ using System; using System.Collections.Generic; using DiscImageChef.CommonTypes; using DiscImageChef.CommonTypes.Enums; -using DiscImageChef.CommonTypes.Exceptions; using DiscImageChef.CommonTypes.Structs; using Schemas; @@ -47,7 +46,6 @@ namespace DiscImageChef.DiscImages public string Name => "VirtualPC"; public Guid Id => new Guid("8014d88f-64cd-4484-9441-7635c632958a"); public string Author => "Natalia Portillo"; - public string Format { get @@ -61,16 +59,6 @@ namespace DiscImageChef.DiscImages } } } - - public List Partitions => - throw new FeatureUnsupportedImageException("Feature not supported by image format"); - - public List Tracks => - throw new FeatureUnsupportedImageException("Feature not supported by image format"); - - public List Sessions => - throw new FeatureUnsupportedImageException("Feature not supported by image format"); - public List DumpHardware => null; public CICMMetadataType CicmMetadata => null; public IEnumerable SupportedMediaTags => new MediaTagType[] { }; diff --git a/DiscImageChef.DiscImages/VHD/Unsupported.cs b/DiscImageChef.DiscImages/VHD/Unsupported.cs index 06c59a33e..e8a63aeb6 100644 --- a/DiscImageChef.DiscImages/VHD/Unsupported.cs +++ b/DiscImageChef.DiscImages/VHD/Unsupported.cs @@ -33,7 +33,6 @@ using System.Collections.Generic; using DiscImageChef.CommonTypes.Enums; using DiscImageChef.CommonTypes.Exceptions; -using DiscImageChef.CommonTypes.Structs; namespace DiscImageChef.DiscImages { @@ -45,44 +44,17 @@ namespace DiscImageChef.DiscImages public byte[] ReadSectorTag(ulong sectorAddress, SectorTagType tag) => throw new FeatureUnsupportedImageException("Feature not supported by image format"); - public byte[] ReadSector(ulong sectorAddress, uint track) => - throw new FeatureUnsupportedImageException("Feature not supported by image format"); - - public byte[] ReadSectorTag(ulong sectorAddress, uint track, SectorTagType tag) => - throw new FeatureUnsupportedImageException("Feature not supported by image format"); - public byte[] ReadSectorsTag(ulong sectorAddress, uint length, SectorTagType tag) => throw new FeatureUnsupportedImageException("Feature not supported by image format"); - public byte[] ReadSectors(ulong sectorAddress, uint length, uint track) => - throw new FeatureUnsupportedImageException("Feature not supported by image format"); - - public byte[] ReadSectorsTag(ulong sectorAddress, uint length, uint track, SectorTagType tag) => - throw new FeatureUnsupportedImageException("Feature not supported by image format"); - public byte[] ReadSectorLong(ulong sectorAddress) => throw new FeatureUnsupportedImageException("Feature not supported by image format"); - public byte[] ReadSectorLong(ulong sectorAddress, uint track) => - throw new FeatureUnsupportedImageException("Feature not supported by image format"); - public byte[] ReadSectorsLong(ulong sectorAddress, uint length) => throw new FeatureUnsupportedImageException("Feature not supported by image format"); - public byte[] ReadSectorsLong(ulong sectorAddress, uint length, uint track) => - throw new FeatureUnsupportedImageException("Feature not supported by image format"); - - public List GetSessionTracks(Session session) => - throw new FeatureUnsupportedImageException("Feature not supported by image format"); - - public List GetSessionTracks(ushort session) => - throw new FeatureUnsupportedImageException("Feature not supported by image format"); - public bool? VerifySector(ulong sectorAddress) => null; - public bool? VerifySector(ulong sectorAddress, uint track) => - throw new FeatureUnsupportedImageException("Feature not supported by image format"); - public bool? VerifySectors(ulong sectorAddress, uint length, out List failingLbas, out List unknownLbas) { @@ -93,10 +65,6 @@ namespace DiscImageChef.DiscImages return null; } - public bool? VerifySectors(ulong sectorAddress, uint length, uint track, out List failingLbas, - out List unknownLbas) => - throw new FeatureUnsupportedImageException("Feature not supported by image format"); - public bool? VerifyMediaImage() => null; } } \ No newline at end of file diff --git a/DiscImageChef.DiscImages/VHD/Write.cs b/DiscImageChef.DiscImages/VHD/Write.cs index 8793d9bc5..fde715714 100644 --- a/DiscImageChef.DiscImages/VHD/Write.cs +++ b/DiscImageChef.DiscImages/VHD/Write.cs @@ -148,12 +148,6 @@ namespace DiscImageChef.DiscImages return false; } - public bool SetTracks(List tracks) - { - ErrorMessage = "Unsupported feature"; - return false; - } - public bool Close() { if(!IsWriting) diff --git a/DiscImageChef.DiscImages/VHDX/Properties.cs b/DiscImageChef.DiscImages/VHDX/Properties.cs index 561f8a846..3a777510b 100644 --- a/DiscImageChef.DiscImages/VHDX/Properties.cs +++ b/DiscImageChef.DiscImages/VHDX/Properties.cs @@ -32,8 +32,6 @@ using System; using System.Collections.Generic; -using DiscImageChef.CommonTypes; -using DiscImageChef.CommonTypes.Exceptions; using DiscImageChef.CommonTypes.Structs; using Schemas; @@ -43,20 +41,10 @@ namespace DiscImageChef.DiscImages { public ImageInfo Info => imageInfo; - public string Name => "Microsoft VHDX"; - public Guid Id => new Guid("536B141B-D09C-4799-AB70-34631286EB9D"); - public string Author => "Natalia Portillo"; - public string Format => "VHDX"; - - public List Partitions => - throw new FeatureUnsupportedImageException("Feature not supported by image format"); - - public List Tracks => - throw new FeatureUnsupportedImageException("Feature not supported by image format"); - - public List Sessions => - throw new FeatureUnsupportedImageException("Feature not supported by image format"); - + public string Name => "Microsoft VHDX"; + public Guid Id => new Guid("536B141B-D09C-4799-AB70-34631286EB9D"); + public string Author => "Natalia Portillo"; + public string Format => "VHDX"; public List DumpHardware => null; public CICMMetadataType CicmMetadata => null; } diff --git a/DiscImageChef.DiscImages/VHDX/Unsupported.cs b/DiscImageChef.DiscImages/VHDX/Unsupported.cs index eb130294b..d1aea5311 100644 --- a/DiscImageChef.DiscImages/VHDX/Unsupported.cs +++ b/DiscImageChef.DiscImages/VHDX/Unsupported.cs @@ -33,7 +33,6 @@ using System.Collections.Generic; using DiscImageChef.CommonTypes.Enums; using DiscImageChef.CommonTypes.Exceptions; -using DiscImageChef.CommonTypes.Structs; namespace DiscImageChef.DiscImages { @@ -45,44 +44,17 @@ namespace DiscImageChef.DiscImages public byte[] ReadSectorTag(ulong sectorAddress, SectorTagType tag) => throw new FeatureUnsupportedImageException("Feature not supported by image format"); - public byte[] ReadSector(ulong sectorAddress, uint track) => - throw new FeatureUnsupportedImageException("Feature not supported by image format"); - - public byte[] ReadSectorTag(ulong sectorAddress, uint track, SectorTagType tag) => - throw new FeatureUnsupportedImageException("Feature not supported by image format"); - public byte[] ReadSectorsTag(ulong sectorAddress, uint length, SectorTagType tag) => throw new FeatureUnsupportedImageException("Feature not supported by image format"); - public byte[] ReadSectors(ulong sectorAddress, uint length, uint track) => - throw new FeatureUnsupportedImageException("Feature not supported by image format"); - - public byte[] ReadSectorsTag(ulong sectorAddress, uint length, uint track, SectorTagType tag) => - throw new FeatureUnsupportedImageException("Feature not supported by image format"); - public byte[] ReadSectorLong(ulong sectorAddress) => throw new FeatureUnsupportedImageException("Feature not supported by image format"); - public byte[] ReadSectorLong(ulong sectorAddress, uint track) => - throw new FeatureUnsupportedImageException("Feature not supported by image format"); - public byte[] ReadSectorsLong(ulong sectorAddress, uint length) => throw new FeatureUnsupportedImageException("Feature not supported by image format"); - public byte[] ReadSectorsLong(ulong sectorAddress, uint length, uint track) => - throw new FeatureUnsupportedImageException("Feature not supported by image format"); - - public List GetSessionTracks(Session session) => - throw new FeatureUnsupportedImageException("Feature not supported by image format"); - - public List GetSessionTracks(ushort session) => - throw new FeatureUnsupportedImageException("Feature not supported by image format"); - public bool? VerifySector(ulong sectorAddress) => null; - public bool? VerifySector(ulong sectorAddress, uint track) => - throw new FeatureUnsupportedImageException("Feature not supported by image format"); - public bool? VerifySectors(ulong sectorAddress, uint length, out List failingLbas, out List unknownLbas) { @@ -93,10 +65,6 @@ namespace DiscImageChef.DiscImages return null; } - public bool? VerifySectors(ulong sectorAddress, uint length, uint track, out List failingLbas, - out List unknownLbas) => - throw new FeatureUnsupportedImageException("Feature not supported by image format"); - public bool? VerifyMediaImage() => null; } } \ No newline at end of file diff --git a/DiscImageChef.DiscImages/VMware/Properties.cs b/DiscImageChef.DiscImages/VMware/Properties.cs index 91b425796..b7f33c65f 100644 --- a/DiscImageChef.DiscImages/VMware/Properties.cs +++ b/DiscImageChef.DiscImages/VMware/Properties.cs @@ -34,7 +34,6 @@ using System; using System.Collections.Generic; using DiscImageChef.CommonTypes; using DiscImageChef.CommonTypes.Enums; -using DiscImageChef.CommonTypes.Exceptions; using DiscImageChef.CommonTypes.Structs; using Schemas; @@ -44,20 +43,10 @@ namespace DiscImageChef.DiscImages { public ImageInfo Info => imageInfo; - public string Name => "VMware disk image"; - public Guid Id => new Guid("E314DE35-C103-48A3-AD36-990F68523C46"); - public string Author => "Natalia Portillo"; - public string Format => "VMware"; - - public List Partitions => - throw new FeatureUnsupportedImageException("Feature not supported by image format"); - - public List Tracks => - throw new FeatureUnsupportedImageException("Feature not supported by image format"); - - public List Sessions => - throw new FeatureUnsupportedImageException("Feature not supported by image format"); - + public string Name => "VMware disk image"; + public Guid Id => new Guid("E314DE35-C103-48A3-AD36-990F68523C46"); + public string Author => "Natalia Portillo"; + public string Format => "VMware"; public List DumpHardware => null; public CICMMetadataType CicmMetadata => null; public IEnumerable SupportedMediaTags => new MediaTagType[] { }; @@ -73,7 +62,7 @@ namespace DiscImageChef.DiscImages new[] { ("adapter_type", typeof(string), - "Type of adapter type. Possible values: ide, lsilogic, buslogic, legacyESX.", "ide"), + "Type of adapter type. Possible values: ide, lsilogic, buslogic, legacyESX.", "ide"), ("hwversion", typeof(uint), "VDMK hardware version.", 4), ("sparse", typeof(bool), "Use sparse extents.", (object)false), ("split", typeof(bool), "Split data file at 2GiB.", (object)false) diff --git a/DiscImageChef.DiscImages/VMware/Unsupported.cs b/DiscImageChef.DiscImages/VMware/Unsupported.cs index 03161a336..0ba52fed0 100644 --- a/DiscImageChef.DiscImages/VMware/Unsupported.cs +++ b/DiscImageChef.DiscImages/VMware/Unsupported.cs @@ -33,7 +33,6 @@ using System.Collections.Generic; using DiscImageChef.CommonTypes.Enums; using DiscImageChef.CommonTypes.Exceptions; -using DiscImageChef.CommonTypes.Structs; namespace DiscImageChef.DiscImages { @@ -48,41 +47,14 @@ namespace DiscImageChef.DiscImages public byte[] ReadDiskTag(MediaTagType tag) => throw new FeatureUnsupportedImageException("Feature not supported by image format"); - public byte[] ReadSector(ulong sectorAddress, uint track) => - throw new FeatureUnsupportedImageException("Feature not supported by image format"); - - public byte[] ReadSectorTag(ulong sectorAddress, uint track, SectorTagType tag) => - throw new FeatureUnsupportedImageException("Feature not supported by image format"); - - public byte[] ReadSectors(ulong sectorAddress, uint length, uint track) => - throw new FeatureUnsupportedImageException("Feature not supported by image format"); - - public byte[] ReadSectorsTag(ulong sectorAddress, uint length, uint track, SectorTagType tag) => - throw new FeatureUnsupportedImageException("Feature not supported by image format"); - public byte[] ReadSectorLong(ulong sectorAddress) => throw new FeatureUnsupportedImageException("Feature not supported by image format"); - public byte[] ReadSectorLong(ulong sectorAddress, uint track) => - throw new FeatureUnsupportedImageException("Feature not supported by image format"); - public byte[] ReadSectorsLong(ulong sectorAddress, uint length) => throw new FeatureUnsupportedImageException("Feature not supported by image format"); - public byte[] ReadSectorsLong(ulong sectorAddress, uint length, uint track) => - throw new FeatureUnsupportedImageException("Feature not supported by image format"); - - public List GetSessionTracks(Session session) => - throw new FeatureUnsupportedImageException("Feature not supported by image format"); - - public List GetSessionTracks(ushort session) => - throw new FeatureUnsupportedImageException("Feature not supported by image format"); - public bool? VerifySector(ulong sectorAddress) => null; - public bool? VerifySector(ulong sectorAddress, uint track) => - throw new FeatureUnsupportedImageException("Feature not supported by image format"); - public bool? VerifySectors(ulong sectorAddress, uint length, out List failingLbas, out List unknownLbas) { @@ -93,10 +65,6 @@ namespace DiscImageChef.DiscImages return null; } - public bool? VerifySectors(ulong sectorAddress, uint length, uint track, out List failingLbas, - out List unknownLbas) => - throw new FeatureUnsupportedImageException("Feature not supported by image format"); - public bool? VerifyMediaImage() => null; } } \ No newline at end of file diff --git a/DiscImageChef.DiscImages/VMware/Write.cs b/DiscImageChef.DiscImages/VMware/Write.cs index 3609194d3..9e22fb32c 100644 --- a/DiscImageChef.DiscImages/VMware/Write.cs +++ b/DiscImageChef.DiscImages/VMware/Write.cs @@ -218,12 +218,6 @@ namespace DiscImageChef.DiscImages return false; } - public bool SetTracks(List tracks) - { - ErrorMessage = "Unsupported feature"; - return false; - } - // TODO: Implement sparse and split public bool Close() { diff --git a/DiscImageChef.DiscImages/Virtual98/Properties.cs b/DiscImageChef.DiscImages/Virtual98/Properties.cs index 1cf936885..5636cbab2 100644 --- a/DiscImageChef.DiscImages/Virtual98/Properties.cs +++ b/DiscImageChef.DiscImages/Virtual98/Properties.cs @@ -34,7 +34,6 @@ using System; using System.Collections.Generic; using DiscImageChef.CommonTypes; using DiscImageChef.CommonTypes.Enums; -using DiscImageChef.CommonTypes.Exceptions; using DiscImageChef.CommonTypes.Structs; using Schemas; @@ -42,20 +41,11 @@ namespace DiscImageChef.DiscImages { public partial class Virtual98 { - public ImageInfo Info => imageInfo; - public string Name => "Virtual98 Disk Image"; - public Guid Id => new Guid("C0CDE13D-04D0-4913-8740-AFAA44D0A107"); - public string Author => "Natalia Portillo"; - public string Format => "Virtual98 disk image"; - - public List Partitions => - throw new FeatureUnsupportedImageException("Feature not supported by image format"); - - public List Tracks => - throw new FeatureUnsupportedImageException("Feature not supported by image format"); - - public List Sessions => - throw new FeatureUnsupportedImageException("Feature not supported by image format"); + public ImageInfo Info => imageInfo; + public string Name => "Virtual98 Disk Image"; + public Guid Id => new Guid("C0CDE13D-04D0-4913-8740-AFAA44D0A107"); + public string Author => "Natalia Portillo"; + public string Format => "Virtual98 disk image"; public List DumpHardware => null; public CICMMetadataType CicmMetadata => null; public IEnumerable SupportedMediaTags => new MediaTagType[] { }; diff --git a/DiscImageChef.DiscImages/Virtual98/Unsupported.cs b/DiscImageChef.DiscImages/Virtual98/Unsupported.cs index 92bb20798..3c43a48bb 100644 --- a/DiscImageChef.DiscImages/Virtual98/Unsupported.cs +++ b/DiscImageChef.DiscImages/Virtual98/Unsupported.cs @@ -33,7 +33,6 @@ using System.Collections.Generic; using DiscImageChef.CommonTypes.Enums; using DiscImageChef.CommonTypes.Exceptions; -using DiscImageChef.CommonTypes.Structs; namespace DiscImageChef.DiscImages { @@ -45,44 +44,17 @@ namespace DiscImageChef.DiscImages public byte[] ReadSectorTag(ulong sectorAddress, SectorTagType tag) => throw new FeatureUnsupportedImageException("Feature not supported by image format"); - public byte[] ReadSector(ulong sectorAddress, uint track) => - throw new FeatureUnsupportedImageException("Feature not supported by image format"); - - public byte[] ReadSectorTag(ulong sectorAddress, uint track, SectorTagType tag) => - throw new FeatureUnsupportedImageException("Feature not supported by image format"); - public byte[] ReadSectorsTag(ulong sectorAddress, uint length, SectorTagType tag) => throw new FeatureUnsupportedImageException("Feature not supported by image format"); - public byte[] ReadSectors(ulong sectorAddress, uint length, uint track) => - throw new FeatureUnsupportedImageException("Feature not supported by image format"); - - public byte[] ReadSectorsTag(ulong sectorAddress, uint length, uint track, SectorTagType tag) => - throw new FeatureUnsupportedImageException("Feature not supported by image format"); - public byte[] ReadSectorLong(ulong sectorAddress) => throw new FeatureUnsupportedImageException("Feature not supported by image format"); - public byte[] ReadSectorLong(ulong sectorAddress, uint track) => - throw new FeatureUnsupportedImageException("Feature not supported by image format"); - public byte[] ReadSectorsLong(ulong sectorAddress, uint length) => throw new FeatureUnsupportedImageException("Feature not supported by image format"); - public byte[] ReadSectorsLong(ulong sectorAddress, uint length, uint track) => - throw new FeatureUnsupportedImageException("Feature not supported by image format"); - - public List GetSessionTracks(Session session) => - throw new FeatureUnsupportedImageException("Feature not supported by image format"); - - public List GetSessionTracks(ushort session) => - throw new FeatureUnsupportedImageException("Feature not supported by image format"); - public bool? VerifySector(ulong sectorAddress) => null; - public bool? VerifySector(ulong sectorAddress, uint track) => - throw new FeatureUnsupportedImageException("Feature not supported by image format"); - public bool? VerifySectors(ulong sectorAddress, uint length, out List failingLbas, out List unknownLbas) { @@ -93,10 +65,6 @@ namespace DiscImageChef.DiscImages return null; } - public bool? VerifySectors(ulong sectorAddress, uint length, uint track, out List failingLbas, - out List unknownLbas) => - throw new FeatureUnsupportedImageException("Feature not supported by image format"); - public bool? VerifyMediaImage() => null; } } \ No newline at end of file diff --git a/DiscImageChef.DiscImages/Virtual98/Write.cs b/DiscImageChef.DiscImages/Virtual98/Write.cs index f07957c40..3b1c5daf9 100644 --- a/DiscImageChef.DiscImages/Virtual98/Write.cs +++ b/DiscImageChef.DiscImages/Virtual98/Write.cs @@ -152,12 +152,6 @@ namespace DiscImageChef.DiscImages return false; } - public bool SetTracks(List tracks) - { - ErrorMessage = "Unsupported feature"; - return false; - } - public bool Close() { if(!IsWriting) diff --git a/DiscImageChef.DiscImages/WCDiskImage/Properties.cs b/DiscImageChef.DiscImages/WCDiskImage/Properties.cs index a6bc45c83..ff260c679 100644 --- a/DiscImageChef.DiscImages/WCDiskImage/Properties.cs +++ b/DiscImageChef.DiscImages/WCDiskImage/Properties.cs @@ -33,8 +33,6 @@ using System; using System.Collections.Generic; -using DiscImageChef.CommonTypes; -using DiscImageChef.CommonTypes.Exceptions; using DiscImageChef.CommonTypes.Structs; using Schemas; @@ -44,19 +42,10 @@ namespace DiscImageChef.DiscImages { public ImageInfo Info => imageInfo; - public string Name => "d2f disk image"; - public Guid Id => new Guid("DDE01493-BCA2-41C2-A269-7E56D3716D2F"); - public string Author => "Michael Drüing"; - public string Format => "d2f disk image"; - public List Partitions => - throw new FeatureUnsupportedImageException("Feature not supported by image format"); - - public List Tracks => - throw new FeatureUnsupportedImageException("Feature not supported by image format"); - - public List Sessions => - throw new FeatureUnsupportedImageException("Feature not supported by image format"); - + public string Name => "d2f disk image"; + public Guid Id => new Guid("DDE01493-BCA2-41C2-A269-7E56D3716D2F"); + public string Author => "Michael Drüing"; + public string Format => "d2f disk image"; public List DumpHardware => null; public CICMMetadataType CicmMetadata => null; } diff --git a/DiscImageChef.DiscImages/WCDiskImage/Unsupported.cs b/DiscImageChef.DiscImages/WCDiskImage/Unsupported.cs index 3ed222fa7..5b2b43748 100644 --- a/DiscImageChef.DiscImages/WCDiskImage/Unsupported.cs +++ b/DiscImageChef.DiscImages/WCDiskImage/Unsupported.cs @@ -33,7 +33,6 @@ using System.Collections.Generic; using DiscImageChef.CommonTypes.Enums; using DiscImageChef.CommonTypes.Exceptions; -using DiscImageChef.CommonTypes.Structs; namespace DiscImageChef.DiscImages { @@ -45,44 +44,17 @@ namespace DiscImageChef.DiscImages public byte[] ReadSectorTag(ulong sectorAddress, SectorTagType tag) => throw new FeatureUnsupportedImageException("Feature not supported by image format"); - public byte[] ReadSector(ulong sectorAddress, uint track) => - throw new FeatureUnsupportedImageException("Feature not supported by image format"); - - public byte[] ReadSectorTag(ulong sectorAddress, uint track, SectorTagType tag) => - throw new FeatureUnsupportedImageException("Feature not supported by image format"); - public byte[] ReadSectorsTag(ulong sectorAddress, uint length, SectorTagType tag) => throw new FeatureUnsupportedImageException("Feature not supported by image format"); - public byte[] ReadSectors(ulong sectorAddress, uint length, uint track) => - throw new FeatureUnsupportedImageException("Feature not supported by image format"); - - public byte[] ReadSectorsTag(ulong sectorAddress, uint length, uint track, SectorTagType tag) => - throw new FeatureUnsupportedImageException("Feature not supported by image format"); - public byte[] ReadSectorLong(ulong sectorAddress) => throw new FeatureUnsupportedImageException("Feature not supported by image format"); - public byte[] ReadSectorLong(ulong sectorAddress, uint track) => - throw new FeatureUnsupportedImageException("Feature not supported by image format"); - public byte[] ReadSectorsLong(ulong sectorAddress, uint length) => throw new FeatureUnsupportedImageException("Feature not supported by image format"); - public byte[] ReadSectorsLong(ulong sectorAddress, uint length, uint track) => - throw new FeatureUnsupportedImageException("Feature not supported by image format"); - - public List GetSessionTracks(Session session) => - throw new FeatureUnsupportedImageException("Feature not supported by image format"); - - public List GetSessionTracks(ushort session) => - throw new FeatureUnsupportedImageException("Feature not supported by image format"); - public bool? VerifySector(ulong sectorAddress) => null; - public bool? VerifySector(ulong sectorAddress, uint track) => - throw new FeatureUnsupportedImageException("Feature not supported by image format"); - public bool? VerifySectors(ulong sectorAddress, uint length, out List failingLbas, out List unknownLbas) { @@ -93,10 +65,6 @@ namespace DiscImageChef.DiscImages return null; } - public bool? VerifySectors(ulong sectorAddress, uint length, uint track, out List failingLbas, - out List unknownLbas) => - throw new FeatureUnsupportedImageException("Feature not supported by image format"); - public bool? VerifyMediaImage() => null; } } \ No newline at end of file diff --git a/DiscImageChef.DiscImages/ZZZRawImage/ZZZRawImage.cs b/DiscImageChef.DiscImages/ZZZRawImage/ZZZRawImage.cs index 73a73f6f1..10c750c21 100644 --- a/DiscImageChef.DiscImages/ZZZRawImage/ZZZRawImage.cs +++ b/DiscImageChef.DiscImages/ZZZRawImage/ZZZRawImage.cs @@ -38,7 +38,7 @@ using DiscImageChef.CommonTypes.Structs; namespace DiscImageChef.DiscImages { - public partial class ZZZRawImage : IWritableImage + public partial class ZZZRawImage : IWritableOpticalImage { string basepath; bool differentTrackZeroSize; diff --git a/DiscImageChef.Gui/Forms/frmImageChecksum.xeto.cs b/DiscImageChef.Gui/Forms/frmImageChecksum.xeto.cs index 12a3286b4..1c9830b44 100644 --- a/DiscImageChef.Gui/Forms/frmImageChecksum.xeto.cs +++ b/DiscImageChef.Gui/Forms/frmImageChecksum.xeto.cs @@ -54,7 +54,7 @@ namespace DiscImageChef.Gui.Forms this.inputFormat = inputFormat; XamlReader.Load(this); cancel = false; - try { chkChecksumTracks.Visible = inputFormat.Tracks?.Count > 0; } + try { chkChecksumTracks.Visible = (inputFormat as IOpticalMediaImage)?.Tracks?.Count > 0; } catch { chkChecksumTracks.Visible = false; } chkChecksumTracks.Checked = chkChecksumTracks.Visible; @@ -92,10 +92,12 @@ namespace DiscImageChef.Gui.Forms void DoWork() { - bool formatHasTracks; + IOpticalMediaImage opticalMediaImage = inputFormat as IOpticalMediaImage; + bool formatHasTracks = false; - try { formatHasTracks = inputFormat.Tracks?.Count > 0; } - catch { formatHasTracks = false; } + if(opticalMediaImage != null) + try { formatHasTracks = opticalMediaImage.Tracks?.Count > 0; } + catch { formatHasTracks = false; } // Setup progress bars Application.Instance.Invoke(() => @@ -104,8 +106,8 @@ namespace DiscImageChef.Gui.Forms prgProgress.MaxValue = 1; prgProgress2.MaxValue = (int)(inputFormat.Info.Sectors / SECTORS_TO_READ); - if(formatHasTracks && chkChecksumTracks.Checked == true) - prgProgress.MaxValue += inputFormat.Tracks.Count; + if(formatHasTracks && chkChecksumTracks.Checked == true && opticalMediaImage != null) + prgProgress.MaxValue += opticalMediaImage.Tracks.Count; else { prgProgress.MaxValue = 2; @@ -137,7 +139,7 @@ namespace DiscImageChef.Gui.Forms TreeGridItemCollection trackHashes = new TreeGridItemCollection(); TreeGridItemCollection mediaHashes = new TreeGridItemCollection(); - if(formatHasTracks) + if(opticalMediaImage != null) try { Checksum trackChecksum = null; @@ -146,12 +148,12 @@ namespace DiscImageChef.Gui.Forms ulong previousTrackEnd = 0; - foreach(Track currentTrack in inputFormat.Tracks) + foreach(Track currentTrack in opticalMediaImage.Tracks) { Application.Instance.Invoke(() => { lblProgress.Text = - $"Hashing track {currentTrack.TrackSequence} of {inputFormat.Tracks.Count}"; + $"Hashing track {currentTrack.TrackSequence} of {opticalMediaImage.Tracks.Count}"; prgProgress.Value++; }); @@ -165,7 +167,7 @@ namespace DiscImageChef.Gui.Forms lblProgress2.Text = $"Hashing track-less sector {sector}"; }); - byte[] hiddenSector = inputFormat.ReadSector(i); + byte[] hiddenSector = opticalMediaImage.ReadSector(i); mediaChecksum?.Update(hiddenSector); } @@ -197,8 +199,8 @@ namespace DiscImageChef.Gui.Forms if(sectors - doneSectors >= SECTORS_TO_READ) { - sector = inputFormat.ReadSectors(doneSectors, SECTORS_TO_READ, - currentTrack.TrackSequence); + sector = opticalMediaImage.ReadSectors(doneSectors, SECTORS_TO_READ, + currentTrack.TrackSequence); ulong doneSectorsToInvoke = doneSectors; Application.Instance.Invoke(() => @@ -212,8 +214,8 @@ namespace DiscImageChef.Gui.Forms } else { - sector = inputFormat.ReadSectors(doneSectors, (uint)(sectors - doneSectors), - currentTrack.TrackSequence); + sector = opticalMediaImage.ReadSectors(doneSectors, (uint)(sectors - doneSectors), + currentTrack.TrackSequence); ulong doneSectorsToInvoke = doneSectors; Application.Instance.Invoke(() => @@ -245,8 +247,8 @@ namespace DiscImageChef.Gui.Forms previousTrackEnd = currentTrack.TrackEndSector; } - if(inputFormat.Info.Sectors - previousTrackEnd != 0 && chkChecksumMedia.Checked == true) - for(ulong i = previousTrackEnd + 1; i < inputFormat.Info.Sectors; i++) + if(opticalMediaImage.Info.Sectors - previousTrackEnd != 0 && chkChecksumMedia.Checked == true) + for(ulong i = previousTrackEnd + 1; i < opticalMediaImage.Info.Sectors; i++) { ulong sector = i; Application.Instance.Invoke(() => @@ -255,7 +257,7 @@ namespace DiscImageChef.Gui.Forms lblProgress2.Text = $"Hashing track-less sector {sector}"; }); - byte[] hiddenSector = inputFormat.ReadSector(i); + byte[] hiddenSector = opticalMediaImage.ReadSector(i); mediaChecksum?.Update(hiddenSector); } diff --git a/DiscImageChef.Gui/Forms/frmImageConvert.xeto.cs b/DiscImageChef.Gui/Forms/frmImageConvert.xeto.cs index 86d54edff..0a8f9798a 100644 --- a/DiscImageChef.Gui/Forms/frmImageConvert.xeto.cs +++ b/DiscImageChef.Gui/Forms/frmImageConvert.xeto.cs @@ -124,9 +124,12 @@ namespace DiscImageChef.Gui.Forms return; } + IOpticalMediaImage inputOptical = inputFormat as IOpticalMediaImage; + IWritableOpticalImage outputOptical = outputFormat as IWritableOpticalImage; + List tracks; - try { tracks = inputFormat.Tracks; } + try { tracks = inputOptical?.Tracks; } catch(Exception) { tracks = null; } // Prepare UI @@ -338,7 +341,7 @@ namespace DiscImageChef.Gui.Forms DicConsole.ErrorWriteLine("continuing..."); } - if(tracks != null && !cancel) + if(tracks != null && !cancel && outputOptical != null) { Application.Instance.Invoke(() => { @@ -348,7 +351,7 @@ namespace DiscImageChef.Gui.Forms prgProgress2.Indeterminate = true; }); - if(!outputFormat.SetTracks(tracks)) + if(!outputOptical.SetTracks(tracks)) { Application.Instance.Invoke(() => { diff --git a/DiscImageChef.Gui/Forms/frmImageEntropy.xeto.cs b/DiscImageChef.Gui/Forms/frmImageEntropy.xeto.cs index 15306298f..6d8e4c6c9 100644 --- a/DiscImageChef.Gui/Forms/frmImageEntropy.xeto.cs +++ b/DiscImageChef.Gui/Forms/frmImageEntropy.xeto.cs @@ -51,7 +51,9 @@ namespace DiscImageChef.Gui.Forms this.inputFormat = inputFormat; XamlReader.Load(this); - if(inputFormat.Tracks != null && inputFormat.Tracks.Count > 0) + IOpticalMediaImage inputOptical = inputFormat as IOpticalMediaImage; + + if(inputOptical?.Tracks != null && inputOptical?.Tracks.Count > 0) { chkSeparatedTracks.Visible = true; chkWholeDisc.Visible = true; diff --git a/DiscImageChef.Gui/Forms/frmImageVerify.xeto.cs b/DiscImageChef.Gui/Forms/frmImageVerify.xeto.cs index d66bd814d..f63d8c122 100644 --- a/DiscImageChef.Gui/Forms/frmImageVerify.xeto.cs +++ b/DiscImageChef.Gui/Forms/frmImageVerify.xeto.cs @@ -76,7 +76,9 @@ namespace DiscImageChef.Gui.Forms long unknownSectors = 0; bool formatHasTracks; - try { formatHasTracks = inputFormat.Tracks?.Count > 0; } + IOpticalMediaImage inputOptical = inputFormat as IOpticalMediaImage; + + try { formatHasTracks = inputOptical?.Tracks?.Count > 0; } catch { formatHasTracks = false; } // Setup progress bars @@ -87,7 +89,7 @@ namespace DiscImageChef.Gui.Forms if(chkVerifyImage.Checked == true || chkVerifySectors.Checked == true) prgProgress.MaxValue = 1; - if(formatHasTracks) prgProgress.MaxValue += inputFormat.Tracks.Count; + if(formatHasTracks && inputOptical != null) prgProgress.MaxValue += inputOptical.Tracks.Count; else { if(chkVerifySectors.Checked == true) @@ -161,16 +163,16 @@ namespace DiscImageChef.Gui.Forms if(formatHasTracks) { - List inputTracks = inputFormat.Tracks; + List inputTracks = inputOptical.Tracks; ulong currentSectorAll = 0; startCheck = DateTime.UtcNow; - foreach(Track currentTrack in inputFormat.Tracks) + foreach(Track currentTrack in inputOptical.Tracks) { Application.Instance.Invoke(() => { lblProgress.Text = - $"Verifying track {currentTrack.TrackSequence} of {inputFormat.Tracks.Count}"; + $"Verifying track {currentTrack.TrackSequence} of {inputOptical?.Tracks.Count}"; prgProgress.Value++; }); @@ -202,12 +204,12 @@ namespace DiscImageChef.Gui.Forms List tempunknownLbas; if(remainingSectors < 512) - inputFormat.VerifySectors(currentSector, (uint)remainingSectors, - currentTrack.TrackSequence, out tempfailingLbas, - out tempunknownLbas); + inputOptical.VerifySectors(currentSector, (uint)remainingSectors, + currentTrack.TrackSequence, out tempfailingLbas, + out tempunknownLbas); else - inputFormat.VerifySectors(currentSector, 512, currentTrack.TrackSequence, - out tempfailingLbas, out tempunknownLbas); + inputOptical.VerifySectors(currentSector, 512, currentTrack.TrackSequence, + out tempfailingLbas, out tempunknownLbas); failingLbas.AddRange(tempfailingLbas); diff --git a/DiscImageChef.Gui/Panels/pnlImageInfo.xeto.cs b/DiscImageChef.Gui/Panels/pnlImageInfo.xeto.cs index 9e8a83b75..cad333f23 100644 --- a/DiscImageChef.Gui/Panels/pnlImageInfo.xeto.cs +++ b/DiscImageChef.Gui/Panels/pnlImageInfo.xeto.cs @@ -682,79 +682,92 @@ namespace DiscImageChef.Gui.Panels tabSdMmcInfo.LoadData(deviceType, cid, csd, ocr, extendedCsd, scr); tabInfos.Pages.Add(tabSdMmcInfo); - try + if(imageFormat is IOpticalMediaImage opticalMediaImage) { - if(imageFormat.Sessions != null && imageFormat.Sessions.Count > 0) + try { - TreeGridItemCollection sessionList = new TreeGridItemCollection(); - - treeSessions.Columns.Add(new GridColumn {HeaderText = "Session", DataCell = new TextBoxCell(0)}); - treeSessions.Columns.Add(new GridColumn + if(opticalMediaImage.Sessions != null && opticalMediaImage.Sessions.Count > 0) { - HeaderText = "First track", DataCell = new TextBoxCell(1) - }); - treeSessions.Columns.Add(new GridColumn {HeaderText = "Last track", DataCell = new TextBoxCell(2)}); - treeSessions.Columns.Add(new GridColumn {HeaderText = "Start", DataCell = new TextBoxCell(3)}); - treeSessions.Columns.Add(new GridColumn {HeaderText = "End", DataCell = new TextBoxCell(4)}); + TreeGridItemCollection sessionList = new TreeGridItemCollection(); - treeSessions.AllowMultipleSelection = false; - treeSessions.ShowHeader = true; - treeSessions.DataStore = sessionList; - - foreach(Session session in imageFormat.Sessions) - sessionList.Add(new TreeGridItem + treeSessions.Columns.Add(new GridColumn { - Values = new object[] - { - session.SessionSequence, session.StartTrack, session.EndTrack, - session.StartSector, session.EndSector - } + HeaderText = "Session", DataCell = new TextBoxCell(0) }); + treeSessions.Columns.Add(new GridColumn + { + HeaderText = "First track", DataCell = new TextBoxCell(1) + }); + treeSessions.Columns.Add(new GridColumn + { + HeaderText = "Last track", DataCell = new TextBoxCell(2) + }); + treeSessions.Columns.Add(new GridColumn {HeaderText = "Start", DataCell = new TextBoxCell(3)}); + treeSessions.Columns.Add(new GridColumn {HeaderText = "End", DataCell = new TextBoxCell(4)}); - tabSessions.Visible = true; + treeSessions.AllowMultipleSelection = false; + treeSessions.ShowHeader = true; + treeSessions.DataStore = sessionList; + + foreach(Session session in opticalMediaImage.Sessions) + sessionList.Add(new TreeGridItem + { + Values = new object[] + { + session.SessionSequence, session.StartTrack, + session.EndTrack, session.StartSector, session.EndSector + } + }); + + tabSessions.Visible = true; + } } - } - catch - { - // ignored - } - - try - { - if(imageFormat.Tracks != null && imageFormat.Tracks.Count > 0) + catch { - TreeGridItemCollection tracksList = new TreeGridItemCollection(); - - treeTracks.Columns.Add(new GridColumn {HeaderText = "Track", DataCell = new TextBoxCell(0)}); - treeTracks.Columns.Add(new GridColumn {HeaderText = "Type", DataCell = new TextBoxCell(1)}); - treeTracks.Columns.Add(new GridColumn {HeaderText = "Bps", DataCell = new TextBoxCell(2)}); - treeTracks.Columns.Add(new GridColumn {HeaderText = "Raw bps", DataCell = new TextBoxCell(3)}); - treeTracks.Columns.Add(new GridColumn {HeaderText = "Subchannel", DataCell = new TextBoxCell(4)}); - treeTracks.Columns.Add(new GridColumn {HeaderText = "Pregap", DataCell = new TextBoxCell(5)}); - treeTracks.Columns.Add(new GridColumn {HeaderText = "Start", DataCell = new TextBoxCell(6)}); - treeTracks.Columns.Add(new GridColumn {HeaderText = "End", DataCell = new TextBoxCell(7)}); - - treeTracks.AllowMultipleSelection = false; - treeTracks.ShowHeader = true; - treeTracks.DataStore = tracksList; - - foreach(Track track in imageFormat.Tracks) - tracksList.Add(new TreeGridItem - { - Values = new object[] - { - track.TrackSequence, track.TrackType, track.TrackBytesPerSector, - track.TrackRawBytesPerSector, track.TrackSubchannelType, - track.TrackPregap, track.TrackStartSector, track.TrackEndSector - } - }); - - tabTracks.Visible = true; + // ignored + } + + try + { + if(opticalMediaImage.Tracks != null && opticalMediaImage.Tracks.Count > 0) + { + TreeGridItemCollection tracksList = new TreeGridItemCollection(); + + treeTracks.Columns.Add(new GridColumn {HeaderText = "Track", DataCell = new TextBoxCell(0)}); + treeTracks.Columns.Add(new GridColumn {HeaderText = "Type", DataCell = new TextBoxCell(1)}); + treeTracks.Columns.Add(new GridColumn {HeaderText = "Bps", DataCell = new TextBoxCell(2)}); + treeTracks.Columns.Add(new GridColumn {HeaderText = "Raw bps", DataCell = new TextBoxCell(3)}); + treeTracks.Columns.Add(new GridColumn + { + HeaderText = "Subchannel", DataCell = new TextBoxCell(4) + }); + treeTracks.Columns.Add(new GridColumn {HeaderText = "Pregap", DataCell = new TextBoxCell(5)}); + treeTracks.Columns.Add(new GridColumn {HeaderText = "Start", DataCell = new TextBoxCell(6)}); + treeTracks.Columns.Add(new GridColumn {HeaderText = "End", DataCell = new TextBoxCell(7)}); + + treeTracks.AllowMultipleSelection = false; + treeTracks.ShowHeader = true; + treeTracks.DataStore = tracksList; + + foreach(Track track in opticalMediaImage.Tracks) + tracksList.Add(new TreeGridItem + { + Values = new object[] + { + track.TrackSequence, track.TrackType, + track.TrackBytesPerSector, track.TrackRawBytesPerSector, + track.TrackSubchannelType, track.TrackPregap, + track.TrackStartSector, track.TrackEndSector + } + }); + + tabTracks.Visible = true; + } + } + catch + { + // ignored } - } - catch - { - // ignored } if(imageFormat.DumpHardware == null) return; diff --git a/DiscImageChef/Commands/Checksum.cs b/DiscImageChef/Commands/Checksum.cs index db034d7dc..331562d95 100644 --- a/DiscImageChef/Commands/Checksum.cs +++ b/DiscImageChef/Commands/Checksum.cs @@ -182,7 +182,7 @@ namespace DiscImageChef.Commands Checksum mediaChecksum = null; - if(inputFormat.Info.HasPartitions) + if(inputFormat is IOpticalMediaImage opticalInput) try { Checksum trackChecksum = null; @@ -191,7 +191,7 @@ namespace DiscImageChef.Commands ulong previousTrackEnd = 0; - List inputTracks = inputFormat.Tracks; + List inputTracks = opticalInput.Tracks; foreach(Track currentTrack in inputTracks) { if(currentTrack.TrackStartSector - previousTrackEnd != 0 && wholeDisc) @@ -221,16 +221,16 @@ namespace DiscImageChef.Commands if(sectors - doneSectors >= SECTORS_TO_READ) { - sector = inputFormat.ReadSectors(doneSectors, SECTORS_TO_READ, - currentTrack.TrackSequence); + sector = opticalInput.ReadSectors(doneSectors, SECTORS_TO_READ, + currentTrack.TrackSequence); DicConsole.Write("\rHashings sectors {0} to {2} of track {1}", doneSectors, currentTrack.TrackSequence, doneSectors + SECTORS_TO_READ); doneSectors += SECTORS_TO_READ; } else { - sector = inputFormat.ReadSectors(doneSectors, (uint)(sectors - doneSectors), - currentTrack.TrackSequence); + sector = opticalInput.ReadSectors(doneSectors, (uint)(sectors - doneSectors), + currentTrack.TrackSequence); DicConsole.Write("\rHashings sectors {0} to {2} of track {1}", doneSectors, currentTrack.TrackSequence, doneSectors + (sectors - doneSectors)); doneSectors += sectors - doneSectors; @@ -252,8 +252,8 @@ namespace DiscImageChef.Commands previousTrackEnd = currentTrack.TrackEndSector; } - if(inputFormat.Info.Sectors - previousTrackEnd != 0 && wholeDisc) - for(ulong i = previousTrackEnd + 1; i < inputFormat.Info.Sectors; i++) + if(opticalInput.Info.Sectors - previousTrackEnd != 0 && wholeDisc) + for(ulong i = previousTrackEnd + 1; i < opticalInput.Info.Sectors; i++) { DicConsole.Write("\rHashing track-less sector {0}", i); diff --git a/DiscImageChef/Commands/Compare.cs b/DiscImageChef/Commands/Compare.cs index 198dd1676..6754ea98d 100644 --- a/DiscImageChef/Commands/Compare.cs +++ b/DiscImageChef/Commands/Compare.cs @@ -168,45 +168,13 @@ namespace DiscImageChef.Commands bool imagesDiffer = false; - ImageInfo image1Info = new ImageInfo(); - ImageInfo image2Info = new ImageInfo(); + ImageInfo image1Info = input1Format.Info; + ImageInfo image2Info = input2Format.Info; List image1Sessions = new List(); List image2Sessions = new List(); Dictionary image1DiskTags = new Dictionary(); Dictionary image2DiskTags = new Dictionary(); - image1Info.HasPartitions = input1Format.Info.HasPartitions; - #pragma warning disable RECS0022 // A catch clause that catches System.Exception and has an empty body - try { image1Sessions = input1Format.Sessions; } - catch - { - // ignored - } - #pragma warning restore RECS0022 // A catch clause that catches System.Exception and has an empty body - image1Info.HasSessions |= image1Sessions?.Count > 0; - image1Info.ImageSize = input1Format.Info.ImageSize; - image1Info.Sectors = input1Format.Info.Sectors; - image1Info.SectorSize = input1Format.Info.SectorSize; - image1Info.CreationTime = input1Format.Info.CreationTime; - image1Info.LastModificationTime = input1Format.Info.LastModificationTime; - image1Info.MediaType = input1Format.Info.MediaType; - image1Info.Version = input1Format.Info.Version; - image1Info.Application = input1Format.Info.Application; - image1Info.ApplicationVersion = input1Format.Info.ApplicationVersion; - image1Info.Creator = input1Format.Info.Creator; - image1Info.MediaTitle = input1Format.Info.MediaTitle; - image1Info.Comments = input1Format.Info.Comments; - image1Info.MediaManufacturer = input1Format.Info.MediaManufacturer; - image1Info.MediaModel = input1Format.Info.MediaModel; - image1Info.MediaSerialNumber = input1Format.Info.MediaSerialNumber; - image1Info.MediaBarcode = input1Format.Info.MediaBarcode; - image1Info.MediaPartNumber = input1Format.Info.MediaPartNumber; - image1Info.MediaSequence = input1Format.Info.MediaSequence; - image1Info.LastMediaSequence = input1Format.Info.LastMediaSequence; - image1Info.DriveManufacturer = input1Format.Info.DriveManufacturer; - image1Info.DriveModel = input1Format.Info.DriveModel; - image1Info.DriveSerialNumber = input1Format.Info.DriveSerialNumber; - image1Info.DriveFirmwareRevision = input1Format.Info.DriveFirmwareRevision; foreach(MediaTagType disktag in Enum.GetValues(typeof(MediaTagType))) { try @@ -222,38 +190,6 @@ namespace DiscImageChef.Commands #pragma warning restore RECS0022 // A catch clause that catches System.Exception and has an empty body } - image2Info.HasPartitions = input2Format.Info.HasPartitions; - #pragma warning disable RECS0022 // A catch clause that catches System.Exception and has an empty body - try { image2Sessions = input2Format.Sessions; } - catch - { - // ignored - } - #pragma warning restore RECS0022 // A catch clause that catches System.Exception and has an empty body - image2Info.HasSessions |= image2Sessions?.Count > 0; - image2Info.ImageSize = input2Format.Info.ImageSize; - image2Info.Sectors = input2Format.Info.Sectors; - image2Info.SectorSize = input2Format.Info.SectorSize; - image2Info.CreationTime = input2Format.Info.CreationTime; - image2Info.LastModificationTime = input2Format.Info.LastModificationTime; - image2Info.MediaType = input2Format.Info.MediaType; - image2Info.Version = input2Format.Info.Version; - image2Info.Application = input2Format.Info.Application; - image2Info.ApplicationVersion = input2Format.Info.ApplicationVersion; - image2Info.Creator = input2Format.Info.Creator; - image2Info.MediaTitle = input2Format.Info.MediaTitle; - image2Info.Comments = input2Format.Info.Comments; - image2Info.MediaManufacturer = input2Format.Info.MediaManufacturer; - image2Info.MediaModel = input2Format.Info.MediaModel; - image2Info.MediaSerialNumber = input2Format.Info.MediaSerialNumber; - image2Info.MediaBarcode = input2Format.Info.MediaBarcode; - image2Info.MediaPartNumber = input2Format.Info.MediaPartNumber; - image2Info.MediaSequence = input2Format.Info.MediaSequence; - image2Info.LastMediaSequence = input2Format.Info.LastMediaSequence; - image2Info.DriveManufacturer = input2Format.Info.DriveManufacturer; - image2Info.DriveModel = input2Format.Info.DriveModel; - image2Info.DriveSerialNumber = input2Format.Info.DriveSerialNumber; - image2Info.DriveFirmwareRevision = input2Format.Info.DriveFirmwareRevision; foreach(MediaTagType disktag in Enum.GetValues(typeof(MediaTagType))) { try diff --git a/DiscImageChef/Commands/ConvertImage.cs b/DiscImageChef/Commands/ConvertImage.cs index 47fed6944..a40da3afe 100644 --- a/DiscImageChef/Commands/ConvertImage.cs +++ b/DiscImageChef/Commands/ConvertImage.cs @@ -422,22 +422,9 @@ namespace DiscImageChef.Commands DicConsole.ErrorWriteLine("continuing..."); } - List tracks; - - try { tracks = inputFormat.Tracks; } - catch(Exception) { tracks = null; } - CICMMetadataType cicmMetadata = inputFormat.CicmMetadata; List dumpHardware = inputFormat.DumpHardware; - if(tracks != null) - if(!outputFormat.SetTracks(tracks)) - { - DicConsole.ErrorWriteLine("Error {0} sending tracks list to output image.", - outputFormat.ErrorMessage); - return (int)ErrorNumber.WriteError; - } - foreach(MediaTagType mediaTag in inputFormat.Info.ReadableMediaTags) { if(force && !outputFormat.SupportedMediaTags.Contains(mediaTag)) continue; @@ -459,7 +446,191 @@ namespace DiscImageChef.Commands DicConsole.WriteLine("{0} sectors to convert", inputFormat.Info.Sectors); ulong doneSectors = 0; - if(tracks == null) + if(inputFormat is IOpticalMediaImage inputOptical && outputFormat is IWritableOpticalImage outputOptical) + { + if(!outputOptical.SetTracks(inputOptical.Tracks)) + { + DicConsole.ErrorWriteLine("Error {0} sending tracks list to output image.", + outputFormat.ErrorMessage); + return (int)ErrorNumber.WriteError; + } + + foreach(Track track in inputOptical.Tracks) + { + doneSectors = 0; + ulong trackSectors = track.TrackEndSector - track.TrackStartSector + 1; + + while(doneSectors < trackSectors) + { + byte[] sector; + + uint sectorsToDo; + if(trackSectors - doneSectors >= (ulong)count) sectorsToDo = (uint)count; + else sectorsToDo = (uint)(trackSectors - doneSectors); + + DicConsole.Write("\rConverting sectors {0} to {1} in track {3} ({2:P2} done)", + doneSectors + track.TrackStartSector, + doneSectors + sectorsToDo + track.TrackStartSector, + (doneSectors + track.TrackStartSector) / (double)inputFormat.Info.Sectors, + track.TrackSequence); + + bool result; + if(useLong) + if(sectorsToDo == 1) + { + sector = inputFormat.ReadSectorLong(doneSectors + track.TrackStartSector); + result = outputFormat.WriteSectorLong(sector, doneSectors + track.TrackStartSector); + } + else + { + sector = inputFormat.ReadSectorsLong(doneSectors + track.TrackStartSector, sectorsToDo); + result = outputFormat.WriteSectorsLong(sector, doneSectors + track.TrackStartSector, + sectorsToDo); + } + else + { + if(sectorsToDo == 1) + { + sector = inputFormat.ReadSector(doneSectors + track.TrackStartSector); + result = outputFormat.WriteSector(sector, doneSectors + track.TrackStartSector); + } + else + { + sector = inputFormat.ReadSectors(doneSectors + track.TrackStartSector, sectorsToDo); + result = outputFormat.WriteSectors(sector, doneSectors + track.TrackStartSector, + sectorsToDo); + } + } + + if(!result) + if(force) + DicConsole.ErrorWriteLine("Error {0} writing sector {1}, continuing...", + outputFormat.ErrorMessage, doneSectors); + else + { + DicConsole.ErrorWriteLine("Error {0} writing sector {1}, not continuing...", + outputFormat.ErrorMessage, doneSectors); + return (int)ErrorNumber.WriteError; + } + + doneSectors += sectorsToDo; + } + } + + DicConsole.Write("\rConverting sectors {0} to {1} in track {3} ({2:P2} done)", inputFormat.Info.Sectors, + inputFormat.Info.Sectors, 1.0, inputOptical.Tracks.Count); + DicConsole.WriteLine(); + + foreach(SectorTagType tag in inputFormat.Info.ReadableSectorTags.OrderBy(t => t)) + { + if(!useLong) break; + + switch(tag) + { + case SectorTagType.AppleSectorTag: + case SectorTagType.CdSectorSync: + case SectorTagType.CdSectorHeader: + case SectorTagType.CdSectorSubHeader: + case SectorTagType.CdSectorEdc: + case SectorTagType.CdSectorEccP: + case SectorTagType.CdSectorEccQ: + case SectorTagType.CdSectorEcc: + // This tags are inline in long sector + continue; + } + + if(force && !outputFormat.SupportedSectorTags.Contains(tag)) continue; + + foreach(Track track in inputOptical.Tracks) + { + doneSectors = 0; + ulong trackSectors = track.TrackEndSector - track.TrackStartSector + 1; + byte[] sector; + bool result; + + switch(tag) + { + case SectorTagType.CdTrackFlags: + case SectorTagType.CdTrackIsrc: + DicConsole.Write("\rConverting tag {0} in track {1} ({2:P2} done).", tag, + track.TrackSequence, + track.TrackSequence / (double)inputOptical.Tracks.Count); + sector = inputFormat.ReadSectorTag(track.TrackStartSector, tag); + result = outputFormat.WriteSectorTag(sector, track.TrackStartSector, tag); + if(!result) + if(force) + DicConsole.ErrorWriteLine("Error {0} writing tag, continuing...", + outputFormat.ErrorMessage); + else + { + DicConsole.ErrorWriteLine("Error {0} writing tag, not continuing...", + outputFormat.ErrorMessage); + return (int)ErrorNumber.WriteError; + } + + continue; + } + + while(doneSectors < trackSectors) + { + uint sectorsToDo; + if(trackSectors - doneSectors >= (ulong)count) sectorsToDo = (uint)count; + else + sectorsToDo = + (uint)(trackSectors - doneSectors); + + DicConsole.Write("\rConverting tag {4} for sectors {0} to {1} in track {3} ({2:P2} done)", + doneSectors + track.TrackStartSector, + doneSectors + sectorsToDo + track.TrackStartSector, + (doneSectors + track.TrackStartSector) / (double)inputFormat.Info.Sectors, + track.TrackSequence, tag); + + if(sectorsToDo == 1) + { + sector = inputFormat.ReadSectorTag(doneSectors + track.TrackStartSector, tag); + result = outputFormat.WriteSectorTag(sector, doneSectors + track.TrackStartSector, tag); + } + else + { + sector = inputFormat.ReadSectorsTag(doneSectors + track.TrackStartSector, sectorsToDo, + tag); + result = outputFormat.WriteSectorsTag(sector, doneSectors + track.TrackStartSector, + sectorsToDo, tag); + } + + if(!result) + if(force) + DicConsole.ErrorWriteLine("Error {0} writing tag for sector {1}, continuing...", + outputFormat.ErrorMessage, doneSectors); + else + { + DicConsole.ErrorWriteLine("Error {0} writing tag for sector {1}, not continuing...", + outputFormat.ErrorMessage, doneSectors); + return (int)ErrorNumber.WriteError; + } + + doneSectors += sectorsToDo; + } + } + + switch(tag) + { + case SectorTagType.CdTrackFlags: + case SectorTagType.CdTrackIsrc: + DicConsole.Write("\rConverting tag {0} in track {1} ({2:P2} done).", tag, + inputOptical.Tracks.Count, 1.0); + break; + default: + DicConsole.Write("\rConverting tag {4} for sectors {0} to {1} in track {3} ({2:P2} done)", + inputFormat.Info.Sectors, inputFormat.Info.Sectors, 1.0, + inputOptical.Tracks.Count, tag); + break; + } + + DicConsole.WriteLine(); + } + } + else { DicConsole.WriteLine("Setting geometry to {0} cylinders, {1} heads and {2} sectors per track", inputFormat.Info.Cylinders, inputFormat.Info.Heads, @@ -592,182 +763,6 @@ namespace DiscImageChef.Commands DicConsole.WriteLine(); } } - else - { - foreach(Track track in tracks) - { - doneSectors = 0; - ulong trackSectors = track.TrackEndSector - track.TrackStartSector + 1; - - while(doneSectors < trackSectors) - { - byte[] sector; - - uint sectorsToDo; - if(trackSectors - doneSectors >= (ulong)count) sectorsToDo = (uint)count; - else sectorsToDo = (uint)(trackSectors - doneSectors); - - DicConsole.Write("\rConverting sectors {0} to {1} in track {3} ({2:P2} done)", - doneSectors + track.TrackStartSector, - doneSectors + sectorsToDo + track.TrackStartSector, - (doneSectors + track.TrackStartSector) / (double)inputFormat.Info.Sectors, - track.TrackSequence); - - bool result; - if(useLong) - if(sectorsToDo == 1) - { - sector = inputFormat.ReadSectorLong(doneSectors + track.TrackStartSector); - result = outputFormat.WriteSectorLong(sector, doneSectors + track.TrackStartSector); - } - else - { - sector = inputFormat.ReadSectorsLong(doneSectors + track.TrackStartSector, sectorsToDo); - result = outputFormat.WriteSectorsLong(sector, doneSectors + track.TrackStartSector, - sectorsToDo); - } - else - { - if(sectorsToDo == 1) - { - sector = inputFormat.ReadSector(doneSectors + track.TrackStartSector); - result = outputFormat.WriteSector(sector, doneSectors + track.TrackStartSector); - } - else - { - sector = inputFormat.ReadSectors(doneSectors + track.TrackStartSector, sectorsToDo); - result = outputFormat.WriteSectors(sector, doneSectors + track.TrackStartSector, - sectorsToDo); - } - } - - if(!result) - if(force) - DicConsole.ErrorWriteLine("Error {0} writing sector {1}, continuing...", - outputFormat.ErrorMessage, doneSectors); - else - { - DicConsole.ErrorWriteLine("Error {0} writing sector {1}, not continuing...", - outputFormat.ErrorMessage, doneSectors); - return (int)ErrorNumber.WriteError; - } - - doneSectors += sectorsToDo; - } - } - - DicConsole.Write("\rConverting sectors {0} to {1} in track {3} ({2:P2} done)", inputFormat.Info.Sectors, - inputFormat.Info.Sectors, 1.0, tracks.Count); - DicConsole.WriteLine(); - - foreach(SectorTagType tag in inputFormat.Info.ReadableSectorTags.OrderBy(t => t)) - { - if(!useLong) break; - - switch(tag) - { - case SectorTagType.AppleSectorTag: - case SectorTagType.CdSectorSync: - case SectorTagType.CdSectorHeader: - case SectorTagType.CdSectorSubHeader: - case SectorTagType.CdSectorEdc: - case SectorTagType.CdSectorEccP: - case SectorTagType.CdSectorEccQ: - case SectorTagType.CdSectorEcc: - // This tags are inline in long sector - continue; - } - - if(force && !outputFormat.SupportedSectorTags.Contains(tag)) continue; - - foreach(Track track in tracks) - { - doneSectors = 0; - ulong trackSectors = track.TrackEndSector - track.TrackStartSector + 1; - byte[] sector; - bool result; - - switch(tag) - { - case SectorTagType.CdTrackFlags: - case SectorTagType.CdTrackIsrc: - DicConsole.Write("\rConverting tag {0} in track {1} ({2:P2} done).", tag, - track.TrackSequence, track.TrackSequence / (double)tracks.Count); - sector = inputFormat.ReadSectorTag(track.TrackStartSector, tag); - result = outputFormat.WriteSectorTag(sector, track.TrackStartSector, tag); - if(!result) - if(force) - DicConsole.ErrorWriteLine("Error {0} writing tag, continuing...", - outputFormat.ErrorMessage); - else - { - DicConsole.ErrorWriteLine("Error {0} writing tag, not continuing...", - outputFormat.ErrorMessage); - return (int)ErrorNumber.WriteError; - } - - continue; - } - - while(doneSectors < trackSectors) - { - uint sectorsToDo; - if(trackSectors - doneSectors >= (ulong)count) sectorsToDo = (uint)count; - else - sectorsToDo = - (uint)(trackSectors - doneSectors); - - DicConsole.Write("\rConverting tag {4} for sectors {0} to {1} in track {3} ({2:P2} done)", - doneSectors + track.TrackStartSector, - doneSectors + sectorsToDo + track.TrackStartSector, - (doneSectors + track.TrackStartSector) / (double)inputFormat.Info.Sectors, - track.TrackSequence, tag); - - if(sectorsToDo == 1) - { - sector = inputFormat.ReadSectorTag(doneSectors + track.TrackStartSector, tag); - result = outputFormat.WriteSectorTag(sector, doneSectors + track.TrackStartSector, tag); - } - else - { - sector = inputFormat.ReadSectorsTag(doneSectors + track.TrackStartSector, sectorsToDo, - tag); - result = outputFormat.WriteSectorsTag(sector, doneSectors + track.TrackStartSector, - sectorsToDo, tag); - } - - if(!result) - if(force) - DicConsole.ErrorWriteLine("Error {0} writing tag for sector {1}, continuing...", - outputFormat.ErrorMessage, doneSectors); - else - { - DicConsole.ErrorWriteLine("Error {0} writing tag for sector {1}, not continuing...", - outputFormat.ErrorMessage, doneSectors); - return (int)ErrorNumber.WriteError; - } - - doneSectors += sectorsToDo; - } - } - - switch(tag) - { - case SectorTagType.CdTrackFlags: - case SectorTagType.CdTrackIsrc: - DicConsole.Write("\rConverting tag {0} in track {1} ({2:P2} done).", tag, tracks.Count, - 1.0); - break; - default: - DicConsole.Write("\rConverting tag {4} for sectors {0} to {1} in track {3} ({2:P2} done)", - inputFormat.Info.Sectors, inputFormat.Info.Sectors, 1.0, tracks.Count, - tag); - break; - } - - DicConsole.WriteLine(); - } - } bool ret = false; if(resume != null || dumpHardware != null) diff --git a/DiscImageChef/Commands/Verify.cs b/DiscImageChef/Commands/Verify.cs index 8d1590a18..919c49e48 100644 --- a/DiscImageChef/Commands/Verify.cs +++ b/DiscImageChef/Commands/Verify.cs @@ -155,22 +155,14 @@ namespace DiscImageChef.Commands if(verifySectors) { - bool formatHasTracks; - try - { - List inputTracks = inputFormat.Tracks; - formatHasTracks = inputTracks.Count > 0; - } - catch { formatHasTracks = false; } - DateTime startCheck; DateTime endCheck; List failingLbas = new List(); List unknownLbas = new List(); - if(formatHasTracks) + if(inputFormat is IOpticalMediaImage opticalMediaImage) { - List inputTracks = inputFormat.Tracks; + List inputTracks = opticalMediaImage.Tracks; ulong currentSectorAll = 0; startCheck = DateTime.UtcNow; @@ -188,12 +180,12 @@ namespace DiscImageChef.Commands List tempunknownLbas; if(remainingSectors < 512) - inputFormat.VerifySectors(currentSector, (uint)remainingSectors, - currentTrack.TrackSequence, out tempfailingLbas, - out tempunknownLbas); + opticalMediaImage.VerifySectors(currentSector, (uint)remainingSectors, + currentTrack.TrackSequence, out tempfailingLbas, + out tempunknownLbas); else - inputFormat.VerifySectors(currentSector, 512, currentTrack.TrackSequence, - out tempfailingLbas, out tempunknownLbas); + opticalMediaImage.VerifySectors(currentSector, 512, currentTrack.TrackSequence, + out tempfailingLbas, out tempunknownLbas); failingLbas.AddRange(tempfailingLbas);