diff --git a/.gitmodules b/.gitmodules index 1cf09b6d6..267806b63 100644 --- a/.gitmodules +++ b/.gitmodules @@ -4,3 +4,6 @@ [submodule "cuetoolsnet"] path = cuetoolsnet url = https://github.com/claunia/cuetoolsnet.git +[submodule "DiscImageChef.CommonTypes"] + path = DiscImageChef.CommonTypes + url = git@github.com:discimagechef/DiscImageChef.CommonTypes.git diff --git a/.idea/.idea.DiscImageChef/.idea/contentModel.xml b/.idea/.idea.DiscImageChef/.idea/contentModel.xml index ffbdd549d..23880ffaa 100644 --- a/.idea/.idea.DiscImageChef/.idea/contentModel.xml +++ b/.idea/.idea.DiscImageChef/.idea/contentModel.xml @@ -97,6 +97,7 @@ + @@ -165,19 +166,7 @@ - - - - - - - - - - - - - + @@ -1926,7 +1915,6 @@ - diff --git a/DiscImageChef.CommonTypes b/DiscImageChef.CommonTypes new file mode 160000 index 000000000..d8c8c7810 --- /dev/null +++ b/DiscImageChef.CommonTypes @@ -0,0 +1 @@ +Subproject commit d8c8c781015c55bcbf5fbc7a9d5fff6c27808829 diff --git a/DiscImageChef.CommonTypes/DiscImageChef.CommonTypes.csproj b/DiscImageChef.CommonTypes/DiscImageChef.CommonTypes.csproj deleted file mode 100644 index 2e2a241a3..000000000 --- a/DiscImageChef.CommonTypes/DiscImageChef.CommonTypes.csproj +++ /dev/null @@ -1,152 +0,0 @@ - - - - Debug - AnyCPU - 2.0 - {F2B84194-26EB-4227-B1C5-6602517E85AE} - Library - DiscImageChef.CommonTypes - DiscImageChef.CommonTypes - $(Version) - false - true - 4.5.99.1693 - Claunia.com - Copyright © 2011-2019 Natalia Portillo - The Disc Image Chef - DiscImageChef.CommonTypes - $(Version) - net461;netstandard2.0;netcoreapp2.0 - - - $(Version)-{chash:8} built by {mname} in $(Configuration){!:, modified} - true - true - - - true - full - false - bin\Debug - DEBUG; - prompt - 4 - false - - - full - true - bin\Release - prompt - 4 - false - - - - - - - Metadata/cicm.cs - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - LICENSE.MIT - - - - - - - - - - - - - - - - - - - - - /Library/Frameworks/Mono.framework/Versions/Current/lib/mono - /usr/lib/mono - /usr/local/lib/mono - - $(BaseFrameworkPathOverrideForMono)/4.0-api - $(BaseFrameworkPathOverrideForMono)/4.5-api - $(BaseFrameworkPathOverrideForMono)/4.5.1-api - $(BaseFrameworkPathOverrideForMono)/4.5.2-api - $(BaseFrameworkPathOverrideForMono)/4.6-api - $(BaseFrameworkPathOverrideForMono)/4.6.1-api - $(BaseFrameworkPathOverrideForMono)/4.6.2-api - $(BaseFrameworkPathOverrideForMono)/4.7-api - $(BaseFrameworkPathOverrideForMono)/4.7.1-api - true - - $(FrameworkPathOverride)/Facades;$(AssemblySearchPaths) - - diff --git a/DiscImageChef.CommonTypes/Enums/DeviceType.cs b/DiscImageChef.CommonTypes/Enums/DeviceType.cs deleted file mode 100644 index 368d32f4b..000000000 --- a/DiscImageChef.CommonTypes/Enums/DeviceType.cs +++ /dev/null @@ -1,51 +0,0 @@ -// /*************************************************************************** -// The Disc Image Chef -// ---------------------------------------------------------------------------- -// -// Filename : DeviceType.cs -// Author(s) : Natalia Portillo -// -// Component : Disc image plugins. -// -// --[ Description ] ---------------------------------------------------------- -// -// Defines enumerations of devce types. -// -// --[ 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 -// ****************************************************************************/ - -namespace DiscImageChef.CommonTypes.Enums -{ - public enum DeviceType - { - Unknown = -1, - ATA = 1, - ATAPI = 2, - SCSI = 3, - SecureDigital = 4, - MMC = 5, - NVMe = 6 - } -} \ No newline at end of file diff --git a/DiscImageChef.CommonTypes/Enums/ErrorNumber.cs b/DiscImageChef.CommonTypes/Enums/ErrorNumber.cs deleted file mode 100644 index 29d8d0016..000000000 --- a/DiscImageChef.CommonTypes/Enums/ErrorNumber.cs +++ /dev/null @@ -1,115 +0,0 @@ -// /*************************************************************************** -// The Disc Image Chef -// ---------------------------------------------------------------------------- -// -// Filename : ErrorNumber.cs -// Author(s) : Natalia Portillo -// -// Component : Common types. -// -// --[ Description ] ---------------------------------------------------------- -// -// Defines enumerations of error numbers. -// -// --[ 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 -// ****************************************************************************/ - -namespace DiscImageChef.CommonTypes.Enums -{ - /// - /// Enumerates error codes. Positive for warnings or informative codes, negative for errors. - /// - public enum ErrorNumber - { - /// No error - NoError = 0, - /// User requested help to be shown - HelpRequested = 1, - /// Command found nothing - NothingFound = 2, - /// Media has been already dumped completely - AlreadyDumped = 3, - /// Image and its sectors cannot be verified - NotVerificable = 4, - /// There are bad sectors and image cannot be verified - BadSectorsImageNotVerified = 5, - /// All sectors are good and image cannot be verified - CorrectSectorsImageNotVerified = 6, - /// Image is bad and sectors cannot be verified - BadImageSectorsNotVerified = 7, - /// Image is bad and there are bad sectors - BadImageBadSectors = 8, - /// All sectors are good and image is bad - CorrectSectorsBadImage = 9, - /// Image is good and sectors cannot be verified - CorrectImageSectorsNotVerified = 10, - /// Image is good and there are bad sectors - CorrectImageBadSectors = 11, - /// Exception has been raised - UnexpectedException = -1, - /// The number of arguments is not as expected - UnexpectedArgumentCount = -2, - /// A required argument is not present - MissingArgument = -3, - /// A specified argument contains an invalid value - InvalidArgument = -4, - /// The specified file cannot be found - FileNotFound = -5, - /// The specified file cannot be opened - CannotOpenFile = -6, - /// The specified encoding cannot be found - EncodingUnknown = -7, - /// The image format has not been recognized - UnrecognizedFormat = -8, - /// The image format failed to open - CannotOpenFormat = -9, - /// The specified metadata sidecar does not have the correct format - InvalidSidecar = -10, - /// The specified resume map does not have the correct format - InvalidResume = -11, - /// The specified destination file/folder already exists - DestinationExists = -12, - /// The specified image format cannot be found - FormatNotFound = -13, - /// More than one format found for the specified search criteria - TooManyFormats = -14, - /// The specified format does not support the specified media - UnsupportedMedia = -15, - /// Data will be lost writing the specified format - DataWillBeLost = -16, - /// Cannot create destination format - CannotCreateFormat = -17, - /// Error writing data - WriteError = -18, - /// Argument expected a directory, but found a file - ExpectedDirectory = -19, - /// Argument expected a file, but found a directory - ExpectedFile = -20, - /// Cannot open device - CannotOpenDevice = -21, - /// The specified operation requires administrative privileges - NotEnoughPermissions = -22 - } -} \ No newline at end of file diff --git a/DiscImageChef.CommonTypes/Enums/Images.cs b/DiscImageChef.CommonTypes/Enums/Images.cs deleted file mode 100644 index 478e42353..000000000 --- a/DiscImageChef.CommonTypes/Enums/Images.cs +++ /dev/null @@ -1,364 +0,0 @@ -// /*************************************************************************** -// The Disc Image Chef -// ---------------------------------------------------------------------------- -// -// Filename : Images.cs -// Author(s) : Natalia Portillo -// -// Component : Disc image plugins. -// -// --[ Description ] ---------------------------------------------------------- -// -// Defines enumerations to be used by 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; - -namespace DiscImageChef.CommonTypes.Enums -{ - /// - /// Track (as partitioning element) types. - /// - public enum TrackType : byte - { - /// Audio track - Audio = 0, - /// Data track (not any of the below defined ones) - Data = 1, - /// Data track, compact disc mode 1 - CdMode1 = 2, - /// Data track, compact disc mode 2, formless - CdMode2Formless = 3, - /// Data track, compact disc mode 2, form 1 - CdMode2Form1 = 4, - /// Data track, compact disc mode 2, form 2 - CdMode2Form2 = 5 - } - - /// - /// Type of subchannel in track - /// - public enum TrackSubchannelType : byte - { - /// - /// Track does not has subchannel dumped, or it's not a CD - /// - None = 0, - /// - /// Subchannel is packed and error corrected - /// - Packed = 1, - /// - /// Subchannel is interleaved - /// - Raw = 2, - /// - /// Subchannel is packed and comes interleaved with main channel in same file - /// - PackedInterleaved = 3, - /// - /// Subchannel is interleaved and comes interleaved with main channel in same file - /// - RawInterleaved = 4, - /// - /// Only Q subchannel is stored as 16 bytes - /// - Q16 = 5, - /// - /// Only Q subchannel is stored as 16 bytes and comes interleaved with main channel in same file - /// - Q16Interleaved = 6 - } - - /// - /// Metadata present for each sector (aka, "tag"). - /// - public enum SectorTagType - { - /// Apple's GCR sector tags, 12 bytes - AppleSectorTag = 0, - /// Sync frame from CD sector, 12 bytes - CdSectorSync = 1, - /// CD sector header, 4 bytes - CdSectorHeader = 2, - /// CD mode 2 sector subheader - CdSectorSubHeader = 3, - /// CD sector EDC, 4 bytes - CdSectorEdc = 4, - /// CD sector ECC P, 172 bytes - CdSectorEccP = 5, - /// CD sector ECC Q, 104 bytes - CdSectorEccQ = 6, - /// CD sector ECC (P and Q), 276 bytes - CdSectorEcc = 7, - /// CD sector subchannel, 96 bytes - CdSectorSubchannel = 8, - /// CD track ISRC, string, 12 bytes - CdTrackIsrc = 9, - /// CD track text, string, 13 bytes - CdTrackText = 10, - /// CD track flags, 1 byte - CdTrackFlags = 11, - /// DVD sector copyright information - DvdCmi = 12, - /// Floppy address mark (contents depend on underlying floppy format) - FloppyAddressMark = 13 - } - - /// - /// Metadata present for each media. - /// - public enum MediaTagType - { - /// CD table of contents - CD_TOC = 0, - /// CD session information - CD_SessionInfo = 1, - /// CD full table of contents - CD_FullTOC = 2, - /// CD PMA - CD_PMA = 3, - /// CD Adress-Time-In-Pregroove - CD_ATIP = 4, - /// CD-Text - CD_TEXT = 5, - /// CD Media Catalogue Number - CD_MCN = 6, - /// DVD/HD DVD Physical Format Information - DVD_PFI = 7, - /// DVD Lead-in Copyright Management Information - DVD_CMI = 8, - /// DVD disc key - DVD_DiscKey = 9, - /// DVD/HD DVD Burst Cutting Area - DVD_BCA = 10, - /// DVD/HD DVD Lead-in Disc Manufacturer Information - DVD_DMI = 11, - /// Media identifier - DVD_MediaIdentifier = 12, - /// Media key block - DVD_MKB = 13, - /// DVD-RAM/HD DVD-RAM DDS information - DVDRAM_DDS = 14, - /// DVD-RAM/HD DVD-RAM Medium status - DVDRAM_MediumStatus = 15, - /// DVD-RAM/HD DVD-RAM Spare area information - DVDRAM_SpareArea = 16, - /// DVD-R/-RW/HD DVD-R RMD in last border-out - DVDR_RMD = 17, - /// Pre-recorded information from DVD-R/-RW lead-in - DVDR_PreRecordedInfo = 18, - /// DVD-R/-RW/HD DVD-R media identifier - DVDR_MediaIdentifier = 19, - /// DVD-R/-RW/HD DVD-R physical format information - DVDR_PFI = 20, - /// ADIP information - DVD_ADIP = 21, - /// HD DVD Lead-in copyright protection information - HDDVD_CPI = 22, - /// HD DVD-R Medium Status - HDDVD_MediumStatus = 23, - /// DVD+/-R DL Layer capacity - DVDDL_LayerCapacity = 24, - /// DVD-R DL Middle Zone start address - DVDDL_MiddleZoneAddress = 25, - /// DVD-R DL Jump Interval Size - DVDDL_JumpIntervalSize = 26, - /// DVD-R DL Start LBA of the manual layer jump - DVDDL_ManualLayerJumpLBA = 27, - /// Blu-ray Disc Information - BD_DI = 28, - /// Blu-ray Burst Cutting Area - BD_BCA = 29, - /// Blu-ray Disc Definition Structure - BD_DDS = 30, - /// Blu-ray Cartridge Status - BD_CartridgeStatus = 31, - /// Blu-ray Status of Spare Area - BD_SpareArea = 32, - /// AACS volume identifier - AACS_VolumeIdentifier = 33, - /// AACS pre-recorded media serial number - AACS_SerialNumber = 34, - /// AACS media identifier - AACS_MediaIdentifier = 35, - /// Lead-in AACS media key block - AACS_MKB = 36, - /// AACS data keys - AACS_DataKeys = 37, - /// LBA extents flagged for bus encryption by AACS - AACS_LBAExtents = 38, - /// CPRM media key block in Lead-in - AACS_CPRM_MKB = 39, - /// Recognized layer formats in hybrid discs - Hybrid_RecognizedLayers = 40, - /// Disc write protection status - MMC_WriteProtection = 41, - /// Disc standard information - MMC_DiscInformation = 42, - /// Disc track resources information - MMC_TrackResourcesInformation = 43, - /// BD-R Pseudo-overwrite information - MMC_POWResourcesInformation = 44, - /// SCSI INQUIRY response - SCSI_INQUIRY = 45, - /// SCSI MODE PAGE 2Ah - SCSI_MODEPAGE_2A = 46, - /// ATA IDENTIFY DEVICE response - ATA_IDENTIFY = 47, - /// ATA IDENTIFY PACKET DEVICE response - ATAPI_IDENTIFY = 48, - /// PCMCIA/CardBus Card Information Structure - PCMCIA_CIS = 49, - /// SecureDigital CID - SD_CID = 50, - /// SecureDigital CSD - SD_CSD = 51, - /// SecureDigital SCR - SD_SCR = 52, - /// SecureDigital OCR - SD_OCR = 53, - /// MultiMediaCard CID - MMC_CID = 54, - /// MultiMediaCard CSD - MMC_CSD = 55, - /// MultiMediaCard OCR - MMC_OCR = 56, - /// MultiMediaCard Extended CSD - MMC_ExtendedCSD = 57, - /// Xbox Security Sector - Xbox_SecuritySector = 58, - /// - /// On floppy disks, data in last cylinder usually in a different format that contains duplication or - /// manufacturing information - /// - Floppy_LeadOut = 59, - /// DVD Disc Control Blocks - DCB = 60, - /// Compact Disc First Track Pregap - CD_FirstTrackPregap = 61, - /// Compact Disc Lead-out - CD_LeadOut = 62, - /// SCSI MODE SENSE (6) - SCSI_MODESENSE_6 = 63, - /// SCSI MODE SENSE (10) - SCSI_MODESENSE_10 = 64, - /// USB descriptors - USB_Descriptors = 65, - /// XGD unlocked DMI - Xbox_DMI = 66, - /// XDG unlocked PFI - Xbox_PFI = 67, - /// Compact Disc Lead-in - CD_LeadIn = 68 - } - - /// - /// Enumeration of media types defined in CICM metadata - /// - public enum XmlMediaType : byte - { - /// - /// Purely optical discs - /// - OpticalDisc = 0, - /// - /// Media that is physically block-based or abstracted like that - /// - BlockMedia = 1, - /// - /// Media that can be accessed by-byte or by-bit, like chips - /// - LinearMedia = 2, - /// - /// Media that can only store data when it is modulated to audio - /// - AudioMedia = 3 - } - - /// CD flags bitmask - [Flags] - public enum CdFlags : byte - { - /// Track is quadraphonic. - FourChannel = 0x08, - /// Track is non-audio (data). - DataTrack = 0x04, - /// Track is copy protected. - CopyPermitted = 0x02, - /// Track has pre-emphasis. - PreEmphasis = 0x01 - } - - /// Status of a requested floppy sector - [Flags] - public enum FloppySectorStatus : byte - { - /// Both address mark and data checksums are correct. - Correct = 0x01, - /// Data checksum is incorrect. - DataError = 0x02, - /// Addres mark checksum is incorrect. - AddressMarkError = 0x04, - /// There is another sector in the same track/head with same sector id. - Duplicated = 0x08, - /// Sector data section is not magnetized. - Demagnetized = 0x10, - /// Sector data section has a physically visible hole. - Hole = 0x20, - /// There is no address mark containing the requested sector id in the track/head. - NotFound = 0x40 - } - - public enum FloppyTypes : byte - { - /// 8" floppy - Floppy, - /// 5.25" floppy - MiniFloppy, - /// 3.5" floppy - MicroFloppy, - /// 3" floppy - CompactFloppy, - /// 5.25" twiggy - FileWare, - /// 2.5" quickdisk - QuickDisk - } - - public enum FloppyDensities : byte - { - /// Standard coercitivity (about 300Oe as found in 8" and 5.25"-double-density disks). - Standard, - /// Double density coercitivity (about 600Oe as found in 5.25" HD and 3.5" DD disks). - Double, - /// High density coercitivity (about 700Oe as found in 3.5" HD disks). - High, - /// Extended density coercitivity (about 750Oe as found in 3.5" ED disks). - Extended - } -} \ No newline at end of file diff --git a/DiscImageChef.CommonTypes/Exceptions/Images.cs b/DiscImageChef.CommonTypes/Exceptions/Images.cs deleted file mode 100644 index f684a17c5..000000000 --- a/DiscImageChef.CommonTypes/Exceptions/Images.cs +++ /dev/null @@ -1,194 +0,0 @@ -// /*************************************************************************** -// The Disc Image Chef -// ---------------------------------------------------------------------------- -// -// Filename : Images.cs -// Author(s) : Natalia Portillo -// -// Component : Disc image plugins. -// -// --[ Description ] ---------------------------------------------------------- -// -// Defines exceptions to be thrown by 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; -using System.Runtime.Serialization; - -namespace DiscImageChef.CommonTypes.Exceptions -{ - /// - /// Feature is supported by image but not implemented yet. - /// - [Serializable] - public class FeatureSupportedButNotImplementedImageException : Exception - { - /// - /// Feature is supported by image but not implemented yet. - /// - /// Message. - /// Inner. - public FeatureSupportedButNotImplementedImageException(string message, Exception inner) : - base(message, inner) { } - - /// - /// Feature is supported by image but not implemented yet. - /// - /// Message. - public FeatureSupportedButNotImplementedImageException(string message) : base(message) { } - - /// - /// Feature is supported by image but not implemented yet. - /// - /// Info. - /// Context. - protected FeatureSupportedButNotImplementedImageException(SerializationInfo info, StreamingContext context) - { - if(info == null) throw new ArgumentNullException(nameof(info)); - } - } - - /// - /// Feature is not supported by image. - /// - [Serializable] - public class FeatureUnsupportedImageException : Exception - { - /// - /// Feature is not supported by image. - /// - /// Message. - /// Inner. - public FeatureUnsupportedImageException(string message, Exception inner) : base(message, inner) { } - - /// - /// Feature is not supported by image. - /// - /// Message. - public FeatureUnsupportedImageException(string message) : base(message) { } - - /// - /// Feature is not supported by image. - /// - /// Info. - /// Context. - protected FeatureUnsupportedImageException(SerializationInfo info, StreamingContext context) - { - if(info == null) throw new ArgumentNullException(nameof(info)); - } - } - - /// - /// Feature is supported by image but not present on it. - /// - [Serializable] - public class FeatureNotPresentImageException : Exception - { - /// - /// Feature is supported by image but not present on it. - /// - /// Message. - /// Inner. - public FeatureNotPresentImageException(string message, Exception inner) : base(message, inner) { } - - /// - /// Feature is supported by image but not present on it. - /// - /// Message. - public FeatureNotPresentImageException(string message) : base(message) { } - - /// - /// Feature is supported by image but not present on it. - /// - /// Info. - /// Context. - protected FeatureNotPresentImageException(SerializationInfo info, StreamingContext context) - { - if(info == null) throw new ArgumentNullException(nameof(info)); - } - } - - /// - /// Feature is supported by image but not by the disc it represents. - /// - [Serializable] - public class FeaturedNotSupportedByDiscImageException : Exception - { - /// - /// Feature is supported by image but not by the disc it represents. - /// - /// Message. - /// Inner. - public FeaturedNotSupportedByDiscImageException(string message, Exception inner) : base(message, inner) { } - - /// - /// Feature is supported by image but not by the disc it represents. - /// - /// Message. - public FeaturedNotSupportedByDiscImageException(string message) : base(message) { } - - /// - /// Feature is supported by image but not by the disc it represents. - /// - /// Info. - /// Context. - protected FeaturedNotSupportedByDiscImageException(SerializationInfo info, StreamingContext context) - { - if(info == null) throw new ArgumentNullException(nameof(info)); - } - } - - /// - /// Corrupt, incorrect or unhandled feature found on image - /// - [Serializable] - public class ImageNotSupportedException : Exception - { - /// - /// Corrupt, incorrect or unhandled feature found on image - /// - /// Message. - /// Inner. - public ImageNotSupportedException(string message, Exception inner) : base(message, inner) { } - - /// - /// Corrupt, incorrect or unhandled feature found on image - /// - /// Message. - public ImageNotSupportedException(string message) : base(message) { } - - /// - /// Corrupt, incorrect or unhandled feature found on image - /// - /// Info. - /// Context. - protected ImageNotSupportedException(SerializationInfo info, StreamingContext context) - { - if(info == null) throw new ArgumentNullException(nameof(info)); - } - } -} \ No newline at end of file diff --git a/DiscImageChef.CommonTypes/Extents/ExtentsByte.cs b/DiscImageChef.CommonTypes/Extents/ExtentsByte.cs deleted file mode 100644 index 6227129d9..000000000 --- a/DiscImageChef.CommonTypes/Extents/ExtentsByte.cs +++ /dev/null @@ -1,251 +0,0 @@ -// /*************************************************************************** -// The Disc Image Chef -// ---------------------------------------------------------------------------- -// -// Filename : ExtentsByte.cs -// Author(s) : Natalia Portillo -// -// Component : Extent helpers. -// -// --[ Description ] ---------------------------------------------------------- -// -// Provides extents for byte types. -// -// --[ 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; -using System.Collections.Generic; -using System.Linq; - -namespace DiscImageChef.CommonTypes.Extents -{ - /// - /// Implements extents for - /// - public class ExtentsByte - { - List> backend; - - /// - /// Initialize an empty list of extents - /// - public ExtentsByte() - { - backend = new List>(); - } - - /// - /// Initializes extents with an specific list - /// - /// List of extents as tuples "start, end" - public ExtentsByte(IEnumerable> list) - { - backend = list.OrderBy(t => t.Item1).ToList(); - } - - /// - /// Gets a count of how many extents are stored - /// - public int Count => backend.Count; - - /// - /// Adds the specified number to the corresponding extent, or creates a new one - /// - /// - public void Add(byte item) - { - Tuple removeOne = null; - Tuple removeTwo = null; - Tuple itemToAdd = null; - - for(int i = 0; i < backend.Count; i++) - { - // Already contained in an extent - if(item >= backend[i].Item1 && item <= backend[i].Item2) return; - - // Expands existing extent start - if(item == backend[i].Item1 - 1) - { - removeOne = backend[i]; - - if(i > 0 && item == backend[i - 1].Item2 + 1) - { - removeTwo = backend[i - 1]; - itemToAdd = new Tuple(backend[i - 1].Item1, backend[i].Item2); - } - else itemToAdd = new Tuple(item, backend[i].Item2); - - break; - } - - // Expands existing extent end - if(item != backend[i].Item2 + 1) continue; - - removeOne = backend[i]; - - if(i < backend.Count - 1 && item == backend[i + 1].Item1 - 1) - { - removeTwo = backend[i + 1]; - itemToAdd = new Tuple(backend[i].Item1, backend[i + 1].Item2); - } - else itemToAdd = new Tuple(backend[i].Item1, item); - - break; - } - - if(itemToAdd != null) - { - backend.Remove(removeOne); - backend.Remove(removeTwo); - backend.Add(itemToAdd); - } - else backend.Add(new Tuple(item, item)); - - // Sort - backend = backend.OrderBy(t => t.Item1).ToList(); - } - - /// - /// Adds a new extent - /// - /// First element of the extent - /// - /// Last element of the extent or if is true how many elements the extent runs - /// for - /// - /// If set to true, indicates how many elements the extent runs for - public void Add(byte start, byte end, bool run = false) - { - byte realEnd; - if(run) realEnd = (byte)(start + end - 1); - else realEnd = end; - - // TODO: Optimize this - for(byte t = start; t <= realEnd; t++) Add(t); - } - - /// - /// Checks if the specified item is contained by an extent on this instance - /// - /// Item to seach for - /// true if any of the extents on this instance contains the item - public bool Contains(byte item) - { - return backend.Any(extent => item >= extent.Item1 && item <= extent.Item2); - } - - /// - /// Removes all extents from this instance - /// - public void Clear() - { - backend.Clear(); - } - - /// - /// Removes an item from the extents in this instance - /// - /// Item to remove - /// true if the item was contained in a known extent and removed, false otherwise - public bool Remove(byte item) - { - Tuple toRemove = null; - Tuple toAddOne = null; - Tuple toAddTwo = null; - - foreach(Tuple extent in backend) - { - // Extent is contained and not a border - if(item > extent.Item1 && item < extent.Item2) - { - toRemove = extent; - toAddOne = new Tuple(extent.Item1, (byte)(item - 1)); - toAddTwo = new Tuple((byte)(item + 1), extent.Item2); - break; - } - - // Extent is left border, but not only element - if(item == extent.Item1 && item != extent.Item2) - { - toRemove = extent; - toAddOne = new Tuple((byte)(item + 1), extent.Item2); - break; - } - - // Extent is right border, but not only element - if(item != extent.Item1 && item == extent.Item2) - { - toRemove = extent; - toAddOne = new Tuple(extent.Item1, (byte)(item - 1)); - break; - } - - // Extent is only element - if(item != extent.Item1 || item != extent.Item2) continue; - - toRemove = extent; - break; - } - - // Item not found - if(toRemove == null) return false; - - backend.Remove(toRemove); - if(toAddOne != null) backend.Add(toAddOne); - if(toAddTwo != null) backend.Add(toAddTwo); - - // Sort - backend = backend.OrderBy(t => t.Item1).ToList(); - - return true; - } - - /// - /// Converts the list of extents to an array of where T1 is first element of the extent and T2 is - /// last element - /// - /// Array of - public Tuple[] ToArray() => backend.ToArray(); - - /// - /// Gets the first element of the extent that contains the specified item - /// - /// Item - /// First element of extent - /// true if item was found in an extent, false otherwise - public bool GetStart(byte item, out byte start) - { - start = 0; - foreach(Tuple extent in backend.Where(extent => item >= extent.Item1 && item <= extent.Item2)) - { - start = extent.Item1; - return true; - } - - return false; - } - } -} \ No newline at end of file diff --git a/DiscImageChef.CommonTypes/Extents/ExtentsConverter.cs b/DiscImageChef.CommonTypes/Extents/ExtentsConverter.cs deleted file mode 100644 index 995942d8f..000000000 --- a/DiscImageChef.CommonTypes/Extents/ExtentsConverter.cs +++ /dev/null @@ -1,71 +0,0 @@ -// /*************************************************************************** -// The Disc Image Chef -// ---------------------------------------------------------------------------- -// -// Filename : ExtentsConverter.cs -// Author(s) : Natalia Portillo -// -// Component : XML metadata. -// -// --[ Description ] ---------------------------------------------------------- -// -// Converts extents to/from XML. -// -// --[ 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; -using System.Collections.Generic; -using System.Linq; -using Schemas; - -namespace DiscImageChef.CommonTypes.Extents -{ - public static class ExtentsConverter - { - public static ExtentType[] ToMetadata(ExtentsULong extents) - { - if(extents == null) return null; - - Tuple[] tuples = extents.ToArray(); - ExtentType[] array = new ExtentType[tuples.Length]; - - for(ulong i = 0; i < (ulong)array.LongLength; i++) - array[i] = new ExtentType {Start = tuples[i].Item1, End = tuples[i].Item2}; - - return array; - } - - public static ExtentsULong FromMetadata(ExtentType[] extents) - { - if(extents == null) return null; - - List> tuples = - extents.Select(extent => new Tuple(extent.Start, extent.End)).ToList(); - - return new ExtentsULong(tuples); - } - } -} \ No newline at end of file diff --git a/DiscImageChef.CommonTypes/Extents/ExtentsInt.cs b/DiscImageChef.CommonTypes/Extents/ExtentsInt.cs deleted file mode 100644 index 5c1fd40d7..000000000 --- a/DiscImageChef.CommonTypes/Extents/ExtentsInt.cs +++ /dev/null @@ -1,251 +0,0 @@ -// /*************************************************************************** -// The Disc Image Chef -// ---------------------------------------------------------------------------- -// -// Filename : ExtentsInt.cs -// Author(s) : Natalia Portillo -// -// Component : Extent helpers. -// -// --[ Description ] ---------------------------------------------------------- -// -// Provides extents for int types. -// -// --[ 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; -using System.Collections.Generic; -using System.Linq; - -namespace DiscImageChef.CommonTypes.Extents -{ - /// - /// Implements extents for - /// - public class ExtentsInt - { - List> backend; - - /// - /// Initialize an empty list of extents - /// - public ExtentsInt() - { - backend = new List>(); - } - - /// - /// Initializes extents with an specific list - /// - /// List of extents as tuples "start, end" - public ExtentsInt(IEnumerable> list) - { - backend = list.OrderBy(t => t.Item1).ToList(); - } - - /// - /// Gets a count of how many extents are stored - /// - public int Count => backend.Count; - - /// - /// Adds the specified number to the corresponding extent, or creates a new one - /// - /// - public void Add(int item) - { - Tuple removeOne = null; - Tuple removeTwo = null; - Tuple itemToAdd = null; - - for(int i = 0; i < backend.Count; i++) - { - // Already contained in an extent - if(item >= backend[i].Item1 && item <= backend[i].Item2) return; - - // Expands existing extent start - if(item == backend[i].Item1 - 1) - { - removeOne = backend[i]; - - if(i > 0 && item == backend[i - 1].Item2 + 1) - { - removeTwo = backend[i - 1]; - itemToAdd = new Tuple(backend[i - 1].Item1, backend[i].Item2); - } - else itemToAdd = new Tuple(item, backend[i].Item2); - - break; - } - - // Expands existing extent end - if(item != backend[i].Item2 + 1) continue; - - removeOne = backend[i]; - - if(i < backend.Count - 1 && item == backend[i + 1].Item1 - 1) - { - removeTwo = backend[i + 1]; - itemToAdd = new Tuple(backend[i].Item1, backend[i + 1].Item2); - } - else itemToAdd = new Tuple(backend[i].Item1, item); - - break; - } - - if(itemToAdd != null) - { - backend.Remove(removeOne); - backend.Remove(removeTwo); - backend.Add(itemToAdd); - } - else backend.Add(new Tuple(item, item)); - - // Sort - backend = backend.OrderBy(t => t.Item1).ToList(); - } - - /// - /// Adds a new extent - /// - /// First element of the extent - /// - /// Last element of the extent or if is true how many elements the extent runs - /// for - /// - /// If set to true, indicates how many elements the extent runs for - public void Add(int start, int end, bool run = false) - { - int realEnd; - if(run) realEnd = start + end - 1; - else realEnd = end; - - // TODO: Optimize this - for(int t = start; t <= realEnd; t++) Add(t); - } - - /// - /// Checks if the specified item is contained by an extent on this instance - /// - /// Item to seach for - /// true if any of the extents on this instance contains the item - public bool Contains(int item) - { - return backend.Any(extent => item >= extent.Item1 && item <= extent.Item2); - } - - /// - /// Removes all extents from this instance - /// - public void Clear() - { - backend.Clear(); - } - - /// - /// Removes an item from the extents in this instance - /// - /// Item to remove - /// true if the item was contained in a known extent and removed, false otherwise - public bool Remove(int item) - { - Tuple toRemove = null; - Tuple toAddOne = null; - Tuple toAddTwo = null; - - foreach(Tuple extent in backend) - { - // Extent is contained and not a border - if(item > extent.Item1 && item < extent.Item2) - { - toRemove = extent; - toAddOne = new Tuple(extent.Item1, item - 1); - toAddTwo = new Tuple(item + 1, extent.Item2); - break; - } - - // Extent is left border, but not only element - if(item == extent.Item1 && item != extent.Item2) - { - toRemove = extent; - toAddOne = new Tuple(item + 1, extent.Item2); - break; - } - - // Extent is right border, but not only element - if(item != extent.Item1 && item == extent.Item2) - { - toRemove = extent; - toAddOne = new Tuple(extent.Item1, item - 1); - break; - } - - // Extent is only element - if(item != extent.Item1 || item != extent.Item2) continue; - - toRemove = extent; - break; - } - - // Item not found - if(toRemove == null) return false; - - backend.Remove(toRemove); - if(toAddOne != null) backend.Add(toAddOne); - if(toAddTwo != null) backend.Add(toAddTwo); - - // Sort - backend = backend.OrderBy(t => t.Item1).ToList(); - - return true; - } - - /// - /// Converts the list of extents to an array of where T1 is first element of the extent and T2 is - /// last element - /// - /// Array of - public Tuple[] ToArray() => backend.ToArray(); - - /// - /// Gets the first element of the extent that contains the specified item - /// - /// Item - /// First element of extent - /// true if item was found in an extent, false otherwise - public bool GetStart(int item, out int start) - { - start = 0; - foreach(Tuple extent in backend.Where(extent => item >= extent.Item1 && item <= extent.Item2)) - { - start = extent.Item1; - return true; - } - - return false; - } - } -} \ No newline at end of file diff --git a/DiscImageChef.CommonTypes/Extents/ExtentsLong.cs b/DiscImageChef.CommonTypes/Extents/ExtentsLong.cs deleted file mode 100644 index cda536f78..000000000 --- a/DiscImageChef.CommonTypes/Extents/ExtentsLong.cs +++ /dev/null @@ -1,251 +0,0 @@ -// /*************************************************************************** -// The Disc Image Chef -// ---------------------------------------------------------------------------- -// -// Filename : ExtentsLong.cs -// Author(s) : Natalia Portillo -// -// Component : Extent helpers. -// -// --[ Description ] ---------------------------------------------------------- -// -// Provides extents for long types. -// -// --[ 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; -using System.Collections.Generic; -using System.Linq; - -namespace DiscImageChef.CommonTypes.Extents -{ - /// - /// Implements extents for - /// - public class ExtentsLong - { - List> backend; - - /// - /// Initialize an empty list of extents - /// - public ExtentsLong() - { - backend = new List>(); - } - - /// - /// Initializes extents with an specific list - /// - /// List of extents as tuples "start, end" - public ExtentsLong(IEnumerable> list) - { - backend = list.OrderBy(t => t.Item1).ToList(); - } - - /// - /// Gets a count of how many extents are stored - /// - public int Count => backend.Count; - - /// - /// Adds the specified number to the corresponding extent, or creates a new one - /// - /// - public void Add(long item) - { - Tuple removeOne = null; - Tuple removeTwo = null; - Tuple itemToAdd = null; - - for(int i = 0; i < backend.Count; i++) - { - // Already contained in an extent - if(item >= backend[i].Item1 && item <= backend[i].Item2) return; - - // Expands existing extent start - if(item == backend[i].Item1 - 1) - { - removeOne = backend[i]; - - if(i > 0 && item == backend[i - 1].Item2 + 1) - { - removeTwo = backend[i - 1]; - itemToAdd = new Tuple(backend[i - 1].Item1, backend[i].Item2); - } - else itemToAdd = new Tuple(item, backend[i].Item2); - - break; - } - - // Expands existing extent end - if(item != backend[i].Item2 + 1) continue; - - removeOne = backend[i]; - - if(i < backend.Count - 1 && item == backend[i + 1].Item1 - 1) - { - removeTwo = backend[i + 1]; - itemToAdd = new Tuple(backend[i].Item1, backend[i + 1].Item2); - } - else itemToAdd = new Tuple(backend[i].Item1, item); - - break; - } - - if(itemToAdd != null) - { - backend.Remove(removeOne); - backend.Remove(removeTwo); - backend.Add(itemToAdd); - } - else backend.Add(new Tuple(item, item)); - - // Sort - backend = backend.OrderBy(t => t.Item1).ToList(); - } - - /// - /// Adds a new extent - /// - /// First element of the extent - /// - /// Last element of the extent or if is true how many elements the extent runs - /// for - /// - /// If set to true, indicates how many elements the extent runs for - public void Add(long start, long end, bool run = false) - { - long realEnd; - if(run) realEnd = start + end - 1; - else realEnd = end; - - // TODO: Optimize this - for(long t = start; t <= realEnd; t++) Add(t); - } - - /// - /// Checks if the specified item is contained by an extent on this instance - /// - /// Item to seach for - /// true if any of the extents on this instance contains the item - public bool Contains(long item) - { - return backend.Any(extent => item >= extent.Item1 && item <= extent.Item2); - } - - /// - /// Removes all extents from this instance - /// - public void Clear() - { - backend.Clear(); - } - - /// - /// Removes an item from the extents in this instance - /// - /// Item to remove - /// true if the item was contained in a known extent and removed, false otherwise - public bool Remove(long item) - { - Tuple toRemove = null; - Tuple toAddOne = null; - Tuple toAddTwo = null; - - foreach(Tuple extent in backend) - { - // Extent is contained and not a border - if(item > extent.Item1 && item < extent.Item2) - { - toRemove = extent; - toAddOne = new Tuple(extent.Item1, item - 1); - toAddTwo = new Tuple(item + 1, extent.Item2); - break; - } - - // Extent is left border, but not only element - if(item == extent.Item1 && item != extent.Item2) - { - toRemove = extent; - toAddOne = new Tuple(item + 1, extent.Item2); - break; - } - - // Extent is right border, but not only element - if(item != extent.Item1 && item == extent.Item2) - { - toRemove = extent; - toAddOne = new Tuple(extent.Item1, item - 1); - break; - } - - // Extent is only element - if(item != extent.Item1 || item != extent.Item2) continue; - - toRemove = extent; - break; - } - - // Item not found - if(toRemove == null) return false; - - backend.Remove(toRemove); - if(toAddOne != null) backend.Add(toAddOne); - if(toAddTwo != null) backend.Add(toAddTwo); - - // Sort - backend = backend.OrderBy(t => t.Item1).ToList(); - - return true; - } - - /// - /// Converts the list of extents to an array of where T1 is first element of the extent and T2 is - /// last element - /// - /// Array of - public Tuple[] ToArray() => backend.ToArray(); - - /// - /// Gets the first element of the extent that contains the specified item - /// - /// Item - /// First element of extent - /// true if item was found in an extent, false otherwise - public bool GetStart(long item, out long start) - { - start = 0; - foreach(Tuple extent in backend.Where(extent => item >= extent.Item1 && item <= extent.Item2)) - { - start = extent.Item1; - return true; - } - - return false; - } - } -} \ No newline at end of file diff --git a/DiscImageChef.CommonTypes/Extents/ExtentsSByte.cs b/DiscImageChef.CommonTypes/Extents/ExtentsSByte.cs deleted file mode 100644 index 31a23e0e7..000000000 --- a/DiscImageChef.CommonTypes/Extents/ExtentsSByte.cs +++ /dev/null @@ -1,251 +0,0 @@ -// /*************************************************************************** -// The Disc Image Chef -// ---------------------------------------------------------------------------- -// -// Filename : ExtentsSByte.cs -// Author(s) : Natalia Portillo -// -// Component : Extent helpers. -// -// --[ Description ] ---------------------------------------------------------- -// -// Provides extents for sbyte types. -// -// --[ 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; -using System.Collections.Generic; -using System.Linq; - -namespace DiscImageChef.CommonTypes.Extents -{ - /// - /// Implements extents for - /// - public class ExtentsSByte - { - List> backend; - - /// - /// Initialize an empty list of extents - /// - public ExtentsSByte() - { - backend = new List>(); - } - - /// - /// Initializes extents with an specific list - /// - /// List of extents as tuples "start, end" - public ExtentsSByte(IEnumerable> list) - { - backend = list.OrderBy(t => t.Item1).ToList(); - } - - /// - /// Gets a count of how many extents are stored - /// - public int Count => backend.Count; - - /// - /// Adds the specified number to the corresponding extent, or creates a new one - /// - /// - public void Add(sbyte item) - { - Tuple removeOne = null; - Tuple removeTwo = null; - Tuple itemToAdd = null; - - for(int i = 0; i < backend.Count; i++) - { - // Already contained in an extent - if(item >= backend[i].Item1 && item <= backend[i].Item2) return; - - // Expands existing extent start - if(item == backend[i].Item1 - 1) - { - removeOne = backend[i]; - - if(i > 0 && item == backend[i - 1].Item2 + 1) - { - removeTwo = backend[i - 1]; - itemToAdd = new Tuple(backend[i - 1].Item1, backend[i].Item2); - } - else itemToAdd = new Tuple(item, backend[i].Item2); - - break; - } - - // Expands existing extent end - if(item != backend[i].Item2 + 1) continue; - - removeOne = backend[i]; - - if(i < backend.Count - 1 && item == backend[i + 1].Item1 - 1) - { - removeTwo = backend[i + 1]; - itemToAdd = new Tuple(backend[i].Item1, backend[i + 1].Item2); - } - else itemToAdd = new Tuple(backend[i].Item1, item); - - break; - } - - if(itemToAdd != null) - { - backend.Remove(removeOne); - backend.Remove(removeTwo); - backend.Add(itemToAdd); - } - else backend.Add(new Tuple(item, item)); - - // Sort - backend = backend.OrderBy(t => t.Item1).ToList(); - } - - /// - /// Adds a new extent - /// - /// First element of the extent - /// - /// Last element of the extent or if is true how many elements the extent runs - /// for - /// - /// If set to true, indicates how many elements the extent runs for - public void Add(sbyte start, sbyte end, bool run = false) - { - sbyte realEnd; - if(run) realEnd = (sbyte)(start + end - 1); - else realEnd = end; - - // TODO: Optimize this - for(sbyte t = start; t <= realEnd; t++) Add(t); - } - - /// - /// Checks if the specified item is contained by an extent on this instance - /// - /// Item to seach for - /// true if any of the extents on this instance contains the item - public bool Contains(sbyte item) - { - return backend.Any(extent => item >= extent.Item1 && item <= extent.Item2); - } - - /// - /// Removes all extents from this instance - /// - public void Clear() - { - backend.Clear(); - } - - /// - /// Removes an item from the extents in this instance - /// - /// Item to remove - /// true if the item was contained in a known extent and removed, false otherwise - public bool Remove(sbyte item) - { - Tuple toRemove = null; - Tuple toAddOne = null; - Tuple toAddTwo = null; - - foreach(Tuple extent in backend) - { - // Extent is contained and not a border - if(item > extent.Item1 && item < extent.Item2) - { - toRemove = extent; - toAddOne = new Tuple(extent.Item1, (sbyte)(item - 1)); - toAddTwo = new Tuple((sbyte)(item + 1), extent.Item2); - break; - } - - // Extent is left border, but not only element - if(item == extent.Item1 && item != extent.Item2) - { - toRemove = extent; - toAddOne = new Tuple((sbyte)(item + 1), extent.Item2); - break; - } - - // Extent is right border, but not only element - if(item != extent.Item1 && item == extent.Item2) - { - toRemove = extent; - toAddOne = new Tuple(extent.Item1, (sbyte)(item - 1)); - break; - } - - // Extent is only element - if(item != extent.Item1 || item != extent.Item2) continue; - - toRemove = extent; - break; - } - - // Item not found - if(toRemove == null) return false; - - backend.Remove(toRemove); - if(toAddOne != null) backend.Add(toAddOne); - if(toAddTwo != null) backend.Add(toAddTwo); - - // Sort - backend = backend.OrderBy(t => t.Item1).ToList(); - - return true; - } - - /// - /// Converts the list of extents to an array of where T1 is first element of the extent and T2 is - /// last element - /// - /// Array of - public Tuple[] ToArray() => backend.ToArray(); - - /// - /// Gets the first element of the extent that contains the specified item - /// - /// Item - /// First element of extent - /// true if item was found in an extent, false otherwise - public bool GetStart(sbyte item, out sbyte start) - { - start = 0; - foreach(Tuple extent in backend.Where(extent => item >= extent.Item1 && item <= extent.Item2)) - { - start = extent.Item1; - return true; - } - - return false; - } - } -} \ No newline at end of file diff --git a/DiscImageChef.CommonTypes/Extents/ExtentsShort.cs b/DiscImageChef.CommonTypes/Extents/ExtentsShort.cs deleted file mode 100644 index 5e09cd3af..000000000 --- a/DiscImageChef.CommonTypes/Extents/ExtentsShort.cs +++ /dev/null @@ -1,251 +0,0 @@ -// /*************************************************************************** -// The Disc Image Chef -// ---------------------------------------------------------------------------- -// -// Filename : ExtentsShort.cs -// Author(s) : Natalia Portillo -// -// Component : Extent helpers. -// -// --[ Description ] ---------------------------------------------------------- -// -// Provides extents for short types. -// -// --[ 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; -using System.Collections.Generic; -using System.Linq; - -namespace DiscImageChef.CommonTypes.Extents -{ - /// - /// Implements extents for - /// - public class ExtentsShort - { - List> backend; - - /// - /// Initialize an empty list of extents - /// - public ExtentsShort() - { - backend = new List>(); - } - - /// - /// Initializes extents with an specific list - /// - /// List of extents as tuples "start, end" - public ExtentsShort(IEnumerable> list) - { - backend = list.OrderBy(t => t.Item1).ToList(); - } - - /// - /// Gets a count of how many extents are stored - /// - public int Count => backend.Count; - - /// - /// Adds the specified number to the corresponding extent, or creates a new one - /// - /// - public void Add(short item) - { - Tuple removeOne = null; - Tuple removeTwo = null; - Tuple itemToAdd = null; - - for(int i = 0; i < backend.Count; i++) - { - // Already contained in an extent - if(item >= backend[i].Item1 && item <= backend[i].Item2) return; - - // Expands existing extent start - if(item == backend[i].Item1 - 1) - { - removeOne = backend[i]; - - if(i > 0 && item == backend[i - 1].Item2 + 1) - { - removeTwo = backend[i - 1]; - itemToAdd = new Tuple(backend[i - 1].Item1, backend[i].Item2); - } - else itemToAdd = new Tuple(item, backend[i].Item2); - - break; - } - - // Expands existing extent end - if(item != backend[i].Item2 + 1) continue; - - removeOne = backend[i]; - - if(i < backend.Count - 1 && item == backend[i + 1].Item1 - 1) - { - removeTwo = backend[i + 1]; - itemToAdd = new Tuple(backend[i].Item1, backend[i + 1].Item2); - } - else itemToAdd = new Tuple(backend[i].Item1, item); - - break; - } - - if(itemToAdd != null) - { - backend.Remove(removeOne); - backend.Remove(removeTwo); - backend.Add(itemToAdd); - } - else backend.Add(new Tuple(item, item)); - - // Sort - backend = backend.OrderBy(t => t.Item1).ToList(); - } - - /// - /// Adds a new extent - /// - /// First element of the extent - /// - /// Last element of the extent or if is true how many elements the extent runs - /// for - /// - /// If set to true, indicates how many elements the extent runs for - public void Add(short start, short end, bool run = false) - { - short realEnd; - if(run) realEnd = (short)(start + end - 1); - else realEnd = end; - - // TODO: Optimize this - for(short t = start; t <= realEnd; t++) Add(t); - } - - /// - /// Checks if the specified item is contained by an extent on this instance - /// - /// Item to seach for - /// true if any of the extents on this instance contains the item - public bool Contains(short item) - { - return backend.Any(extent => item >= extent.Item1 && item <= extent.Item2); - } - - /// - /// Removes all extents from this instance - /// - public void Clear() - { - backend.Clear(); - } - - /// - /// Removes an item from the extents in this instance - /// - /// Item to remove - /// true if the item was contained in a known extent and removed, false otherwise - public bool Remove(short item) - { - Tuple toRemove = null; - Tuple toAddOne = null; - Tuple toAddTwo = null; - - foreach(Tuple extent in backend) - { - // Extent is contained and not a border - if(item > extent.Item1 && item < extent.Item2) - { - toRemove = extent; - toAddOne = new Tuple(extent.Item1, (short)(item - 1)); - toAddTwo = new Tuple((short)(item + 1), extent.Item2); - break; - } - - // Extent is left border, but not only element - if(item == extent.Item1 && item != extent.Item2) - { - toRemove = extent; - toAddOne = new Tuple((short)(item + 1), extent.Item2); - break; - } - - // Extent is right border, but not only element - if(item != extent.Item1 && item == extent.Item2) - { - toRemove = extent; - toAddOne = new Tuple(extent.Item1, (short)(item - 1)); - break; - } - - // Extent is only element - if(item != extent.Item1 || item != extent.Item2) continue; - - toRemove = extent; - break; - } - - // Item not found - if(toRemove == null) return false; - - backend.Remove(toRemove); - if(toAddOne != null) backend.Add(toAddOne); - if(toAddTwo != null) backend.Add(toAddTwo); - - // Sort - backend = backend.OrderBy(t => t.Item1).ToList(); - - return true; - } - - /// - /// Converts the list of extents to an array of where T1 is first element of the extent and T2 is - /// last element - /// - /// Array of - public Tuple[] ToArray() => backend.ToArray(); - - /// - /// Gets the first element of the extent that contains the specified item - /// - /// Item - /// First element of extent - /// true if item was found in an extent, false otherwise - public bool GetStart(short item, out short start) - { - start = 0; - foreach(Tuple extent in backend.Where(extent => item >= extent.Item1 && item <= extent.Item2)) - { - start = extent.Item1; - return true; - } - - return false; - } - } -} \ No newline at end of file diff --git a/DiscImageChef.CommonTypes/Extents/ExtentsUInt.cs b/DiscImageChef.CommonTypes/Extents/ExtentsUInt.cs deleted file mode 100644 index 2c80f799b..000000000 --- a/DiscImageChef.CommonTypes/Extents/ExtentsUInt.cs +++ /dev/null @@ -1,251 +0,0 @@ -// /*************************************************************************** -// The Disc Image Chef -// ---------------------------------------------------------------------------- -// -// Filename : ExtentsUInt.cs -// Author(s) : Natalia Portillo -// -// Component : Extent helpers. -// -// --[ Description ] ---------------------------------------------------------- -// -// Provides extents for uint types. -// -// --[ 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; -using System.Collections.Generic; -using System.Linq; - -namespace DiscImageChef.CommonTypes.Extents -{ - /// - /// Implements extents for - /// - public class ExtentsUInt - { - List> backend; - - /// - /// Initialize an empty list of extents - /// - public ExtentsUInt() - { - backend = new List>(); - } - - /// - /// Initializes extents with an specific list - /// - /// List of extents as tuples "start, end" - public ExtentsUInt(IEnumerable> list) - { - backend = list.OrderBy(t => t.Item1).ToList(); - } - - /// - /// Gets a count of how many extents are stored - /// - public int Count => backend.Count; - - /// - /// Adds the specified number to the corresponding extent, or creates a new one - /// - /// - public void Add(uint item) - { - Tuple removeOne = null; - Tuple removeTwo = null; - Tuple itemToAdd = null; - - for(int i = 0; i < backend.Count; i++) - { - // Already contained in an extent - if(item >= backend[i].Item1 && item <= backend[i].Item2) return; - - // Expands existing extent start - if(item == backend[i].Item1 - 1) - { - removeOne = backend[i]; - - if(i > 0 && item == backend[i - 1].Item2 + 1) - { - removeTwo = backend[i - 1]; - itemToAdd = new Tuple(backend[i - 1].Item1, backend[i].Item2); - } - else itemToAdd = new Tuple(item, backend[i].Item2); - - break; - } - - // Expands existing extent end - if(item != backend[i].Item2 + 1) continue; - - removeOne = backend[i]; - - if(i < backend.Count - 1 && item == backend[i + 1].Item1 - 1) - { - removeTwo = backend[i + 1]; - itemToAdd = new Tuple(backend[i].Item1, backend[i + 1].Item2); - } - else itemToAdd = new Tuple(backend[i].Item1, item); - - break; - } - - if(itemToAdd != null) - { - backend.Remove(removeOne); - backend.Remove(removeTwo); - backend.Add(itemToAdd); - } - else backend.Add(new Tuple(item, item)); - - // Sort - backend = backend.OrderBy(t => t.Item1).ToList(); - } - - /// - /// Adds a new extent - /// - /// First element of the extent - /// - /// Last element of the extent or if is true how many elements the extent runs - /// for - /// - /// If set to true, indicates how many elements the extent runs for - public void Add(uint start, uint end, bool run = false) - { - uint realEnd; - if(run) realEnd = start + end - 1; - else realEnd = end; - - // TODO: Optimize this - for(uint t = start; t <= realEnd; t++) Add(t); - } - - /// - /// Checks if the specified item is contained by an extent on this instance - /// - /// Item to seach for - /// true if any of the extents on this instance contains the item - public bool Contains(uint item) - { - return backend.Any(extent => item >= extent.Item1 && item <= extent.Item2); - } - - /// - /// Removes all extents from this instance - /// - public void Clear() - { - backend.Clear(); - } - - /// - /// Removes an item from the extents in this instance - /// - /// Item to remove - /// true if the item was contained in a known extent and removed, false otherwise - public bool Remove(uint item) - { - Tuple toRemove = null; - Tuple toAddOne = null; - Tuple toAddTwo = null; - - foreach(Tuple extent in backend) - { - // Extent is contained and not a border - if(item > extent.Item1 && item < extent.Item2) - { - toRemove = extent; - toAddOne = new Tuple(extent.Item1, item - 1); - toAddTwo = new Tuple(item + 1, extent.Item2); - break; - } - - // Extent is left border, but not only element - if(item == extent.Item1 && item != extent.Item2) - { - toRemove = extent; - toAddOne = new Tuple(item + 1, extent.Item2); - break; - } - - // Extent is right border, but not only element - if(item != extent.Item1 && item == extent.Item2) - { - toRemove = extent; - toAddOne = new Tuple(extent.Item1, item - 1); - break; - } - - // Extent is only element - if(item != extent.Item1 || item != extent.Item2) continue; - - toRemove = extent; - break; - } - - // Item not found - if(toRemove == null) return false; - - backend.Remove(toRemove); - if(toAddOne != null) backend.Add(toAddOne); - if(toAddTwo != null) backend.Add(toAddTwo); - - // Sort - backend = backend.OrderBy(t => t.Item1).ToList(); - - return true; - } - - /// - /// Converts the list of extents to an array of where T1 is first element of the extent and T2 is - /// last element - /// - /// Array of - public Tuple[] ToArray() => backend.ToArray(); - - /// - /// Gets the first element of the extent that contains the specified item - /// - /// Item - /// First element of extent - /// true if item was found in an extent, false otherwise - public bool GetStart(uint item, out uint start) - { - start = 0; - foreach(Tuple extent in backend.Where(extent => item >= extent.Item1 && item <= extent.Item2)) - { - start = extent.Item1; - return true; - } - - return false; - } - } -} \ No newline at end of file diff --git a/DiscImageChef.CommonTypes/Extents/ExtentsULong.cs b/DiscImageChef.CommonTypes/Extents/ExtentsULong.cs deleted file mode 100644 index 8540a0aea..000000000 --- a/DiscImageChef.CommonTypes/Extents/ExtentsULong.cs +++ /dev/null @@ -1,251 +0,0 @@ -// /*************************************************************************** -// The Disc Image Chef -// ---------------------------------------------------------------------------- -// -// Filename : ExtentsULong.cs -// Author(s) : Natalia Portillo -// -// Component : Extent helpers. -// -// --[ Description ] ---------------------------------------------------------- -// -// Provides extents for ulong types. -// -// --[ 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; -using System.Collections.Generic; -using System.Linq; - -namespace DiscImageChef.CommonTypes.Extents -{ - /// - /// Implements extents for - /// - public class ExtentsULong - { - List> backend; - - /// - /// Initialize an empty list of extents - /// - public ExtentsULong() - { - backend = new List>(); - } - - /// - /// Initializes extents with an specific list - /// - /// List of extents as tuples "start, end" - public ExtentsULong(IEnumerable> list) - { - backend = list.OrderBy(t => t.Item1).ToList(); - } - - /// - /// Gets a count of how many extents are stored - /// - public int Count => backend.Count; - - /// - /// Adds the specified number to the corresponding extent, or creates a new one - /// - /// - public void Add(ulong item) - { - Tuple removeOne = null; - Tuple removeTwo = null; - Tuple itemToAdd = null; - - for(int i = 0; i < backend.Count; i++) - { - // Already contained in an extent - if(item >= backend[i].Item1 && item <= backend[i].Item2) return; - - // Expands existing extent start - if(item == backend[i].Item1 - 1) - { - removeOne = backend[i]; - - if(i > 0 && item == backend[i - 1].Item2 + 1) - { - removeTwo = backend[i - 1]; - itemToAdd = new Tuple(backend[i - 1].Item1, backend[i].Item2); - } - else itemToAdd = new Tuple(item, backend[i].Item2); - - break; - } - - // Expands existing extent end - if(item != backend[i].Item2 + 1) continue; - - removeOne = backend[i]; - - if(i < backend.Count - 1 && item == backend[i + 1].Item1 - 1) - { - removeTwo = backend[i + 1]; - itemToAdd = new Tuple(backend[i].Item1, backend[i + 1].Item2); - } - else itemToAdd = new Tuple(backend[i].Item1, item); - - break; - } - - if(itemToAdd != null) - { - backend.Remove(removeOne); - backend.Remove(removeTwo); - backend.Add(itemToAdd); - } - else backend.Add(new Tuple(item, item)); - - // Sort - backend = backend.OrderBy(t => t.Item1).ToList(); - } - - /// - /// Adds a new extent - /// - /// First element of the extent - /// - /// Last element of the extent or if is true how many elements the extent runs - /// for - /// - /// If set to true, indicates how many elements the extent runs for - public void Add(ulong start, ulong end, bool run = false) - { - ulong realEnd; - if(run) realEnd = start + end - 1; - else realEnd = end; - - // TODO: Optimize this - for(ulong t = start; t <= realEnd; t++) Add(t); - } - - /// - /// Checks if the specified item is contained by an extent on this instance - /// - /// Item to seach for - /// true if any of the extents on this instance contains the item - public bool Contains(ulong item) - { - return backend.Any(extent => item >= extent.Item1 && item <= extent.Item2); - } - - /// - /// Removes all extents from this instance - /// - public void Clear() - { - backend.Clear(); - } - - /// - /// Removes an item from the extents in this instance - /// - /// Item to remove - /// true if the item was contained in a known extent and removed, false otherwise - public bool Remove(ulong item) - { - Tuple toRemove = null; - Tuple toAddOne = null; - Tuple toAddTwo = null; - - foreach(Tuple extent in backend) - { - // Extent is contained and not a border - if(item > extent.Item1 && item < extent.Item2) - { - toRemove = extent; - toAddOne = new Tuple(extent.Item1, item - 1); - toAddTwo = new Tuple(item + 1, extent.Item2); - break; - } - - // Extent is left border, but not only element - if(item == extent.Item1 && item != extent.Item2) - { - toRemove = extent; - toAddOne = new Tuple(item + 1, extent.Item2); - break; - } - - // Extent is right border, but not only element - if(item != extent.Item1 && item == extent.Item2) - { - toRemove = extent; - toAddOne = new Tuple(extent.Item1, item - 1); - break; - } - - // Extent is only element - if(item != extent.Item1 || item != extent.Item2) continue; - - toRemove = extent; - break; - } - - // Item not found - if(toRemove == null) return false; - - backend.Remove(toRemove); - if(toAddOne != null) backend.Add(toAddOne); - if(toAddTwo != null) backend.Add(toAddTwo); - - // Sort - backend = backend.OrderBy(t => t.Item1).ToList(); - - return true; - } - - /// - /// Converts the list of extents to an array of where T1 is first element of the extent and T2 is - /// last element - /// - /// Array of - public Tuple[] ToArray() => backend.ToArray(); - - /// - /// Gets the first element of the extent that contains the specified item - /// - /// Item - /// First element of extent - /// true if item was found in an extent, false otherwise - public bool GetStart(ulong item, out ulong start) - { - start = 0; - foreach(Tuple extent in backend.Where(extent => item >= extent.Item1 && item <= extent.Item2)) - { - start = extent.Item1; - return true; - } - - return false; - } - } -} \ No newline at end of file diff --git a/DiscImageChef.CommonTypes/Extents/ExtentsUShort.cs b/DiscImageChef.CommonTypes/Extents/ExtentsUShort.cs deleted file mode 100644 index cec53bbd3..000000000 --- a/DiscImageChef.CommonTypes/Extents/ExtentsUShort.cs +++ /dev/null @@ -1,252 +0,0 @@ -// /*************************************************************************** -// The Disc Image Chef -// ---------------------------------------------------------------------------- -// -// Filename : ExtentsUShort.cs -// Author(s) : Natalia Portillo -// -// Component : Extent helpers. -// -// --[ Description ] ---------------------------------------------------------- -// -// Provides extents for ushort types. -// -// --[ 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; -using System.Collections.Generic; -using System.Linq; - -namespace DiscImageChef.CommonTypes.Extents -{ - /// - /// Implements extents for - /// - public class ExtentsUShort - { - List> backend; - - /// - /// Initialize an empty list of extents - /// - public ExtentsUShort() - { - backend = new List>(); - } - - /// - /// Initializes extents with an specific list - /// - /// List of extents as tuples "start, end" - public ExtentsUShort(IEnumerable> list) - { - backend = list.OrderBy(t => t.Item1).ToList(); - } - - /// - /// Gets a count of how many extents are stored - /// - public int Count => backend.Count; - - /// - /// Adds the specified number to the corresponding extent, or creates a new one - /// - /// - public void Add(ushort item) - { - Tuple removeOne = null; - Tuple removeTwo = null; - Tuple itemToAdd = null; - - for(int i = 0; i < backend.Count; i++) - { - // Already contained in an extent - if(item >= backend[i].Item1 && item <= backend[i].Item2) return; - - // Expands existing extent start - if(item == backend[i].Item1 - 1) - { - removeOne = backend[i]; - - if(i > 0 && item == backend[i - 1].Item2 + 1) - { - removeTwo = backend[i - 1]; - itemToAdd = new Tuple(backend[i - 1].Item1, backend[i].Item2); - } - else itemToAdd = new Tuple(item, backend[i].Item2); - - break; - } - - // Expands existing extent end - if(item != backend[i].Item2 + 1) continue; - - removeOne = backend[i]; - - if(i < backend.Count - 1 && item == backend[i + 1].Item1 - 1) - { - removeTwo = backend[i + 1]; - itemToAdd = new Tuple(backend[i].Item1, backend[i + 1].Item2); - } - else itemToAdd = new Tuple(backend[i].Item1, item); - - break; - } - - if(itemToAdd != null) - { - backend.Remove(removeOne); - backend.Remove(removeTwo); - backend.Add(itemToAdd); - } - else backend.Add(new Tuple(item, item)); - - // Sort - backend = backend.OrderBy(t => t.Item1).ToList(); - } - - /// - /// Adds a new extent - /// - /// First element of the extent - /// - /// Last element of the extent or if is true how many elements the extent runs - /// for - /// - /// If set to true, indicates how many elements the extent runs for - public void Add(ushort start, ushort end, bool run = false) - { - ushort realEnd; - if(run) realEnd = (ushort)(start + end - 1); - else realEnd = end; - - // TODO: Optimize this - for(ushort t = start; t <= realEnd; t++) Add(t); - } - - /// - /// Checks if the specified item is contained by an extent on this instance - /// - /// Item to seach for - /// true if any of the extents on this instance contains the item - public bool Contains(ushort item) - { - return backend.Any(extent => item >= extent.Item1 && item <= extent.Item2); - } - - /// - /// Removes all extents from this instance - /// - public void Clear() - { - backend.Clear(); - } - - /// - /// Removes an item from the extents in this instance - /// - /// Item to remove - /// true if the item was contained in a known extent and removed, false otherwise - public bool Remove(ushort item) - { - Tuple toRemove = null; - Tuple toAddOne = null; - Tuple toAddTwo = null; - - foreach(Tuple extent in backend) - { - // Extent is contained and not a border - if(item > extent.Item1 && item < extent.Item2) - { - toRemove = extent; - toAddOne = new Tuple(extent.Item1, (ushort)(item - 1)); - toAddTwo = new Tuple((ushort)(item + 1), extent.Item2); - break; - } - - // Extent is left border, but not only element - if(item == extent.Item1 && item != extent.Item2) - { - toRemove = extent; - toAddOne = new Tuple((ushort)(item + 1), extent.Item2); - break; - } - - // Extent is right border, but not only element - if(item != extent.Item1 && item == extent.Item2) - { - toRemove = extent; - toAddOne = new Tuple(extent.Item1, (ushort)(item - 1)); - break; - } - - // Extent is only element - if(item != extent.Item1 || item != extent.Item2) continue; - - toRemove = extent; - break; - } - - // Item not found - if(toRemove == null) return false; - - backend.Remove(toRemove); - if(toAddOne != null) backend.Add(toAddOne); - if(toAddTwo != null) backend.Add(toAddTwo); - - // Sort - backend = backend.OrderBy(t => t.Item1).ToList(); - - return true; - } - - /// - /// Converts the list of extents to an array of where T1 is first element of the extent and T2 is - /// last element - /// - /// Array of - public Tuple[] ToArray() => backend.ToArray(); - - /// - /// Gets the first element of the extent that contains the specified item - /// - /// Item - /// First element of extent - /// true if item was found in an extent, false otherwise - public bool GetStart(ushort item, out ushort start) - { - start = 0; - foreach(Tuple extent in - backend.Where(extent => item >= extent.Item1 && item <= extent.Item2)) - { - start = extent.Item1; - return true; - } - - return false; - } - } -} \ No newline at end of file diff --git a/DiscImageChef.CommonTypes/Filters.cs b/DiscImageChef.CommonTypes/Filters.cs deleted file mode 100644 index 297c4389f..000000000 --- a/DiscImageChef.CommonTypes/Filters.cs +++ /dev/null @@ -1,111 +0,0 @@ -// /*************************************************************************** -// The Disc Image Chef -// ---------------------------------------------------------------------------- -// -// Filename : Filters.cs -// Author(s) : Natalia Portillo -// -// Component : Filters. -// -// --[ Description ] ---------------------------------------------------------- -// -// Enumerates all filters and instantiates the correct one. -// -// --[ 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; -using System.Collections.Generic; -using System.IO; -using System.Linq; -using System.Reflection; -using DiscImageChef.CommonTypes.Interfaces; -using DiscImageChef.Console; - -namespace DiscImageChef.CommonTypes -{ - public class FiltersList - { - public SortedDictionary Filters; - - /// - /// Fills the list of all known filters - /// - public FiltersList() - { - Assembly assembly = Assembly.Load("DiscImageChef.Filters"); - Filters = new SortedDictionary(); - - foreach(Type type in assembly.GetTypes().Where(t => t.GetInterfaces().Contains(typeof(IFilter)))) - try - { - IFilter filter = (IFilter)type.GetConstructor(Type.EmptyTypes)?.Invoke(new object[] { }); - if(filter != null && !Filters.ContainsKey(filter.Name.ToLower())) - Filters.Add(filter.Name.ToLower(), filter); - } - catch(Exception exception) { DicConsole.ErrorWriteLine("Exception {0}", exception); } - } - - /// - /// Gets the filter that allows to read the specified path - /// - /// Path - /// The filter that allows reading the specified path - public IFilter GetFilter(string path) - { - try - { - IFilter noFilter = null; - foreach(IFilter filter in Filters.Values) - if(filter.Id != new Guid("12345678-AAAA-BBBB-CCCC-123456789000")) - { - if(!filter.Identify(path)) continue; - - IFilter foundFilter = - (IFilter)filter.GetType().GetConstructor(Type.EmptyTypes)?.Invoke(new object[] { }); - - foundFilter?.Open(path); - - if(foundFilter?.IsOpened() == true) return foundFilter; - } - else - noFilter = filter; - - if(!noFilter?.Identify(path) == true) return noFilter; - - noFilter?.Open(path); - - return noFilter; - } - catch(IOException) { return null; } - } - - /// - /// Gets all known filters - /// - /// Known filters - public SortedDictionary GetFiltersList() => Filters; - } -} \ No newline at end of file diff --git a/DiscImageChef.CommonTypes/Geometry.cs b/DiscImageChef.CommonTypes/Geometry.cs deleted file mode 100644 index 6ea550953..000000000 --- a/DiscImageChef.CommonTypes/Geometry.cs +++ /dev/null @@ -1,134 +0,0 @@ -// /*************************************************************************** -// The Disc Image Chef -// ---------------------------------------------------------------------------- -// -// Filename : Geometry.cs -// Author(s) : Natalia Portillo -// -// Component : CommonTypes. -// -// --[ Description ] ---------------------------------------------------------- -// -// Includes geometry for several medias. -// -// --[ 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.Linq; - -namespace DiscImageChef.CommonTypes -{ - public static class Geometry - { - static readonly (ushort cylinders, byte heads, ushort sectorsPerTrack, uint bytesPerSector, MediaEncoding - encoding, bool variableSectorsPerTrack, MediaType type)[] KnownGeometries = - { - (32, 1, 8, 319, MediaEncoding.FM, false, MediaType.IBM23FD), - (35, 1, 9, 256, MediaEncoding.FM, false, MediaType.ECMA_66), - (35, 1, 13, 256, MediaEncoding.AppleGCR, false, MediaType.Apple32SS), - (35, 1, 16, 256, MediaEncoding.AppleGCR, false, MediaType.Apple33SS), - (35, 1, 19, 256, MediaEncoding.CommodoreGCR, false, MediaType.CBM_1540), - (35, 2, 13, 256, MediaEncoding.AppleGCR, false, MediaType.Apple32DS), - (35, 2, 16, 256, MediaEncoding.AppleGCR, false, MediaType.Apple33DS), - (35, 2, 19, 256, MediaEncoding.CommodoreGCR, false, MediaType.CBM_1571), - (40, 1, 8, 512, MediaEncoding.MFM, false, MediaType.DOS_525_SS_DD_8), - (40, 1, 9, 512, MediaEncoding.MFM, false, MediaType.DOS_525_SS_DD_9), - (40, 1, 10, 256, MediaEncoding.FM, false, MediaType.ACORN_525_SS_SD_40), - (40, 1, 16, 256, MediaEncoding.MFM, false, MediaType.ACORN_525_SS_DD_40), - (40, 1, 18, 128, MediaEncoding.FM, false, MediaType.ATARI_525_SD), - (40, 1, 18, 256, MediaEncoding.MFM, false, MediaType.ATARI_525_DD), - (40, 1, 19, 256, MediaEncoding.CommodoreGCR, false, MediaType.CBM_1540_Ext), - (40, 1, 26, 128, MediaEncoding.MFM, false, MediaType.ATARI_525_ED), - (40, 2, 8, 512, MediaEncoding.MFM, false, MediaType.DOS_525_DS_DD_8), - (40, 2, 9, 512, MediaEncoding.MFM, false, MediaType.DOS_525_DS_DD_9), - (40, 2, 16, 256, MediaEncoding.FM, false, MediaType.ECMA_70), - (70, 2, 9, 512, MediaEncoding.MFM, false, MediaType.Apricot_35), - (74, 1, 8, 512, MediaEncoding.FM, false, MediaType.IBM33FD_512), - (74, 1, 15, 256, MediaEncoding.FM, false, MediaType.IBM33FD_256), - (74, 1, 26, 128, MediaEncoding.FM, false, MediaType.IBM33FD_128), - (74, 2, 8, 1024, MediaEncoding.MFM, false, MediaType.IBM53FD_1024), - (74, 2, 15, 256, MediaEncoding.FM, false, MediaType.IBM43FD_256), - (74, 2, 15, 512, MediaEncoding.MFM, false, MediaType.IBM53FD_512), - (74, 2, 26, 128, MediaEncoding.FM, false, MediaType.IBM43FD_128), - (74, 2, 26, 256, MediaEncoding.MFM, false, MediaType.IBM53FD_256), - (77, 1, 26, 128, MediaEncoding.FM, false, MediaType.RX01), - (77, 1, 26, 256, MediaEncoding.MFM, false, MediaType.RX02), - (77, 2, 8, 1024, MediaEncoding.MFM, false, MediaType.NEC_525_HD), - (77, 2, 15, 512, MediaEncoding.MFM, false, MediaType.ECMA_99_15), - (77, 2, 26, 128, MediaEncoding.FM, false, MediaType.NEC_8_SD), - (77, 2, 26, 256, MediaEncoding.MFM, false, MediaType.RX03), - (80, 1, 8, 512, MediaEncoding.MFM, false, MediaType.DOS_35_SS_DD_8), - (80, 1, 9, 512, MediaEncoding.MFM, false, MediaType.DOS_35_SS_DD_9), - (80, 1, 10, 256, MediaEncoding.FM, false, MediaType.ACORN_525_SS_SD_80), - (80, 1, 10, 512, MediaEncoding.AppleGCR, true, MediaType.AppleSonySS), - (80, 1, 10, 512, MediaEncoding.MFM, false, MediaType.RX50), - (80, 1, 11, 512, MediaEncoding.MFM, false, MediaType.ATARI_35_SS_DD_11), - (80, 1, 16, 256, MediaEncoding.MFM, false, MediaType.ACORN_525_SS_DD_80), - (80, 2, 5, 1024, MediaEncoding.MFM, false, MediaType.ACORN_35_DS_DD), - (80, 2, 8, 512, MediaEncoding.MFM, false, MediaType.DOS_35_DS_DD_8), - (80, 2, 9, 512, MediaEncoding.MFM, false, MediaType.DOS_35_DS_DD_9), - (80, 2, 10, 512, MediaEncoding.AppleGCR, true, MediaType.AppleSonyDS), - (80, 2, 10, 512, MediaEncoding.MFM, false, MediaType.CBM_35_DD), - (80, 2, 10, 1024, MediaEncoding.MFM, false, MediaType.ACORN_35_DS_HD), - (80, 2, 11, 512, MediaEncoding.MFM, false, MediaType.CBM_AMIGA_35_DD), - (80, 2, 15, 512, MediaEncoding.MFM, false, MediaType.DOS_525_HD), - (80, 2, 16, 256, MediaEncoding.FM, false, MediaType.ECMA_78), - (80, 2, 16, 256, MediaEncoding.MFM, false, MediaType.ACORN_525_DS_DD), - (80, 2, 18, 512, MediaEncoding.MFM, false, MediaType.DOS_35_HD), - (80, 2, 19, 512, MediaEncoding.MFM, false, MediaType.XDF_525), - (80, 2, 21, 512, MediaEncoding.MFM, false, MediaType.DMF), - (80, 2, 22, 512, MediaEncoding.MFM, false, MediaType.CBM_AMIGA_35_HD), - (80, 2, 23, 512, MediaEncoding.MFM, false, MediaType.XDF_35), - (80, 2, 36, 512, MediaEncoding.MFM, false, MediaType.DOS_35_ED), - (82, 2, 10, 512, MediaEncoding.MFM, false, MediaType.FDFORMAT_35_DD), - (82, 2, 17, 512, MediaEncoding.MFM, false, MediaType.FDFORMAT_525_HD), - (82, 2, 21, 512, MediaEncoding.MFM, false, MediaType.FDFORMAT_35_HD), - (240, 2, 38, 512, MediaEncoding.MFM, false, MediaType.NEC_35_TD), - (753, 2, 27, 512, MediaEncoding.MFM, false, MediaType.Floptical), - // Following ones are what the device itself report, not the physical geometry - (154, 16, 32, 512, MediaEncoding.MFM, false, MediaType.PocketZip), - (262, 32, 56, 512, MediaEncoding.MFM, false, MediaType.LS240), - (963, 8, 32, 512, MediaEncoding.MFM, false, MediaType.LS120), - (1021, 64, 32, 512, MediaEncoding.MFM, false, MediaType.Jaz), - (1024, 2, 32, 512, MediaEncoding.MFM, false, MediaType.FD32MB) - }; - - public static MediaType GetMediaType( - (ushort cylinders, byte heads, ushort sectorsPerTrack, uint bytesPerSector, MediaEncoding encoding, bool - variableSectorsPerTrack) geometry) => - (from geom in KnownGeometries - where geom.cylinders == geometry.cylinders && - geom.heads == geometry.heads && - geom.sectorsPerTrack == geometry.sectorsPerTrack && - geom.bytesPerSector == geometry.bytesPerSector && - geom.encoding == geometry.encoding && - geom.variableSectorsPerTrack == geometry.variableSectorsPerTrack - select geom.type).FirstOrDefault(); - - public static (ushort cylinders, byte heads, ushort sectorsPerTrack, uint bytesPerSector, MediaEncoding encoding - , bool variableSectorsPerTrack, MediaType type) GetGeometry(MediaType mediaType) => - (from geom in KnownGeometries where geom.type == mediaType select geom).FirstOrDefault(); - } -} \ No newline at end of file diff --git a/DiscImageChef.CommonTypes/Interfaces/IArchive.cs b/DiscImageChef.CommonTypes/Interfaces/IArchive.cs deleted file mode 100644 index b71dab40e..000000000 --- a/DiscImageChef.CommonTypes/Interfaces/IArchive.cs +++ /dev/null @@ -1,253 +0,0 @@ -// /*************************************************************************** -// The Disc Image Chef -// ---------------------------------------------------------------------------- -// -// Filename : IArchive.cs -// Author(s) : Michael Drüing -// -// Component : Archives. -// -// --[ Description ] ---------------------------------------------------------- -// -// Defines the interface for an Archive. -// -// --[ 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 © 2018-2019 Michael Drüing -// Copyright © 2011-2019 Natalia Portillo -// ****************************************************************************/ - -using System; -using System.IO; -using System.Collections.Generic; - -namespace DiscImageChef.CommonTypes.Interfaces -{ - [Flags] - public enum ArchiveSupportedFeature : uint - { - /// - /// The archive supports filenames for its entries. If this flag is not set, - /// files can only be accessed by number. - /// - SupportsFilenames = 1 << 0, - - /// - /// The archive supports compression. If this flag is not set, compressed and - /// uncompressed lengths are always the same. - /// - SupportsCompression = 1 << 1, - - /// - /// The archive supports subdirectories. If this flag is not set, all filenames are - /// guaranteed to not contain any "/" character. - /// - SupportsSubdirectories = 1 << 2, - - /// - /// The archive supports explicit entries for directories (like Zip, for example). - /// If this flag is not set, directories are implicit by the relative name of the files. - /// - HasExplicitDirectories = 1 << 3, - - /// - /// The archive stores a timestamp with each entry if this flag is set. - /// - HasEntryTimestamp = 1 << 4, - - /// - /// If this flag is set, individual files or the whole archive might be encrypted or - /// password-protected. - /// - SupportsProtection = 1 << 5, // TODO: not implemented yet - - /// - /// If this flag is set, the archive supports returning extended attributes (Xattrs) for each entry. - /// - SupportsXAttrs = 1 << 6, - }; - - public interface IArchive - { - /// Descriptive name of the plugin - string Name { get; } - - /// Unique UUID of the plugin - Guid Id { get; } - - /// - /// Identifies if the specified path contains data recognizable by this archive instance - /// - /// Path. - bool Identify(string path); - - /// - /// Identifies if the specified stream contains data recognizable by this archive instance - /// - /// Stream. - bool Identify(Stream stream); - - /// - /// Identifies if the specified buffer contains data recognizable by this archive instance - /// - /// Buffer. - bool Identify(byte[] buffer); - - /// - /// Opens the specified path with this archive instance - /// - /// Path. - void Open(string path); - - /// - /// Opens the specified stream with this archive instance - /// - /// Stream. - void Open(Stream stream); - - /// - /// Opens the specified buffer with this archive instance - /// - /// Buffer. - void Open(byte[] buffer); - - /// - /// Returns true if the archive has a file/stream/buffer currently opened and no - /// has been issued. - /// - bool IsOpened(); - - /// - /// Closes all opened streams. - /// - void Close(); - - /// - /// Return a bitfield indicating the features supported by this archive type. - /// - /// The ArchiveSupportedFeature bitfield. - /// - /// This should be a constant, tied to the archive type, not to the particular - /// features used by the currently-opened archive file. - /// - ArchiveSupportedFeature GetArchiveFeatures(); - - /// - /// Gets the number of entries (i.e. files) that are contained in this archive. - /// - /// - /// Entries in this context can also mean directories or volume labels, for some types of - /// archives that store these explicitly. Do not rely on all entries being regular files! - /// - /// The number of files. - int GetNumberOfEntries(); - - /// - /// Gets the file name (and path) of the given entry in the archive. - /// - /// - /// The path components are separated by a forward slash "/".
- /// The path should not start with a leading slash (i.e. it should be relative, not absolute). - ///
- /// - /// The entry in the archive for which to return the file name. - /// The file name, with (relative) path - string GetFilename(int entryNumber); - - /// - /// Gets the entry number for a particular file path in the archive. fileName is - /// the relative path of the file in the archive. If the file cannot be found, -1 is returned. - /// - /// - /// The path should be relative (no leading slash), using regular slashes as path separator, and be - /// normalized, i.e. no "foo//bar" or "foo/../bar" path components. - /// - /// The relative path for which to get the entry number. - /// If set, do a case insensitive matching and return the first file that matches. - /// The number of the entry corresponding to the given path, or -1 if the path does not exist. - int GetEntryNumber(string fileName, bool caseInsensitiveMatch); - - /// - /// Gets the (compressed) size of the given entry. - /// - /// The entry for which to get the compressed size. - /// The compressed size of the entry, or 0 if the entry is not a regular file. - /// - /// The return value is equal to the return value of GetUncompressedSize() if the file is not compressed. - /// - /// - long GetCompressedSize(int entryNumber); - - /// - /// Gets the uncompressed size of the given entry. - /// - /// The entry for which to get the uncompressed size. - /// The uncompressed size of the entry, or 0 if the entry is not a regular file. - /// - /// The return value is equal to the return value of GetCompressedSize() if the file is not compressed. - /// - /// - long GetUncompressedSize(int entryNumber); - - /// - /// Gets the attributes of a file or directory. - /// - /// - /// Error number. - /// The entry in the archive for which to retreive the attributes. - /// File attributes, or zero if the archive does not support attributes. - FileAttributes GetAttributes(int entryNumber); - - /// - /// Lists all extended attributes, alternate data streams and forks of the given file. - /// - /// The entry in the archive for which to retreive the list of attributes. - /// List of extended attributes, alternate data streams and forks. - List GetXAttrs(int entryNumber); - - /// - /// Reads an extended attribute, alternate data stream or fork from the given file. - /// - /// Error number. - /// The entry in the archive for which to retreive the XAttr. - /// Extended attribute, alternate data stream or fork name. - /// Buffer with the XAttr data. - byte[] GetXattr(int entryNumber, string xattr); - - /// - /// Gets information about an entry in the archive. - /// - /// - /// Note that some of the data might be incomplete or not available at all, depending on the type of - /// archive. - /// - /// - /// - /// The entry int he archive for which to get the information - /// The available information about the entry in the archive - FileSystemInfo Stat(int entryNumber); - - /// - /// Returns the Filter for the given entry. It will return null if the entry in question - /// is not a regular file (i.e. directory, volume label, etc.) - /// - /// The entry for which the Filter should be returned. - /// The Filter for the given entry. - IFilter GetEntry(int entryNumber); - } -} - diff --git a/DiscImageChef.CommonTypes/Interfaces/IChecksum.cs b/DiscImageChef.CommonTypes/Interfaces/IChecksum.cs deleted file mode 100644 index b1f6bad2c..000000000 --- a/DiscImageChef.CommonTypes/Interfaces/IChecksum.cs +++ /dev/null @@ -1,66 +0,0 @@ -// /*************************************************************************** -// The Disc Image Chef -// ---------------------------------------------------------------------------- -// -// Filename : IChecksum.cs -// Author(s) : Natalia Portillo -// -// Component : Checksums. -// -// --[ Description ] ---------------------------------------------------------- -// -// Provides an interface for implementing checksums and hashes. -// -// --[ 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 -// ****************************************************************************/ - -namespace DiscImageChef.CommonTypes.Interfaces -{ - public interface IChecksum - { - /// - /// Updates the hash with data. - /// - /// Data buffer. - /// Length of buffer to hash. - void Update(byte[] data, uint len); - - /// - /// Updates the hash with data. - /// - /// Data buffer. - void Update(byte[] data); - - /// - /// Returns a byte array of the hash value. - /// - byte[] Final(); - - /// - /// Returns a hexadecimal representation of the hash value. - /// - string End(); - } -} \ No newline at end of file diff --git a/DiscImageChef.CommonTypes/Interfaces/IFilesystem.cs b/DiscImageChef.CommonTypes/Interfaces/IFilesystem.cs deleted file mode 100644 index e5eeaf691..000000000 --- a/DiscImageChef.CommonTypes/Interfaces/IFilesystem.cs +++ /dev/null @@ -1,80 +0,0 @@ -// /*************************************************************************** -// The Disc Image Chef -// ---------------------------------------------------------------------------- -// -// Filename : IFilesystem.cs -// Author(s) : Natalia Portillo -// -// Component : Filesystem plugins. -// -// --[ Description ] ---------------------------------------------------------- -// -// Interface for filesystem 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; -using System.Text; -using Schemas; - -namespace DiscImageChef.CommonTypes.Interfaces -{ - /// - /// Interface to implement filesystem plugins. - /// - public interface IFilesystem - { - Encoding Encoding { get; } - /// Plugin name. - string Name { get; } - /// Plugin UUID. - Guid Id { get; } - /// - /// Information about the filesystem as expected by CICM Metadata XML - /// - /// Information about the filesystem as expected by CICM Metadata XML - FileSystemType XmlFsType { get; } - /// Plugin author - string Author { get; } - - /// - /// Identifies the filesystem in the specified LBA - /// - /// Disk image. - /// Partition. - /// true, if the filesystem is recognized, false otherwise. - bool Identify(IMediaImage imagePlugin, Partition partition); - - /// - /// Gets information about the identified filesystem. - /// - /// Disk image. - /// Partition. - /// Filesystem information. - /// Which encoding to use for this filesystem. - void GetInformation(IMediaImage imagePlugin, Partition partition, out string information, Encoding encoding); - } -} \ No newline at end of file diff --git a/DiscImageChef.CommonTypes/Interfaces/IFilter.cs b/DiscImageChef.CommonTypes/Interfaces/IFilter.cs deleted file mode 100644 index a4b071426..000000000 --- a/DiscImageChef.CommonTypes/Interfaces/IFilter.cs +++ /dev/null @@ -1,180 +0,0 @@ -// /*************************************************************************** -// The Disc Image Chef -// ---------------------------------------------------------------------------- -// -// Filename : IFilter.cs -// Author(s) : Natalia Portillo -// -// Component : Filters. -// -// --[ Description ] ---------------------------------------------------------- -// -// Defines the interface for a Filter. -// -// --[ 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; -using System.IO; - -namespace DiscImageChef.CommonTypes.Interfaces -{ - public interface IFilter - { - /// Descriptive name of the plugin - string Name { get; } - /// Unique UUID of the plugin - Guid Id { get; } - /// Plugin author - string Author { get; } - - /// - /// Closes all opened streams. - /// - void Close(); - - /// - /// Gets the path used to open this filter.
- /// UNIX: /path/to/archive.zip/path/to/file.bin => /path/to/archive.zip/path/to/file.bin
- /// Windows: C:\path\to\archive.zip\path\to\file.bin => C:\path\to\archive.zip\path\to\file.bin - ///
- /// Path used to open this filter. - string GetBasePath(); - - /// - /// Gets creation time of file referenced by this filter. - /// - /// The creation time. - DateTime GetCreationTime(); - - /// - /// Gets length of this filter's data fork. - /// - /// The data fork length. - long GetDataForkLength(); - - /// - /// Gets a stream to access the data fork contents. - /// - /// The data fork stream. - Stream GetDataForkStream(); - - /// - /// Gets the filename for the file referenced by this filter.
- /// UNIX: /path/to/archive.zip/path/to/file.bin => file.bin
- /// Windows: C:\path\to\archive.zip\path\to\file.bin => file.bin - ///
- /// The filename. - string GetFilename(); - - /// - /// Gets last write time of file referenced by this filter. - /// - /// The last write time. - DateTime GetLastWriteTime(); - - /// - /// Gets length of file referenced by ths filter. - /// - /// The length. - long GetLength(); - - /// - /// Gets full path to file referenced by this filter. If it's an archive, it's the path inside the archive.
- /// UNIX: /path/to/archive.zip/path/to/file.bin => /path/to/file.bin
- /// Windows: C:\path\to\archive.zip\path\to\file.bin => \path\to\file.bin - ///
- /// The path. - string GetPath(); - - /// - /// Gets path to parent folder to the file referenced by this filter. If it's an archive, it's the full path to the - /// archive itself.
- /// UNIX: /path/to/archive.zip/path/to/file.bin => /path/to/archive.zip
- /// Windows: C:\path\to\archive.zip\path\to\file.bin => C:\path\to\archive.zip - ///
- /// The parent folder. - string GetParentFolder(); - - /// - /// Gets length of this filter's resource fork. - /// - /// The resource fork length. - long GetResourceForkLength(); - - /// - /// Gets a stream to access the resource fork contents. - /// - /// The resource fork stream. - Stream GetResourceForkStream(); - - /// - /// Returns true if the file referenced by this filter has a resource fork - /// - bool HasResourceFork(); - - /// - /// Identifies if the specified path contains data recognizable by this filter instance - /// - /// Path. - bool Identify(string path); - - /// - /// Identifies if the specified stream contains data recognizable by this filter instance - /// - /// Stream. - bool Identify(Stream stream); - - /// - /// Identifies if the specified buffer contains data recognizable by this filter instance - /// - /// Buffer. - bool Identify(byte[] buffer); - - /// - /// Returns true if the filter has a file/stream/buffer currently opened and no - /// has been issued. - /// - bool IsOpened(); - - /// - /// Opens the specified path with this filter instance - /// - /// Path. - void Open(string path); - - /// - /// Opens the specified stream with this filter instance - /// - /// Stream. - void Open(Stream stream); - - /// - /// Opens the specified buffer with this filter instance - /// - /// Buffer. - void Open(byte[] buffer); - } -} \ No newline at end of file diff --git a/DiscImageChef.CommonTypes/Interfaces/IFloppyImage.cs b/DiscImageChef.CommonTypes/Interfaces/IFloppyImage.cs deleted file mode 100644 index f7c675a99..000000000 --- a/DiscImageChef.CommonTypes/Interfaces/IFloppyImage.cs +++ /dev/null @@ -1,135 +0,0 @@ -// /*************************************************************************** -// The Disc Image Chef -// ---------------------------------------------------------------------------- -// -// Filename : IFloppyImage.cs -// Author(s) : Natalia Portillo -// -// Component : Disc image plugins. -// -// --[ Description ] ---------------------------------------------------------- -// -// Defines interface to be implemented by floppy 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 DiscImageChef.CommonTypes.Enums; -using DiscImageChef.CommonTypes.Structs; - -namespace DiscImageChef.CommonTypes.Interfaces -{ - /// - /// Abstract class to implement disk image reading plugins that can contain floppy images. - /// This interface is needed because floppy formatting characteristics are not necesarily compatible with the whole. - /// LBA-oriented interface is defined by . - /// All data returned by these methods is already decoded from its corresponding bitstream. - /// - public interface IFloppyImage : IMediaImage - { - /// - /// Floppy info, contains information about physical characteristics of floppy, like size, bitrate, track density, - /// etc... - /// - FloppyInfo FloppyInfo { get; } - - /// - /// Reads a sector's user data. - /// - /// - /// If is one of the duplicates is returned - /// randomly. - /// If is or - /// random data is returned. - /// If is null is returned. - /// Otherwise, whatever is in the sector is returned. - /// - /// Physical track (position of the heads over the floppy media, 0-based). - /// Physical head (0-based). - /// Logical sector ID. - /// Status of request. - byte[] ReadSector(ushort track, byte head, ushort sector, out FloppySectorStatus status); - - /// - /// Reads a sector's tag. - /// - /// - /// If is one of the duplicates is returned - /// randomly. - /// If is or - /// random data is returned. - /// If is null is returned. - /// Otherwise, whatever tag is in the sector is returned. - /// - /// Physical track (position of the heads over the floppy media, 0-based). - /// Physical head (0-based). - /// Logical sector ID. - /// Status of request. - byte[] ReadSectorTag(ushort track, byte head, ushort sector, out FloppySectorStatus status, SectorTagType tag); - - /// - /// Reads a whole track. It includes all gaps, address marks, sectors data, etc. - /// - /// The track data. - /// Physical track (position of the heads over the floppy media, 0-based). - /// Physical head (0-based). - byte[] ReadTrack(ushort track, byte head); - - /// - /// Reads a sector's data including all tags, address mark, and so, in a format dependent of represented media. - /// - /// - /// If is one of the duplicates is returned - /// randomly. - /// If is or - /// random data is returned. - /// If is null is returned. - /// Otherwise, whatever is in the sector is returned. - /// - /// Physical track (position of the heads over the floppy media, 0-based). - /// Physical head (0-based). - /// Logical sector ID. - /// Status of request. - byte[] ReadSectorLong(ushort track, byte head, ushort sector, out FloppySectorStatus status); - - /// - /// Verifies a track. - /// - /// True if correct, false if incorrect, null if uncheckable. - /// Physical track (position of the heads over the floppy media, 0-based). - /// Physical head (0-based). - bool? VerifyTrack(ushort track, byte head); - - /// - /// Verifies a sector, relative to track. - /// - /// True if correct, false if incorrect, null if uncheckable. - /// Physical track (position of the heads over the floppy media, 0-based). - /// Physical head (0-based). - /// Logical sector ID. - /// Status of request. - bool? VerifySector(ushort track, byte head, ushort sector); - } -} \ No newline at end of file diff --git a/DiscImageChef.CommonTypes/Interfaces/IMediaImage.cs b/DiscImageChef.CommonTypes/Interfaces/IMediaImage.cs deleted file mode 100644 index b02a10e6f..000000000 --- a/DiscImageChef.CommonTypes/Interfaces/IMediaImage.cs +++ /dev/null @@ -1,139 +0,0 @@ -// /*************************************************************************** -// The Disc Image Chef -// ---------------------------------------------------------------------------- -// -// Filename : IMediaImage.cs -// Author(s) : Natalia Portillo -// -// Component : Disc image plugins. -// -// --[ Description ] ---------------------------------------------------------- -// -// Defines interface to be implemented by block addressable disk 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; -using System.Collections.Generic; -using DiscImageChef.CommonTypes.Enums; -using DiscImageChef.CommonTypes.Structs; -using Schemas; - -namespace DiscImageChef.CommonTypes.Interfaces -{ - /// - /// Abstract class to implement disk image reading plugins. - /// - public interface IMediaImage - { - /// Image information - ImageInfo Info { get; } - /// Plugin name. - string Name { get; } - /// Plugin UUID. - Guid Id { get; } - /// Plugin author - string Author { get; } - /// - /// Gets the image format. - /// - /// The image format. - string Format { get; } - /// List of dump hardware used to create the image from real media - List DumpHardware { get; } - /// Gets the CICM XML metadata for the image - CICMMetadataType CicmMetadata { get; } - - /// - /// Identifies the image. - /// - /// true, if image was identified, false otherwise. - /// Image filter. - bool Identify(IFilter imageFilter); - - /// - /// Opens the image. - /// - /// true, if image was opened, false otherwise. - /// Image filter. - bool Open(IFilter imageFilter); - - /// - /// Reads a disk tag. - /// - /// Disk tag - /// Tag type to read. - byte[] ReadDiskTag(MediaTagType tag); - - /// - /// Reads a sector's user data. - /// - /// The sector's user data. - /// Sector address (LBA). - byte[] ReadSector(ulong sectorAddress); - - /// - /// Reads a sector's tag. - /// - /// The sector's tag. - /// Sector address (LBA). - /// Tag type. - byte[] ReadSectorTag(ulong sectorAddress, SectorTagType tag); - - /// - /// Reads user data from several sectors. - /// - /// The sectors user data. - /// Starting sector address (LBA). - /// How many sectors to read. - byte[] ReadSectors(ulong sectorAddress, uint length); - - /// - /// Reads tag from several sectors. - /// - /// The sectors tag. - /// Starting sector address (LBA). - /// How many sectors to read. - /// Tag type. - byte[] ReadSectorsTag(ulong sectorAddress, uint length, SectorTagType tag); - - /// - /// Reads a complete sector (user data + all tags). - /// - /// The complete sector. Format depends on disk type. - /// Sector address (LBA). - byte[] ReadSectorLong(ulong sectorAddress); - - /// - /// Reads several complete sector (user data + all tags). - /// - /// The complete sectors. Format depends on disk type. - /// Starting sector address (LBA). - /// How many sectors to read. - byte[] ReadSectorsLong(ulong sectorAddress, uint length); - } -} \ No newline at end of file diff --git a/DiscImageChef.CommonTypes/Interfaces/IOpticalMediaImage.cs b/DiscImageChef.CommonTypes/Interfaces/IOpticalMediaImage.cs deleted file mode 100644 index 7cb50c838..000000000 --- a/DiscImageChef.CommonTypes/Interfaces/IOpticalMediaImage.cs +++ /dev/null @@ -1,140 +0,0 @@ -// /*************************************************************************** -// 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, IVerifiableSectorsImage - { - /// - /// 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/IPartition.cs b/DiscImageChef.CommonTypes/Interfaces/IPartition.cs deleted file mode 100644 index 98ba538a9..000000000 --- a/DiscImageChef.CommonTypes/Interfaces/IPartition.cs +++ /dev/null @@ -1,68 +0,0 @@ -// /*************************************************************************** -// The Disc Image Chef -// ---------------------------------------------------------------------------- -// -// Filename : IPartition.cs -// Author(s) : Natalia Portillo -// -// Component : Partitioning scheme plugins. -// -// --[ Description ] ---------------------------------------------------------- -// -// Defines methods to be used by partitioning scheme plugins and several -// constants. -// -// --[ 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; -using System.Collections.Generic; -using DiscImageChef.CommonTypes; -using DiscImageChef.CommonTypes.Interfaces; - -namespace DiscImageChef.Partitions -{ - /// - /// Abstract class to implement partitioning schemes interpreting plugins. - /// - public interface IPartition - { - /// Plugin name. - string Name { get; } - /// Plugin UUID. - Guid Id { get; } - /// Plugin author - string Author { get; } - - /// - /// Interprets a partitioning scheme. - /// - /// true, if partitioning scheme is recognized, false otherwise. - /// Disk image. - /// Returns list of partitions. - /// At which sector to start searching for the partition scheme. - bool GetInformation(IMediaImage imagePlugin, out List partitions, ulong sectorOffset); - } -} \ No newline at end of file diff --git a/DiscImageChef.CommonTypes/Interfaces/IPartitionableMediaImage.cs b/DiscImageChef.CommonTypes/Interfaces/IPartitionableMediaImage.cs deleted file mode 100644 index f342e339d..000000000 --- a/DiscImageChef.CommonTypes/Interfaces/IPartitionableMediaImage.cs +++ /dev/null @@ -1,54 +0,0 @@ -// /*************************************************************************** -// 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/IPluginRegister.cs b/DiscImageChef.CommonTypes/Interfaces/IPluginRegister.cs deleted file mode 100644 index e95f72c44..000000000 --- a/DiscImageChef.CommonTypes/Interfaces/IPluginRegister.cs +++ /dev/null @@ -1,100 +0,0 @@ -// /*************************************************************************** -// The Disc Image Chef -// ---------------------------------------------------------------------------- -// -// Filename : IPluginsRegister.cs -// Author(s) : Natalia Portillo -// -// Component : Interfaces. -// -// --[ Description ] ---------------------------------------------------------- -// -// Interface that declares class and methods to call to register 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; -using System.Collections.Generic; - -namespace DiscImageChef.CommonTypes.Interfaces -{ - public interface IPluginRegister - { - /// - /// Gets all checksum plugins - /// - /// List of checksum plugins - List GetAllChecksumPlugins(); - - /// - /// Gets all filesystem plugins - /// - /// List of filesystem plugins - List GetAllFilesystemPlugins(); - - /// - /// Gets all filter plugins - /// - /// List of filter plugins - List GetAllFilterPlugins(); - - /// - /// Gets all floppy image plugins - /// - /// List of floppy image plugins - List GetAllFloppyImagePlugins(); - - /// - /// Gets all media image plugins - /// - /// List of media image plugins - List GetAllMediaImagePlugins(); - - /// - /// Gets all partition plugins - /// - /// List of partition plugins - List GetAllPartitionPlugins(); - - /// - /// Gets all read-only filesystem plugins - /// - /// List of read-only filesystem plugins - List GetAllReadOnlyFilesystemPlugins(); - - /// - /// Gets all writable floppy image plugins - /// - /// List of writable floppy image plugins - List GetAllWritableFloppyImagePlugins(); - - /// - /// Gets all writable media image plugins - /// - /// List of writable media image plugins - List GetAllWritableImagePlugins(); - } -} \ No newline at end of file diff --git a/DiscImageChef.CommonTypes/Interfaces/IReadOnlyFilesystem.cs b/DiscImageChef.CommonTypes/Interfaces/IReadOnlyFilesystem.cs deleted file mode 100644 index f69427375..000000000 --- a/DiscImageChef.CommonTypes/Interfaces/IReadOnlyFilesystem.cs +++ /dev/null @@ -1,147 +0,0 @@ -// /*************************************************************************** -// The Disc Image Chef -// ---------------------------------------------------------------------------- -// -// Filename : IReadOnlyFilesystem.cs -// Author(s) : Natalia Portillo -// -// Component : Filesystem plugins. -// -// --[ Description ] ---------------------------------------------------------- -// -// Interface for filesystem plugins that offer read-only support of their -// contents. -// -// --[ 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; -using System.Collections.Generic; -using System.Text; -using DiscImageChef.CommonTypes.Structs; - -namespace DiscImageChef.CommonTypes.Interfaces -{ - /// - /// Interface to implement filesystem plugins. - /// - public interface IReadOnlyFilesystem : IFilesystem - { - /// - /// Retrieves a list of options supported by the filesystem, with name, type and description - /// - IEnumerable<(string name, Type type, string description)> SupportedOptions { get; } - - Dictionary Namespaces { get; } - - /// - /// Initializates whatever internal structures the filesystem plugin needs to be able to read files and directories - /// from the filesystem. - /// - /// - /// - /// Which encoding to use for this filesystem. - /// Dictionary of key=value pairs containing options to pass to the filesystem - /// Filename namespace - Errno Mount(IMediaImage imagePlugin, Partition partition, Encoding encoding, Dictionary options, - string @namespace); - - /// - /// Frees all internal structures created by - /// - /// - Errno Unmount(); - - /// - /// Maps a filesystem block from a file to a block from the underlying device. - /// - /// Error number. - /// File path. - /// File block. - /// Device block. - Errno MapBlock(string path, long fileBlock, out long deviceBlock); - - /// - /// Gets the attributes of a file or directory - /// - /// Error number. - /// File path. - /// File attributes. - Errno GetAttributes(string path, out FileAttributes attributes); - - /// - /// Lists all extended attributes, alternate data streams and forks of the given file. - /// - /// Error number. - /// Path. - /// List of extended attributes, alternate data streams and forks. - Errno ListXAttr(string path, out List xattrs); - - /// - /// Reads an extended attribute, alternate data stream or fork from the given file. - /// - /// Error number. - /// File path. - /// Extendad attribute, alternate data stream or fork name. - /// Buffer. - Errno GetXattr(string path, string xattr, ref byte[] buf); - - /// - /// Reads data from a file (main/only data stream or data fork). - /// - /// File path. - /// Offset. - /// Bytes to read. - /// Buffer. - Errno Read(string path, long offset, long size, ref byte[] buf); - - /// - /// Lists contents from a directory. - /// - /// Directory path. - /// Directory contents. - Errno ReadDir(string path, out List contents); - - /// - /// Gets information about the mounted volume. - /// - /// Information about the mounted volume. - Errno StatFs(out FileSystemInfo stat); - - /// - /// Gets information about a file or directory. - /// - /// File path. - /// File information. - Errno Stat(string path, out FileEntryInfo stat); - - /// - /// Solves a symbolic link. - /// - /// Link path. - /// Link destination. - Errno ReadLink(string path, out string dest); - } -} \ No newline at end of file diff --git a/DiscImageChef.CommonTypes/Interfaces/ITapeImage.cs b/DiscImageChef.CommonTypes/Interfaces/ITapeImage.cs deleted file mode 100644 index 6899ac55b..000000000 --- a/DiscImageChef.CommonTypes/Interfaces/ITapeImage.cs +++ /dev/null @@ -1,60 +0,0 @@ -// /*************************************************************************** -// The Disc Image Chef -// ---------------------------------------------------------------------------- -// -// Filename : ITapeImage.cs -// Author(s) : Natalia Portillo -// -// Component : Disc image plugins. -// -// --[ Description ] ---------------------------------------------------------- -// -// Defines interface to be implemented by block addressable sequential tape -// 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 ITapeImage : IMediaImage - { - /// - /// Gets a list of all the files registered in the image - /// - List Files { get; } - /// - /// Gets a list of all the partitions registered in the image - /// - List TapePartitions { get; } - /// - /// If the media is a really a tape, as some formats can store non-tapes - /// - bool IsTape { get; } - } -} \ No newline at end of file diff --git a/DiscImageChef.CommonTypes/Interfaces/IVerifiableImage.cs b/DiscImageChef.CommonTypes/Interfaces/IVerifiableImage.cs deleted file mode 100644 index af6d77eda..000000000 --- a/DiscImageChef.CommonTypes/Interfaces/IVerifiableImage.cs +++ /dev/null @@ -1,50 +0,0 @@ -// /*************************************************************************** -// The Disc Image Chef -// ---------------------------------------------------------------------------- -// -// Filename : IVerifiableImage.cs -// Author(s) : Natalia Portillo -// -// Component : Disc image plugins. -// -// --[ Description ] ---------------------------------------------------------- -// -// Defines interface to be implemented by image plugins that can verify the -// image itself. -// -// --[ 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 -// ****************************************************************************/ - -namespace DiscImageChef.CommonTypes.Interfaces -{ - public interface IVerifiableImage - { - /// - /// Verifies media image internal checksum. - /// - /// True if correct, false if incorrect, null if there is no internal checksum available - bool? VerifyMediaImage(); - } -} \ No newline at end of file diff --git a/DiscImageChef.CommonTypes/Interfaces/IVerifiableSectorsImage.cs b/DiscImageChef.CommonTypes/Interfaces/IVerifiableSectorsImage.cs deleted file mode 100644 index f9da0d59a..000000000 --- a/DiscImageChef.CommonTypes/Interfaces/IVerifiableSectorsImage.cs +++ /dev/null @@ -1,63 +0,0 @@ -// /*************************************************************************** -// The Disc Image Chef -// ---------------------------------------------------------------------------- -// -// Filename : IVerifiableSectorsImage.cs -// Author(s) : Natalia Portillo -// -// Component : Disc image plugins. -// -// --[ Description ] ---------------------------------------------------------- -// -// Defines interface to be implemented by image plugins that can verify the -// sectors contained in the image. -// -// --[ 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 IVerifiableSectorsImage - { - /// - /// Verifies a sector. - /// - /// True if correct, false if incorrect, null if uncheckable. - /// Sector address (LBA). - bool? VerifySector(ulong sectorAddress); - - /// - /// Verifies several sectors. - /// - /// True if all are correct, false if any is incorrect, null if any is uncheckable. - /// Starting sector address (LBA). - /// How many sectors to read. - /// List of incorrect sectors - /// List of uncheckable sectors - bool? VerifySectors(ulong sectorAddress, uint length, out List failingLbas, out List unknownLbas); - } -} \ No newline at end of file diff --git a/DiscImageChef.CommonTypes/Interfaces/IWritableFloppyImage.cs b/DiscImageChef.CommonTypes/Interfaces/IWritableFloppyImage.cs deleted file mode 100644 index db33ee47a..000000000 --- a/DiscImageChef.CommonTypes/Interfaces/IWritableFloppyImage.cs +++ /dev/null @@ -1,104 +0,0 @@ -// /*************************************************************************** -// The Disc Image Chef -// ---------------------------------------------------------------------------- -// -// Filename : IFloppyImage.cs -// Author(s) : Natalia Portillo -// -// Component : Disc image plugins. -// -// --[ Description ] ---------------------------------------------------------- -// -// Defines interface to be implemented by floppy 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 DiscImageChef.CommonTypes.Enums; -using DiscImageChef.CommonTypes.Structs; - -namespace DiscImageChef.CommonTypes.Interfaces -{ - /// - /// Abstract class to implement disk image reading plugins that can contain floppy images. - /// This interface is needed because floppy formatting characteristics are not necesarily compatible with the whole - /// LBA-oriented interface defined by . - /// All data expected by these methods is already decoded from its corresponding bitstream. - /// - public interface IWritableFloppyImage : IFloppyImage, IWritableImage - { - /// - /// Indicates the image plugin the floppy physical characteristics and must be called before following methods are - /// called. Once this is called, LBA-based methods should not be used. - /// - /// - /// Floppy info, contains information about physical characteristics of floppy, like size, bitrate, - /// track density, etc... - /// - /// true if operating completed successfully, false otherwise - bool SetFloppyCharacteristics(FloppyInfo info); - - /// - /// Writes a sector's user data. - /// - /// - /// If is one of the duplicates. - /// If is , , - /// it will be ignored. - /// Otherwise, whatever data should be in the sector. - /// - /// Physical track (position of the heads over the floppy media, 0-based). - /// Physical head (0-based). - /// Logical sector ID. - /// Status of sector. - /// true if operating completed successfully, false otherwise - bool WriteSector(byte[] data, ushort track, byte head, ushort sector, FloppySectorStatus status); - - /// - /// Writes a whole track, including all gaps, address marks, sectors data, etc. - /// - /// The track data. - /// Physical track (position of the heads over the floppy media, 0-based). - /// Physical head (0-based). - /// true if operating completed successfully, false otherwise - bool WriteTrack(byte[] data, ushort track, byte head); - - /// - /// Writes a sector's data including all tags, address mark, and so, in a format dependent of represented media. - /// - /// - /// If is one of the duplicates. - /// If is , , - /// it will be ignored. - /// Otherwise, whatever data should be in the sector. - /// - /// Physical track (position of the heads over the floppy media, 0-based). - /// Physical head (0-based). - /// Logical sector ID. - /// Status of request. - /// true if operating completed successfully, false otherwise - bool WriteSectorLong(byte[] data, ushort track, byte head, ushort sector, out FloppySectorStatus status); - } -} \ No newline at end of file diff --git a/DiscImageChef.CommonTypes/Interfaces/IWritableImage.cs b/DiscImageChef.CommonTypes/Interfaces/IWritableImage.cs deleted file mode 100644 index d7777de1a..000000000 --- a/DiscImageChef.CommonTypes/Interfaces/IWritableImage.cs +++ /dev/null @@ -1,185 +0,0 @@ -// /*************************************************************************** -// The Disc Image Chef -// ---------------------------------------------------------------------------- -// -// Filename : IWritableImage.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; -using System.Collections.Generic; -using DiscImageChef.CommonTypes.Enums; -using DiscImageChef.CommonTypes.Structs; -using Schemas; - -namespace DiscImageChef.CommonTypes.Interfaces -{ - /// - /// Abstract class to implement disk image writing plugins. - /// TODO: This interface is subject to change until notice. - /// - public interface IWritableImage : IMediaImage - { - /// - /// Gets a list of that are supported by the media image format - /// - IEnumerable SupportedMediaTags { get; } - /// - /// Gets a list of that are supported by the media image format - /// - IEnumerable SupportedSectorTags { get; } - /// - /// Gets a list of that are supported by the media image format - /// - IEnumerable SupportedMediaTypes { get; } - /// - /// Retrieves a list of options supported by the filesystem, with name, type and description - /// - IEnumerable<(string name, Type type, string description, object @default)> SupportedOptions { get; } - /// - /// Gets a list of known extensions for format auto-chosing - /// - IEnumerable KnownExtensions { get; } - - bool IsWriting { get; } - string ErrorMessage { get; } - - /// - /// Creates a new image in the specified path, for the specified , with the - /// specified options to hold a media with the specified number of sectors - /// - /// Path to the new image, with extension - /// that will be written in the image - /// Options to be used when creating new image - /// How many sectors the media has. - /// - /// true if operating completed successfully, false otherwise - bool Create(string path, MediaType mediaType, Dictionary options, ulong sectors, - uint sectorSize); - - /// - /// Writes a media tag to the image - /// - /// Media tag - /// - /// - /// - /// true if operating completed successfully, false otherwise - bool WriteMediaTag(byte[] data, MediaTagType tag); - - /// - /// Writes a sector to the image - /// - /// Sector data - /// Sector address - /// true if operating completed successfully, false otherwise - bool WriteSector(byte[] data, ulong sectorAddress); - - /// - /// Writes several sectors to the image - /// - /// Sectors data - /// Sector starting address - /// How many sectors to write - /// true if operating completed successfully, false otherwise - bool WriteSectors(byte[] data, ulong sectorAddress, uint length); - - /// - /// Writes a sector to the image with main channel tags attached - /// - /// Sector data with its main channel tags attached - /// Sector address - /// true if operating completed successfully, false otherwise - bool WriteSectorLong(byte[] data, ulong sectorAddress); - - /// - /// Writes several sectors to the image - /// - /// Sector data with their main channel tags attached - /// Sector starting address - /// How many sectors to write - /// true if operating completed successfully, false otherwise - bool WriteSectorsLong(byte[] data, ulong sectorAddress, uint length); - - /// - /// Closes and flushes to disk the image - /// - /// true if operating completed successfully, false otherwise - bool Close(); - - /// - /// Sets image metadata - /// - /// containing image metadata - /// true if operating completed successfully, false otherwise - bool SetMetadata(ImageInfo metadata); - - /// - /// Sets media geometry - /// - /// Cylinders - /// Heads - /// Sectors per track - /// true if operating completed successfully, false otherwise - bool SetGeometry(uint cylinders, uint heads, uint sectorsPerTrack); - - /// - /// Writes parallel or subchannel sector tag for one sector - /// - /// Tag data to write - /// Sector address - /// Tag type - /// true if operating completed successfully, false otherwise - bool WriteSectorTag(byte[] data, ulong sectorAddress, SectorTagType tag); - - /// - /// Writes parallel or subchannel sector tag for several sector - /// - /// Tag data to write - /// Starting sector address - /// How many sectors to write - /// Tag type - /// true if operating completed successfully, false otherwise - bool WriteSectorsTag(byte[] data, ulong sectorAddress, uint length, SectorTagType tag); - - /// - /// Sets the list of dump hardware used to create the image from real media - /// - bool SetDumpHardware(List dumpHardware); - - /// - /// Sets the CICM XML metadata for the image - /// - bool SetCicmMetadata(CICMMetadataType metadata); - } -} \ No newline at end of file diff --git a/DiscImageChef.CommonTypes/Interfaces/IWritableOpticalImage.cs b/DiscImageChef.CommonTypes/Interfaces/IWritableOpticalImage.cs deleted file mode 100644 index 072815c7f..000000000 --- a/DiscImageChef.CommonTypes/Interfaces/IWritableOpticalImage.cs +++ /dev/null @@ -1,53 +0,0 @@ -// /*************************************************************************** -// 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.CommonTypes/Interfaces/IWritableTapeImage.cs b/DiscImageChef.CommonTypes/Interfaces/IWritableTapeImage.cs deleted file mode 100644 index b08263811..000000000 --- a/DiscImageChef.CommonTypes/Interfaces/IWritableTapeImage.cs +++ /dev/null @@ -1,67 +0,0 @@ -// /*************************************************************************** -// The Disc Image Chef -// ---------------------------------------------------------------------------- -// -// Filename : IWritableTapeImage.cs -// Author(s) : Natalia Portillo -// -// Component : Disc image plugins. -// -// --[ Description ] ---------------------------------------------------------- -// -// Defines interface to be implemented by writable block addressable -// sequential tape 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 DiscImageChef.CommonTypes.Structs; - -namespace DiscImageChef.CommonTypes.Interfaces -{ - public interface IWritableTapeImage : ITapeImage, IWritableImage - { - /// - /// Registers a new file in the image - /// - /// Tape file descriptor - /// true if successful, false otherwise - bool AddFile(TapeFile file); - - /// - /// Registers a new partition - /// - /// Tape partition descriptor - /// true if successful, false otherwise - bool AddPartition(TapePartition partition); - - /// - /// Tells the image plugin to set the internal structures to expect a tape (e.g. unknown block count and size). - /// Must be called before - /// - /// true if successful, false otherwise - bool SetTape(); - } -} \ No newline at end of file diff --git a/DiscImageChef.CommonTypes/Interop/DetectOS.cs b/DiscImageChef.CommonTypes/Interop/DetectOS.cs deleted file mode 100644 index cc5843690..000000000 --- a/DiscImageChef.CommonTypes/Interop/DetectOS.cs +++ /dev/null @@ -1,349 +0,0 @@ -// /*************************************************************************** -// The Disc Image Chef -// ---------------------------------------------------------------------------- -// -// Filename : DetectOS.cs -// Author(s) : Natalia Portillo -// -// Component : Interop services. -// -// --[ Description ] ---------------------------------------------------------- -// -// Detects underlying operating system. -// -// --[ 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; -using System.Diagnostics; -using System.IO; -using System.Runtime.InteropServices; -using System.Security.Principal; - -namespace DiscImageChef.CommonTypes.Interop -{ - public static class DetectOS - { - public static readonly bool IsMono = - RuntimeInformation.FrameworkDescription.StartsWith("Mono", StringComparison.Ordinal); - public static readonly bool IsNetFramework = - RuntimeInformation.FrameworkDescription.StartsWith(".NET Framework", StringComparison.Ordinal); - public static readonly bool IsNetCore = - RuntimeInformation.FrameworkDescription.StartsWith(".NET Core", StringComparison.Ordinal); - public static readonly bool IsNetNative = - RuntimeInformation.FrameworkDescription.StartsWith(".NET Native", StringComparison.Ordinal); - - /// - /// Checks if the underlying runtime runs in 64-bit mode - /// - public static readonly bool Is64Bit = IntPtr.Size == 8; - - /// - /// Checks if the underlying runtime runs in 32-bit mode - /// - public static readonly bool Is32Bit = IntPtr.Size == 4; - - public static bool IsWindows => - GetRealPlatformID() == PlatformID.Win32NT || GetRealPlatformID() == PlatformID.Win32S || - GetRealPlatformID() == PlatformID.Win32Windows || GetRealPlatformID() == PlatformID.WinCE || - GetRealPlatformID() == PlatformID.WindowsPhone || GetRealPlatformID() == PlatformID.Xbox; - - public static bool IsAdmin - { - get - { - if(!IsWindows) return Environment.UserName == "root"; - - bool isAdmin; - WindowsIdentity user = null; - try - { - user = WindowsIdentity.GetCurrent(); - WindowsPrincipal principal = new WindowsPrincipal(user); - isAdmin = principal.IsInRole(WindowsBuiltInRole.Administrator); - } - catch(UnauthorizedAccessException ex) { isAdmin = false; } - catch(Exception ex) { isAdmin = false; } - finally { user?.Dispose(); } - - return isAdmin; - } - } - - [DllImport("libc", SetLastError = true)] - static extern int uname(out utsname name); - - [DllImport("libc", SetLastError = true, EntryPoint = "sysctlbyname", CharSet = CharSet.Ansi)] - static extern int OSX_sysctlbyname(string name, IntPtr oldp, IntPtr oldlenp, IntPtr newp, uint newlen); - - /// - /// Gets the real platform ID, not the incomplete .NET framework one - /// - /// Platform ID - /// Unhandled exception - public static PlatformID GetRealPlatformID() - { - if((int)Environment.OSVersion.Platform < 4 || (int)Environment.OSVersion.Platform == 5) - return (PlatformID)(int)Environment.OSVersion.Platform; - - int error = uname(out utsname unixname); - if(error != 0) throw new Exception($"Unhandled exception calling uname: {Marshal.GetLastWin32Error()}"); - - switch(unixname.sysname) - { - // TODO: Differentiate Linux, Android, Tizen - case "Linux": - { - #if __ANDROID__ - return PlatformID.Android; - #else - return PlatformID.Linux; - #endif - } - - case "Darwin": - { - IntPtr pLen = Marshal.AllocHGlobal(sizeof(int)); - int osxError = OSX_sysctlbyname("hw.machine", IntPtr.Zero, pLen, IntPtr.Zero, 0); - if(osxError != 0) - { - Marshal.FreeHGlobal(pLen); - - throw new Exception($"Unhandled exception calling uname: {Marshal.GetLastWin32Error()}"); - } - - int length = Marshal.ReadInt32(pLen); - IntPtr pStr = Marshal.AllocHGlobal(length); - osxError = OSX_sysctlbyname("hw.machine", pStr, pLen, IntPtr.Zero, 0); - if(osxError != 0) - { - Marshal.FreeHGlobal(pStr); - Marshal.FreeHGlobal(pLen); - - throw new Exception($"Unhandled exception calling uname: {Marshal.GetLastWin32Error()}"); - } - - string machine = Marshal.PtrToStringAnsi(pStr); - - Marshal.FreeHGlobal(pStr); - Marshal.FreeHGlobal(pLen); - - if(machine != null && (machine.StartsWith("iPad", StringComparison.Ordinal) || - machine.StartsWith("iPod", StringComparison.Ordinal) || - machine.StartsWith("iPhone", StringComparison.Ordinal))) - return PlatformID.iOS; - - return PlatformID.MacOSX; - } - - case "GNU": return PlatformID.Hurd; - case "FreeBSD": - case "GNU/kFreeBSD": return PlatformID.FreeBSD; - case "DragonFly": return PlatformID.DragonFly; - case "Haiku": return PlatformID.Haiku; - case "HP-UX": return PlatformID.HPUX; - case "AIX": return PlatformID.AIX; - case "OS400": return PlatformID.OS400; - case "IRIX": - case "IRIX64": return PlatformID.IRIX; - case "Minix": return PlatformID.Minix; - case "NetBSD": return PlatformID.NetBSD; - case "NONSTOP_KERNEL": return PlatformID.NonStop; - case "OpenBSD": return PlatformID.OpenBSD; - case "QNX": return PlatformID.QNX; - case "SINIX-Y": return PlatformID.SINIX; - case "SunOS": return PlatformID.Solaris; - case "OSF1": return PlatformID.Tru64; - case "ULTRIX": return PlatformID.Ultrix; - case "SCO_SV": return PlatformID.OpenServer; - case "UnixWare": return PlatformID.UnixWare; - case "Interix": - case "UWIN-W7": return PlatformID.Win32NT; - default: - { - if(unixname.sysname.StartsWith("CYGWIN_NT", StringComparison.Ordinal) || - unixname.sysname.StartsWith("MINGW32_NT", StringComparison.Ordinal) || - unixname.sysname.StartsWith("MSYS_NT", StringComparison.Ordinal) || - unixname.sysname.StartsWith("UWIN", StringComparison.Ordinal)) return PlatformID.Win32NT; - - return PlatformID.Unknown; - } - } - } - - /// - /// Gets a string for the current operating system REAL version (handles Darwin 1.4 and Windows 10 falsifying) - /// - /// Current operating system version - public static string GetVersion() - { - string environ = Environment.OSVersion.Version.ToString(); - - switch(GetRealPlatformID()) - { - case PlatformID.MacOSX: - if(Environment.OSVersion.Version.Major != 1) - return $"10.{Environment.OSVersion.Version.Major - 4}.{Environment.OSVersion.Version.Minor}"; - - switch(Environment.OSVersion.Version.Minor) - { - case 3: return "10.0"; - case 4: return "10.1"; - } - - goto default; - case PlatformID.Win32NT: - // From Windows 8.1 the reported version is simply falsified... - if(Environment.OSVersion.Version.Major == 6 && Environment.OSVersion.Version.Major >= 2 || - Environment.OSVersion.Version.Major > 6) - return FileVersionInfo - .GetVersionInfo(Path.Combine(Environment.GetFolderPath(Environment.SpecialFolder.System), - "KERNEL32.DLL")).ProductVersion; - - return environ; - default: return environ; - } - } - - /// - /// From a platform ID and version returns a human-readable version - /// - /// Platform ID - /// Version number - /// Operating system name - public static string GetPlatformName(PlatformID id, string version = null) - { - switch(id) - { - case PlatformID.AIX: return "AIX"; - case PlatformID.Android: return "Android"; - case PlatformID.DragonFly: return "DragonFly BSD"; - case PlatformID.FreeBSD: return "FreeBSD"; - case PlatformID.Haiku: return "Haiku"; - case PlatformID.HPUX: return "HP/UX"; - case PlatformID.Hurd: return "Hurd"; - case PlatformID.iOS: return "iOS"; - case PlatformID.IRIX: return "IRIX"; - case PlatformID.Linux: - if(!File.Exists("/proc/version")) return "Linux"; - - string s = File.ReadAllText("/proc/version"); - - return s.Contains("Microsoft") || s.Contains("WSL") ? "Windows Subsystem for Linux" : "Linux"; - - case PlatformID.MacOSX: - if(string.IsNullOrEmpty(version)) return "macOS"; - - string[] pieces = version.Split('.'); - if(pieces.Length < 2 || !int.TryParse(pieces[1], out int minor)) return "macOS"; - - if(minor >= 12) return "macOS"; - if(minor >= 8) return "OS X"; - - return "Mac OS X"; - - case PlatformID.Minix: return "MINIX"; - case PlatformID.NetBSD: return "NetBSD"; - case PlatformID.NonStop: return "NonStop OS"; - case PlatformID.OpenBSD: return "OpenBSD"; - case PlatformID.OpenServer: return "SCO OpenServer"; - case PlatformID.OS400: return "OS/400"; - case PlatformID.PlayStation3: return "Sony CellOS"; - case PlatformID.PlayStation4: return "Sony Orbis OS"; - case PlatformID.QNX: return "QNX"; - case PlatformID.SINIX: return "SINIX"; - case PlatformID.Solaris: return "Sun Solaris"; - case PlatformID.Tizen: return "Samsung Tizen"; - case PlatformID.Tru64: return "Tru64 UNIX"; - case PlatformID.Ultrix: return "Ultrix"; - case PlatformID.Unix: return "UNIX"; - case PlatformID.UnixWare: return "SCO UnixWare"; - case PlatformID.Wii: return "Nintendo Wii"; - case PlatformID.WiiU: return "Nintendo Wii U"; - case PlatformID.Win32NT: - if(string.IsNullOrEmpty(version)) return "Windows NT/2000/XP/Vista/7/10"; - if(version.StartsWith("3.", StringComparison.Ordinal) || - version.StartsWith("4.", StringComparison.Ordinal)) return "Windows NT"; - if(version.StartsWith("5.0", StringComparison.Ordinal)) return "Windows 2000"; - if(version.StartsWith("5.1", StringComparison.Ordinal)) return "Windows XP"; - if(version.StartsWith("5.2", StringComparison.Ordinal)) return "Windows 2003"; - if(version.StartsWith("6.0", StringComparison.Ordinal)) return "Windows Vista"; - if(version.StartsWith("6.1", StringComparison.Ordinal)) return "Windows 7"; - if(version.StartsWith("6.2", StringComparison.Ordinal)) return "Windows 8"; - if(version.StartsWith("6.3", StringComparison.Ordinal)) return "Windows 8.1"; - if(version.StartsWith("10.0", StringComparison.Ordinal)) return "Windows 10"; - - return "Windows NT/2000/XP/Vista/7/10"; - case PlatformID.Win32S: return "Windows 3.x with win32s"; - case PlatformID.Win32Windows: - if(string.IsNullOrEmpty(version)) return "Windows 9x/Me"; - if(version.StartsWith("4.0", StringComparison.Ordinal)) return "Windows 95"; - if(version.StartsWith("4.10.2222", StringComparison.Ordinal)) return "Windows 98 SE"; - if(version.StartsWith("4.1", StringComparison.Ordinal)) return "Windows 98"; - if(version.StartsWith("4.9", StringComparison.Ordinal)) return "Windows Me"; - - return "Windows 9x/Me"; - case PlatformID.WinCE: return "Windows CE/Mobile"; - case PlatformID.WindowsPhone: return "Windows Phone"; - case PlatformID.Xbox: return "Xbox OS"; - case PlatformID.zOS: return "z/OS"; - default: return id.ToString(); - } - } - - /// - /// POSIX uname structure, size from OSX, big enough to handle extra fields - /// - [StructLayout(LayoutKind.Sequential, CharSet = CharSet.Ansi)] - struct utsname - { - /// - /// System name - /// - [MarshalAs(UnmanagedType.ByValTStr, SizeConst = 256)] - public readonly string sysname; - /// - /// Node name - /// - [MarshalAs(UnmanagedType.ByValTStr, SizeConst = 256)] - public readonly string nodename; - /// - /// Release level - /// - [MarshalAs(UnmanagedType.ByValTStr, SizeConst = 256)] - public readonly string release; - /// - /// Version level - /// - [MarshalAs(UnmanagedType.ByValTStr, SizeConst = 256)] - public readonly string version; - /// - /// Hardware level - /// - [MarshalAs(UnmanagedType.ByValTStr, SizeConst = 256)] - public readonly string machine; - } - } -} \ No newline at end of file diff --git a/DiscImageChef.CommonTypes/Interop/PlatformID.cs b/DiscImageChef.CommonTypes/Interop/PlatformID.cs deleted file mode 100644 index 0cd6dd108..000000000 --- a/DiscImageChef.CommonTypes/Interop/PlatformID.cs +++ /dev/null @@ -1,192 +0,0 @@ -// /*************************************************************************** -// The Disc Image Chef -// ---------------------------------------------------------------------------- -// -// Filename : PlatformID.cs -// Author(s) : Natalia Portillo -// -// Component : Interop services. -// -// --[ Description ] ---------------------------------------------------------- -// -// Contains an enhanced PlatformID enumeration. -// -// --[ 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 -// ****************************************************************************/ - -namespace DiscImageChef.CommonTypes.Interop -{ - /// - /// Contains an arbitrary list of OSes, even if .NET does not run on them - /// - public enum PlatformID - { - /// - /// Win32s - /// - Win32S = 0, - /// - /// Win32 (Windows 9x) - /// - Win32Windows = 1, - /// - /// Windows NT - /// - Win32NT = 2, - /// - /// Windows Mobile - /// - WinCE = 3, - /// - /// UNIX (do not use, too generic) - /// - Unix = 4, - /// - /// Xbox 360 - /// - Xbox = 5, - /// - /// OS X - /// - MacOSX = 6, - /// - /// iOS is not OS X - /// - iOS = 7, - /// - /// Linux - /// - Linux = 8, - /// - /// Sun Solaris - /// - Solaris = 9, - /// - /// NetBSD - /// - NetBSD = 10, - /// - /// OpenBSD - /// - OpenBSD = 11, - /// - /// FreeBSD - /// - FreeBSD = 12, - /// - /// DragonFly BSD - /// - DragonFly = 13, - /// - /// Nintendo Wii - /// - Wii = 14, - /// - /// Nintendo Wii U - /// - WiiU = 15, - /// - /// Sony PlayStation 3 - /// - PlayStation3 = 16, - /// - /// Sony Playstation 4 - /// - PlayStation4 = 17, - /// - /// Google Android - /// - Android = 18, - /// - /// Samsung Tizen - /// - Tizen = 19, - /// - /// Windows Phone - /// - WindowsPhone = 20, - /// - /// GNU/Hurd - /// - Hurd = 21, - /// - /// Haiku - /// - Haiku = 22, - /// - /// HP-UX - /// - HPUX = 23, - /// - /// AIX - /// - AIX = 24, - /// - /// OS/400 - /// - OS400 = 25, - /// - /// IRIX - /// - IRIX = 26, - /// - /// Minix - /// - Minix = 27, - /// - /// NonStop - /// - NonStop = 28, - /// - /// QNX - /// - QNX = 29, - /// - /// SINIX - /// - SINIX = 30, - /// - /// Tru64 UNIX - /// - Tru64 = 31, - /// - /// Ultrix - /// - Ultrix = 32, - /// - /// SCO OpenServer / SCO UNIX - /// - OpenServer = 33, - /// - /// SCO UnixWare - /// - UnixWare = 34, - /// - /// IBM z/OS - /// - zOS = 35, - Unknown = -1 - } -} \ No newline at end of file diff --git a/DiscImageChef.CommonTypes/Interop/Version.cs b/DiscImageChef.CommonTypes/Interop/Version.cs deleted file mode 100644 index 3dfbe4f89..000000000 --- a/DiscImageChef.CommonTypes/Interop/Version.cs +++ /dev/null @@ -1,76 +0,0 @@ -// /*************************************************************************** -// The Disc Image Chef -// ---------------------------------------------------------------------------- -// -// Filename : Version.cs -// Author(s) : Natalia Portillo -// -// Component : Interop services. -// -// --[ Description ] ---------------------------------------------------------- -// -// Returns DiscImageChef version. -// -// --[ 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; -using System.Reflection; -using System.Runtime; - -namespace DiscImageChef.CommonTypes.Interop -{ - public static class Version - { - /// - /// Gets version string - /// - /// Version - public static string GetVersion() => typeof(Version).Assembly.GetName().Version.ToString(); - - public static string GetNetCoreVersion() - { - Assembly assembly = typeof(GCSettings).Assembly; - string[] assemblyPath = - assembly.CodeBase.Split(new[] {'/', '\\'}, StringSplitOptions.RemoveEmptyEntries); - int netCoreAppIndex = Array.IndexOf(assemblyPath, "Microsoft.NETCore.App"); - if(netCoreAppIndex > 0 && netCoreAppIndex < assemblyPath.Length - 2) - return assemblyPath[netCoreAppIndex + 1]; - - return null; - } - - public static string GetMonoVersion() - { - if(!DetectOS.IsMono) return null; - - MethodInfo monoDisplayName = Type.GetType("Mono.Runtime") - ?.GetMethod("GetDisplayName", BindingFlags.NonPublic | BindingFlags.Static); - if(monoDisplayName != null) return (string)monoDisplayName.Invoke(null, null); - - return null; - } - } -} \ No newline at end of file diff --git a/DiscImageChef.CommonTypes/MediaType.cs b/DiscImageChef.CommonTypes/MediaType.cs deleted file mode 100644 index 4863edb51..000000000 --- a/DiscImageChef.CommonTypes/MediaType.cs +++ /dev/null @@ -1,1061 +0,0 @@ -// /*************************************************************************** -// The Disc Image Chef -// ---------------------------------------------------------------------------- -// -// Filename : MediaType.cs -// Author(s) : Natalia Portillo -// -// Component : DiscImageChef common types. -// -// --[ Description ] ---------------------------------------------------------- -// -// Contains common media types. -// -// --[ 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 -// ****************************************************************************/ - -// ReSharper disable InconsistentNaming -// TODO: Rename contents - -namespace DiscImageChef.CommonTypes -{ - public enum MediaEncoding - { - Unknown, - FM, - MFM, - M2FM, - AppleGCR, - CommodoreGCR - } - - /// - /// Contains an enumeration of all known types of media. - /// - public enum MediaType : uint - { - #region Generics, types 0 to 9 - /// Unknown disk type - Unknown = 0, - /// Unknown magneto-optical - UnknownMO = 1, - /// Generic hard disk - GENERIC_HDD = 2, - /// Microdrive type hard disk - Microdrive = 3, - /// Zoned hard disk - Zone_HDD = 4, - /// USB flash drives - FlashDrive = 5, - /// USB flash drives - UnknownTape = 4, - #endregion Generics, types 0 to 9 - - #region Somewhat standard Compact Disc formats, types 10 to 39 - /// Any unknown or standard violating CD - CD = 10, - /// CD Digital Audio (Red Book) - CDDA = 11, - /// CD+G (Red Book) - CDG = 12, - /// CD+EG (Red Book) - CDEG = 13, - /// CD-i (Green Book) - CDI = 14, - /// CD-ROM (Yellow Book) - CDROM = 15, - /// CD-ROM XA (Yellow Book) - CDROMXA = 16, - /// CD+ (Blue Book) - CDPLUS = 17, - /// CD-MO (Orange Book) - CDMO = 18, - /// CD-Recordable (Orange Book) - CDR = 19, - /// CD-ReWritable (Orange Book) - CDRW = 20, - /// Mount-Rainier CD-RW - CDMRW = 21, - /// Video CD (White Book) - VCD = 22, - /// Super Video CD (White Book) - SVCD = 23, - /// Photo CD (Beige Book) - PCD = 24, - /// Super Audio CD (Scarlet Book) - SACD = 25, - /// Double-Density CD-ROM (Purple Book) - DDCD = 26, - /// DD CD-R (Purple Book) - DDCDR = 27, - /// DD CD-RW (Purple Book) - DDCDRW = 28, - /// DTS audio CD (non-standard) - DTSCD = 29, - /// CD-MIDI (Red Book) - CDMIDI = 30, - /// CD-Video (ISO/IEC 61104) - CDV = 31, - /// 120mm, Phase-Change, 1298496 sectors, 512 bytes/sector, PD650, ECMA-240, ISO 15485 - PD650 = 32, - /// 120mm, Write-Once, 1281856 sectors, 512 bytes/sector, PD650, ECMA-240, ISO 15485 - PD650_WORM = 33, - /// - /// CD-i Ready, contains a track before the first TOC track, in mode 2, and all TOC tracks are Audio. Subchannel - /// marks track as audio pause. - /// - CDIREADY = 34, - FMTOWNS = 35, - #endregion Somewhat standard Compact Disc formats, types 10 to 39 - - #region Standard DVD formats, types 40 to 50 - /// DVD-ROM (applies to DVD Video and DVD Audio) - DVDROM = 40, - /// DVD-R - DVDR = 41, - /// DVD-RW - DVDRW = 42, - /// DVD+R - DVDPR = 43, - /// DVD+RW - DVDPRW = 44, - /// DVD+RW DL - DVDPRWDL = 45, - /// DVD-R DL - DVDRDL = 46, - /// DVD+R DL - DVDPRDL = 47, - /// DVD-RAM - DVDRAM = 48, - /// DVD-RW DL - DVDRWDL = 49, - /// DVD-Download - DVDDownload = 50, - #endregion Standard DVD formats, types 40 to 50 - - #region Standard HD-DVD formats, types 51 to 59 - /// HD DVD-ROM (applies to HD DVD Video) - HDDVDROM = 51, - /// HD DVD-RAM - HDDVDRAM = 52, - /// HD DVD-R - HDDVDR = 53, - /// HD DVD-RW - HDDVDRW = 54, - /// HD DVD-R DL - HDDVDRDL = 55, - /// HD DVD-RW DL - HDDVDRWDL = 56, - #endregion Standard HD-DVD formats, types 51 to 59 - - #region Standard Blu-ray formats, types 60 to 69 - /// BD-ROM (and BD Video) - BDROM = 60, - /// BD-R - BDR = 61, - /// BD-RE - BDRE = 62, - /// BD-R XL - BDRXL = 63, - /// BD-RE XL - BDREXL = 64, - #endregion Standard Blu-ray formats, types 60 to 69 - - #region Rare or uncommon optical standards, types 70 to 79 - /// Enhanced Versatile Disc - EVD = 70, - /// Forward Versatile Disc - FVD = 71, - /// Holographic Versatile Disc - HVD = 72, - /// China Blue High Definition - CBHD = 73, - /// High Definition Versatile Multilayer Disc - HDVMD = 74, - /// Versatile Compact Disc High Density - VCDHD = 75, - /// Stacked Volumetric Optical Disc - SVOD = 76, - /// Five Dimensional disc - FDDVD = 77, - #endregion Rare or uncommon optical standards, types 70 to 79 - - #region LaserDisc based, types 80 to 89 - /// Pioneer LaserDisc - LD = 80, - /// Pioneer LaserDisc data - LDROM = 81, - LDROM2 = 82, - LVROM = 83, - MegaLD = 84, - #endregion LaserDisc based, types 80 to 89 - - #region MiniDisc based, types 90 to 99 - /// Sony Hi-MD - HiMD = 90, - /// Sony MiniDisc - MD = 91, - MDData = 92, - MDData2 = 93, - #endregion MiniDisc based, types 90 to 99 - - #region Plasmon UDO, types 100 to 109 - /// 5.25", Phase-Change, 1834348 sectors, 8192 bytes/sector, Ultra Density Optical, ECMA-350, ISO 17345 - UDO = 100, - /// 5.25", Phase-Change, 3669724 sectors, 8192 bytes/sector, Ultra Density Optical 2, ECMA-380, ISO 11976 - UDO2 = 101, - /// 5.25", Write-Once, 3668759 sectors, 8192 bytes/sector, Ultra Density Optical 2, ECMA-380, ISO 11976 - UDO2_WORM = 102, - #endregion Plasmon UDO, types 100 to 109 - - #region Sony game media, types 110 to 129 - PlayStationMemoryCard = 110, - PlayStationMemoryCard2 = 111, - /// Sony PlayStation game CD - PS1CD = 112, - /// Sony PlayStation 2 game CD - PS2CD = 113, - /// Sony PlayStation 2 game DVD - PS2DVD = 114, - /// Sony PlayStation 3 game DVD - PS3DVD = 115, - /// Sony PlayStation 3 game Blu-ray - PS3BD = 116, - /// Sony PlayStation 4 game Blu-ray - PS4BD = 117, - /// Sony PlayStation Portable Universal Media Disc (ECMA-365) - UMD = 118, - PlayStationVitaGameCard = 119, - #endregion Sony game media, types 110 to 129 - - #region Microsoft game media, types 130 to 149 - /// Microsoft X-box Game Disc - XGD = 130, - /// Microsoft X-box 360 Game Disc - XGD2 = 131, - /// Microsoft X-box 360 Game Disc - XGD3 = 132, - /// Microsoft X-box One Game Disc - XGD4 = 133, - #endregion Microsoft game media, types 130 to 149 - - #region Sega game media, types 150 to 169 - /// Sega MegaCD - MEGACD = 150, - /// Sega Saturn disc - SATURNCD = 151, - /// Sega/Yamaha Gigabyte Disc - GDROM = 152, - /// Sega/Yamaha recordable Gigabyte Disc - GDR = 153, - SegaCard = 154, - MilCD = 155, - #endregion Sega game media, types 150 to 169 - - #region Other game media, types 170 to 179 - /// PC-Engine / TurboGrafx cartridge - HuCard = 170, - /// PC-Engine / TurboGrafx CD - SuperCDROM2 = 171, - /// Atari Jaguar CD - JaguarCD = 172, - /// 3DO CD - ThreeDO = 173, - /// NEC PC-FX - PCFX = 174, - /// NEO-GEO CD - NeoGeoCD = 175, - /// Commodore CDTV - CDTV = 176, - /// Amiga CD32 - CD32 = 177, - /// Nuon (DVD based videogame console) - Nuon = 178, - /// Bandai Playdia - Playdia = 179, - #endregion Other game media, types 170 to 179 - - #region Apple standard floppy format, types 180 to 189 - /// 5.25", SS, DD, 35 tracks, 13 spt, 256 bytes/sector, GCR - Apple32SS = 180, - /// 5.25", DS, DD, 35 tracks, 13 spt, 256 bytes/sector, GCR - Apple32DS = 181, - /// 5.25", SS, DD, 35 tracks, 16 spt, 256 bytes/sector, GCR - Apple33SS = 182, - /// 5.25", DS, DD, 35 tracks, 16 spt, 256 bytes/sector, GCR - Apple33DS = 183, - /// 3.5", SS, DD, 80 tracks, 8 to 12 spt, 512 bytes/sector, GCR - AppleSonySS = 184, - /// 3.5", DS, DD, 80 tracks, 8 to 12 spt, 512 bytes/sector, GCR - AppleSonyDS = 185, - /// 5.25", DS, ?D, ?? tracks, ?? spt, 512 bytes/sector, GCR, opposite side heads, aka Twiggy - AppleFileWare = 186, - #endregion Apple standard floppy format - - #region IBM/Microsoft PC floppy formats, types 190 to 209 - /// 5.25", SS, DD, 40 tracks, 8 spt, 512 bytes/sector, MFM - DOS_525_SS_DD_8 = 190, - /// 5.25", SS, DD, 40 tracks, 9 spt, 512 bytes/sector, MFM - DOS_525_SS_DD_9 = 191, - /// 5.25", DS, DD, 40 tracks, 8 spt, 512 bytes/sector, MFM - DOS_525_DS_DD_8 = 192, - /// 5.25", DS, DD, 40 tracks, 9 spt, 512 bytes/sector, MFM - DOS_525_DS_DD_9 = 193, - /// 5.25", DS, HD, 80 tracks, 15 spt, 512 bytes/sector, MFM - DOS_525_HD = 194, - /// 3.5", SS, DD, 80 tracks, 8 spt, 512 bytes/sector, MFM - DOS_35_SS_DD_8 = 195, - /// 3.5", SS, DD, 80 tracks, 9 spt, 512 bytes/sector, MFM - DOS_35_SS_DD_9 = 196, - /// 3.5", DS, DD, 80 tracks, 8 spt, 512 bytes/sector, MFM - DOS_35_DS_DD_8 = 197, - /// 3.5", DS, DD, 80 tracks, 9 spt, 512 bytes/sector, MFM - DOS_35_DS_DD_9 = 198, - /// 3.5", DS, HD, 80 tracks, 18 spt, 512 bytes/sector, MFM - DOS_35_HD = 199, - /// 3.5", DS, ED, 80 tracks, 36 spt, 512 bytes/sector, MFM - DOS_35_ED = 200, - /// 3.5", DS, HD, 80 tracks, 21 spt, 512 bytes/sector, MFM - DMF = 201, - /// 3.5", DS, HD, 82 tracks, 21 spt, 512 bytes/sector, MFM - DMF_82 = 202, - /// - /// 5.25", DS, HD, 80 tracks, ? spt, ??? + ??? + ??? bytes/sector, MFM track 0 = ??15 sectors, 512 - /// bytes/sector, falsified to DOS as 19 spt, 512 bps - /// - XDF_525 = 203, - /// - /// 3.5", DS, HD, 80 tracks, 4 spt, 8192 + 2048 + 1024 + 512 bytes/sector, MFM track 0 = 19 sectors, 512 - /// bytes/sector, falsified to DOS as 23 spt, 512 bps - /// - XDF_35 = 204, - #endregion IBM/Microsoft PC standard floppy formats, types 190 to 209 - - #region IBM standard floppy formats, types 210 to 219 - /// 8", SS, SD, 32 tracks, 8 spt, 319 bytes/sector, FM - IBM23FD = 210, - /// 8", SS, SD, 73 tracks, 26 spt, 128 bytes/sector, FM - IBM33FD_128 = 211, - /// 8", SS, SD, 74 tracks, 15 spt, 256 bytes/sector, FM, track 0 = 26 sectors, 128 bytes/sector - IBM33FD_256 = 212, - /// 8", SS, SD, 74 tracks, 8 spt, 512 bytes/sector, FM, track 0 = 26 sectors, 128 bytes/sector - IBM33FD_512 = 213, - /// 8", DS, SD, 74 tracks, 26 spt, 128 bytes/sector, FM, track 0 = 26 sectors, 128 bytes/sector - IBM43FD_128 = 214, - /// 8", DS, SD, 74 tracks, 26 spt, 256 bytes/sector, FM, track 0 = 26 sectors, 128 bytes/sector - IBM43FD_256 = 215, - /// - /// 8", DS, DD, 74 tracks, 26 spt, 256 bytes/sector, MFM, track 0 side 0 = 26 sectors, 128 bytes/sector, track 0 - /// side 1 = 26 sectors, 256 bytes/sector - /// - IBM53FD_256 = 216, - /// - /// 8", DS, DD, 74 tracks, 15 spt, 512 bytes/sector, MFM, track 0 side 0 = 26 sectors, 128 bytes/sector, track 0 - /// side 1 = 26 sectors, 256 bytes/sector - /// - IBM53FD_512 = 217, - /// - /// 8", DS, DD, 74 tracks, 8 spt, 1024 bytes/sector, MFM, track 0 side 0 = 26 sectors, 128 bytes/sector, track 0 - /// side 1 = 26 sectors, 256 bytes/sector - /// - IBM53FD_1024 = 218, - #endregion IBM standard floppy formats, types 210 to 219 - - #region DEC standard floppy formats, types 220 to 229 - /// 8", SS, DD, 77 tracks, 26 spt, 128 bytes/sector, FM - RX01 = 220, - /// 8", SS, DD, 77 tracks, 26 spt, 256 bytes/sector, FM/MFM - RX02 = 221, - /// 8", DS, DD, 77 tracks, 26 spt, 256 bytes/sector, FM/MFM - RX03 = 222, - /// 5.25", SS, DD, 80 tracks, 10 spt, 512 bytes/sector, MFM - RX50 = 223, - #endregion DEC standard floppy formats, types 220 to 229 - - #region Acorn standard floppy formats, types 230 to 239 - /// 5,25", SS, SD, 40 tracks, 10 spt, 256 bytes/sector, FM - ACORN_525_SS_SD_40 = 230, - /// 5,25", SS, SD, 80 tracks, 10 spt, 256 bytes/sector, FM - ACORN_525_SS_SD_80 = 231, - /// 5,25", SS, DD, 40 tracks, 16 spt, 256 bytes/sector, MFM - ACORN_525_SS_DD_40 = 232, - /// 5,25", SS, DD, 80 tracks, 16 spt, 256 bytes/sector, MFM - ACORN_525_SS_DD_80 = 233, - /// 5,25", DS, DD, 80 tracks, 16 spt, 256 bytes/sector, MFM - ACORN_525_DS_DD = 234, - /// 3,5", DS, DD, 80 tracks, 5 spt, 1024 bytes/sector, MFM - ACORN_35_DS_DD = 235, - /// 3,5", DS, HD, 80 tracks, 10 spt, 1024 bytes/sector, MFM - ACORN_35_DS_HD = 236, - #endregion Acorn standard floppy formats, types 230 to 239 - - #region Atari standard floppy formats, types 240 to 249 - /// 5,25", SS, SD, 40 tracks, 18 spt, 128 bytes/sector, FM - ATARI_525_SD = 240, - /// 5,25", SS, ED, 40 tracks, 26 spt, 128 bytes/sector, MFM - ATARI_525_ED = 241, - /// 5,25", SS, DD, 40 tracks, 18 spt, 256 bytes/sector, MFM - ATARI_525_DD = 242, - /// 3,5", SS, DD, 80 tracks, 10 spt, 512 bytes/sector, MFM - ATARI_35_SS_DD = 243, - /// 3,5", DS, DD, 80 tracks, 10 spt, 512 bytes/sector, MFM - ATARI_35_DS_DD = 244, - /// 3,5", SS, DD, 80 tracks, 11 spt, 512 bytes/sector, MFM - ATARI_35_SS_DD_11 = 245, - /// 3,5", DS, DD, 80 tracks, 11 spt, 512 bytes/sector, MFM - ATARI_35_DS_DD_11 = 246, - #endregion Atari standard floppy formats, types 240 to 249 - - #region Commodore standard floppy formats, types 250 to 259 - /// 3,5", DS, DD, 80 tracks, 10 spt, 512 bytes/sector, MFM (1581) - CBM_35_DD = 250, - /// 3,5", DS, DD, 80 tracks, 11 spt, 512 bytes/sector, MFM (Amiga) - CBM_AMIGA_35_DD = 251, - /// 3,5", DS, HD, 80 tracks, 22 spt, 512 bytes/sector, MFM (Amiga) - CBM_AMIGA_35_HD = 252, - /// 5,25", SS, DD, 35 tracks, GCR - CBM_1540 = 253, - /// 5,25", SS, DD, 40 tracks, GCR - CBM_1540_Ext = 254, - /// 5,25", DS, DD, 35 tracks, GCR - CBM_1571 = 255, - #endregion Commodore standard floppy formats, types 250 to 259 - - #region NEC/SHARP standard floppy formats, types 260 to 269 - /// 8", DS, SD, 77 tracks, 26 spt, 128 bytes/sector, FM - NEC_8_SD = 260, - /// 8", DS, DD, 77 tracks, 26 spt, 256 bytes/sector, MFM - NEC_8_DD = 261, - /// 5.25", SS, SD, 80 tracks, 16 spt, 256 bytes/sector, FM - NEC_525_SS = 262, - /// 5.25", DS, SD, 80 tracks, 16 spt, 256 bytes/sector, MFM - NEC_525_DS = 263, - /// 5,25", DS, HD, 77 tracks, 8 spt, 1024 bytes/sector, MFM - NEC_525_HD = 264, - /// 3,5", DS, HD, 77 tracks, 8 spt, 1024 bytes/sector, MFM, aka mode 3 - NEC_35_HD_8 = 265, - /// 3,5", DS, HD, 80 tracks, 15 spt, 512 bytes/sector, MFM - NEC_35_HD_15 = 266, - /// 3,5", DS, TD, 240 tracks, 38 spt, 512 bytes/sector, MFM - NEC_35_TD = 267, - /// 5,25", DS, HD, 77 tracks, 8 spt, 1024 bytes/sector, MFM - SHARP_525 = NEC_525_HD, - /// 3,5", DS, HD, 80 tracks, 9 spt, 1024 bytes/sector, MFM - SHARP_525_9 = 268, - /// 3,5", DS, HD, 77 tracks, 8 spt, 1024 bytes/sector, MFM - SHARP_35 = NEC_35_HD_8, - /// 3,5", DS, HD, 80 tracks, 9 spt, 1024 bytes/sector, MFM - SHARP_35_9 = 269, - #endregion NEC/SHARP standard floppy formats, types 260 to 269 - - #region ECMA floppy standards, types 270 to 289 - /// - /// 5,25", DS, DD, 80 tracks, 8 spt, 1024 bytes/sector, MFM, track 0 side 0 = 26 sectors, 128 bytes/sector, track - /// 0 side 1 = 26 sectors, 256 bytes/sector - /// - ECMA_99_8 = 270, - /// - /// 5,25", DS, DD, 77 tracks, 15 spt, 512 bytes/sector, MFM, track 0 side 0 = 26 sectors, 128 bytes/sector, track - /// 0 side 1 = 26 sectors, 256 bytes/sector - /// - ECMA_99_15 = 271, - /// - /// 5,25", DS, DD, 77 tracks, 26 spt, 256 bytes/sector, MFM, track 0 side 0 = 26 sectors, 128 bytes/sector, track - /// 0 side 1 = 26 sectors, 256 bytes/sector - /// - ECMA_99_26 = 272, - /// 3,5", DS, DD, 80 tracks, 9 spt, 512 bytes/sector, MFM - ECMA_100 = DOS_35_DS_DD_9, - /// 3,5", DS, HD, 80 tracks, 18 spt, 512 bytes/sector, MFM - ECMA_125 = DOS_35_HD, - /// 3,5", DS, ED, 80 tracks, 36 spt, 512 bytes/sector, MFM - ECMA_147 = DOS_35_ED, - /// 8", SS, SD, 77 tracks, 26 spt, 128 bytes/sector, FM - ECMA_54 = 273, - /// 8", DS, SD, 77 tracks, 26 spt, 128 bytes/sector, FM - ECMA_59 = 274, - /// 5,25", SS, DD, 35 tracks, 9 spt, 256 bytes/sector, FM, track 0 side 0 = 16 sectors, 128 bytes/sector - ECMA_66 = 275, - /// - /// 8", DS, DD, 77 tracks, 8 spt, 1024 bytes/sector, FM, track 0 side 0 = 26 sectors, 128 bytes/sector, track 0 - /// side 1 = 26 sectors, 256 bytes/sector - /// - ECMA_69_8 = 276, - /// - /// 8", DS, DD, 77 tracks, 15 spt, 512 bytes/sector, FM, track 0 side 0 = 26 sectors, 128 bytes/sector, track 0 - /// side 1 = 26 sectors, 256 bytes/sector - /// - ECMA_69_15 = 277, - /// - /// 8", DS, DD, 77 tracks, 26 spt, 256 bytes/sector, FM, track 0 side 0 = 26 sectors, 128 bytes/sector, track 0 - /// side 1 = 26 sectors, 256 bytes/sector - /// - ECMA_69_26 = 278, - /// - /// 5,25", DS, DD, 40 tracks, 16 spt, 256 bytes/sector, FM, track 0 side 0 = 16 sectors, 128 bytes/sector, track 0 - /// side 1 = 16 sectors, 256 bytes/sector - /// - ECMA_70 = 279, - /// - /// 5,25", DS, DD, 80 tracks, 16 spt, 256 bytes/sector, FM, track 0 side 0 = 16 sectors, 128 bytes/sector, track 0 - /// side 1 = 16 sectors, 256 bytes/sector - /// - ECMA_78 = 280, - /// 5,25", DS, DD, 80 tracks, 9 spt, 512 bytes/sector, FM - ECMA_78_2 = 281, - #endregion ECMA floppy standards, types 270 to 289 - - #region Non-standard PC formats (FDFORMAT, 2M, etc), types 290 to 308 - /// 5,25", DS, DD, 82 tracks, 10 spt, 512 bytes/sector, MFM - FDFORMAT_525_DD = 290, - /// 5,25", DS, HD, 82 tracks, 17 spt, 512 bytes/sector, MFM - FDFORMAT_525_HD = 291, - /// 3,5", DS, DD, 82 tracks, 10 spt, 512 bytes/sector, MFM - FDFORMAT_35_DD = 292, - /// 3,5", DS, HD, 82 tracks, 21 spt, 512 bytes/sector, MFM - FDFORMAT_35_HD = 293, - #endregion Non-standard PC formats (FDFORMAT, 2M, etc), types 290 to 308 - - #region Apricot ACT standard floppy formats, type 309 - /// 3.5", DS, DD, 70 tracks, 9 spt, 512 bytes/sector, MFM - Apricot_35 = 309, - #endregion Apricot ACT standard floppy formats, type 309 - - #region OnStream ADR, types 310 to 319 - ADR2120 = 310, - ADR260 = 311, - ADR30 = 312, - ADR50 = 313, - #endregion OnStream ADR, types 310 to 319 - - #region Advanced Intelligent Tape, types 320 to 339 - AIT1 = 320, - AIT1Turbo = 321, - AIT2 = 322, - AIT2Turbo = 323, - AIT3 = 324, - AIT3Ex = 325, - AIT3Turbo = 326, - AIT4 = 327, - AIT5 = 328, - AITETurbo = 329, - SAIT1 = 330, - SAIT2 = 331, - #endregion Advanced Intelligent Tape, types 320 to 339 - - #region Iomega, types 340 to 359 - Bernoulli = 340, - Bernoulli2 = 341, - Ditto = 342, - DittoMax = 343, - Jaz = 344, - Jaz2 = 345, - PocketZip = 346, - REV120 = 347, - REV35 = 348, - REV70 = 349, - ZIP100 = 350, - ZIP250 = 351, - ZIP750 = 352, - #endregion Iomega, types 340 to 359 - - #region Audio or video media, types 360 to 369 - CompactCassette = 360, - Data8 = 361, - MiniDV = 362, - /// D/CAS-25: Digital data on Compact Cassette form factor, special magnetic media, 9-track - Dcas25 = 363, - /// D/CAS-85: Digital data on Compact Cassette form factor, special magnetic media, 17-track - Dcas85 = 364, - /// D/CAS-103: Digital data on Compact Cassette form factor, special magnetic media, 21-track - Dcas103 = 365, - #endregion Audio media, types 360 to 369 - - #region CompactFlash Association, types 370 to 379 - CFast = 370, - CompactFlash = 371, - CompactFlashType2 = 372, - #endregion CompactFlash Association, types 370 to 379 - - #region Digital Audio Tape / Digital Data Storage, types 380 to 389 - DigitalAudioTape = 380, - DAT160 = 381, - DAT320 = 382, - DAT72 = 383, - DDS1 = 384, - DDS2 = 385, - DDS3 = 386, - DDS4 = 387, - #endregion Digital Audio Tape / Digital Data Storage, types 380 to 389 - - #region DEC, types 390 to 399 - CompactTapeI = 390, - CompactTapeII = 391, - DECtapeII = 392, - DLTtapeIII = 393, - DLTtapeIIIxt = 394, - DLTtapeIV = 395, - DLTtapeS4 = 396, - SDLT1 = 397, - SDLT2 = 398, - VStapeI = 399, - #endregion DEC, types 390 to 399 - - #region Exatape, types 400 to 419 - Exatape15m = 400, - Exatape22m = 401, - Exatape22mAME = 402, - Exatape28m = 403, - Exatape40m = 404, - Exatape45m = 405, - Exatape54m = 406, - Exatape75m = 407, - Exatape76m = 408, - Exatape80m = 409, - Exatape106m = 410, - Exatape160mXL = 411, - Exatape112m = 412, - Exatape125m = 413, - Exatape150m = 414, - Exatape170m = 415, - Exatape225m = 416, - #endregion Exatape, types 400 to 419 - - #region PCMCIA / ExpressCard, types 420 to 429 - ExpressCard34 = 420, - ExpressCard54 = 421, - PCCardTypeI = 422, - PCCardTypeII = 423, - PCCardTypeIII = 424, - PCCardTypeIV = 425, - #endregion PCMCIA / ExpressCard, types 420 to 429 - - #region SyQuest, types 430 to 449 - EZ135 = 430, - EZ230 = 431, - Quest = 432, - SparQ = 433, - SQ100 = 434, - SQ200 = 435, - SQ300 = 436, - SQ310 = 437, - SQ327 = 438, - SQ400 = 439, - SQ800 = 440, - SQ1500 = 441, - SQ2000 = 442, - SyJet = 443, - #endregion SyQuest, types 430 to 449 - - #region Nintendo, types 450 to 469 - FamicomGamePak = 450, - GameBoyAdvanceGamePak = 451, - GameBoyGamePak = 452, - /// Nintendo GameCube Optical Disc - GOD = 453, - N64DD = 454, - N64GamePak = 455, - NESGamePak = 456, - Nintendo3DSGameCard = 457, - NintendoDiskCard = 458, - NintendoDSGameCard = 459, - NintendoDSiGameCard = 460, - SNESGamePak = 461, - SNESGamePakUS = 462, - /// Nintendo Wii Optical Disc - WOD = 463, - /// Nintendo Wii U Optical Disc - WUOD = 464, - SwitchGameCard = 465, - #endregion Nintendo, types 450 to 469 - - #region IBM Tapes, types 470 to 479 - IBM3470 = 470, - IBM3480 = 471, - IBM3490 = 472, - IBM3490E = 473, - IBM3592 = 474, - #endregion IBM Tapes, types 470 to 479 - - #region LTO Ultrium, types 480 to 509 - LTO = 480, - LTO2 = 481, - LTO3 = 482, - LTO3WORM = 483, - LTO4 = 484, - LTO4WORM = 485, - LTO5 = 486, - LTO5WORM = 487, - LTO6 = 488, - LTO6WORM = 489, - LTO7 = 490, - LTO7WORM = 491, - #endregion LTO Ultrium, types 480 to 509 - - #region MemoryStick, types 510 to 519 - MemoryStick = 510, - MemoryStickDuo = 511, - MemoryStickMicro = 512, - MemoryStickPro = 513, - MemoryStickProDuo = 514, - #endregion MemoryStick, types 510 to 519 - - #region SecureDigital, types 520 to 529 - microSD = 520, - miniSD = 521, - SecureDigital = 522, - #endregion SecureDigital, types 520 to 529 - - #region MultiMediaCard, types 530 to 539 - MMC = 530, - MMCmicro = 531, - RSMMC = 532, - MMCplus = 533, - MMCmobile = 534, - #endregion MultiMediaCard, types 530 to 539 - - #region SLR, types 540 to 569 - MLR1 = 540, - MLR1SL = 541, - MLR3 = 542, - SLR1 = 543, - SLR2 = 544, - SLR3 = 545, - SLR32 = 546, - SLR32SL = 547, - SLR4 = 548, - SLR5 = 549, - SLR5SL = 550, - SLR6 = 551, - SLRtape7 = 552, - SLRtape7SL = 553, - SLRtape24 = 554, - SLRtape24SL = 555, - SLRtape40 = 556, - SLRtape50 = 557, - SLRtape60 = 558, - SLRtape75 = 559, - SLRtape100 = 560, - SLRtape140 = 561, - #endregion SLR, types 540 to 569 - - #region QIC, types 570 to 589 - QIC11 = 570, - QIC120 = 571, - QIC1350 = 572, - QIC150 = 573, - QIC24 = 574, - QIC3010 = 575, - QIC3020 = 576, - QIC3080 = 577, - QIC3095 = 578, - QIC320 = 579, - QIC40 = 580, - QIC525 = 581, - QIC80 = 582, - #endregion QIC, types 570 to 589 - - #region StorageTek tapes, types 590 to 609 - STK4480 = 590, - STK4490 = 591, - STK9490 = 592, - T9840A = 593, - T9840B = 594, - T9840C = 595, - T9840D = 596, - T9940A = 597, - T9940B = 598, - T10000A = 599, - T10000B = 600, - T10000C = 601, - T10000D = 602, - #endregion StorageTek tapes, types 590 to 609 - - #region Travan, types 610 to 619 - Travan = 610, - Travan1Ex = 611, - Travan3 = 612, - Travan3Ex = 613, - Travan4 = 614, - Travan5 = 615, - Travan7 = 616, - #endregion Travan, types 610 to 619 - - #region VXA, types 620 to 629 - VXA1 = 620, - VXA2 = 621, - VXA3 = 622, - #endregion VXA, types 620 to 629 - - #region Magneto-optical, types 630 to 659 - /// 5,25", M.O., ??? sectors, 1024 bytes/sector, ECMA-153, ISO 11560 - ECMA_153 = 630, - /// 5,25", M.O., ??? sectors, 512 bytes/sector, ECMA-153, ISO 11560 - ECMA_153_512 = 631, - /// 3,5", M.O., 249850 sectors, 512 bytes/sector, ECMA-154, ISO 10090 - ECMA_154 = 632, - /// 5,25", M.O., 904995 sectors, 512 bytes/sector, ECMA-183, ISO 13481 - ECMA_183_512 = 633, - /// 5,25", M.O., 498526 sectors, 1024 bytes/sector, ECMA-183, ISO 13481 - ECMA_183 = 634, - /// 5,25", M.O., 1128772 or 1163337 sectors, 512 bytes/sector, ECMA-183, ISO 13549 - ECMA_184_512 = 635, - /// 5,25", M.O., 603466 or 637041 sectors, 1024 bytes/sector, ECMA-183, ISO 13549 - ECMA_184 = 636, - /// 300mm, M.O., ??? sectors, 1024 bytes/sector, ECMA-189, ISO 13614 - ECMA_189 = 637, - /// 300mm, M.O., ??? sectors, 1024 bytes/sector, ECMA-190, ISO 13403 - ECMA_190 = 638, - /// 5,25", M.O., 936921 or 948770 sectors, 1024 bytes/sector, ECMA-195, ISO 13842 - ECMA_195 = 639, - /// 5,25", M.O., 1644581 or 1647371 sectors, 512 bytes/sector, ECMA-195, ISO 13842 - ECMA_195_512 = 640, - /// 3,5", M.O., 446325 sectors, 512 bytes/sector, ECMA-201, ISO 13963 - ECMA_201 = 641, - /// 3,5", M.O., 429975 sectors, 512 bytes/sector, embossed, ISO 13963 - ECMA_201_ROM = 642, - /// 3,5", M.O., 371371 sectors, 1024 bytes/sector, ECMA-223 - ECMA_223 = 643, - /// 3,5", M.O., 694929 sectors, 512 bytes/sector, ECMA-223 - ECMA_223_512 = 644, - /// 5,25", M.O., 1244621 sectors, 1024 bytes/sector, ECMA-238, ISO 15486 - ECMA_238 = 645, - /// 3,5", M.O., 318988, 320332 or 321100 sectors, 2048 bytes/sector, ECMA-239, ISO 15498 - ECMA_239 = 646, - /// 356mm, M.O., 14476734 sectors, 1024 bytes/sector, ECMA-260, ISO 15898 - ECMA_260 = 647, - /// 356mm, M.O., 24445990 sectors, 1024 bytes/sector, ECMA-260, ISO 15898 - ECMA_260_Double = 648, - /// 5,25", M.O., 1128134 sectors, 2048 bytes/sector, ECMA-280, ISO 18093 - ECMA_280 = 649, - /// 300mm, M.O., 7355716 sectors, 2048 bytes/sector, ECMA-317, ISO 20162 - ECMA_317 = 650, - /// 5,25", M.O., 1095840 sectors, 4096 bytes/sector, ECMA-322, ISO 22092 - ECMA_322 = 651, - /// 5,25", M.O., 2043664 sectors, 2048 bytes/sector, ECMA-322, ISO 22092 - ECMA_322_2k = 652, - /// 3,5", M.O., 605846 sectors, 2048 bytes/sector, Cherry Book, GigaMo, ECMA-351, ISO 17346 - GigaMo = 653, - /// 3,5", M.O., 1063146 sectors, 2048 bytes/sector, Cherry Book 2, GigaMo 2, ECMA-353, ISO 22533 - GigaMo2 = 654, - #endregion Magneto-optical, types 630 to 659 - - #region Other floppy standards, types 660 to 689 - CompactFloppy = 660, - DemiDiskette = 661, - /// 3.5", 652 tracks, 2 sides, 512 bytes/sector, Floptical, ECMA-207, ISO 14169 - Floptical = 662, - HiFD = 663, - QuickDisk = 664, - UHD144 = 665, - VideoFloppy = 666, - Wafer = 667, - ZXMicrodrive = 668, - #endregion Other floppy standards, types 660 to 669 - - #region Miscellaneous, types 670 to 689 - BeeCard = 670, - Borsu = 671, - DataStore = 672, - DIR = 673, - DST = 674, - DTF = 675, - DTF2 = 676, - Flextra3020 = 677, - Flextra3225 = 678, - HiTC1 = 679, - HiTC2 = 680, - LT1 = 681, - MiniCard = 872, - Orb = 683, - Orb5 = 684, - SmartMedia = 685, - xD = 686, - XQD = 687, - DataPlay = 688, - #endregion Miscellaneous, types 670 to 689 - - #region Apple specific media, types 690 to 699 - AppleProfile = 690, - AppleWidget = 691, - AppleHD20 = 692, - PriamDataTower = 693, - Pippin = 694, - #endregion Apple specific media, types 690 to 699 - - #region DEC hard disks, types 700 to 729 - /// - /// 2382 cylinders, 4 tracks/cylinder, 42 sectors/track, 128 words/sector, 32 bits/word, 512 bytes/sector, - /// 204890112 bytes - /// - RA60 = 700, - /// - /// 546 cylinders, 14 tracks/cylinder, 31 sectors/track, 128 words/sector, 32 bits/word, 512 bytes/sector, - /// 121325568 bytes - /// - RA80 = 701, - /// - /// 1248 cylinders, 14 tracks/cylinder, 51 sectors/track, 128 words/sector, 32 bits/word, 512 bytes/sector, - /// 456228864 bytes - /// - RA81 = 702, - /// - /// 302 cylinders, 4 tracks/cylinder, 42 sectors/track, 128 words/sector, 32 bits/word, 512 bytes/sector, 25976832 - /// bytes - /// - RC25 = 703, - /// - /// 615 cylinders, 4 tracks/cylinder, 17 sectors/track, 128 words/sector, 32 bits/word, 512 bytes/sector, 21411840 - /// bytes - /// - RD31 = 704, - /// - /// 820 cylinders, 6 tracks/cylinder, 17 sectors/track, 128 words/sector, 32 bits/word, 512 bytes/sector, 42823680 - /// bytes - /// - RD32 = 705, - /// - /// 306 cylinders, 4 tracks/cylinder, 17 sectors/track, 128 words/sector, 32 bits/word, 512 bytes/sector, 10653696 - /// bytes - /// - RD51 = 706, - /// - /// 480 cylinders, 7 tracks/cylinder, 18 sectors/track, 128 words/sector, 32 bits/word, 512 bytes/sector, 30965760 - /// bytes - /// - RD52 = 707, - /// - /// 1024 cylinders, 7 tracks/cylinder, 18 sectors/track, 128 words/sector, 32 bits/word, 512 bytes/sector, - /// 75497472 bytes - /// - RD53 = 708, - /// - /// 1225 cylinders, 8 tracks/cylinder, 18 sectors/track, 128 words/sector, 32 bits/word, 512 bytes/sector, - /// 159936000 bytes - /// - RD54 = 709, - /// - /// 411 cylinders, 3 tracks/cylinder, 22 sectors/track, 256 words/sector, 16 bits/word, 512 bytes/sector, 13888512 - /// bytes - /// - RK06 = 710, - /// - /// 411 cylinders, 3 tracks/cylinder, 20 sectors/track, 256 words/sector, 18 bits/word, 576 bytes/sector, 14204160 - /// bytes - /// - RK06_18 = 711, - /// - /// 815 cylinders, 3 tracks/cylinder, 22 sectors/track, 256 words/sector, 16 bits/word, 512 bytes/sector, 27540480 - /// bytes - /// - RK07 = 712, - /// - /// 815 cylinders, 3 tracks/cylinder, 20 sectors/track, 256 words/sector, 18 bits/word, 576 bytes/sector, 28166400 - /// bytes - /// - RK07_18 = 713, - /// - /// 823 cylinders, 5 tracks/cylinder, 32 sectors/track, 128 words/sector, 32 bits/word, 512 bytes/sector, 67420160 - /// bytes - /// - RM02 = 714, - /// - /// 823 cylinders, 5 tracks/cylinder, 32 sectors/track, 128 words/sector, 32 bits/word, 512 bytes/sector, 67420160 - /// bytes - /// - RM03 = 715, - /// - /// 823 cylinders, 19 tracks/cylinder, 32 sectors/track, 128 words/sector, 32 bits/word, 512 bytes/sector, - /// 256196608 bytes - /// - RM05 = 716, - /// - /// 203 cylinders, 10 tracks/cylinder, 22 sectors/track, 128 words/sector, 32 bits/word, 512 bytes/sector, - /// 22865920 bytes - /// - RP02 = 717, - /// - /// 203 cylinders, 10 tracks/cylinder, 20 sectors/track, 128 words/sector, 36 bits/word, 576 bytes/sector, - /// 23385600 bytes - /// - RP02_18 = 718, - /// - /// 400 cylinders, 10 tracks/cylinder, 22 sectors/track, 128 words/sector, 32 bits/word, 512 bytes/sector, - /// 45056000 bytes - /// - RP03 = 719, - /// - /// 400 cylinders, 10 tracks/cylinder, 20 sectors/track, 128 words/sector, 36 bits/word, 576 bytes/sector, - /// 46080000 bytes - /// - RP03_18 = 720, - /// - /// 411 cylinders, 19 tracks/cylinder, 22 sectors/track, 128 words/sector, 32 bits/word, 512 bytes/sector, - /// 87960576 bytes - /// - RP04 = 721, - /// - /// 411 cylinders, 19 tracks/cylinder, 20 sectors/track, 128 words/sector, 36 bits/word, 576 bytes/sector, - /// 89959680 bytes - /// - RP04_18 = 722, - /// - /// 411 cylinders, 19 tracks/cylinder, 22 sectors/track, 128 words/sector, 32 bits/word, 512 bytes/sector, - /// 87960576 bytes - /// - RP05 = 723, - /// - /// 411 cylinders, 19 tracks/cylinder, 20 sectors/track, 128 words/sector, 36 bits/word, 576 bytes/sector, - /// 89959680 bytes - /// - RP05_18 = 724, - /// - /// 815 cylinders, 19 tracks/cylinder, 22 sectors/track, 128 words/sector, 32 bits/word, 512 bytes/sector, - /// 174423040 bytes - /// - RP06 = 725, - /// - /// 815 cylinders, 19 tracks/cylinder, 20 sectors/track, 128 words/sector, 36 bits/word, 576 bytes/sector, - /// 178387200 bytes - /// - RP06_18 = 726, - #endregion DEC hard disks, types 700 to 729 - - #region Imation, types 730 to 739 - LS120 = 730, - LS240 = 731, - FD32MB = 732, - RDX = 733, - /// Imation 320Gb RDX - RDX320 = 734, - #endregion Imation, types 730 to 739 - - #region VideoNow, types 740 to 749 - VideoNow = 740, - VideoNowColor = 741, - VideoNowXp = 742 - #endregion - } -} \ No newline at end of file diff --git a/DiscImageChef.CommonTypes/MediaTypeFromSCSI.cs b/DiscImageChef.CommonTypes/MediaTypeFromSCSI.cs deleted file mode 100644 index f77c45911..000000000 --- a/DiscImageChef.CommonTypes/MediaTypeFromSCSI.cs +++ /dev/null @@ -1,1617 +0,0 @@ -// /*************************************************************************** -// The Disc Image Chef -// ---------------------------------------------------------------------------- -// -// Filename : MediaTypeFromSCSI.cs -// Author(s) : Natalia Portillo -// -// Component : DiscImageChef common types. -// -// --[ Description ] ---------------------------------------------------------- -// -// Lookups media type from SCSI informative values. -// -// --[ 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; - -namespace DiscImageChef.CommonTypes -{ -#pragma warning disable RECS0063 // Warns when a culture-aware 'StartsWith' call is used by default. - public static class MediaTypeFromScsi - { - /// - /// Tries to guess, from SCSI information, the media type of a device and/or its inserted media - /// - /// The SCSI Peripheral Type as indicated in the INQUIRY response - /// The vendor string of the device - /// The model string of the device - /// The medium type byte from MODE SENSE - /// The density type byte from MODE SENSE - /// How many blocks are on the media - /// Size in bytes of each block - /// - public static MediaType Get(byte scsiPeripheralType, string vendor, string model, byte mediumType, - byte densityCode, ulong blocks, uint blockSize) - { - switch (scsiPeripheralType) - { - // Direct access device - case 0x00: - // Simpilified access device - case 0x0E: - { - if (mediumType == 0x03 || mediumType == 0x05 || mediumType == 0x07) goto case 0x07; - - if (vendor.ToLowerInvariant() == "syquest") - { - if (blocks == 173400 && blockSize == 256) return MediaType.SQ400; - - if (blockSize != 512) return MediaType.Unknown; - - if (model.ToLowerInvariant().StartsWith("syjet", StringComparison.Ordinal)) - return MediaType.SyJet; - - switch (blocks) - { - case 262144: return MediaType.EZ135; - case 524288: return MediaType.SQ327; - } - - return MediaType.Unknown; - } - - if (vendor.ToLowerInvariant().StartsWith("iomega", StringComparison.Ordinal) && - (model.ToLowerInvariant().StartsWith("clik", StringComparison.Ordinal) || - model.ToLowerInvariant().StartsWith("pocketzip", StringComparison.Ordinal)) && - blockSize == 512 && - blocks == 78882) return MediaType.PocketZip; - - if (model.ToLowerInvariant().StartsWith("zip", StringComparison.Ordinal)) - { - if (blockSize != 512) return MediaType.Unknown; - - if (blocks == 196608) return MediaType.ZIP100; - - return blocks == 489532 ? MediaType.ZIP250 : MediaType.ZIP750; - } - - if (model.ToLowerInvariant().StartsWith("jaz", StringComparison.Ordinal)) - { - if (blockSize != 512) return MediaType.Unknown; - - if (blocks == 2091050) return MediaType.Jaz; - - return blocks == 3915600 ? MediaType.Jaz2 : MediaType.Unknown; - } - - if (model.ToLowerInvariant().StartsWith("ls-", StringComparison.Ordinal)) - { - if (blockSize == 512) - { - if (blocks == 469504) return MediaType.LS240; - if (blocks == 246528) return MediaType.LS120; - if (blocks == 65536) return MediaType.FD32MB; - if (blocks == 2880) return MediaType.DOS_35_HD; - if (blocks == 1440) return MediaType.DOS_35_DS_DD_9; - } - else if (blockSize == 1024) - { - if (blocks == 1232) - return MediaType.NEC_35_HD_8; - } - - return MediaType.Unknown; - } - - if (model.ToLowerInvariant().StartsWith("rdx", StringComparison.Ordinal)) - { - if (blockSize != 512) return MediaType.Unknown; - - return blocks == 625134256 ? MediaType.RDX320 : MediaType.RDX; - } - - switch (mediumType) - { - case 0x01: - switch (blockSize) - { - case 128: - switch (blocks) - { - case 720: return MediaType.ATARI_525_SD; - case 1040: return MediaType.ATARI_525_DD; - case 1898: return MediaType.IBM33FD_128; - case 2002: return MediaType.ECMA_54; - } - - break; - case 256: - switch (blocks) - { - case 322: return MediaType.ECMA_66; - case 400: return MediaType.ACORN_525_SS_SD_40; - case 455: return MediaType.Apple32SS; - case 560: return MediaType.Apple33SS; - case 640: return MediaType.ACORN_525_SS_DD_40; - case 720: return MediaType.ATARI_525_DD; - case 800: return MediaType.ACORN_525_SS_SD_80; - case 1121: return MediaType.IBM33FD_256; - case 1280: return MediaType.ACORN_525_SS_DD_80; - case 2002: return MediaType.RX02; - } - - break; - case 319: - switch (blocks) - { - case 256: return MediaType.IBM23FD; - } - - break; - case 512: - switch (blocks) - { - case 320: return MediaType.DOS_525_DS_DD_8; - case 360: return MediaType.DOS_35_SS_DD_9; - case 610: return MediaType.IBM33FD_512; - case 630: return MediaType.Apricot_35; - case 640: return MediaType.DOS_35_SS_DD_8; - case 720: return MediaType.DOS_35_DS_DD_9; - case 800: return MediaType.AppleSonySS; - case 249850: return MediaType.ECMA_154; - case 429975: return MediaType.ECMA_201_ROM; - case 446325: return MediaType.ECMA_201; - case 694929: return MediaType.ECMA_223_512; - case 904995: return MediaType.ECMA_183_512; - case 1128772: - case 1163337: return MediaType.ECMA_184_512; - case 1281856: return MediaType.PD650_WORM; - case 1298496: return MediaType.PD650; - case 1644581: - case 1647371: return MediaType.ECMA_195_512; - } - - break; - case 1024: - { - switch (blocks) - { - case 371371: return MediaType.ECMA_223; - case 498526: return MediaType.ECMA_183; - case 603466: - case 637041: return MediaType.ECMA_184; - case 936921: - case 948770: return MediaType.ECMA_195; - case 1244621: return MediaType.ECMA_238; - case 14476734: return MediaType.ECMA_260; - case 24445990: return MediaType.ECMA_260_Double; - } - } - - break; - case 2048: - { - switch (blocks) - { - case 310352: // Found in real media - case 318988: - case 320332: - case 321100: return MediaType.ECMA_239; - case 605846: return MediaType.GigaMo; - case 1063146: return MediaType.GigaMo2; - case 1128134: return MediaType.ECMA_280; - case 2043664: return MediaType.ECMA_322_2k; - case 7355716: return MediaType.ECMA_317; - } - } - - break; - case 4096: - { - switch (blocks) - { - case 1095840: return MediaType.ECMA_322; - } - } - - break; - case 8192: - { - switch (blocks) - { - case 1834348: return MediaType.UDO; - case 3668759: return MediaType.UDO2_WORM; - case 3669724: return MediaType.UDO2; - } - } - - break; - } - - return MediaType.Unknown; - case 0x02: - switch (blockSize) - { - case 128: - switch (blocks) - { - case 3848: return MediaType.IBM43FD_128; - case 4004: return MediaType.ECMA_59; - } - - break; - case 256: - switch (blocks) - { - case 910: return MediaType.Apple32DS; - case 1120: return MediaType.Apple33DS; - case 1280: return MediaType.ECMA_70; - case 2560: return MediaType.ECMA_78; - case 3848: return MediaType.IBM53FD_256; - case 4004: return MediaType.ECMA_99_26; - } - - break; - case 512: - switch (blocks) - { - case 640: return MediaType.DOS_525_DS_DD_8; - case 720: return MediaType.DOS_525_DS_DD_9; - case 1280: return MediaType.DOS_35_DS_DD_8; - case 1440: return MediaType.DOS_35_DS_DD_9; - case 1640: return MediaType.FDFORMAT_35_DD; - case 1760: return MediaType.CBM_AMIGA_35_DD; - case 2242: return MediaType.IBM53FD_512; - case 2332: return MediaType.ECMA_99_15; - case 2400: return MediaType.DOS_525_HD; - case 2788: return MediaType.FDFORMAT_525_HD; - case 2880: return MediaType.DOS_35_HD; - case 3360: return MediaType.DMF; - case 3444: return MediaType.FDFORMAT_35_HD; - case 3520: return MediaType.CBM_AMIGA_35_HD; - case 5760: return MediaType.DOS_35_ED; - case 249850: return MediaType.ECMA_154; - case 429975: return MediaType.ECMA_201_ROM; - case 446325: return MediaType.ECMA_201; - case 694929: return MediaType.ECMA_223_512; - case 904995: return MediaType.ECMA_183_512; - case 1128772: - case 1163337: return MediaType.ECMA_184_512; - case 1281856: return MediaType.PD650_WORM; - case 1298496: return MediaType.PD650; - case 1644581: - case 1647371: return MediaType.ECMA_195_512; - } - - break; - case 1024: - switch (blocks) - { - case 800: return MediaType.ACORN_35_DS_DD; - case 1600: return MediaType.ACORN_35_DS_HD; - case 1220: return MediaType.IBM53FD_1024; - case 1232: return MediaType.SHARP_35; - case 1268: return MediaType.ECMA_69_8; - case 1280: return MediaType.NEC_525_HD; - case 1316: return MediaType.ECMA_99_8; - case 371371: return MediaType.ECMA_223; - case 498526: return MediaType.ECMA_183; - case 603466: - case 637041: return MediaType.ECMA_184; - case 936921: - case 948770: return MediaType.ECMA_195; - case 1244621: return MediaType.ECMA_238; - case 14476734: return MediaType.ECMA_260; - case 24445990: return MediaType.ECMA_260_Double; - } - - break; - case 2048: - { - switch (blocks) - { - case 310352: // Found in real media - case 318988: - case 320332: - case 321100: return MediaType.ECMA_239; - case 605846: return MediaType.GigaMo; - case 1063146: return MediaType.GigaMo2; - case 1128134: return MediaType.ECMA_280; - case 2043664: return MediaType.ECMA_322_2k; - case 7355716: return MediaType.ECMA_317; - } - } - - break; - case 4096: - { - switch (blocks) - { - case 1095840: return MediaType.ECMA_322; - } - } - - break; - case 8192: - { - switch (blocks) - { - case 1834348: return MediaType.UDO; - case 3668759: return MediaType.UDO2_WORM; - case 3669724: return MediaType.UDO2; - } - } - - break; - } - - return MediaType.Unknown; - case 0x09: return MediaType.ECMA_54; - case 0x0A: return MediaType.ECMA_59; - case 0x0B: - switch (blockSize) - { - case 256: return MediaType.ECMA_69_26; - case 512: return MediaType.ECMA_69_15; - case 1024: return MediaType.ECMA_69_8; - } - - return MediaType.Unknown; - case 0x0E: return MediaType.ECMA_66; - case 0x12: return MediaType.ECMA_70; - case 0x16: - switch (blockSize) - { - case 256: return MediaType.ECMA_78; - case 512: return MediaType.ECMA_78_2; - } - - return MediaType.Unknown; - case 0x1A: - switch (blockSize) - { - case 256: return MediaType.ECMA_99_26; - case 512: return MediaType.ECMA_99_15; - case 1024: return MediaType.ECMA_99_8; - } - - return MediaType.Unknown; - case 0x1E: return MediaType.DOS_35_DS_DD_9; - case 0x41: - switch (blocks) - { - case 58620544: return MediaType.REV120; - case 17090880: return MediaType.REV35; - // TODO: Unknown value - default: return MediaType.REV70; - } - - break; - case 0x93: return MediaType.NEC_35_HD_15; - case 0x94: return MediaType.DOS_35_HD; - } - - switch (blockSize) - { - case 128: - { - switch (blocks) - { - case 720: return MediaType.ATARI_525_SD; - case 1040: return MediaType.ATARI_525_ED; - case 1898: return MediaType.IBM33FD_128; - case 2002: return MediaType.ECMA_54; - case 3848: return MediaType.IBM43FD_128; - case 4004: return MediaType.ECMA_59; - } - } - - break; - case 256: - { - switch (blocks) - { - case 322: return MediaType.ECMA_66; - case 400: return MediaType.ACORN_525_SS_SD_40; - case 455: return MediaType.Apple32SS; - case 560: return MediaType.Apple33SS; - case 640: return MediaType.ACORN_525_SS_DD_40; - case 720: return MediaType.ATARI_525_DD; - case 800: return MediaType.ACORN_525_SS_SD_80; - case 910: return MediaType.Apple32DS; - case 1120: return MediaType.Apple33DS; - case 1121: return MediaType.IBM33FD_256; - case 1280: return MediaType.ECMA_70; - case 2002: return MediaType.RX02; - case 2560: return MediaType.ECMA_78; - case 3848: return MediaType.IBM53FD_256; - case 4004: return MediaType.ECMA_99_26; - } - } - - break; - case 319: - switch (blocks) - { - case 256: return MediaType.IBM23FD; - } - - break; - case 512: - { - switch (blocks) - { - case 320: return MediaType.DOS_525_SS_DD_8; - case 360: return MediaType.DOS_525_SS_DD_9; - case 610: return MediaType.IBM33FD_512; - case 640: return MediaType.DOS_525_DS_DD_8; - case 720: return MediaType.DOS_525_DS_DD_9; - case 800: return MediaType.AppleSonySS; - case 1280: return MediaType.DOS_35_DS_DD_8; - case 1440: return MediaType.DOS_35_DS_DD_9; - case 1600: return MediaType.ACORN_35_DS_DD; - case 1640: return MediaType.FDFORMAT_35_DD; - case 1760: return MediaType.CBM_AMIGA_35_DD; - case 2242: return MediaType.IBM53FD_512; - case 2332: return MediaType.ECMA_99_15; - case 2400: return MediaType.DOS_525_HD; - case 2788: return MediaType.FDFORMAT_525_HD; - case 2880: return MediaType.DOS_35_HD; - case 3360: return MediaType.DMF; - case 3444: return MediaType.FDFORMAT_35_HD; - case 3520: return MediaType.CBM_AMIGA_35_HD; - case 5760: return MediaType.DOS_35_ED; - } - } - - break; - case 1024: - { - switch (blocks) - { - case 1220: return MediaType.IBM53FD_1024; - case 1232: return MediaType.SHARP_35; - case 1268: return MediaType.ECMA_69_8; - case 1280: return MediaType.NEC_525_HD; - case 1316: return MediaType.ECMA_99_8; - } - } - - break; - } - - return MediaType.Unknown; - } - - // Sequential access device - case 0x01: - { - switch (mediumType) - { - case 0x00: - switch (densityCode) - { - case 0x04: return MediaType.QIC11; - case 0x05: return MediaType.QIC24; - case 0x09: return MediaType.IBM3490; - case 0x0F: return MediaType.QIC120; - case 0x10: return MediaType.QIC150; - case 0x13: return MediaType.DDS1; - case 0x24: return MediaType.DDS2; - case 0x25: return MediaType.DDS3; - case 0x26: return MediaType.DDS4; - case 0x28: return MediaType.IBM3490E; - case 0x40: - { - if (model.ToLowerInvariant().StartsWith("ult", StringComparison.Ordinal)) - return MediaType.LTO; - if (model.ToLowerInvariant().StartsWith("sdz", StringComparison.Ordinal)) - return MediaType.SAIT1; - - break; - } - - case 0x41: - { - if (model.ToLowerInvariant().StartsWith("ult", StringComparison.Ordinal)) - return MediaType.LTO2; - - break; - } - - case 0x42: - { - if (model.ToLowerInvariant().StartsWith("ult", StringComparison.Ordinal)) - return MediaType.LTO2; - if (vendor.ToLowerInvariant() == "stk") return MediaType.T9840A; - - break; - } - - case 0x43: - { - if (vendor.ToLowerInvariant() == "stk") return MediaType.T9940A; - - break; - } - - case 0x44: - { - if (model.ToLowerInvariant().StartsWith("ult", StringComparison.Ordinal)) - return MediaType.LTO3; - if (vendor.ToLowerInvariant() == "stk") return MediaType.T9940B; - - break; - } - - case 0x45: - { - if (vendor.ToLowerInvariant() == "stk") return MediaType.T9840C; - - break; - } - - case 0x46: - { - if (model.ToLowerInvariant().StartsWith("ult", StringComparison.Ordinal)) - return MediaType.LTO4; - if (vendor.ToLowerInvariant() == "stk") return MediaType.T9840D; - - break; - } - - case 0x4A: - { - if (vendor.ToLowerInvariant() == "stk") return MediaType.T10000A; - - break; - } - - case 0x4B: - { - if (vendor.ToLowerInvariant() == "stk") return MediaType.T10000B; - - break; - } - - case 0x4C: - { - if (vendor.ToLowerInvariant() == "stk") return MediaType.T10000C; - - break; - } - - case 0x4D: - { - if (vendor.ToLowerInvariant() == "stk") return MediaType.T10000D; - - break; - } - - case 0x58: - { - if (model.ToLowerInvariant().StartsWith("ult", StringComparison.Ordinal)) - return MediaType.LTO5; - - break; - } - - // Used by some HP drives for all generations - case 0x8C: - { - return MediaType.DDS1; - - break; - } - } - - break; - case 0x01: - { - switch (densityCode) - { - case 0x44: - { - if (model.ToLowerInvariant().StartsWith("ult", StringComparison.Ordinal)) - return MediaType.LTO3WORM; - - break; - } - - case 0x46: - { - if (model.ToLowerInvariant().StartsWith("ult", StringComparison.Ordinal)) - return MediaType.LTO4WORM; - - break; - } - - case 0x58: - { - if (model.ToLowerInvariant().StartsWith("ult", StringComparison.Ordinal)) - return MediaType.LTO5WORM; - - break; - } - } - } - - break; - case 0x18: - { - switch (densityCode) - { - case 0x00: - { - if (model.ToLowerInvariant().StartsWith("ult", StringComparison.Ordinal)) - return MediaType.LTO; - - break; - } - - case 0x40: - { - return MediaType.LTO; - } - } - } - - break; - case 0x28: - { - switch (densityCode) - { - case 0x00: - { - if (model.ToLowerInvariant().StartsWith("ult", StringComparison.Ordinal)) - return MediaType.LTO2; - - break; - } - - case 0x42: return MediaType.LTO2; - } - } - - break; - case 0x33: - { - switch (densityCode) - { - case 0x00: - case 0x25: - { - if (model.ToLowerInvariant().StartsWith("dat", StringComparison.Ordinal)) - return MediaType.DDS3; - - break; - } - } - } - - break; - case 0x34: - { - switch (densityCode) - { - case 0x00: - case 0x26: - { - if (model.ToLowerInvariant().StartsWith("dat", StringComparison.Ordinal)) - return MediaType.DDS4; - - break; - } - } - } - - break; - case 0x35: - { - switch (densityCode) - { - case 0x00: - case 0x47: - { - if (model.ToLowerInvariant().StartsWith("dat", StringComparison.Ordinal)) - return MediaType.DAT72; - - break; - } - } - } - - break; - case 0x38: - { - switch (densityCode) - { - case 0x00: - case 0x44: - { - if (model.ToLowerInvariant().StartsWith("ult", StringComparison.Ordinal)) - return MediaType.LTO3; - - break; - } - } - } - - break; - case 0x3C: - { - switch (densityCode) - { - case 0x00: - case 0x44: - { - if (model.ToLowerInvariant().StartsWith("ult", StringComparison.Ordinal)) - return MediaType.LTO3WORM; - - break; - } - } - } - - break; - case 0x48: - { - switch (densityCode) - { - case 0x00: - case 0x46: - { - if (model.ToLowerInvariant().StartsWith("ult", StringComparison.Ordinal)) - return MediaType.LTO4; - - break; - } - } - } - - break; - case 0x4C: - { - switch (densityCode) - { - case 0x00: - case 0x46: - { - if (model.ToLowerInvariant().StartsWith("ult", StringComparison.Ordinal)) - return MediaType.LTO4WORM; - - break; - } - } - } - - break; - case 0x50: - { - switch (densityCode) - { - case 0x00: - case 0x24: - { - if (model.ToLowerInvariant().StartsWith("dat", StringComparison.Ordinal)) - return MediaType.DDS2; - - break; - } - } - } - break; - case 0x58: - { - switch (densityCode) - { - case 0x00: - case 0x58: - { - if (model.ToLowerInvariant().StartsWith("ult", StringComparison.Ordinal)) - return MediaType.LTO5; - - break; - } - } - } - - break; - case 0x5C: - { - switch (densityCode) - { - case 0x00: - case 0x58: - { - if (model.ToLowerInvariant().StartsWith("ult", StringComparison.Ordinal)) - return MediaType.LTO5WORM; - - break; - } - } - } - - break; - case 0x68: - { - switch (densityCode) - { - case 0x00: - case 0x5A: - { - if (model.ToLowerInvariant().StartsWith("ult", StringComparison.Ordinal)) - return MediaType.LTO6; - - break; - } - } - } - - break; - case 0x6C: - { - switch (densityCode) - { - case 0x00: - case 0x5A: - { - if (model.ToLowerInvariant().StartsWith("ult", StringComparison.Ordinal)) - return MediaType.LTO6WORM; - - break; - } - } - } - - break; - case 0x78: - { - switch (densityCode) - { - case 0x00: - case 0x5C: - { - if (model.ToLowerInvariant().StartsWith("ult", StringComparison.Ordinal)) - return MediaType.LTO7; - - break; - } - } - } - - break; - case 0x7C: - { - switch (densityCode) - { - case 0x00: - case 0x5C: - { - if (model.ToLowerInvariant().StartsWith("ult", StringComparison.Ordinal)) - return MediaType.LTO7WORM; - - break; - } - } - } - - break; - case 0x81: - { - switch (densityCode) - { - case 0x00: - { - if (model.ToLowerInvariant().StartsWith("exb", StringComparison.Ordinal)) - return MediaType.Exatape15m; - if (vendor.ToLowerInvariant() == "ibm") return MediaType.IBM3592; - if (model.ToLowerInvariant().StartsWith("vxa", StringComparison.Ordinal)) - return MediaType.VXA1; - - break; - } - - case 0x14: - case 0x15: - case 0x27: - case 0x8C: - case 0x90: - { - if (model.ToLowerInvariant().StartsWith("exb", StringComparison.Ordinal)) - return MediaType.Exatape15m; - - break; - } - - case 0x29: - case 0x2A: - { - if (vendor.ToLowerInvariant() == "ibm") return MediaType.IBM3592; - - break; - } - - case 0x80: - { - if (model.ToLowerInvariant().StartsWith("vxa", StringComparison.Ordinal)) - return MediaType.VXA1; - - break; - } - } - } - - break; - case 0x82: - { - switch (densityCode) - { - case 0x00: - { - if (model.ToLowerInvariant().StartsWith("exb", StringComparison.Ordinal)) - return MediaType.Exatape28m; - if (vendor.ToLowerInvariant() == "ibm") return MediaType.IBM3592; - - break; - } - - case 0x0A: - { - if (model.ToLowerInvariant().StartsWith("dlt", StringComparison.Ordinal)) - return MediaType.CompactTapeI; - - break; - } - - case 0x14: - case 0x15: - case 0x27: - case 0x8C: - case 0x90: - { - if (model.ToLowerInvariant().StartsWith("exb", StringComparison.Ordinal)) - return MediaType.Exatape28m; - - break; - } - - case 0x16: - { - if (model.ToLowerInvariant().StartsWith("dlt", StringComparison.Ordinal)) - return MediaType.CompactTapeII; - - break; - } - - case 0x29: - case 0x2A: - { - if (vendor.ToLowerInvariant() == "ibm") return MediaType.IBM3592; - - break; - } - - case 0x81: - { - if (model.ToLowerInvariant().StartsWith("vxa", StringComparison.Ordinal)) - return MediaType.VXA2; - - break; - } - - case 0x82: - { - if (model.ToLowerInvariant().StartsWith("vxa", StringComparison.Ordinal)) - return MediaType.VXA3; - - break; - } - } - } - - break; - case 0x83: - { - switch (densityCode) - { - case 0x00: - { - if (model.ToLowerInvariant().StartsWith("exb", StringComparison.Ordinal)) - return MediaType.Exatape54m; - if (model.ToLowerInvariant().StartsWith("dlt", StringComparison.Ordinal)) - return MediaType.DLTtapeIII; - - break; - } - - case 0x14: - case 0x15: - case 0x27: - case 0x8C: - case 0x90: - { - if (model.ToLowerInvariant().StartsWith("exb", StringComparison.Ordinal)) - return MediaType.Exatape54m; - - break; - } - - case 0x17: - case 0x18: - case 0x19: - case 0x80: - case 0x81: - { - if (model.ToLowerInvariant().StartsWith("dlt", StringComparison.Ordinal)) - return MediaType.DLTtapeIII; - - break; - } - } - } - - break; - case 0x84: - { - switch (densityCode) - { - case 0x00: - { - if (model.ToLowerInvariant().StartsWith("exb", StringComparison.Ordinal)) - return MediaType.Exatape80m; - if (model.ToLowerInvariant().StartsWith("dlt", StringComparison.Ordinal)) - return MediaType.DLTtapeIIIxt; - - break; - } - - case 0x14: - case 0x15: - case 0x27: - case 0x8C: - case 0x90: - { - if (model.ToLowerInvariant().StartsWith("exb", StringComparison.Ordinal)) - return MediaType.Exatape80m; - - break; - } - - case 0x19: - case 0x80: - case 0x81: - { - if (model.ToLowerInvariant().StartsWith("dlt", StringComparison.Ordinal)) - return MediaType.DLTtapeIIIxt; - - break; - } - } - } - - break; - case 0x85: - { - switch (densityCode) - { - case 0x00: - { - if (model.ToLowerInvariant().StartsWith("exb", StringComparison.Ordinal)) - return MediaType.Exatape106m; - if (model.ToLowerInvariant().StartsWith("dlt", StringComparison.Ordinal) || - model.ToLowerInvariant().StartsWith("sdlt", StringComparison.Ordinal) || - model.ToLowerInvariant().StartsWith("superdlt", StringComparison.Ordinal)) - return MediaType.DLTtapeIV; - if (model.ToLowerInvariant().StartsWith("stt", StringComparison.Ordinal)) - return MediaType.Travan5; - - break; - } - - case 0x14: - case 0x15: - case 0x27: - case 0x8C: - case 0x90: - { - if (model.ToLowerInvariant().StartsWith("exb", StringComparison.Ordinal)) - return MediaType.Exatape106m; - - break; - } - - case 0x1A: - case 0x1B: - case 0x40: - case 0x41: - case 0x82: - case 0x83: - case 0x84: - case 0x85: - case 0x86: - case 0x87: - case 0x88: - case 0x89: - { - if (model.ToLowerInvariant().StartsWith("dlt", StringComparison.Ordinal) || - model.ToLowerInvariant().StartsWith("sdlt", StringComparison.Ordinal) || - model.ToLowerInvariant().StartsWith("superdlt", StringComparison.Ordinal)) - return MediaType.DLTtapeIV; - - break; - } - - case 0x46: - { - if (model.ToLowerInvariant().StartsWith("stt", StringComparison.Ordinal)) - return MediaType.Travan5; - - break; - } - } - } - - break; - case 0x86: - { - switch (densityCode) - { - case 0x00: - case 0x90: - { - if (model.ToLowerInvariant().StartsWith("exb", StringComparison.Ordinal)) - return MediaType.Exatape160mXL; - if (model.ToLowerInvariant().StartsWith("dlt", StringComparison.Ordinal) || - model.ToLowerInvariant().StartsWith("sdlt", StringComparison.Ordinal) || - model.ToLowerInvariant().StartsWith("superdlt", StringComparison.Ordinal)) - return MediaType.SDLT1; - - break; - } - - case 0x8C: - { - if (model.ToLowerInvariant().StartsWith("exb", StringComparison.Ordinal)) - return MediaType.Exatape160mXL; - - break; - } - - case 0x91: - case 0x92: - case 0x93: - { - if (model.ToLowerInvariant().StartsWith("dlt", StringComparison.Ordinal) || - model.ToLowerInvariant().StartsWith("sdlt", StringComparison.Ordinal) || - model.ToLowerInvariant().StartsWith("superdlt", StringComparison.Ordinal)) - return MediaType.SDLT1; - - break; - } - } - } - - break; - case 0x87: - { - switch (densityCode) - { - case 0x00: - case 0x4A: - { - if (model.ToLowerInvariant().StartsWith("dlt", StringComparison.Ordinal) || - model.ToLowerInvariant().StartsWith("sdlt", StringComparison.Ordinal) || - model.ToLowerInvariant().StartsWith("superdlt", StringComparison.Ordinal)) - return MediaType.SDLT2; - - break; - } - } - } - - break; - case 0x90: - { - switch (densityCode) - { - case 0x00: - case 0x50: - case 0x98: - case 0x99: - { - if (model.ToLowerInvariant().StartsWith("dlt", StringComparison.Ordinal) || - model.ToLowerInvariant().StartsWith("sdlt", StringComparison.Ordinal) || - model.ToLowerInvariant().StartsWith("superdlt", StringComparison.Ordinal)) - return MediaType.VStapeI; - - break; - } - } - } - - break; - case 0x95: - { - if (model.ToLowerInvariant().StartsWith("stt", StringComparison.Ordinal)) - return MediaType.Travan7; - } - - break; - case 0xC1: - { - switch (densityCode) - { - case 0x00: - case 0x14: - case 0x15: - case 0x8C: - case 0x90: - { - if (model.ToLowerInvariant().StartsWith("exb", StringComparison.Ordinal)) - return MediaType.Exatape22m; - - break; - } - } - } - - break; - case 0xC2: - { - switch (densityCode) - { - case 0x00: - case 0x14: - case 0x15: - case 0x27: - case 0x8C: - case 0x90: - { - if (model.ToLowerInvariant().StartsWith("exb", StringComparison.Ordinal)) - return MediaType.Exatape40m; - - break; - } - } - } - - break; - case 0xC3: - { - switch (densityCode) - { - case 0x00: - case 0x14: - case 0x15: - case 0x27: - case 0x8C: - case 0x90: - { - if (model.ToLowerInvariant().StartsWith("exb", StringComparison.Ordinal)) - return MediaType.Exatape76m; - - break; - } - } - } - - break; - case 0xC4: - { - switch (densityCode) - { - case 0x00: - case 0x14: - case 0x15: - case 0x27: - case 0x8C: - case 0x90: - { - if (model.ToLowerInvariant().StartsWith("exb", StringComparison.Ordinal)) - return MediaType.Exatape112m; - - break; - } - } - } - - break; - case 0xD1: - { - switch (densityCode) - { - case 0x00: - case 0x27: - case 0x28: - { - if (model.ToLowerInvariant().StartsWith("exb", StringComparison.Ordinal)) - return MediaType.Exatape22mAME; - - break; - } - } - } - - break; - case 0xD2: - { - switch (densityCode) - { - case 0x00: - case 0x27: - case 0x28: - { - if (model.ToLowerInvariant().StartsWith("exb", StringComparison.Ordinal)) - return MediaType.Exatape170m; - - break; - } - } - } - - break; - case 0xD3: - { - switch (densityCode) - { - case 0x00: - case 0x27: - case 0x28: - { - if (model.ToLowerInvariant().StartsWith("exb", StringComparison.Ordinal)) - return MediaType.Exatape125m; - - break; - } - } - } - - break; - case 0xD4: - { - switch (densityCode) - { - case 0x00: - case 0x27: - case 0x28: - { - if (model.ToLowerInvariant().StartsWith("exb", StringComparison.Ordinal)) - return MediaType.Exatape45m; - - break; - } - } - } - - break; - case 0xD5: - { - switch (densityCode) - { - case 0x00: - case 0x27: - case 0x28: - { - if (model.ToLowerInvariant().StartsWith("exb", StringComparison.Ordinal)) - return MediaType.Exatape225m; - - break; - } - } - } - - break; - case 0xD6: - { - switch (densityCode) - { - case 0x00: - case 0x27: - case 0x28: - { - if (model.ToLowerInvariant().StartsWith("exb", StringComparison.Ordinal)) - return MediaType.Exatape150m; - - break; - } - } - } - - break; - case 0xD7: - { - switch (densityCode) - { - case 0x00: - case 0x27: - case 0x28: - { - if (model.ToLowerInvariant().StartsWith("exb", StringComparison.Ordinal)) - return MediaType.Exatape75m; - - break; - } - } - } - - break; - } - - return MediaType.Unknown; - } - - // Write-once device - case 0x04: - // Optical device - case 0x07: - { - if (mediumType != 0x01 && mediumType != 0x02 && mediumType != 0x03 && mediumType != 0x05 && - mediumType != 0x07) return MediaType.UnknownMO; - - switch (blockSize) - { - case 512: - { - switch (blocks) - { - case 249850: return MediaType.ECMA_154; - case 429975: return MediaType.ECMA_201_ROM; - case 446325: return MediaType.ECMA_201; - case 694929: return MediaType.ECMA_223_512; - case 904995: return MediaType.ECMA_183_512; - case 1128772: - case 1163337: return MediaType.ECMA_184_512; - case 1281856: return MediaType.PD650_WORM; - case 1298496: return MediaType.PD650; - case 1644581: - case 1647371: return MediaType.ECMA_195_512; - default: return MediaType.UnknownMO; - } - } - - case 1024: - { - switch (blocks) - { - case 371371: return MediaType.ECMA_223; - case 498526: return MediaType.ECMA_183; - case 603466: - case 637041: return MediaType.ECMA_184; - case 936921: - case 948770: return MediaType.ECMA_195; - case 1244621: return MediaType.ECMA_238; - case 14476734: return MediaType.ECMA_260; - case 24445990: return MediaType.ECMA_260_Double; - default: return MediaType.UnknownMO; - } - } - - case 2048: - { - switch (blocks) - { - case 310352: // Found in real media - case 318988: - case 320332: - case 321100: return MediaType.ECMA_239; - case 605846: return MediaType.GigaMo; - case 1063146: return MediaType.GigaMo2; - case 1128134: return MediaType.ECMA_280; - case 2043664: return MediaType.ECMA_322_2k; - case 7355716: return MediaType.ECMA_317; - default: return MediaType.UnknownMO; - } - } - - case 4096: - { - switch (blocks) - { - case 1095840: return MediaType.ECMA_322; - default: return MediaType.UnknownMO; - } - } - - case 8192: - { - switch (blocks) - { - case 1834348: return MediaType.UDO; - case 3668759: return MediaType.UDO2_WORM; - case 3669724: return MediaType.UDO2; - default: return MediaType.UnknownMO; - } - } - - default: return MediaType.UnknownMO; - } - } - - // MultiMedia Device - case 0x05: - { - switch (mediumType) - { - case 0x00: - return blockSize == 512 - ? blocks == 1281856 - ? MediaType.PD650_WORM - : MediaType.PD650 - : MediaType.CD; - case 0x01: - case 0x05: return MediaType.CDROM; - case 0x02: - case 0x06: return MediaType.CDDA; - case 0x03: - case 0x07: return MediaType.CDPLUS; - case 0x04: return MediaType.PCD; - case 0x10: - case 0x11: - case 0x12: - case 0x13: - case 0x14: - case 0x15: - case 0x16: - case 0x17: - case 0x18: return MediaType.CDR; - case 0x20: - case 0x21: - case 0x22: - case 0x23: - case 0x24: - case 0x25: - case 0x26: - case 0x27: - case 0x28: return MediaType.CDRW; - case 0x80: - if (model.ToLowerInvariant().StartsWith("ult", StringComparison.Ordinal)) - switch (densityCode) - { - case 0x42: return MediaType.LTO2; - case 0x44: return MediaType.LTO3; - case 0x46: return MediaType.LTO4; - case 0x58: return MediaType.LTO5; - } - - break; - } - } - - break; - // Host managed zoned block device - case 0x14: - { - return MediaType.Zone_HDD; - } - } - - return MediaType.Unknown; - } - } -#pragma warning restore RECS0063 // Warns when a culture-aware 'StartsWith' call is used by default. -} \ No newline at end of file diff --git a/DiscImageChef.CommonTypes/Metadata/CdOffset.cs b/DiscImageChef.CommonTypes/Metadata/CdOffset.cs deleted file mode 100644 index 319130c31..000000000 --- a/DiscImageChef.CommonTypes/Metadata/CdOffset.cs +++ /dev/null @@ -1,49 +0,0 @@ -// /*************************************************************************** -// The Disc Image Chef -// ---------------------------------------------------------------------------- -// -// Filename : CdOffset.cs -// Author(s) : Natalia Portillo -// -// Component : Device database. -// -// --[ Description ] ---------------------------------------------------------- -// -// Models Compact Disc read offset entries from AccurateRip database. -// -// --[ 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 -// ****************************************************************************/ - -namespace DiscImageChef.CommonTypes.Metadata -{ - public class CdOffset - { - public string Manufacturer { get; set; } - public string Model { get; set; } - public short Offset { get; set; } - public int Submissions { get; set; } - public float Agreement { get; set; } - } -} \ No newline at end of file diff --git a/DiscImageChef.CommonTypes/Metadata/DeviceReport.cs b/DiscImageChef.CommonTypes/Metadata/DeviceReport.cs deleted file mode 100644 index 69b3d5bbb..000000000 --- a/DiscImageChef.CommonTypes/Metadata/DeviceReport.cs +++ /dev/null @@ -1,1096 +0,0 @@ -// /*************************************************************************** -// The Disc Image Chef -// ---------------------------------------------------------------------------- -// -// Filename : DeviceReport.cs -// Author(s) : Natalia Portillo -// -// Component : XML metadata. -// -// --[ Description ] ---------------------------------------------------------- -// -// Contains classes for an XML device report. -// -// --[ 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; -using System.Xml.Serialization; -using DiscImageChef.Decoders.ATA; -using DiscImageChef.Decoders.SCSI; -using DiscImageChef.Decoders.SCSI.MMC; -using Newtonsoft.Json; - -// ReSharper disable InconsistentNaming -// ReSharper disable UnusedAutoPropertyAccessor.Global - -namespace DiscImageChef.CommonTypes.Metadata -{ - [Serializable] - [XmlRoot("DicDeviceReport", Namespace = "", IsNullable = false)] - public class DeviceReport - { - public usbType USB { get; set; } - public firewireType FireWire { get; set; } - public pcmciaType PCMCIA { get; set; } - public bool CompactFlash { get; set; } - public ataType ATA { get; set; } - public ataType ATAPI { get; set; } - public scsiType SCSI { get; set; } - public mmcsdType MultiMediaCard { get; set; } - public mmcsdType SecureDigital { get; set; } - - [XmlIgnore] - public bool CompactFlashSpecified { get; set; } - } - - public class usbType - { - public ushort VendorID { get; set; } - public ushort ProductID { get; set; } - public string Manufacturer { get; set; } - public string Product { get; set; } - public bool RemovableMedia { get; set; } - public byte[] Descriptors { get; set; } - } - - public class firewireType - { - public uint VendorID { get; set; } - public uint ProductID { get; set; } - public string Manufacturer { get; set; } - public string Product { get; set; } - public bool RemovableMedia { get; set; } - } - - public class ataType - { - public string AdditionalPID { get; set; } - public Identify.TransferMode APIOSupported { get; set; } - public ushort ATAPIByteCount { get; set; } - public ushort BufferType { get; set; } - public ushort BufferSize { get; set; } - public Identify.CapabilitiesBit Capabilities { get; set; } - public Identify.CapabilitiesBit2 Capabilities2 { get; set; } - public Identify.CapabilitiesBit3 Capabilities3 { get; set; } - public ushort CFAPowerMode { get; set; } - public Identify.CommandSetBit CommandSet { get; set; } - public Identify.CommandSetBit2 CommandSet2 { get; set; } - public Identify.CommandSetBit3 CommandSet3 { get; set; } - public Identify.CommandSetBit4 CommandSet4 { get; set; } - public Identify.CommandSetBit5 CommandSet5 { get; set; } - public byte CurrentAAM { get; set; } - public ushort CurrentAPM { get; set; } - public Identify.DataSetMgmtBit DataSetMgmt { get; set; } - public ushort DataSetMgmtSize { get; set; } - public Identify.DeviceFormFactorEnum DeviceFormFactor { get; set; } - public Identify.TransferMode DMAActive { get; set; } - public Identify.TransferMode DMASupported { get; set; } - public byte DMATransferTimingMode { get; set; } - public ushort EnhancedSecurityEraseTime { get; set; } - public Identify.CommandSetBit EnabledCommandSet { get; set; } - public Identify.CommandSetBit2 EnabledCommandSet2 { get; set; } - public Identify.CommandSetBit3 EnabledCommandSet3 { get; set; } - public Identify.CommandSetBit4 EnabledCommandSet4 { get; set; } - public Identify.SATAFeaturesBit EnabledSATAFeatures { get; set; } - public ulong ExtendedUserSectors { get; set; } - public byte FreeFallSensitivity { get; set; } - public string FirmwareRevision { get; set; } - public Identify.GeneralConfigurationBit GeneralConfiguration { get; set; } - public ushort HardwareResetResult { get; set; } - public ushort InterseekDelay { get; set; } - public Identify.MajorVersionBit MajorVersion { get; set; } - public ushort MasterPasswordRevisionCode { get; set; } - public ushort MaxDownloadMicroMode3 { get; set; } - public ushort MaxQueueDepth { get; set; } - public Identify.TransferMode MDMAActive { get; set; } - public Identify.TransferMode MDMASupported { get; set; } - public ushort MinDownloadMicroMode3 { get; set; } - public ushort MinMDMACycleTime { get; set; } - public ushort MinorVersion { get; set; } - public ushort MinPIOCycleTimeNoFlow { get; set; } - public ushort MinPIOCycleTimeFlow { get; set; } - public string Model { get; set; } - public byte MultipleMaxSectors { get; set; } - public byte MultipleSectorNumber { get; set; } - public ushort NVCacheCaps { get; set; } - public uint NVCacheSize { get; set; } - public ushort NVCacheWriteSpeed { get; set; } - public byte NVEstimatedSpinUp { get; set; } - public ushort PacketBusRelease { get; set; } - public byte PIOTransferTimingMode { get; set; } - public byte RecommendedAAM { get; set; } - public ushort RecommendedMDMACycleTime { get; set; } - public ushort RemovableStatusSet { get; set; } - public Identify.SATACapabilitiesBit SATACapabilities { get; set; } - public Identify.SATACapabilitiesBit2 SATACapabilities2 { get; set; } - public Identify.SATAFeaturesBit SATAFeatures { get; set; } - public Identify.SCTCommandTransportBit SCTCommandTransport { get; set; } - public uint SectorsPerCard { get; set; } - public ushort SecurityEraseTime { get; set; } - public Identify.SecurityStatusBit SecurityStatus { get; set; } - public ushort ServiceBusyClear { get; set; } - public Identify.SpecificConfigurationEnum SpecificConfiguration { get; set; } - public ushort StreamAccessLatency { get; set; } - public ushort StreamMinReqSize { get; set; } - public uint StreamPerformanceGranularity { get; set; } - public ushort StreamTransferTimeDMA { get; set; } - public ushort StreamTransferTimePIO { get; set; } - public ushort TransportMajorVersion { get; set; } - public ushort TransportMinorVersion { get; set; } - public Identify.TrustedComputingBit TrustedComputing { get; set; } - public Identify.TransferMode UDMAActive { get; set; } - public Identify.TransferMode UDMASupported { get; set; } - public byte WRVMode { get; set; } - public uint WRVSectorCountMode3 { get; set; } - public uint WRVSectorCountMode2 { get; set; } - - public byte[] Identify { get; set; } - - public testedMediaType ReadCapabilities { get; set; } - public testedMediaType[] RemovableMedias { get; set; } - - [XmlIgnore] - public bool AdditionalPIDSpecified { get; set; } - [XmlIgnore] - public bool APIOSupportedSpecified { get; set; } - [XmlIgnore] - public bool ATAPIByteCountSpecified { get; set; } - [XmlIgnore] - public bool BufferTypeSpecified { get; set; } - [XmlIgnore] - public bool BufferSizeSpecified { get; set; } - [XmlIgnore] - public bool CapabilitiesSpecified { get; set; } - [XmlIgnore] - public bool Capabilities2Specified { get; set; } - [XmlIgnore] - public bool Capabilities3Specified { get; set; } - [XmlIgnore] - public bool CFAPowerModeSpecified { get; set; } - [XmlIgnore] - public bool CommandSetSpecified { get; set; } - [XmlIgnore] - public bool CommandSet2Specified { get; set; } - [XmlIgnore] - public bool CommandSet3Specified { get; set; } - [XmlIgnore] - public bool CommandSet4Specified { get; set; } - [XmlIgnore] - public bool CommandSet5Specified { get; set; } - [XmlIgnore] - public bool CurrentAAMSpecified { get; set; } - [XmlIgnore] - public bool CurrentAPMSpecified { get; set; } - [XmlIgnore] - public bool DataSetMgmtSpecified { get; set; } - [XmlIgnore] - public bool DataSetMgmtSizeSpecified { get; set; } - [XmlIgnore] - public bool DeviceFormFactorSpecified { get; set; } - [XmlIgnore] - public bool DMAActiveSpecified { get; set; } - [XmlIgnore] - public bool DMASupportedSpecified { get; set; } - [XmlIgnore] - public bool DMATransferTimingModeSpecified { get; set; } - [XmlIgnore] - public bool EnhancedSecurityEraseTimeSpecified { get; set; } - [XmlIgnore] - public bool EnabledCommandSetSpecified { get; set; } - [XmlIgnore] - public bool EnabledCommandSet2Specified { get; set; } - [XmlIgnore] - public bool EnabledCommandSet3Specified { get; set; } - [XmlIgnore] - public bool EnabledCommandSet4Specified { get; set; } - [XmlIgnore] - public bool EnabledSATAFeaturesSpecified { get; set; } - [XmlIgnore] - public bool ExtendedIdentifySpecified { get; set; } - [XmlIgnore] - public bool ExtendedUserSectorsSpecified { get; set; } - [XmlIgnore] - public bool FreeFallSensitivitySpecified { get; set; } - [XmlIgnore] - public bool FirmwareRevisionSpecified { get; set; } - [XmlIgnore] - public bool GeneralConfigurationSpecified { get; set; } - [XmlIgnore] - public bool HardwareResetResultSpecified { get; set; } - [XmlIgnore] - public bool InterseekDelaySpecified { get; set; } - [XmlIgnore] - public bool MajorVersionSpecified { get; set; } - [XmlIgnore] - public bool MasterPasswordRevisionCodeSpecified { get; set; } - [XmlIgnore] - public bool MaxDownloadMicroMode3Specified { get; set; } - [XmlIgnore] - public bool MaxQueueDepthSpecified { get; set; } - [XmlIgnore] - public bool MDMAActiveSpecified { get; set; } - [XmlIgnore] - public bool MDMASupportedSpecified { get; set; } - [XmlIgnore] - public bool MinDownloadMicroMode3Specified { get; set; } - [XmlIgnore] - public bool MinMDMACycleTimeSpecified { get; set; } - [XmlIgnore] - public bool MinorVersionSpecified { get; set; } - [XmlIgnore] - public bool MinPIOCycleTimeNoFlowSpecified { get; set; } - [XmlIgnore] - public bool MinPIOCycleTimeFlowSpecified { get; set; } - [XmlIgnore] - public bool ModelSpecified { get; set; } - [XmlIgnore] - public bool MultipleMaxSectorsSpecified { get; set; } - [XmlIgnore] - public bool MultipleSectorNumberSpecified { get; set; } - [XmlIgnore] - public bool NVCacheCapsSpecified { get; set; } - [XmlIgnore] - public bool NVCacheSizeSpecified { get; set; } - [XmlIgnore] - public bool NVCacheWriteSpeedSpecified { get; set; } - [XmlIgnore] - public bool NVEstimatedSpinUpSpecified { get; set; } - [XmlIgnore] - public bool PacketBusReleaseSpecified { get; set; } - [XmlIgnore] - public bool PIOTransferTimingModeSpecified { get; set; } - [XmlIgnore] - public bool RecommendedAAMSpecified { get; set; } - [XmlIgnore] - public bool RecommendedMDMACycleTimeSpecified { get; set; } - [XmlIgnore] - public bool RemovableStatusSetSpecified { get; set; } - [XmlIgnore] - public bool SATACapabilitiesSpecified { get; set; } - [XmlIgnore] - public bool SATACapabilities2Specified { get; set; } - [XmlIgnore] - public bool SATAFeaturesSpecified { get; set; } - [XmlIgnore] - public bool SCTCommandTransportSpecified { get; set; } - [XmlIgnore] - public bool SectorsPerCardSpecified { get; set; } - [XmlIgnore] - public bool SecurityEraseTimeSpecified { get; set; } - [XmlIgnore] - public bool SecurityStatusSpecified { get; set; } - [XmlIgnore] - public bool ServiceBusyClearSpecified { get; set; } - [XmlIgnore] - public bool SpecificConfigurationSpecified { get; set; } - [XmlIgnore] - public bool StreamAccessLatencySpecified { get; set; } - [XmlIgnore] - public bool StreamMinReqSizeSpecified { get; set; } - [XmlIgnore] - public bool StreamPerformanceGranularitySpecified { get; set; } - [XmlIgnore] - public bool StreamTransferTimeDMASpecified { get; set; } - [XmlIgnore] - public bool StreamTransferTimePIOSpecified { get; set; } - [XmlIgnore] - public bool TransportMajorVersionSpecified { get; set; } - [XmlIgnore] - public bool TransportMinorVersionSpecified { get; set; } - [XmlIgnore] - public bool TrustedComputingSpecified { get; set; } - [XmlIgnore] - public bool UDMAActiveSpecified { get; set; } - [XmlIgnore] - public bool UDMASupportedSpecified { get; set; } - [XmlIgnore] - public bool WRVModeSpecified { get; set; } - [XmlIgnore] - public bool WRVSectorCountMode3Specified { get; set; } - [XmlIgnore] - public bool WRVSectorCountMode2Specified { get; set; } - } - - public class chsType - { - public ushort Cylinders { get; set; } - public ushort Heads { get; set; } - public ushort Sectors { get; set; } - } - - public class scsiType - { - public scsiInquiryType Inquiry { get; set; } - public pageType[] EVPDPages { get; set; } - public bool SupportsModeSense6 { get; set; } - public bool SupportsModeSense10 { get; set; } - public bool SupportsModeSubpages { get; set; } - public modeType ModeSense { get; set; } - public mmcType MultiMediaDevice { get; set; } - public testedMediaType ReadCapabilities { get; set; } - public testedMediaType[] RemovableMedias { get; set; } - public sscType SequentialDevice { get; set; } - public byte[] ModeSense6Data { get; set; } - public byte[] ModeSense10Data { get; set; } - - [XmlIgnore] - public bool ReadCapabilitiesSpecified { get; set; } - } - - public class scsiInquiryType - { - public bool AccessControlCoordinator { get; set; } - public bool ACKRequests { get; set; } - public bool AERCSupported { get; set; } - public bool Address16 { get; set; } - public bool Address32 { get; set; } - public byte ANSIVersion { get; set; } - public TGPSValues AsymmetricalLUNAccess { get; set; } - public bool BasicQueueing { get; set; } - public byte DeviceTypeModifier { get; set; } - public byte ECMAVersion { get; set; } - public bool EnclosureServices { get; set; } - public bool HierarchicalLUN { get; set; } - public bool IUS { get; set; } - public byte ISOVersion { get; set; } - public bool LinkedCommands { get; set; } - public bool MediumChanger { get; set; } - public bool MultiPortDevice { get; set; } - public bool NormalACA { get; set; } - public PeripheralDeviceTypes PeripheralDeviceType { get; set; } - public PeripheralQualifiers PeripheralQualifier { get; set; } - public string ProductIdentification { get; set; } - public string ProductRevisionLevel { get; set; } - public bool Protection { get; set; } - public bool QAS { get; set; } - public bool RelativeAddressing { get; set; } - public bool Removable { get; set; } - public byte ResponseDataFormat { get; set; } - public bool TaggedCommandQueue { get; set; } - public bool TerminateTaskSupported { get; set; } - public bool ThirdPartyCopy { get; set; } - public bool TranferDisable { get; set; } - public bool SoftReset { get; set; } - public SPIClocking SPIClocking { get; set; } - public bool StorageArrayController { get; set; } - public bool SyncTransfer { get; set; } - public string VendorIdentification { get; set; } - public ushort[] VersionDescriptors { get; set; } - public bool WideBus16 { get; set; } - public bool WideBus32 { get; set; } - public byte[] Data { get; set; } - - [XmlIgnore] - public bool ANSIVersionSpecified { get; set; } - [XmlIgnore] - public bool ECMAVersionSpecified { get; set; } - [XmlIgnore] - public bool DeviceTypeModifierSpecified { get; set; } - [XmlIgnore] - public bool ISOVersionSpecified { get; set; } - [XmlIgnore] - public bool ProductIdentificationSpecified { get; set; } - [XmlIgnore] - public bool ProductRevisionLevelSpecified { get; set; } - [XmlIgnore] - public bool ResponseDataFormatSpecified { get; set; } - [XmlIgnore] - public bool VendorIdentificationSpecified { get; set; } - } - - [Serializable] - public class pageType - { - [XmlAttribute] - public byte page { get; set; } - - [XmlText] - public byte[] value { get; set; } - } - - public class modeType - { - public byte MediumType { get; set; } - public bool WriteProtected { get; set; } - public blockDescriptorType[] BlockDescriptors { get; set; } - public byte Speed { get; set; } - public byte BufferedMode { get; set; } - public bool BlankCheckEnabled { get; set; } - public bool DPOandFUA { get; set; } - public modePageType[] ModePages { get; set; } - - [XmlIgnore] - public bool MediumTypeSpecified { get; set; } - [XmlIgnore] - public bool SpeedSpecified { get; set; } - [XmlIgnore] - public bool BufferedModeSpecified { get; set; } - } - - public class blockDescriptorType - { - public byte Density { get; set; } - public ulong Blocks { get; set; } - public uint BlockLength { get; set; } - - [XmlIgnore] - public bool BlocksSpecified { get; set; } - [XmlIgnore] - public bool BlockLengthSpecified { get; set; } - } - - [Serializable] - public class modePageType - { - [XmlAttribute] - public byte page { get; set; } - - [XmlAttribute] - public byte subpage { get; set; } - - [XmlText] - public byte[] value { get; set; } - } - - public class mmcType - { - public mmcModeType ModeSense2A { get; set; } - public mmcFeaturesType Features { get; set; } - public testedMediaType[] TestedMedia { get; set; } - } - - public class mmcModeType - { - public bool AccurateCDDA { get; set; } - public bool BCK { get; set; } - public ushort BufferSize { get; set; } - public bool BufferUnderRunProtection { get; set; } - public bool CanEject { get; set; } - public bool CanLockMedia { get; set; } - public bool CDDACommand { get; set; } - public bool CompositeAudioVideo { get; set; } - public bool CSSandCPPMSupported { get; set; } - public ushort CurrentSpeed { get; set; } - public ushort CurrentWriteSpeed { get; set; } - public ushort CurrentWriteSpeedSelected { get; set; } - public bool DeterministicSlotChanger { get; set; } - public bool DigitalPort1 { get; set; } - public bool DigitalPort2 { get; set; } - public bool LeadInPW { get; set; } - public byte LoadingMechanismType { get; set; } - public bool LockStatus { get; set; } - public bool LSBF { get; set; } - public ushort MaximumSpeed { get; set; } - public ushort MaximumWriteSpeed { get; set; } - public bool PlaysAudio { get; set; } - public bool PreventJumperStatus { get; set; } - public bool RCK { get; set; } - public bool ReadsBarcode { get; set; } - public bool ReadsBothSides { get; set; } - public bool ReadsCDR { get; set; } - public bool ReadsCDRW { get; set; } - public bool ReadsDeinterlavedSubchannel { get; set; } - public bool ReadsDVDR { get; set; } - public bool ReadsDVDRAM { get; set; } - public bool ReadsDVDROM { get; set; } - public bool ReadsISRC { get; set; } - public bool ReadsMode2Form2 { get; set; } - public bool ReadsMode2Form1 { get; set; } - public bool ReadsPacketCDR { get; set; } - public bool ReadsSubchannel { get; set; } - public bool ReadsUPC { get; set; } - public bool ReturnsC2Pointers { get; set; } - public byte RotationControlSelected { get; set; } - public bool SeparateChannelMute { get; set; } - public bool SeparateChannelVolume { get; set; } - public bool SSS { get; set; } - public bool SupportsMultiSession { get; set; } - public ushort SupportedVolumeLevels { get; set; } - public bool TestWrite { get; set; } - public bool WritesCDR { get; set; } - public bool WritesCDRW { get; set; } - public bool WritesDVDR { get; set; } - public bool WritesDVDRAM { get; set; } - public Modes.ModePage_2A_WriteDescriptor[] WriteSpeedPerformanceDescriptors { get; set; } - - [XmlIgnore] - public bool MaximumSpeedSpecified { get; set; } - [XmlIgnore] - public bool SupportedVolumeLevelsSpecified { get; set; } - [XmlIgnore] - public bool BufferSizeSpecified { get; set; } - [XmlIgnore] - public bool CurrentSpeedSpecified { get; set; } - [XmlIgnore] - public bool MaximumWriteSpeedSpecified { get; set; } - [XmlIgnore] - public bool CurrentWriteSpeedSpecified { get; set; } - [XmlIgnore] - public bool RotationControlSelectedSpecified { get; set; } - [XmlIgnore] - public bool CurrentWriteSpeedSelectedSpecified { get; set; } - } - - public class mmcFeaturesType - { - public byte AACSVersion { get; set; } - public byte AGIDs { get; set; } - public byte BindingNonceBlocks { get; set; } - public ushort BlocksPerReadableUnit { get; set; } - public bool BufferUnderrunFreeInDVD { get; set; } - public bool BufferUnderrunFreeInSAO { get; set; } - public bool BufferUnderrunFreeInTAO { get; set; } - public bool CanAudioScan { get; set; } - public bool CanEject { get; set; } - public bool CanEraseSector { get; set; } - public bool CanExpandBDRESpareArea { get; set; } - public bool CanFormat { get; set; } - public bool CanFormatBDREWithoutSpare { get; set; } - public bool CanFormatCert { get; set; } - public bool CanFormatFRF { get; set; } - public bool CanFormatQCert { get; set; } - public bool CanFormatRRM { get; set; } - public bool CanGenerateBindingNonce { get; set; } - public bool CanLoad { get; set; } - public bool CanMuteSeparateChannels { get; set; } - public bool CanOverwriteSAOTrack { get; set; } - public bool CanOverwriteTAOTrack { get; set; } - public bool CanPlayCDAudio { get; set; } - public bool CanPseudoOverwriteBDR { get; set; } - public bool CanReadAllDualR { get; set; } - public bool CanReadAllDualRW { get; set; } - public bool CanReadBD { get; set; } - public bool CanReadBDR { get; set; } - public bool CanReadBDRE1 { get; set; } - public bool CanReadBDRE2 { get; set; } - public bool CanReadBDROM { get; set; } - public bool CanReadBluBCA { get; set; } - public bool CanReadCD { get; set; } - public bool CanReadCDMRW { get; set; } - public bool CanReadCPRM_MKB { get; set; } - public bool CanReadDDCD { get; set; } - public bool CanReadDVD { get; set; } - public bool CanReadDVDPlusMRW { get; set; } - public bool CanReadDVDPlusR { get; set; } - public bool CanReadDVDPlusRDL { get; set; } - public bool CanReadDVDPlusRW { get; set; } - public bool CanReadDVDPlusRWDL { get; set; } - public bool CanReadDriveAACSCertificate { get; set; } - public bool CanReadHDDVD { get; set; } - public bool CanReadHDDVDR { get; set; } - public bool CanReadHDDVDRAM { get; set; } - public bool CanReadLeadInCDText { get; set; } - public bool CanReadOldBDR { get; set; } - public bool CanReadOldBDRE { get; set; } - public bool CanReadOldBDROM { get; set; } - public bool CanReadSpareAreaInformation { get; set; } - public bool CanReportDriveSerial { get; set; } - public bool CanReportMediaSerial { get; set; } - public bool CanTestWriteDDCDR { get; set; } - public bool CanTestWriteDVD { get; set; } - public bool CanTestWriteInSAO { get; set; } - public bool CanTestWriteInTAO { get; set; } - public bool CanUpgradeFirmware { get; set; } - public bool CanWriteBD { get; set; } - public bool CanWriteBDR { get; set; } - public bool CanWriteBDRE1 { get; set; } - public bool CanWriteBDRE2 { get; set; } - public bool CanWriteBusEncryptedBlocks { get; set; } - public bool CanWriteCDMRW { get; set; } - public bool CanWriteCDRW { get; set; } - public bool CanWriteCDRWCAV { get; set; } - public bool CanWriteCDSAO { get; set; } - public bool CanWriteCDTAO { get; set; } - public bool CanWriteCSSManagedDVD { get; set; } - public bool CanWriteDDCDR { get; set; } - public bool CanWriteDDCDRW { get; set; } - public bool CanWriteDVDPlusMRW { get; set; } - public bool CanWriteDVDPlusR { get; set; } - public bool CanWriteDVDPlusRDL { get; set; } - public bool CanWriteDVDPlusRW { get; set; } - public bool CanWriteDVDPlusRWDL { get; set; } - public bool CanWriteDVDR { get; set; } - public bool CanWriteDVDRDL { get; set; } - public bool CanWriteDVDRW { get; set; } - public bool CanWriteHDDVDR { get; set; } - public bool CanWriteHDDVDRAM { get; set; } - public bool CanWriteOldBDR { get; set; } - public bool CanWriteOldBDRE { get; set; } - public bool CanWritePackedSubchannelInTAO { get; set; } - public bool CanWriteRWSubchannelInSAO { get; set; } - public bool CanWriteRWSubchannelInTAO { get; set; } - public bool CanWriteRaw { get; set; } - public bool CanWriteRawMultiSession { get; set; } - public bool CanWriteRawSubchannelInTAO { get; set; } - public bool ChangerIsSideChangeCapable { get; set; } - public byte ChangerSlots { get; set; } - public bool ChangerSupportsDiscPresent { get; set; } - public byte CPRMVersion { get; set; } - public byte CSSVersion { get; set; } - public bool DBML { get; set; } - public bool DVDMultiRead { get; set; } - public bool EmbeddedChanger { get; set; } - public bool ErrorRecoveryPage { get; set; } - [XmlElement(DataType = "date")] - public DateTime FirmwareDate { get; set; } - public byte LoadingMechanismType { get; set; } - public bool Locked { get; set; } - public uint LogicalBlockSize { get; set; } - public bool MultiRead { get; set; } - public PhysicalInterfaces PhysicalInterfaceStandard { get; set; } - public uint PhysicalInterfaceStandardNumber { get; set; } - public bool PreventJumper { get; set; } - public bool SupportsAACS { get; set; } - public bool SupportsBusEncryption { get; set; } - public bool SupportsC2 { get; set; } - public bool SupportsCPRM { get; set; } - public bool SupportsCSS { get; set; } - public bool SupportsDAP { get; set; } - public bool SupportsDeviceBusyEvent { get; set; } - public bool SupportsHybridDiscs { get; set; } - public bool SupportsModePage1Ch { get; set; } - public bool SupportsOSSC { get; set; } - public bool SupportsPWP { get; set; } - public bool SupportsSWPP { get; set; } - public bool SupportsSecurDisc { get; set; } - public bool SupportsSeparateVolume { get; set; } - public bool SupportsVCPS { get; set; } - public bool SupportsWriteInhibitDCB { get; set; } - public bool SupportsWriteProtectPAC { get; set; } - public ushort VolumeLevels { get; set; } - - [XmlIgnore] - public bool PhysicalInterfaceStandardSpecified { get; set; } - [XmlIgnore] - public bool PhysicalInterfaceStandardNumberSpecified { get; set; } - [XmlIgnore] - public bool AACSVersionSpecified { get; set; } - [XmlIgnore] - public bool AGIDsSpecified { get; set; } - [XmlIgnore] - public bool BindingNonceBlocksSpecified { get; set; } - [XmlIgnore] - public bool CPRMVersionSpecified { get; set; } - [XmlIgnore] - public bool CSSVersionSpecified { get; set; } - [XmlIgnore] - public bool ChangerHighestSlotNumberSpecified { get; set; } - [XmlIgnore] - public bool LoadingMechanismTypeSpecified { get; set; } - [XmlIgnore] - public bool LogicalBlockSizeSpecified { get; set; } - [XmlIgnore] - public bool BlocksPerReadableUnitSpecified { get; set; } - [XmlIgnore] - public bool FirmwareDateSpecified { get; set; } - [XmlIgnore] - public bool VolumeLevelsSpecified { get; set; } - } - - public class testedMediaType - { - public ulong Blocks { get; set; } - public uint BlockSize { get; set; } - public bool CanReadAACS { get; set; } - public bool CanReadADIP { get; set; } - public bool CanReadATIP { get; set; } - public bool CanReadBCA { get; set; } - public bool CanReadC2Pointers { get; set; } - public bool CanReadCMI { get; set; } - public bool CanReadCorrectedSubchannel { get; set; } - public bool CanReadCorrectedSubchannelWithC2 { get; set; } - public bool CanReadDCB { get; set; } - public bool CanReadDDS { get; set; } - public bool CanReadDMI { get; set; } - public bool CanReadDiscInformation { get; set; } - public bool CanReadFullTOC { get; set; } - public bool CanReadHDCMI { get; set; } - public bool CanReadLayerCapacity { get; set; } - public bool CanReadLeadIn { get; set; } - public bool CanReadLeadOut { get; set; } - public bool CanReadMediaID { get; set; } - public bool CanReadMediaSerial { get; set; } - public bool CanReadPAC { get; set; } - public bool CanReadPFI { get; set; } - public bool CanReadPMA { get; set; } - public bool CanReadPQSubchannel { get; set; } - public bool CanReadPQSubchannelWithC2 { get; set; } - public bool CanReadPRI { get; set; } - public bool CanReadRWSubchannel { get; set; } - public bool CanReadRWSubchannelWithC2 { get; set; } - public bool CanReadRecordablePFI { get; set; } - public bool CanReadSpareAreaInformation { get; set; } - public bool CanReadTOC { get; set; } - public byte Density { get; set; } - public uint LongBlockSize { get; set; } - public string Manufacturer { get; set; } - public bool MediaIsRecognized { get; set; } - public byte MediumType { get; set; } - public string MediumTypeName { get; set; } - public string Model { get; set; } - public bool SupportsHLDTSTReadRawDVD { get; set; } - public bool SupportsNECReadCDDA { get; set; } - public bool SupportsPioneerReadCDDA { get; set; } - public bool SupportsPioneerReadCDDAMSF { get; set; } - public bool SupportsPlextorReadCDDA { get; set; } - public bool SupportsPlextorReadRawDVD { get; set; } - public bool SupportsRead10 { get; set; } - public bool SupportsRead12 { get; set; } - public bool SupportsRead16 { get; set; } - public bool SupportsRead { get; set; } - public bool SupportsReadCapacity16 { get; set; } - public bool SupportsReadCapacity { get; set; } - public bool SupportsReadCd { get; set; } - public bool SupportsReadCdMsf { get; set; } - public bool SupportsReadCdRaw { get; set; } - public bool SupportsReadCdMsfRaw { get; set; } - public bool SupportsReadLong16 { get; set; } - public bool SupportsReadLong { get; set; } - - public byte[] ModeSense6Data { get; set; } - public byte[] ModeSense10Data { get; set; } - - [XmlIgnore] - public bool BlocksSpecified { get; set; } - [XmlIgnore] - public bool BlockSizeSpecified { get; set; } - [XmlIgnore] - public bool CanReadAACSSpecified { get; set; } - [XmlIgnore] - public bool CanReadADIPSpecified { get; set; } - [XmlIgnore] - public bool CanReadATIPSpecified { get; set; } - [XmlIgnore] - public bool CanReadBCASpecified { get; set; } - [XmlIgnore] - public bool CanReadC2PointersSpecified { get; set; } - [XmlIgnore] - public bool CanReadCMISpecified { get; set; } - [XmlIgnore] - public bool CanReadCorrectedSubchannelSpecified { get; set; } - [XmlIgnore] - public bool CanReadCorrectedSubchannelWithC2Specified { get; set; } - [XmlIgnore] - public bool CanReadDCBSpecified { get; set; } - [XmlIgnore] - public bool CanReadDDSSpecified { get; set; } - [XmlIgnore] - public bool CanReadDMISpecified { get; set; } - [XmlIgnore] - public bool CanReadDiscInformationSpecified { get; set; } - [XmlIgnore] - public bool CanReadFullTOCSpecified { get; set; } - [XmlIgnore] - public bool CanReadHDCMISpecified { get; set; } - [XmlIgnore] - public bool CanReadLayerCapacitySpecified { get; set; } - [XmlIgnore] - public bool CanReadLeadInSpecified { get; set; } - [XmlIgnore] - public bool CanReadLeadOutSpecified { get; set; } - [XmlIgnore] - public bool CanReadMediaIDSpecified { get; set; } - [XmlIgnore] - public bool CanReadMediaSerialSpecified { get; set; } - [XmlIgnore] - public bool CanReadPACSpecified { get; set; } - [XmlIgnore] - public bool CanReadPFISpecified { get; set; } - [XmlIgnore] - public bool CanReadPMASpecified { get; set; } - [XmlIgnore] - public bool CanReadPQSubchannelSpecified { get; set; } - [XmlIgnore] - public bool CanReadPQSubchannelWithC2Specified { get; set; } - [XmlIgnore] - public bool CanReadPRISpecified { get; set; } - [XmlIgnore] - public bool CanReadRWSubchannelSpecified { get; set; } - [XmlIgnore] - public bool CanReadRWSubchannelWithC2Specified { get; set; } - [XmlIgnore] - public bool CanReadRecordablePFISpecified { get; set; } - [XmlIgnore] - public bool CanReadSpareAreaInformationSpecified { get; set; } - [XmlIgnore] - public bool CanReadTOCSpecified { get; set; } - [XmlIgnore] - public bool DensitySpecified { get; set; } - [XmlIgnore] - public bool LongBlockSizeSpecified { get; set; } - [XmlIgnore] - public bool ManufacturerSpecified { get; set; } - [XmlIgnore] - public bool MediumTypeSpecified { get; set; } - [XmlIgnore] - public bool ModelSpecified { get; set; } - [XmlIgnore] - public bool SupportsHLDTSTReadRawDVDSpecified { get; set; } - [XmlIgnore] - public bool SupportsNECReadCDDASpecified { get; set; } - [XmlIgnore] - public bool SupportsPioneerReadCDDASpecified { get; set; } - [XmlIgnore] - public bool SupportsPioneerReadCDDAMSFSpecified { get; set; } - [XmlIgnore] - public bool SupportsPlextorReadCDDASpecified { get; set; } - [XmlIgnore] - public bool SupportsPlextorReadRawDVDSpecified { get; set; } - [XmlIgnore] - public bool SupportsRead10Specified { get; set; } - [XmlIgnore] - public bool SupportsRead12Specified { get; set; } - [XmlIgnore] - public bool SupportsRead16Specified { get; set; } - [XmlIgnore] - public bool SupportsReadSpecified { get; set; } - [XmlIgnore] - public bool SupportsReadCapacity16Specified { get; set; } - [XmlIgnore] - public bool SupportsReadCapacitySpecified { get; set; } - [XmlIgnore] - public bool SupportsReadCdSpecified { get; set; } - [XmlIgnore] - public bool SupportsReadCdMsfSpecified { get; set; } - [XmlIgnore] - public bool SupportsReadCdRawSpecified { get; set; } - [XmlIgnore] - public bool SupportsReadCdMsfRawSpecified { get; set; } - [XmlIgnore] - public bool SupportsReadLong16Specified { get; set; } - [XmlIgnore] - public bool SupportsReadLongSpecified { get; set; } - - public chsType CHS { get; set; } - public chsType CurrentCHS { get; set; } - public uint LBASectors { get; set; } - public ulong LBA48Sectors { get; set; } - public ushort LogicalAlignment { get; set; } - public ushort NominalRotationRate { get; set; } - public uint PhysicalBlockSize { get; set; } - public bool SolidStateDevice { get; set; } - public ushort UnformattedBPT { get; set; } - public ushort UnformattedBPS { get; set; } - - [XmlIgnore] - public bool LBASectorsSpecified { get; set; } - [XmlIgnore] - public bool LBA48SectorsSpecified { get; set; } - [XmlIgnore] - public bool LogicalAlignmentSpecified { get; set; } - [XmlIgnore] - public bool NominalRotationRateSpecified { get; set; } - [XmlIgnore] - public bool PhysicalBlockSizeSpecified { get; set; } - [XmlIgnore] - public bool SolidStateDeviceSpecified { get; set; } - [XmlIgnore] - public bool UnformattedBPTSpecified { get; set; } - [XmlIgnore] - public bool UnformattedBPSSpecified { get; set; } - - public bool SupportsReadDmaLba { get; set; } - public bool SupportsReadDmaRetryLba { get; set; } - public bool SupportsReadLba { get; set; } - public bool SupportsReadRetryLba { get; set; } - public bool SupportsReadLongLba { get; set; } - public bool SupportsReadLongRetryLba { get; set; } - public bool SupportsSeekLba { get; set; } - - public bool SupportsReadDmaLba48 { get; set; } - public bool SupportsReadLba48 { get; set; } - - public bool SupportsReadDma { get; set; } - public bool SupportsReadDmaRetry { get; set; } - public bool SupportsReadRetry { get; set; } - public bool SupportsReadLongRetry { get; set; } - public bool SupportsSeek { get; set; } - - [XmlIgnore] - public bool SupportsReadDmaLbaSpecified { get; set; } - [XmlIgnore] - public bool SupportsReadDmaRetryLbaSpecified { get; set; } - [XmlIgnore] - public bool SupportsReadLbaSpecified { get; set; } - [XmlIgnore] - public bool SupportsReadRetryLbaSpecified { get; set; } - [XmlIgnore] - public bool SupportsReadLongLbaSpecified { get; set; } - [XmlIgnore] - public bool SupportsReadLongRetryLbaSpecified { get; set; } - [XmlIgnore] - public bool SupportsSeekLbaSpecified { get; set; } - - [XmlIgnore] - public bool SupportsReadDmaLba48Specified { get; set; } - [XmlIgnore] - public bool SupportsReadLba48Specified { get; set; } - - [XmlIgnore] - public bool SupportsReadDmaSpecified { get; set; } - [XmlIgnore] - public bool SupportsReadDmaRetrySpecified { get; set; } - [XmlIgnore] - public bool SupportsReadRetrySpecified { get; set; } - [XmlIgnore] - public bool SupportsReadLongRetrySpecified { get; set; } - [XmlIgnore] - public bool SupportsSeekSpecified { get; set; } - } - - public class sscType - { - public byte BlockSizeGranularity { get; set; } - public uint MaxBlockLength { get; set; } - public uint MinBlockLength { get; set; } - - public SupportedDensity[] SupportedDensities { get; set; } - public SupportedMedia[] SupportedMediaTypes { get; set; } - public SequentialMedia[] TestedMedia { get; set; } - - [XmlIgnore] - public bool BlockSizeGranularitySpecified { get; set; } - [XmlIgnore] - public bool MaxBlockLengthSpecified { get; set; } - [XmlIgnore] - public bool MinBlockLengthSpecified { get; set; } - } - - public class SupportedDensity - { - [XmlIgnore] - [JsonIgnore] - public int Id { get; set; } - public byte PrimaryCode { get; set; } - public byte SecondaryCode { get; set; } - public bool Writable { get; set; } - public bool Duplicate { get; set; } - public bool DefaultDensity { get; set; } - public uint BitsPerMm { get; set; } - public ushort Width { get; set; } - public ushort Tracks { get; set; } - public uint Capacity { get; set; } - public string Organization { get; set; } - public string Name { get; set; } - public string Description { get; set; } - - [JsonIgnore] - [XmlIgnore] - public int BitsPerMmSql - { - get => (int)BitsPerMm; - set => BitsPerMm = (uint)value; - } - - [JsonIgnore] - [XmlIgnore] - public short WidthSql - { - get => (short)Width; - set => Width = (ushort)value; - } - - [JsonIgnore] - [XmlIgnore] - public short TracksSql - { - get => (short)Tracks; - set => Tracks = (ushort)value; - } - - [JsonIgnore] - [XmlIgnore] - public int CapacitySql - { - get => (int)Capacity; - set => Capacity = (uint)value; - } - } - - public class SupportedMedia - { - [XmlIgnore] - [JsonIgnore] - public int Id { get; set; } - public byte MediumType { get; set; } - public int[] DensityCodes { get; set; } - public ushort Width { get; set; } - public ushort Length { get; set; } - public string Organization { get; set; } - public string Name { get; set; } - public string Description { get; set; } - } - - public struct SequentialMedia - { - public bool CanReadMediaSerial { get; set; } - public byte Density { get; set; } - public string Manufacturer { get; set; } - public bool MediaIsRecognized { get; set; } - public byte MediumType { get; set; } - public string MediumTypeName { get; set; } - public string Model { get; set; } - public SupportedDensity[] SupportedDensities { get; set; } - public SupportedMedia[] SupportedMediaTypes { get; set; } - - public byte[] ModeSense6Data { get; set; } - public byte[] ModeSense10Data { get; set; } - - [XmlIgnore] - public bool CanReadMediaSerialSpecified { get; set; } - [XmlIgnore] - public bool DensitySpecified { get; set; } - [XmlIgnore] - public bool MediumTypeSpecified { get; set; } - } - - [Serializable] - public class pcmciaType - { - public byte[] CIS { get; set; } - public string Compliance { get; set; } - public ushort ManufacturerCode { get; set; } - public ushort CardCode { get; set; } - public string Manufacturer { get; set; } - public string ProductName { get; set; } - public string[] AdditionalInformation { get; set; } - - [XmlIgnore] - public bool ManufacturerCodeSpecified { get; set; } - [XmlIgnore] - public bool CardCodeSpecified { get; set; } - } - - [Serializable] - public class mmcsdType - { - public byte[] CID { get; set; } - public byte[] CSD { get; set; } - public byte[] OCR { get; set; } - public byte[] SCR { get; set; } - public byte[] ExtendedCSD { get; set; } - } -} \ No newline at end of file diff --git a/DiscImageChef.CommonTypes/Metadata/DeviceReportV2.cs b/DiscImageChef.CommonTypes/Metadata/DeviceReportV2.cs deleted file mode 100644 index 320c5fffe..000000000 --- a/DiscImageChef.CommonTypes/Metadata/DeviceReportV2.cs +++ /dev/null @@ -1,1712 +0,0 @@ -// /*************************************************************************** -// The Disc Image Chef -// ---------------------------------------------------------------------------- -// -// Filename : DeviceReportV2.cs -// Author(s) : Natalia Portillo -// -// Component : JSON metadata. -// -// --[ Description ] ---------------------------------------------------------- -// -// Contains classes for a JSON device report. -// -// --[ 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; -using System.Collections.Generic; -using System.ComponentModel.DataAnnotations; -using System.Linq; -using System.Text; -using DiscImageChef.CommonTypes.Enums; -using DiscImageChef.Decoders.ATA; -using DiscImageChef.Decoders.SCSI; -using DiscImageChef.Decoders.SCSI.MMC; -using Newtonsoft.Json; - -// ReSharper disable VirtualMemberNeverOverridden.Global -// ReSharper disable VirtualMemberCallInConstructor - -// ReSharper disable InconsistentNaming -// ReSharper disable UnusedAutoPropertyAccessor.Global - -namespace DiscImageChef.CommonTypes.Metadata -{ - public class DeviceReportV2 - { - public DeviceReportV2() { } - - public DeviceReportV2(DeviceReport reportV1) - { - if(reportV1.USB != null) USB = new Usb(reportV1.USB); - if(reportV1.FireWire != null) FireWire = new FireWire(reportV1.FireWire); - if(reportV1.PCMCIA != null) PCMCIA = new Pcmcia(reportV1.PCMCIA); - if(reportV1.CompactFlashSpecified) CompactFlash = reportV1.CompactFlash; - if(reportV1.ATA != null) - { - ATA = new Ata(reportV1.ATA); - Type = DeviceType.ATA; - } - - if(reportV1.SCSI != null) - { - SCSI = new Scsi(reportV1.SCSI); - Type = DeviceType.SCSI; - - if(SCSI.ModeSense?.ModePages?.FirstOrDefault(p => p.page == 0x2A)?.value != null) - { - if(SCSI.MultiMediaDevice != null) - SCSI.MultiMediaDevice.ModeSense2AData = - SCSI.ModeSense?.ModePages?.FirstOrDefault(p => p.page == 0x2A)?.value; - else if(SCSI.Inquiry?.PeripheralDeviceType == (byte)PeripheralDeviceTypes.MultiMediaDevice) - SCSI.MultiMediaDevice = new Mmc - { - ModeSense2AData = SCSI.ModeSense?.ModePages?.FirstOrDefault(p => p.page == 0x2A)?.value - }; - } - } - - if(reportV1.ATAPI != null) - { - ATAPI = new Ata(reportV1.ATAPI); - Type = DeviceType.ATAPI; - } - - if(reportV1.MultiMediaCard != null) - { - MultiMediaCard = new MmcSd(reportV1.MultiMediaCard); - Type = DeviceType.MMC; - } - - if(reportV1.SecureDigital != null) - { - SecureDigital = new MmcSd(reportV1.SecureDigital); - Type = DeviceType.SecureDigital; - } - - if(reportV1.SCSI?.Inquiry != null) - { - Manufacturer = reportV1.SCSI.Inquiry.VendorIdentification; - Model = reportV1.SCSI.Inquiry.ProductIdentification; - Revision = reportV1.SCSI.Inquiry.ProductRevisionLevel; - } - else if(reportV1.ATA != null || reportV1.ATAPI != null) - { - ataType ata = reportV1.ATA ?? reportV1.ATAPI; - - string[] split = ata.Model.Split(' '); - - if(split.Length > 1) - { - Manufacturer = split[0]; - Model = string.Join(" ", split, 1, split.Length - 1); - } - else Model = ata.Model; - - Revision = ata.FirmwareRevision; - } - } - - [JsonIgnore] - public int Id { get; set; } - public virtual Usb USB { get; set; } - public virtual FireWire FireWire { get; set; } - public virtual Pcmcia PCMCIA { get; set; } - public bool CompactFlash { get; set; } - public virtual Ata ATA { get; set; } - public virtual Ata ATAPI { get; set; } - public virtual Scsi SCSI { get; set; } - public virtual MmcSd MultiMediaCard { get; set; } - public virtual MmcSd SecureDigital { get; set; } - - public string Manufacturer { get; set; } - public string Model { get; set; } - public string Revision { get; set; } - public DeviceType Type { get; set; } - } - - public class Usb - { - public Usb() { } - - public Usb(usbType usb) - { - VendorID = usb.VendorID; - ProductID = usb.ProductID; - Manufacturer = usb.Manufacturer; - Product = usb.Product; - RemovableMedia = usb.RemovableMedia; - Descriptors = usb.Descriptors; - } - - [JsonIgnore] - public int Id { get; set; } - public ushort VendorID { get; set; } - public ushort ProductID { get; set; } - public string Manufacturer { get; set; } - public string Product { get; set; } - public bool RemovableMedia { get; set; } - public byte[] Descriptors { get; set; } - - [JsonIgnore] - public short VendorIDSql - { - get => (short)VendorID; - set => VendorID = (ushort)value; - } - - [JsonIgnore] - public short ProductIDSql - { - get => (short)ProductID; - set => ProductID = (ushort)value; - } - } - - public class FireWire - { - public FireWire() { } - - public FireWire(firewireType firewire) - { - VendorID = firewire.VendorID; - ProductID = firewire.ProductID; - Manufacturer = firewire.Manufacturer; - Product = firewire.Product; - RemovableMedia = firewire.RemovableMedia; - } - - [JsonIgnore] - public int Id { get; set; } - public uint VendorID { get; set; } - public uint ProductID { get; set; } - public string Manufacturer { get; set; } - public string Product { get; set; } - public bool RemovableMedia { get; set; } - - [JsonIgnore] - public int VendorIDSql - { - get => (int)VendorID; - set => VendorID = (uint)value; - } - - [JsonIgnore] - public int ProductIDSql - { - get => (int)ProductID; - set => ProductID = (uint)value; - } - } - - public class Ata - { - public Ata() { } - - public Ata(ataType ata) - { - Identify = ata.Identify; - - if(ata.ReadCapabilities != null) ReadCapabilities = new TestedMedia(ata.ReadCapabilities, true); - - if(ata.RemovableMedias != null) - { - RemovableMedias = new List(); - - foreach(testedMediaType ataRemovableMedia in ata.RemovableMedias) - RemovableMedias.Add(new TestedMedia(ataRemovableMedia, true)); - } - - if(Identify != null) return; - - Identify.IdentifyDevice identifyDevice = new Identify.IdentifyDevice(); - - if(ata.AdditionalPIDSpecified) identifyDevice.AdditionalPID = ata.AdditionalPID; - - if(ata.APIOSupportedSpecified) identifyDevice.APIOSupported = ata.APIOSupported; - - if(ata.ATAPIByteCountSpecified) identifyDevice.ATAPIByteCount = ata.ATAPIByteCount; - - if(ata.BufferTypeSpecified) identifyDevice.BufferType = ata.BufferType; - - if(ata.BufferSizeSpecified) identifyDevice.BufferSize = ata.BufferSize; - - if(ata.CapabilitiesSpecified) identifyDevice.Capabilities = ata.Capabilities; - - if(ata.Capabilities2Specified) identifyDevice.Capabilities2 = ata.Capabilities2; - - if(ata.Capabilities3Specified) identifyDevice.Capabilities3 = ata.Capabilities3; - - if(ata.CFAPowerModeSpecified) identifyDevice.CFAPowerMode = ata.CFAPowerMode; - - if(ata.CommandSetSpecified) identifyDevice.CommandSet = ata.CommandSet; - - if(ata.CommandSet2Specified) identifyDevice.CommandSet2 = ata.CommandSet2; - - if(ata.CommandSet3Specified) identifyDevice.CommandSet3 = ata.CommandSet3; - - if(ata.CommandSet4Specified) identifyDevice.CommandSet4 = ata.CommandSet4; - - if(ata.CommandSet5Specified) identifyDevice.CommandSet4 = ata.CommandSet4; - - if(ata.CurrentAAMSpecified) identifyDevice.CurrentAAM = ata.CurrentAAM; - - if(ata.CurrentAPMSpecified) identifyDevice.CurrentAPM = ata.CurrentAPM; - - if(ata.DataSetMgmtSpecified) identifyDevice.DataSetMgmt = ata.DataSetMgmt; - - if(ata.DataSetMgmtSizeSpecified) identifyDevice.DataSetMgmtSize = ata.DataSetMgmtSize; - - if(ata.DeviceFormFactorSpecified) identifyDevice.DeviceFormFactor = ata.DeviceFormFactor; - - if(ata.DMAActiveSpecified) identifyDevice.DMAActive = ata.DMAActive; - - if(ata.DMASupportedSpecified) identifyDevice.DMASupported = ata.DMASupported; - - if(ata.DMATransferTimingModeSpecified) identifyDevice.DMATransferTimingMode = ata.DMATransferTimingMode; - - if(ata.EnhancedSecurityEraseTimeSpecified) - identifyDevice.EnhancedSecurityEraseTime = ata.EnhancedSecurityEraseTime; - - if(ata.EnabledCommandSetSpecified) identifyDevice.EnabledCommandSet = ata.EnabledCommandSet; - - if(ata.EnabledCommandSet2Specified) identifyDevice.EnabledCommandSet2 = ata.EnabledCommandSet2; - - if(ata.EnabledCommandSet3Specified) identifyDevice.EnabledCommandSet3 = ata.EnabledCommandSet3; - - if(ata.EnabledCommandSet4Specified) identifyDevice.EnabledCommandSet4 = ata.EnabledCommandSet4; - - if(ata.EnabledSATAFeaturesSpecified) identifyDevice.EnabledSATAFeatures = ata.EnabledSATAFeatures; - - if(ata.ExtendedUserSectorsSpecified) identifyDevice.ExtendedUserSectors = ata.ExtendedUserSectors; - - if(ata.FreeFallSensitivitySpecified) identifyDevice.FreeFallSensitivity = ata.FreeFallSensitivity; - - if(ata.FirmwareRevisionSpecified) identifyDevice.FirmwareRevision = ata.FirmwareRevision; - - if(ata.GeneralConfigurationSpecified) identifyDevice.GeneralConfiguration = ata.GeneralConfiguration; - - if(ata.HardwareResetResultSpecified) identifyDevice.HardwareResetResult = ata.HardwareResetResult; - - if(ata.InterseekDelaySpecified) identifyDevice.InterseekDelay = ata.InterseekDelay; - - if(ata.MajorVersionSpecified) identifyDevice.MajorVersion = ata.MajorVersion; - - if(ata.MasterPasswordRevisionCodeSpecified) - identifyDevice.MasterPasswordRevisionCode = ata.MasterPasswordRevisionCode; - - if(ata.MaxDownloadMicroMode3Specified) identifyDevice.MaxDownloadMicroMode3 = ata.MaxDownloadMicroMode3; - - if(ata.MaxQueueDepthSpecified) identifyDevice.MaxQueueDepth = ata.MaxQueueDepth; - - if(ata.MDMAActiveSpecified) identifyDevice.MDMAActive = ata.MDMAActive; - - if(ata.MDMASupportedSpecified) identifyDevice.MDMASupported = ata.MDMASupported; - - if(ata.MinDownloadMicroMode3Specified) identifyDevice.MinDownloadMicroMode3 = ata.MinDownloadMicroMode3; - - if(ata.MinMDMACycleTimeSpecified) identifyDevice.MinMDMACycleTime = ata.MinMDMACycleTime; - - if(ata.MinorVersionSpecified) identifyDevice.MinorVersion = ata.MinorVersion; - - if(ata.MinPIOCycleTimeNoFlowSpecified) identifyDevice.MinPIOCycleTimeNoFlow = ata.MinPIOCycleTimeNoFlow; - - if(ata.MinPIOCycleTimeFlowSpecified) identifyDevice.MinPIOCycleTimeFlow = ata.MinPIOCycleTimeFlow; - - if(ata.ModelSpecified) identifyDevice.Model = ata.Model; - - if(ata.MultipleMaxSectorsSpecified) identifyDevice.MultipleMaxSectors = ata.MultipleMaxSectors; - - if(ata.MultipleSectorNumberSpecified) identifyDevice.MultipleSectorNumber = ata.MultipleSectorNumber; - - if(ata.NVCacheCapsSpecified) identifyDevice.NVCacheCaps = ata.NVCacheCaps; - - if(ata.NVCacheSizeSpecified) identifyDevice.NVCacheSize = ata.NVCacheSize; - - if(ata.NVCacheWriteSpeedSpecified) identifyDevice.NVCacheWriteSpeed = ata.NVCacheWriteSpeed; - - if(ata.NVEstimatedSpinUpSpecified) identifyDevice.NVEstimatedSpinUp = ata.NVEstimatedSpinUp; - - if(ata.PacketBusReleaseSpecified) identifyDevice.PacketBusRelease = ata.PacketBusRelease; - - if(ata.PIOTransferTimingModeSpecified) identifyDevice.PIOTransferTimingMode = ata.PIOTransferTimingMode; - - if(ata.RecommendedAAMSpecified) identifyDevice.RecommendedAAM = ata.RecommendedAAM; - - if(ata.RecommendedMDMACycleTimeSpecified) identifyDevice.RecMDMACycleTime = ata.RecommendedMDMACycleTime; - - if(ata.RemovableStatusSetSpecified) identifyDevice.RemovableStatusSet = ata.RemovableStatusSet; - - if(ata.SATACapabilitiesSpecified) identifyDevice.SATACapabilities = ata.SATACapabilities; - - if(ata.SATACapabilities2Specified) identifyDevice.SATACapabilities2 = ata.SATACapabilities2; - - if(ata.SATAFeaturesSpecified) identifyDevice.SATAFeatures = ata.SATAFeatures; - - if(ata.SCTCommandTransportSpecified) identifyDevice.SCTCommandTransport = ata.SCTCommandTransport; - - if(ata.SectorsPerCardSpecified) identifyDevice.SectorsPerCard = ata.SectorsPerCard; - - if(ata.SecurityEraseTimeSpecified) identifyDevice.SecurityEraseTime = ata.SecurityEraseTime; - - if(ata.SecurityStatusSpecified) identifyDevice.SecurityStatus = ata.SecurityStatus; - - if(ata.ServiceBusyClearSpecified) identifyDevice.ServiceBusyClear = ata.ServiceBusyClear; - - if(ata.SpecificConfigurationSpecified) identifyDevice.SpecificConfiguration = ata.SpecificConfiguration; - - if(ata.StreamAccessLatencySpecified) identifyDevice.StreamAccessLatency = ata.StreamAccessLatency; - - if(ata.StreamMinReqSizeSpecified) identifyDevice.StreamMinReqSize = ata.StreamMinReqSize; - - if(ata.StreamPerformanceGranularitySpecified) - identifyDevice.StreamPerformanceGranularity = ata.StreamPerformanceGranularity; - - if(ata.StreamTransferTimeDMASpecified) identifyDevice.StreamTransferTimeDMA = ata.StreamTransferTimeDMA; - - if(ata.StreamTransferTimePIOSpecified) identifyDevice.StreamTransferTimePIO = ata.StreamTransferTimePIO; - - if(ata.TransportMajorVersionSpecified) identifyDevice.TransportMajorVersion = ata.TransportMajorVersion; - - if(ata.TransportMinorVersionSpecified) identifyDevice.TransportMinorVersion = ata.TransportMinorVersion; - - if(ata.TrustedComputingSpecified) identifyDevice.TrustedComputing = ata.TrustedComputing; - - if(ata.UDMAActiveSpecified) identifyDevice.UDMAActive = ata.UDMAActive; - - if(ata.UDMASupportedSpecified) identifyDevice.UDMASupported = ata.UDMASupported; - - if(ata.WRVModeSpecified) identifyDevice.WRVMode = ata.WRVMode; - - if(ata.WRVSectorCountMode3Specified) identifyDevice.WRVSectorCountMode3 = ata.WRVSectorCountMode3; - - if(ata.WRVSectorCountMode2Specified) identifyDevice.WRVSectorCountMode2 = ata.WRVSectorCountMode2; - - Identify = Decoders.ATA.Identify.Encode(identifyDevice); - } - - public Identify.IdentifyDevice? IdentifyDevice => Decoders.ATA.Identify.Decode(Identify); - - [JsonIgnore] - public int Id { get; set; } - public byte[] Identify { get; set; } - public virtual TestedMedia ReadCapabilities { get; set; } - public virtual List RemovableMedias { get; set; } - } - - public class Chs - { - public Chs() { } - - public Chs(chsType chs) - { - Cylinders = chs.Cylinders; - Heads = chs.Heads; - Sectors = chs.Sectors; - } - - [JsonIgnore] - public int Id { get; set; } - public ushort Cylinders { get; set; } - public ushort Heads { get; set; } - public ushort Sectors { get; set; } - - [JsonIgnore] - public short CylindersSql - { - get => (short)Cylinders; - set => Cylinders = (ushort)value; - } - [JsonIgnore] - public short HeadsSql - { - get => (short)Heads; - set => Heads = (ushort)value; - } - [JsonIgnore] - public short SectorsSql - { - get => (short)Sectors; - set => Sectors = (ushort)value; - } - } - - public class Scsi - { - public Scsi() { } - - public Scsi(scsiType scsi) - { - InquiryData = scsi.Inquiry.Data; - SupportsModeSense6 = scsi.SupportsModeSense6; - SupportsModeSense10 = scsi.SupportsModeSense10; - SupportsModeSubpages = scsi.SupportsModeSubpages; - if(scsi.ReadCapabilitiesSpecified && scsi.ReadCapabilities != null) - ReadCapabilities = new TestedMedia(scsi.ReadCapabilities, false); - - if(scsi.RemovableMedias != null) - { - RemovableMedias = new List(); - foreach(testedMediaType scsiRemovableMedia in scsi.RemovableMedias) - RemovableMedias.Add(new TestedMedia(scsiRemovableMedia, false)); - } - - ModeSense6Data = scsi.ModeSense6Data; - ModeSense10Data = scsi.ModeSense10Data; - - if(scsi.EVPDPages != null) - { - EVPDPages = new List(); - foreach(pageType evpdPage in scsi.EVPDPages) EVPDPages.Add(new ScsiPage(evpdPage)); - } - - if(scsi.ModeSense != null) ModeSense = new ScsiMode(scsi.ModeSense); - - if(scsi.MultiMediaDevice != null) MultiMediaDevice = new Mmc(scsi.MultiMediaDevice); - - if(scsi.SequentialDevice != null) SequentialDevice = new Ssc(scsi.SequentialDevice); - - if(InquiryData != null) return; - - Inquiry.SCSIInquiry inq = new Inquiry.SCSIInquiry(); - - if(scsi.Inquiry.ANSIVersionSpecified) inq.ANSIVersion = scsi.Inquiry.ANSIVersion; - - if(scsi.Inquiry.ECMAVersionSpecified) inq.ECMAVersion = scsi.Inquiry.ECMAVersion; - - if(scsi.Inquiry.DeviceTypeModifierSpecified) inq.DeviceTypeModifier = scsi.Inquiry.DeviceTypeModifier; - - if(scsi.Inquiry.ISOVersionSpecified) inq.ISOVersion = scsi.Inquiry.ISOVersion; - - if(scsi.Inquiry.ProductIdentificationSpecified) - { - byte[] tmp = Encoding.ASCII.GetBytes(scsi.Inquiry.ProductIdentification); - inq.ProductIdentification = new byte[tmp.Length + 1]; - Array.Copy(tmp, 0, inq.ProductIdentification, 0, tmp.Length); - } - - if(scsi.Inquiry.ProductRevisionLevelSpecified) - { - byte[] tmp = Encoding.ASCII.GetBytes(scsi.Inquiry.ProductRevisionLevel); - inq.ProductRevisionLevel = new byte[tmp.Length + 1]; - Array.Copy(tmp, 0, inq.ProductRevisionLevel, 0, tmp.Length); - } - - if(scsi.Inquiry.ResponseDataFormatSpecified) inq.ResponseDataFormat = scsi.Inquiry.ResponseDataFormat; - - if(scsi.Inquiry.VendorIdentificationSpecified) - { - byte[] tmp = Encoding.ASCII.GetBytes(scsi.Inquiry.VendorIdentification); - inq.VendorIdentification = new byte[tmp.Length + 1]; - Array.Copy(tmp, 0, inq.VendorIdentification, 0, tmp.Length); - } - - inq.ACC = scsi.Inquiry.AccessControlCoordinator; - inq.ACKREQQ = scsi.Inquiry.ACKRequests; - inq.AERC = scsi.Inquiry.AERCSupported; - inq.Addr16 = scsi.Inquiry.Address16; - inq.Addr32 = scsi.Inquiry.Address32; - inq.TPGS = (byte)scsi.Inquiry.AsymmetricalLUNAccess; - inq.BQue = scsi.Inquiry.BasicQueueing; - inq.EncServ = scsi.Inquiry.EnclosureServices; - inq.HiSup = scsi.Inquiry.HierarchicalLUN; - inq.IUS = scsi.Inquiry.IUS; - inq.Linked = scsi.Inquiry.LinkedCommands; - inq.MChngr = scsi.Inquiry.MediumChanger; - inq.MultiP = scsi.Inquiry.MultiPortDevice; - inq.NormACA = scsi.Inquiry.NormalACA; - inq.PeripheralDeviceType = (byte)scsi.Inquiry.PeripheralDeviceType; - inq.PeripheralQualifier = (byte)scsi.Inquiry.PeripheralQualifier; - inq.Protect = scsi.Inquiry.Protection; - inq.QAS = scsi.Inquiry.QAS; - inq.RelAddr = scsi.Inquiry.RelativeAddressing; - inq.RMB = scsi.Inquiry.Removable; - inq.CmdQue = scsi.Inquiry.TaggedCommandQueue; - inq.TrmTsk = scsi.Inquiry.TerminateTaskSupported; - inq.ThreePC = scsi.Inquiry.ThirdPartyCopy; - inq.TranDis = scsi.Inquiry.TranferDisable; - inq.SftRe = scsi.Inquiry.SoftReset; - inq.Clocking = (byte)scsi.Inquiry.SPIClocking; - inq.SCCS = scsi.Inquiry.StorageArrayController; - inq.Sync = scsi.Inquiry.SyncTransfer; - inq.VersionDescriptors = scsi.Inquiry.VersionDescriptors; - inq.WBus16 = scsi.Inquiry.WideBus16; - inq.WBus32 = scsi.Inquiry.WideBus32; - - InquiryData = Decoders.SCSI.Inquiry.Encode(inq); - } - - public Inquiry.SCSIInquiry? Inquiry => Decoders.SCSI.Inquiry.Decode(InquiryData); - - [JsonIgnore] - public int Id { get; set; } - public byte[] InquiryData { get; set; } - public virtual List EVPDPages { get; set; } - public bool SupportsModeSense6 { get; set; } - public bool SupportsModeSense10 { get; set; } - public bool SupportsModeSubpages { get; set; } - public virtual ScsiMode ModeSense { get; set; } - public virtual Mmc MultiMediaDevice { get; set; } - public virtual TestedMedia ReadCapabilities { get; set; } - public virtual List RemovableMedias { get; set; } - public virtual Ssc SequentialDevice { get; set; } - public byte[] ModeSense6Data { get; set; } - public byte[] ModeSense10Data { get; set; } - public byte[] ModeSense6CurrentData { get; set; } - public byte[] ModeSense10CurrentData { get; set; } - public byte[] ModeSense6ChangeableData { get; set; } - public byte[] ModeSense10ChangeableData { get; set; } - } - - public class ScsiMode - { - public ScsiMode() { } - - public ScsiMode(modeType mode) - { - if(mode.MediumTypeSpecified) MediumType = mode.MediumType; - WriteProtected = mode.WriteProtected; - if(mode.SpeedSpecified) Speed = mode.Speed; - if(mode.BufferedModeSpecified) BufferedMode = mode.BufferedMode; - BlankCheckEnabled = mode.BlankCheckEnabled; - DPOandFUA = mode.DPOandFUA; - - if(mode.ModePages != null) - { - ModePages = new List(); - foreach(modePageType modePage in mode.ModePages) ModePages.Add(new ScsiPage(modePage)); - } - - if(mode.BlockDescriptors == null) return; - - BlockDescriptors = new List(); - foreach(blockDescriptorType blockDescriptor in mode.BlockDescriptors) - BlockDescriptors.Add(new BlockDescriptor(blockDescriptor)); - } - - [JsonIgnore] - public int Id { get; set; } - public byte? MediumType { get; set; } - public bool WriteProtected { get; set; } - public virtual List BlockDescriptors { get; set; } - public byte? Speed { get; set; } - public byte? BufferedMode { get; set; } - public bool BlankCheckEnabled { get; set; } - public bool DPOandFUA { get; set; } - public virtual List ModePages { get; set; } - } - - public class BlockDescriptor - { - public BlockDescriptor() { } - - public BlockDescriptor(blockDescriptorType descriptor) - { - Density = descriptor.Density; - if(descriptor.BlocksSpecified) Blocks = descriptor.Blocks; - if(descriptor.BlockLengthSpecified) BlockLength = descriptor.BlockLength; - } - - [JsonIgnore] - public int Id { get; set; } - public byte Density { get; set; } - public ulong? Blocks { get; set; } - public uint? BlockLength { get; set; } - - [JsonIgnore] - public long? BlocksSql - { - get => (long?)Blocks; - set => Blocks = (ulong?)value; - } - [JsonIgnore] - public int? BlockLengthSql - { - get => (int?)BlockLength; - set => BlockLength = (uint?)value; - } - } - - public class ScsiPage - { - public ScsiPage() { } - - public ScsiPage(pageType evpdPage) - { - page = evpdPage.page; - value = evpdPage.value; - } - - public ScsiPage(modePageType modePage) - { - page = modePage.page; - subpage = modePage.subpage; - value = modePage.value; - } - - [JsonIgnore] - public int Id { get; set; } - public byte page { get; set; } - public byte? subpage { get; set; } - public byte[] value { get; set; } - } - - public class Mmc - { - public Mmc() { } - - public Mmc(mmcType mmc) - { - if(mmc.ModeSense2A != null) - ModeSense2AData = Modes.EncodeModePage_2A(new Modes.ModePage_2A - { - AccurateCDDA = mmc.ModeSense2A.AccurateCDDA, - BCK = mmc.ModeSense2A.BCK, - BufferSize = mmc.ModeSense2A.BufferSize, - BUF = mmc.ModeSense2A.BufferUnderRunProtection, - Eject = mmc.ModeSense2A.CanEject, - Lock = mmc.ModeSense2A.CanLockMedia, - CDDACommand = mmc.ModeSense2A.CDDACommand, - Composite = mmc.ModeSense2A.CompositeAudioVideo, - CMRSupported = - (ushort)(mmc.ModeSense2A.CSSandCPPMSupported - ? 1 - : 0), - CurrentSpeed = mmc.ModeSense2A.CurrentSpeed, - CurrentWriteSpeed = mmc.ModeSense2A.CurrentWriteSpeed, - CurrentWriteSpeedSelected = - mmc.ModeSense2A.CurrentWriteSpeedSelected, - SDP = mmc.ModeSense2A.DeterministicSlotChanger, - DigitalPort1 = mmc.ModeSense2A.DigitalPort1, - DigitalPort2 = mmc.ModeSense2A.DigitalPort2, - LeadInPW = mmc.ModeSense2A.LeadInPW, - LoadingMechanism = - mmc.ModeSense2A.LoadingMechanismType, - LockState = mmc.ModeSense2A.LockStatus, - LSBF = mmc.ModeSense2A.LSBF, - MaximumSpeed = mmc.ModeSense2A.MaximumSpeed, - MaxWriteSpeed = mmc.ModeSense2A.MaximumWriteSpeed, - AudioPlay = mmc.ModeSense2A.PlaysAudio, - PreventJumper = mmc.ModeSense2A.PreventJumperStatus, - RCK = mmc.ModeSense2A.RCK, - ReadBarcode = mmc.ModeSense2A.ReadsBarcode, - SCC = mmc.ModeSense2A.ReadsBothSides, - ReadCDR = mmc.ModeSense2A.ReadsCDR, - ReadCDRW = mmc.ModeSense2A.ReadsCDRW, - DeinterlaveSubchannel = - mmc.ModeSense2A.ReadsDeinterlavedSubchannel, - ReadDVDR = mmc.ModeSense2A.ReadsDVDR, - ReadDVDRAM = mmc.ModeSense2A.ReadsDVDRAM, - ReadDVDROM = mmc.ModeSense2A.ReadsDVDROM, - ISRC = mmc.ModeSense2A.ReadsISRC, - Mode2Form2 = mmc.ModeSense2A.ReadsMode2Form2, - Mode2Form1 = mmc.ModeSense2A.ReadsMode2Form1, - Method2 = mmc.ModeSense2A.ReadsPacketCDR, - Subchannel = mmc.ModeSense2A.ReadsSubchannel, - UPC = mmc.ModeSense2A.ReadsUPC, - C2Pointer = mmc.ModeSense2A.ReturnsC2Pointers, - RotationControlSelected = - mmc.ModeSense2A.RotationControlSelected, - SeparateChannelMute = - mmc.ModeSense2A.SeparateChannelMute, - SeparateChannelVolume = - mmc.ModeSense2A.SeparateChannelVolume, - SSS = mmc.ModeSense2A.SSS, - MultiSession = mmc.ModeSense2A.SupportsMultiSession, - SupportedVolumeLevels = - mmc.ModeSense2A.SupportedVolumeLevels, - TestWrite = mmc.ModeSense2A.TestWrite, - WriteCDR = mmc.ModeSense2A.WritesCDR, - WriteCDRW = mmc.ModeSense2A.WritesCDRW, - WriteDVDR = mmc.ModeSense2A.WritesDVDR, - WriteDVDRAM = mmc.ModeSense2A.WritesDVDRAM, - WriteSpeedPerformanceDescriptors = - mmc.ModeSense2A.WriteSpeedPerformanceDescriptors - }); - - if(mmc.Features != null) Features = new MmcFeatures(mmc.Features); - - if(mmc.TestedMedia == null) return; - - TestedMedia = new List(); - foreach(testedMediaType mediaType in mmc.TestedMedia) TestedMedia.Add(new TestedMedia(mediaType, false)); - } - - [JsonIgnore] - public int Id { get; set; } - public virtual Modes.ModePage_2A ModeSense2A => Modes.DecodeModePage_2A(ModeSense2AData); - public virtual MmcFeatures Features { get; set; } - public virtual List TestedMedia { get; set; } - public byte[] ModeSense2AData { get; set; } - } - - public class MmcFeatures - { - public MmcFeatures() { } - - public MmcFeatures(mmcFeaturesType features) - { - if(features.PhysicalInterfaceStandardSpecified && !features.PhysicalInterfaceStandardNumberSpecified) - PhysicalInterfaceStandardNumber = (uint?)features.PhysicalInterfaceStandard; - - if(features.PhysicalInterfaceStandardNumberSpecified) - PhysicalInterfaceStandardNumber = features.PhysicalInterfaceStandardNumber; - - if(features.AACSVersionSpecified) AACSVersion = features.AACSVersion; - - if(features.AGIDsSpecified) AGIDs = features.AGIDs; - - if(features.BindingNonceBlocksSpecified) BindingNonceBlocks = features.BindingNonceBlocks; - - if(features.CPRMVersionSpecified) CPRMVersion = features.CPRMVersion; - - if(features.CSSVersionSpecified) CSSVersion = features.CSSVersion; - - if(features.LoadingMechanismTypeSpecified) LoadingMechanismType = features.LoadingMechanismType; - - if(features.LogicalBlockSizeSpecified) LogicalBlockSize = features.LogicalBlockSize; - - if(features.BlocksPerReadableUnitSpecified) BlocksPerReadableUnit = features.BlocksPerReadableUnit; - - if(features.FirmwareDateSpecified) FirmwareDate = features.FirmwareDate; - - if(features.VolumeLevelsSpecified) VolumeLevels = features.VolumeLevels; - - BufferUnderrunFreeInDVD = features.BufferUnderrunFreeInDVD; - BufferUnderrunFreeInSAO = features.BufferUnderrunFreeInSAO; - BufferUnderrunFreeInTAO = features.BufferUnderrunFreeInTAO; - CanAudioScan = features.CanAudioScan; - CanEject = features.CanEject; - CanEraseSector = features.CanEraseSector; - CanExpandBDRESpareArea = features.CanExpandBDRESpareArea; - CanFormat = features.CanFormat; - CanFormatBDREWithoutSpare = features.CanFormatBDREWithoutSpare; - CanFormatCert = features.CanFormatCert; - CanFormatFRF = features.CanFormatFRF; - CanFormatQCert = features.CanFormatQCert; - CanFormatRRM = features.CanFormatRRM; - CanGenerateBindingNonce = features.CanGenerateBindingNonce; - CanLoad = features.CanLoad; - CanMuteSeparateChannels = features.CanMuteSeparateChannels; - CanOverwriteSAOTrack = features.CanOverwriteSAOTrack; - CanOverwriteTAOTrack = features.CanOverwriteTAOTrack; - CanPlayCDAudio = features.CanPlayCDAudio; - CanPseudoOverwriteBDR = features.CanPseudoOverwriteBDR; - CanReadAllDualR = features.CanReadAllDualR; - CanReadAllDualRW = features.CanReadAllDualRW; - CanReadBD = features.CanReadBD; - CanReadBDR = features.CanReadBDR; - CanReadBDRE1 = features.CanReadBDRE1; - CanReadBDRE2 = features.CanReadBDRE2; - CanReadBDROM = features.CanReadBDROM; - CanReadBluBCA = features.CanReadBluBCA; - CanReadCD = features.CanReadCD; - CanReadCDMRW = features.CanReadCDMRW; - CanReadCPRM_MKB = features.CanReadCPRM_MKB; - CanReadDDCD = features.CanReadDDCD; - CanReadDVD = features.CanReadDVD; - CanReadDVDPlusMRW = features.CanReadDVDPlusMRW; - CanReadDVDPlusR = features.CanReadDVDPlusR; - CanReadDVDPlusRDL = features.CanReadDVDPlusRDL; - CanReadDVDPlusRW = features.CanReadDVDPlusRW; - CanReadDVDPlusRWDL = features.CanReadDVDPlusRWDL; - CanReadDriveAACSCertificate = features.CanReadDriveAACSCertificate; - CanReadHDDVD = features.CanReadHDDVD; - CanReadHDDVDR = features.CanReadHDDVDR; - CanReadHDDVDRAM = features.CanReadHDDVDRAM; - CanReadLeadInCDText = features.CanReadLeadInCDText; - CanReadOldBDR = features.CanReadOldBDR; - CanReadOldBDRE = features.CanReadOldBDRE; - CanReadOldBDROM = features.CanReadOldBDROM; - CanReadSpareAreaInformation = features.CanReadSpareAreaInformation; - CanReportDriveSerial = features.CanReportDriveSerial; - CanReportMediaSerial = features.CanReportMediaSerial; - CanTestWriteDDCDR = features.CanTestWriteDDCDR; - CanTestWriteDVD = features.CanTestWriteDVD; - CanTestWriteInSAO = features.CanTestWriteInSAO; - CanTestWriteInTAO = features.CanTestWriteInTAO; - CanUpgradeFirmware = features.CanUpgradeFirmware; - CanWriteBD = features.CanWriteBD; - CanWriteBDR = features.CanWriteBDR; - CanWriteBDRE1 = features.CanWriteBDRE1; - CanWriteBDRE2 = features.CanWriteBDRE2; - CanWriteBusEncryptedBlocks = features.CanWriteBusEncryptedBlocks; - CanWriteCDMRW = features.CanWriteCDMRW; - CanWriteCDRW = features.CanWriteCDRW; - CanWriteCDRWCAV = features.CanWriteCDRWCAV; - CanWriteCDSAO = features.CanWriteCDSAO; - CanWriteCDTAO = features.CanWriteCDTAO; - CanWriteCSSManagedDVD = features.CanWriteCSSManagedDVD; - CanWriteDDCDR = features.CanWriteDDCDR; - CanWriteDDCDRW = features.CanWriteDDCDRW; - CanWriteDVDPlusMRW = features.CanWriteDVDPlusMRW; - CanWriteDVDPlusR = features.CanWriteDVDPlusR; - CanWriteDVDPlusRDL = features.CanWriteDVDPlusRDL; - CanWriteDVDPlusRW = features.CanWriteDVDPlusRW; - CanWriteDVDPlusRWDL = features.CanWriteDVDPlusRWDL; - CanWriteDVDR = features.CanWriteDVDR; - CanWriteDVDRDL = features.CanWriteDVDRDL; - CanWriteDVDRW = features.CanWriteDVDRW; - CanWriteHDDVDR = features.CanWriteHDDVDR; - CanWriteHDDVDRAM = features.CanWriteHDDVDRAM; - CanWriteOldBDR = features.CanWriteOldBDR; - CanWriteOldBDRE = features.CanWriteOldBDRE; - CanWritePackedSubchannelInTAO = features.CanWritePackedSubchannelInTAO; - CanWriteRWSubchannelInSAO = features.CanWriteRWSubchannelInSAO; - CanWriteRWSubchannelInTAO = features.CanWriteRWSubchannelInTAO; - CanWriteRaw = features.CanWriteRaw; - CanWriteRawMultiSession = features.CanWriteRawMultiSession; - CanWriteRawSubchannelInTAO = features.CanWriteRawSubchannelInTAO; - ChangerIsSideChangeCapable = features.ChangerIsSideChangeCapable; - ChangerSlots = features.ChangerSlots; - ChangerSupportsDiscPresent = features.ChangerSupportsDiscPresent; - DBML = features.DBML; - DVDMultiRead = features.DVDMultiRead; - EmbeddedChanger = features.EmbeddedChanger; - ErrorRecoveryPage = features.ErrorRecoveryPage; - Locked = features.Locked; - MultiRead = features.MultiRead; - PreventJumper = features.PreventJumper; - SupportsAACS = features.SupportsAACS; - SupportsBusEncryption = features.SupportsBusEncryption; - SupportsC2 = features.SupportsC2; - SupportsCPRM = features.SupportsCPRM; - SupportsCSS = features.SupportsCSS; - SupportsDAP = features.SupportsDAP; - SupportsDeviceBusyEvent = features.SupportsDeviceBusyEvent; - SupportsHybridDiscs = features.SupportsHybridDiscs; - SupportsModePage1Ch = features.SupportsModePage1Ch; - SupportsOSSC = features.SupportsOSSC; - SupportsPWP = features.SupportsPWP; - SupportsSWPP = features.SupportsSWPP; - SupportsSecurDisc = features.SupportsSecurDisc; - SupportsSeparateVolume = features.SupportsSeparateVolume; - SupportsVCPS = features.SupportsVCPS; - SupportsWriteInhibitDCB = features.SupportsWriteInhibitDCB; - SupportsWriteProtectPAC = features.SupportsWriteProtectPAC; - } - - [JsonIgnore] - public int Id { get; set; } - public byte? AACSVersion { get; set; } - public byte? AGIDs { get; set; } - public byte? BindingNonceBlocks { get; set; } - public ushort? BlocksPerReadableUnit { get; set; } - public bool BufferUnderrunFreeInDVD { get; set; } - public bool BufferUnderrunFreeInSAO { get; set; } - public bool BufferUnderrunFreeInTAO { get; set; } - public bool CanAudioScan { get; set; } - public bool CanEject { get; set; } - public bool CanEraseSector { get; set; } - public bool CanExpandBDRESpareArea { get; set; } - public bool CanFormat { get; set; } - public bool CanFormatBDREWithoutSpare { get; set; } - public bool CanFormatCert { get; set; } - public bool CanFormatFRF { get; set; } - public bool CanFormatQCert { get; set; } - public bool CanFormatRRM { get; set; } - public bool CanGenerateBindingNonce { get; set; } - public bool CanLoad { get; set; } - public bool CanMuteSeparateChannels { get; set; } - public bool CanOverwriteSAOTrack { get; set; } - public bool CanOverwriteTAOTrack { get; set; } - public bool CanPlayCDAudio { get; set; } - public bool CanPseudoOverwriteBDR { get; set; } - public bool CanReadAllDualR { get; set; } - public bool CanReadAllDualRW { get; set; } - public bool CanReadBD { get; set; } - public bool CanReadBDR { get; set; } - public bool CanReadBDRE1 { get; set; } - public bool CanReadBDRE2 { get; set; } - public bool CanReadBDROM { get; set; } - public bool CanReadBluBCA { get; set; } - public bool CanReadCD { get; set; } - public bool CanReadCDMRW { get; set; } - public bool CanReadCPRM_MKB { get; set; } - public bool CanReadDDCD { get; set; } - public bool CanReadDVD { get; set; } - public bool CanReadDVDPlusMRW { get; set; } - public bool CanReadDVDPlusR { get; set; } - public bool CanReadDVDPlusRDL { get; set; } - public bool CanReadDVDPlusRW { get; set; } - public bool CanReadDVDPlusRWDL { get; set; } - public bool CanReadDriveAACSCertificate { get; set; } - public bool CanReadHDDVD { get; set; } - public bool CanReadHDDVDR { get; set; } - public bool CanReadHDDVDRAM { get; set; } - public bool CanReadLeadInCDText { get; set; } - public bool CanReadOldBDR { get; set; } - public bool CanReadOldBDRE { get; set; } - public bool CanReadOldBDROM { get; set; } - public bool CanReadSpareAreaInformation { get; set; } - public bool CanReportDriveSerial { get; set; } - public bool CanReportMediaSerial { get; set; } - public bool CanTestWriteDDCDR { get; set; } - public bool CanTestWriteDVD { get; set; } - public bool CanTestWriteInSAO { get; set; } - public bool CanTestWriteInTAO { get; set; } - public bool CanUpgradeFirmware { get; set; } - public bool CanWriteBD { get; set; } - public bool CanWriteBDR { get; set; } - public bool CanWriteBDRE1 { get; set; } - public bool CanWriteBDRE2 { get; set; } - public bool CanWriteBusEncryptedBlocks { get; set; } - public bool CanWriteCDMRW { get; set; } - public bool CanWriteCDRW { get; set; } - public bool CanWriteCDRWCAV { get; set; } - public bool CanWriteCDSAO { get; set; } - public bool CanWriteCDTAO { get; set; } - public bool CanWriteCSSManagedDVD { get; set; } - public bool CanWriteDDCDR { get; set; } - public bool CanWriteDDCDRW { get; set; } - public bool CanWriteDVDPlusMRW { get; set; } - public bool CanWriteDVDPlusR { get; set; } - public bool CanWriteDVDPlusRDL { get; set; } - public bool CanWriteDVDPlusRW { get; set; } - public bool CanWriteDVDPlusRWDL { get; set; } - public bool CanWriteDVDR { get; set; } - public bool CanWriteDVDRDL { get; set; } - public bool CanWriteDVDRW { get; set; } - public bool CanWriteHDDVDR { get; set; } - public bool CanWriteHDDVDRAM { get; set; } - public bool CanWriteOldBDR { get; set; } - public bool CanWriteOldBDRE { get; set; } - public bool CanWritePackedSubchannelInTAO { get; set; } - public bool CanWriteRWSubchannelInSAO { get; set; } - public bool CanWriteRWSubchannelInTAO { get; set; } - public bool CanWriteRaw { get; set; } - public bool CanWriteRawMultiSession { get; set; } - public bool CanWriteRawSubchannelInTAO { get; set; } - public bool ChangerIsSideChangeCapable { get; set; } - public byte ChangerSlots { get; set; } - public bool ChangerSupportsDiscPresent { get; set; } - public byte? CPRMVersion { get; set; } - public byte? CSSVersion { get; set; } - public bool DBML { get; set; } - public bool DVDMultiRead { get; set; } - public bool EmbeddedChanger { get; set; } - public bool ErrorRecoveryPage { get; set; } - public DateTime? FirmwareDate { get; set; } - public byte? LoadingMechanismType { get; set; } - public bool Locked { get; set; } - public uint? LogicalBlockSize { get; set; } - public bool MultiRead { get; set; } - public PhysicalInterfaces? PhysicalInterfaceStandard => - (PhysicalInterfaces?)PhysicalInterfaceStandardNumber; - public uint? PhysicalInterfaceStandardNumber { get; set; } - public bool PreventJumper { get; set; } - public bool SupportsAACS { get; set; } - public bool SupportsBusEncryption { get; set; } - public bool SupportsC2 { get; set; } - public bool SupportsCPRM { get; set; } - public bool SupportsCSS { get; set; } - public bool SupportsDAP { get; set; } - public bool SupportsDeviceBusyEvent { get; set; } - public bool SupportsHybridDiscs { get; set; } - public bool SupportsModePage1Ch { get; set; } - public bool SupportsOSSC { get; set; } - public bool SupportsPWP { get; set; } - public bool SupportsSWPP { get; set; } - public bool SupportsSecurDisc { get; set; } - public bool SupportsSeparateVolume { get; set; } - public bool SupportsVCPS { get; set; } - public bool SupportsWriteInhibitDCB { get; set; } - public bool SupportsWriteProtectPAC { get; set; } - public ushort? VolumeLevels { get; set; } - public byte[] BinaryData { get; set; } - - [JsonIgnore] - public short? BlocksPerReadableUnitSql - { - get => (short?)BlocksPerReadableUnit; - set => BlocksPerReadableUnit = (ushort?)value; - } - [JsonIgnore] - public int? LogicalBlockSizeSql - { - get => (int?)LogicalBlockSize; - set => LogicalBlockSize = (uint?)value; - } - [JsonIgnore] - public int? PhysicalInterfaceStandardNumberSql - { - get => (int?)PhysicalInterfaceStandardNumber; - set => PhysicalInterfaceStandardNumber = (uint?)value; - } - [JsonIgnore] - public short? VolumeLevelsSql - { - get => (short?)VolumeLevels; - set => VolumeLevels = (ushort?)value; - } - } - - public class TestedMedia - { - public Identify.IdentifyDevice? IdentifyDevice; - - public TestedMedia() { } - - public TestedMedia(testedMediaType mediaType, bool ata) - { - if(mediaType.BlocksSpecified) Blocks = mediaType.Blocks; - - if(mediaType.BlockSizeSpecified) BlockSize = mediaType.BlockSize; - - if(mediaType.CanReadAACSSpecified) CanReadAACS = mediaType.CanReadAACS; - - if(mediaType.CanReadADIPSpecified) CanReadADIP = mediaType.CanReadADIP; - - if(mediaType.CanReadATIPSpecified) CanReadATIP = mediaType.CanReadATIP; - - if(mediaType.CanReadBCASpecified) CanReadBCA = mediaType.CanReadBCA; - - if(mediaType.CanReadC2PointersSpecified) CanReadC2Pointers = mediaType.CanReadC2Pointers; - - if(mediaType.CanReadCMISpecified) CanReadCMI = mediaType.CanReadCMI; - - if(mediaType.CanReadCorrectedSubchannelSpecified) - CanReadCorrectedSubchannel = mediaType.CanReadCorrectedSubchannel; - - if(mediaType.CanReadCorrectedSubchannelWithC2Specified) - CanReadCorrectedSubchannelWithC2 = mediaType.CanReadCorrectedSubchannelWithC2; - - if(mediaType.CanReadDCBSpecified) CanReadDCB = mediaType.CanReadDCB; - - if(mediaType.CanReadDDSSpecified) CanReadDDS = mediaType.CanReadDDS; - - if(mediaType.CanReadDMISpecified) CanReadDMI = mediaType.CanReadDMI; - - if(mediaType.CanReadDiscInformationSpecified) CanReadDiscInformation = mediaType.CanReadDiscInformation; - - if(mediaType.CanReadFullTOCSpecified) CanReadFullTOC = mediaType.CanReadFullTOC; - - if(mediaType.CanReadHDCMISpecified) CanReadHDCMI = mediaType.CanReadHDCMI; - - if(mediaType.CanReadLayerCapacitySpecified) CanReadLayerCapacity = mediaType.CanReadLayerCapacity; - - if(mediaType.CanReadLeadInSpecified) CanReadFirstTrackPreGap = mediaType.CanReadLeadIn; - - if(mediaType.CanReadLeadOutSpecified) CanReadLeadOut = mediaType.CanReadLeadOut; - - if(mediaType.CanReadMediaIDSpecified) CanReadMediaID = mediaType.CanReadMediaID; - - if(mediaType.CanReadMediaSerialSpecified) CanReadMediaSerial = mediaType.CanReadMediaSerial; - - if(mediaType.CanReadPACSpecified) CanReadPAC = mediaType.CanReadPAC; - - if(mediaType.CanReadPFISpecified) CanReadPFI = mediaType.CanReadPFI; - - if(mediaType.CanReadPMASpecified) CanReadPMA = mediaType.CanReadPMA; - - if(mediaType.CanReadPQSubchannelSpecified) CanReadPQSubchannel = mediaType.CanReadPQSubchannel; - - if(mediaType.CanReadPQSubchannelWithC2Specified) - CanReadPQSubchannelWithC2 = mediaType.CanReadPQSubchannelWithC2; - - if(mediaType.CanReadPRISpecified) CanReadPRI = mediaType.CanReadPRI; - - if(mediaType.CanReadRWSubchannelSpecified) CanReadRWSubchannel = mediaType.CanReadRWSubchannel; - - if(mediaType.CanReadRWSubchannelWithC2Specified) - CanReadRWSubchannelWithC2 = mediaType.CanReadRWSubchannelWithC2; - - if(mediaType.CanReadRecordablePFISpecified) CanReadRecordablePFI = mediaType.CanReadRecordablePFI; - - if(mediaType.CanReadSpareAreaInformationSpecified) - CanReadSpareAreaInformation = mediaType.CanReadSpareAreaInformation; - - if(mediaType.CanReadTOCSpecified) CanReadTOC = mediaType.CanReadTOC; - - if(mediaType.DensitySpecified) Density = mediaType.Density; - - if(mediaType.LongBlockSizeSpecified) LongBlockSize = mediaType.LongBlockSize; - - if(mediaType.ManufacturerSpecified) Manufacturer = mediaType.Manufacturer; - - if(mediaType.MediumTypeSpecified) MediumType = mediaType.MediumType; - - if(mediaType.ModelSpecified) Model = mediaType.Model; - - if(mediaType.SupportsHLDTSTReadRawDVDSpecified) - SupportsHLDTSTReadRawDVD = mediaType.SupportsHLDTSTReadRawDVD; - - if(mediaType.SupportsNECReadCDDASpecified) SupportsNECReadCDDA = mediaType.SupportsNECReadCDDA; - - if(mediaType.SupportsPioneerReadCDDASpecified) SupportsPioneerReadCDDA = mediaType.SupportsPioneerReadCDDA; - - if(mediaType.SupportsPioneerReadCDDAMSFSpecified) - SupportsPioneerReadCDDAMSF = mediaType.SupportsPioneerReadCDDAMSF; - - if(mediaType.SupportsPlextorReadCDDASpecified) SupportsPlextorReadCDDA = mediaType.SupportsPlextorReadCDDA; - - if(mediaType.SupportsPlextorReadRawDVDSpecified) - SupportsPlextorReadRawDVD = mediaType.SupportsPlextorReadRawDVD; - - if(mediaType.SupportsRead10Specified) SupportsRead10 = mediaType.SupportsRead10; - - if(mediaType.SupportsRead12Specified) SupportsRead12 = mediaType.SupportsRead12; - - if(mediaType.SupportsRead16Specified) SupportsRead16 = mediaType.SupportsRead16; - - if(mediaType.SupportsReadSpecified) - { - if(ata) SupportsReadSectors = mediaType.SupportsRead; - else SupportsRead6 = mediaType.SupportsRead; - } - - if(mediaType.SupportsReadCapacity16Specified) SupportsReadCapacity16 = mediaType.SupportsReadCapacity16; - - if(mediaType.SupportsReadCapacitySpecified) SupportsReadCapacity = mediaType.SupportsReadCapacity; - - if(mediaType.SupportsReadCdSpecified) SupportsReadCd = mediaType.SupportsReadCd; - - if(mediaType.SupportsReadCdMsfSpecified) SupportsReadCdMsf = mediaType.SupportsReadCdMsf; - - if(mediaType.SupportsReadCdRawSpecified) SupportsReadCdRaw = mediaType.SupportsReadCdRaw; - - if(mediaType.SupportsReadCdMsfRawSpecified) SupportsReadCdMsfRaw = mediaType.SupportsReadCdMsfRaw; - - if(mediaType.SupportsReadLong16Specified) SupportsReadLong16 = mediaType.SupportsReadLong16; - - if(mediaType.SupportsReadLongSpecified) SupportsReadLong = mediaType.SupportsReadLong; - - if(mediaType.LBASectorsSpecified) LBASectors = mediaType.LBASectors; - - if(mediaType.LBA48SectorsSpecified) LBA48Sectors = mediaType.LBA48Sectors; - - if(mediaType.LogicalAlignmentSpecified) LogicalAlignment = mediaType.LogicalAlignment; - - if(mediaType.NominalRotationRateSpecified) NominalRotationRate = mediaType.NominalRotationRate; - - if(mediaType.PhysicalBlockSizeSpecified) PhysicalBlockSize = mediaType.PhysicalBlockSize; - - if(mediaType.SolidStateDeviceSpecified) SolidStateDevice = mediaType.SolidStateDevice; - - if(mediaType.UnformattedBPTSpecified) UnformattedBPT = mediaType.UnformattedBPT; - - if(mediaType.UnformattedBPSSpecified) UnformattedBPS = mediaType.UnformattedBPS; - - if(mediaType.SupportsReadDmaLbaSpecified) SupportsReadDmaLba = mediaType.SupportsReadDmaLba; - - if(mediaType.SupportsReadDmaRetryLbaSpecified) SupportsReadDmaRetryLba = mediaType.SupportsReadDmaRetryLba; - - if(mediaType.SupportsReadLbaSpecified) SupportsReadLba = mediaType.SupportsReadLba; - - if(mediaType.SupportsReadRetryLbaSpecified) SupportsReadRetryLba = mediaType.SupportsReadRetryLba; - - if(mediaType.SupportsReadLongLbaSpecified) SupportsReadLongLba = mediaType.SupportsReadLongLba; - - if(mediaType.SupportsReadLongRetryLbaSpecified) - SupportsReadLongRetryLba = mediaType.SupportsReadLongRetryLba; - - if(mediaType.SupportsSeekLbaSpecified) SupportsSeekLba = mediaType.SupportsSeekLba; - - if(mediaType.SupportsReadDmaLba48Specified) SupportsReadDmaLba48 = mediaType.SupportsReadDmaLba48; - - if(mediaType.SupportsReadLba48Specified) SupportsReadLba48 = mediaType.SupportsReadLba48; - - if(mediaType.SupportsReadDmaSpecified) SupportsReadDma = mediaType.SupportsReadDma; - - if(mediaType.SupportsReadDmaRetrySpecified) SupportsReadDmaRetry = mediaType.SupportsReadDmaRetry; - - if(mediaType.SupportsReadRetrySpecified) SupportsReadRetry = mediaType.SupportsReadRetry; - - if(mediaType.SupportsReadLongRetrySpecified) SupportsReadLongRetry = mediaType.SupportsReadLongRetry; - - if(mediaType.SupportsSeekSpecified) SupportsSeek = mediaType.SupportsSeek; - - if(mediaType.CHS != null) CHS = new Chs(mediaType.CHS); - if(mediaType.CurrentCHS != null) CurrentCHS = new Chs(mediaType.CurrentCHS); - - MediaIsRecognized = mediaType.MediaIsRecognized; - MediumTypeName = mediaType.MediumTypeName; - ModeSense6Data = mediaType.ModeSense6Data; - ModeSense10Data = mediaType.ModeSense10Data; - } - - [JsonIgnore] - public int Id { get; set; } - public byte[] IdentifyData { get; set; } - public ulong? Blocks { get; set; } - public uint? BlockSize { get; set; } - public bool? CanReadAACS { get; set; } - public bool? CanReadADIP { get; set; } - public bool? CanReadATIP { get; set; } - public bool? CanReadBCA { get; set; } - public bool? CanReadC2Pointers { get; set; } - public bool? CanReadCMI { get; set; } - public bool? CanReadCorrectedSubchannel { get; set; } - public bool? CanReadCorrectedSubchannelWithC2 { get; set; } - public bool? CanReadDCB { get; set; } - public bool? CanReadDDS { get; set; } - public bool? CanReadDMI { get; set; } - public bool? CanReadDiscInformation { get; set; } - public bool? CanReadFullTOC { get; set; } - public bool? CanReadHDCMI { get; set; } - public bool? CanReadLayerCapacity { get; set; } - public bool? CanReadFirstTrackPreGap { get; set; } - public bool? CanReadLeadIn { get; set; } - public bool? CanReadLeadOut { get; set; } - public bool? CanReadMediaID { get; set; } - public bool? CanReadMediaSerial { get; set; } - public bool? CanReadPAC { get; set; } - public bool? CanReadPFI { get; set; } - public bool? CanReadPMA { get; set; } - public bool? CanReadPQSubchannel { get; set; } - public bool? CanReadPQSubchannelWithC2 { get; set; } - public bool? CanReadPRI { get; set; } - public bool? CanReadRWSubchannel { get; set; } - public bool? CanReadRWSubchannelWithC2 { get; set; } - public bool? CanReadRecordablePFI { get; set; } - public bool? CanReadSpareAreaInformation { get; set; } - public bool? CanReadTOC { get; set; } - public byte? Density { get; set; } - public uint? LongBlockSize { get; set; } - public string Manufacturer { get; set; } - public bool MediaIsRecognized { get; set; } - public byte? MediumType { get; set; } - public string MediumTypeName { get; set; } - public string Model { get; set; } - public bool? SupportsHLDTSTReadRawDVD { get; set; } - public bool? SupportsNECReadCDDA { get; set; } - public bool? SupportsPioneerReadCDDA { get; set; } - public bool? SupportsPioneerReadCDDAMSF { get; set; } - public bool? SupportsPlextorReadCDDA { get; set; } - public bool? SupportsPlextorReadRawDVD { get; set; } - public bool? SupportsRead10 { get; set; } - public bool? SupportsRead12 { get; set; } - public bool? SupportsRead16 { get; set; } - public bool? SupportsRead6 { get; set; } - public bool? SupportsReadCapacity16 { get; set; } - public bool? SupportsReadCapacity { get; set; } - public bool? SupportsReadCd { get; set; } - public bool? SupportsReadCdMsf { get; set; } - public bool? SupportsReadCdRaw { get; set; } - public bool? SupportsReadCdMsfRaw { get; set; } - public bool? SupportsReadLong16 { get; set; } - public bool? SupportsReadLong { get; set; } - - public byte[] ModeSense6Data { get; set; } - public byte[] ModeSense10Data { get; set; } - - public virtual Chs CHS { get; set; } - public virtual Chs CurrentCHS { get; set; } - public uint? LBASectors { get; set; } - public ulong? LBA48Sectors { get; set; } - public ushort? LogicalAlignment { get; set; } - public ushort? NominalRotationRate { get; set; } - public uint? PhysicalBlockSize { get; set; } - public bool? SolidStateDevice { get; set; } - public ushort? UnformattedBPT { get; set; } - public ushort? UnformattedBPS { get; set; } - - public bool? SupportsReadDmaLba { get; set; } - public bool? SupportsReadDmaRetryLba { get; set; } - public bool? SupportsReadLba { get; set; } - public bool? SupportsReadRetryLba { get; set; } - public bool? SupportsReadLongLba { get; set; } - public bool? SupportsReadLongRetryLba { get; set; } - public bool? SupportsSeekLba { get; set; } - - public bool? SupportsReadDmaLba48 { get; set; } - public bool? SupportsReadLba48 { get; set; } - - public bool? SupportsReadDma { get; set; } - public bool? SupportsReadDmaRetry { get; set; } - public bool? SupportsReadRetry { get; set; } - public bool? SupportsReadSectors { get; set; } - public bool? SupportsReadLongRetry { get; set; } - public bool? SupportsSeek { get; set; } - - public bool? CanReadingIntersessionLeadIn { get; set; } - public bool? CanReadingIntersessionLeadOut { get; set; } - public byte[] IntersessionLeadInData { get; set; } - public byte[] IntersessionLeadOutData { get; set; } - - [JsonIgnore] - public long? BlocksSql - { - get => (long?)Blocks; - set => Blocks = (ulong?)value; - } - [JsonIgnore] - public int? BlockSizeSql - { - get => (int?)BlockSize; - set => BlockSize = (uint?)value; - } - [JsonIgnore] - public int? LongBlockSizeSql - { - get => (int?)LongBlockSize; - set => LongBlockSize = (uint?)value; - } - [JsonIgnore] - public int? LBASectorsSql - { - get => (int?)LBASectors; - set => LBASectors = (uint?)value; - } - [JsonIgnore] - public long? LBA48SectorsSql - { - get => (long?)LBA48Sectors; - set => LBA48Sectors = (ulong?)value; - } - [JsonIgnore] - public short? LogicalAlignmentSql - { - get => (short?)LogicalAlignment; - set => LogicalAlignment = (ushort?)value; - } - [JsonIgnore] - public short? NominalRotationRateSql - { - get => (short?)NominalRotationRate; - set => NominalRotationRate = (ushort?)value; - } - [JsonIgnore] - public int? PhysicalBlockSizeSql - { - get => (int?)PhysicalBlockSize; - set => PhysicalBlockSize = (uint?)value; - } - [JsonIgnore] - public short? UnformattedBPTSql - { - get => (short?)UnformattedBPT; - set => UnformattedBPT = (ushort?)value; - } - [JsonIgnore] - public short? UnformattedBPSSql - { - get => (short?)UnformattedBPS; - set => UnformattedBPS = (ushort?)value; - } - - #region SCSI data - public byte[] Read6Data { get; set; } - public byte[] Read10Data { get; set; } - public byte[] Read12Data { get; set; } - public byte[] Read16Data { get; set; } - public byte[] ReadLong10Data { get; set; } - public byte[] ReadLong16Data { get; set; } - #endregion - - #region ATA data - public byte[] ReadSectorsData { get; set; } - public byte[] ReadSectorsRetryData { get; set; } - public byte[] ReadDmaData { get; set; } - public byte[] ReadDmaRetryData { get; set; } - public byte[] ReadLbaData { get; set; } - public byte[] ReadRetryLbaData { get; set; } - public byte[] ReadDmaLbaData { get; set; } - public byte[] ReadDmaRetryLbaData { get; set; } - public byte[] ReadLba48Data { get; set; } - public byte[] ReadDmaLba48Data { get; set; } - public byte[] ReadLongData { get; set; } - public byte[] ReadLongRetryData { get; set; } - public byte[] ReadLongLbaData { get; set; } - public byte[] ReadLongRetryLbaData { get; set; } - #endregion - - #region CompactDisc data - public byte[] TocData { get; set; } - public byte[] FullTocData { get; set; } - public byte[] AtipData { get; set; } - public byte[] PmaData { get; set; } - public byte[] ReadCdData { get; set; } - public byte[] ReadCdMsfData { get; set; } - public byte[] ReadCdFullData { get; set; } - public byte[] ReadCdMsfFullData { get; set; } - public byte[] Track1PregapData { get; set; } - public byte[] LeadInData { get; set; } - public byte[] LeadOutData { get; set; } - public byte[] C2PointersData { get; set; } - public byte[] PQSubchannelData { get; set; } - public byte[] RWSubchannelData { get; set; } - public byte[] CorrectedSubchannelData { get; set; } - public byte[] PQSubchannelWithC2Data { get; set; } - public byte[] RWSubchannelWithC2Data { get; set; } - public byte[] CorrectedSubchannelWithC2Data { get; set; } - #endregion - - #region DVD data - public byte[] PfiData { get; set; } - public byte[] DmiData { get; set; } - public byte[] CmiData { get; set; } - public byte[] DvdBcaData { get; set; } - public byte[] DvdAacsData { get; set; } - public byte[] DvdDdsData { get; set; } - public byte[] DvdSaiData { get; set; } - public byte[] PriData { get; set; } - public byte[] EmbossedPfiData { get; set; } - public byte[] AdipData { get; set; } - public byte[] DcbData { get; set; } - public byte[] HdCmiData { get; set; } - public byte[] DvdLayerData { get; set; } - #endregion - - #region Blu-ray data - public byte[] BluBcaData { get; set; } - public byte[] BluDdsData { get; set; } - public byte[] BluSaiData { get; set; } - public byte[] BluDiData { get; set; } - public byte[] BluPacData { get; set; } - #endregion - - #region Vendor data - public byte[] PlextorReadCddaData { get; set; } - public byte[] PioneerReadCddaData { get; set; } - public byte[] PioneerReadCddaMsfData { get; set; } - public byte[] NecReadCddaData { get; set; } - public byte[] PlextorReadRawDVDData { get; set; } - public byte[] HLDTSTReadRawDVDData { get; set; } - #endregion - } - - public class Ssc - { - public Ssc() { } - - public Ssc(sscType ssc) - { - if(ssc.BlockSizeGranularitySpecified) BlockSizeGranularity = ssc.BlockSizeGranularity; - if(ssc.MaxBlockLengthSpecified) MaxBlockLength = ssc.MaxBlockLength; - if(ssc.MinBlockLengthSpecified) MinBlockLength = ssc.MinBlockLength; - - if(ssc.SupportedDensities != null) SupportedDensities = new List(ssc.SupportedDensities); - - if(ssc.SupportedMediaTypes != null) - { - SupportedMediaTypes = new List(); - foreach(SupportedMedia mediaType in ssc.SupportedMediaTypes) - SupportedMediaTypes.Add(new SscSupportedMedia(mediaType)); - } - - if(ssc.TestedMedia == null) return; - - TestedMedia = new List(); - foreach(SequentialMedia testedMedia in ssc.TestedMedia) - TestedMedia.Add(new TestedSequentialMedia(testedMedia)); - } - - [JsonIgnore] - public int Id { get; set; } - public byte? BlockSizeGranularity { get; set; } - public uint? MaxBlockLength { get; set; } - public uint? MinBlockLength { get; set; } - - public virtual List SupportedDensities { get; set; } - public virtual List SupportedMediaTypes { get; set; } - public virtual List TestedMedia { get; set; } - [JsonIgnore] - public int? MaxBlockLengthSql - { - get => (int?)MaxBlockLength; - set => MaxBlockLength = (uint?)value; - } - [JsonIgnore] - public int? MinBlockLengthSql - { - get => (int?)MinBlockLength; - set => MinBlockLength = (uint?)value; - } - } - - public class TestedSequentialMedia - { - public TestedSequentialMedia() { } - - public TestedSequentialMedia(SequentialMedia media) - { - if(media.CanReadMediaSerialSpecified) CanReadMediaSerial = media.CanReadMediaSerial; - if(media.DensitySpecified) Density = media.Density; - Manufacturer = media.Manufacturer; - MediaIsRecognized = media.MediaIsRecognized; - if(media.MediumTypeSpecified) MediumType = media.MediumType; - MediumTypeName = media.MediumTypeName; - Model = media.Model; - if(media.SupportedDensities != null) - SupportedDensities = new List(media.SupportedDensities); - - if(media.SupportedMediaTypes != null) - { - SupportedMediaTypes = new List(); - foreach(SupportedMedia supportedMedia in media.SupportedMediaTypes) - SupportedMediaTypes.Add(new SscSupportedMedia(supportedMedia)); - } - - ModeSense6Data = media.ModeSense6Data; - ModeSense10Data = media.ModeSense10Data; - } - - [JsonIgnore] - public int Id { get; set; } - public bool? CanReadMediaSerial { get; set; } - public byte? Density { get; set; } - public string Manufacturer { get; set; } - public bool MediaIsRecognized { get; set; } - public byte? MediumType { get; set; } - public string MediumTypeName { get; set; } - public string Model { get; set; } - public virtual List SupportedDensities { get; set; } - public virtual List SupportedMediaTypes { get; set; } - - public byte[] ModeSense6Data { get; set; } - public byte[] ModeSense10Data { get; set; } - } - - public class Pcmcia - { - public string[] AdditionalInformation; - - public Pcmcia() { } - - public Pcmcia(pcmciaType pcmcia) - { - AdditionalInformation = pcmcia.AdditionalInformation; - CIS = pcmcia.CIS; - Compliance = pcmcia.Compliance; - if(pcmcia.ManufacturerCodeSpecified) ManufacturerCode = pcmcia.ManufacturerCode; - if(pcmcia.CardCodeSpecified) CardCode = pcmcia.CardCode; - Manufacturer = pcmcia.Manufacturer; - ProductName = pcmcia.ProductName; - } - - [JsonIgnore] - public int Id { get; set; } - public byte[] CIS { get; set; } - public string Compliance { get; set; } - public ushort? ManufacturerCode { get; set; } - public ushort? CardCode { get; set; } - public string Manufacturer { get; set; } - public string ProductName { get; set; } - [JsonIgnore] - public short? ManufacturerCodeSql - { - get => (short?)ManufacturerCode; - set => ManufacturerCode = (ushort?)value; - } - [JsonIgnore] - public short? CardCodeSql - { - get => (short?)CardCode; - set => CardCode = (ushort?)value; - } - } - - public class MmcSd - { - public MmcSd() { } - - public MmcSd(mmcsdType mmcSd) - { - CID = mmcSd.CID; - CSD = mmcSd.CSD; - OCR = mmcSd.OCR; - SCR = mmcSd.SCR; - ExtendedCSD = mmcSd.ExtendedCSD; - } - - [JsonIgnore] - public int Id { get; set; } - public byte[] CID { get; set; } - public byte[] CSD { get; set; } - public byte[] OCR { get; set; } - public byte[] SCR { get; set; } - public byte[] ExtendedCSD { get; set; } - } - - public class SscSupportedMedia - { - public SscSupportedMedia() { } - - public SscSupportedMedia(SupportedMedia media) - { - MediumType = media.MediumType; - Width = media.Width; - Length = media.Length; - Organization = media.Organization; - Name = media.Name; - Description = media.Description; - if(media.DensityCodes == null) return; - - DensityCodes = new List(); - foreach(int densityCode in media.DensityCodes) DensityCodes.Add(new DensityCode {Code = densityCode}); - } - - [JsonIgnore] - public int Id { get; set; } - public byte MediumType { get; set; } - public virtual List DensityCodes { get; set; } - public ushort Width { get; set; } - public ushort Length { get; set; } - public string Organization { get; set; } - public string Name { get; set; } - public string Description { get; set; } - [JsonIgnore] - public short WidthSql - { - get => (short)Width; - set => Width = (ushort)value; - } - [JsonIgnore] - public short LengthSql - { - get => (short)Length; - set => Length = (ushort)value; - } - } - - public class DensityCode : IEquatable - { - [JsonIgnore] - [Key] - public int Id { get; set; } - - public int Code { get; set; } - - public bool Equals(DensityCode other) - { - if(ReferenceEquals(null, other)) return false; - if(ReferenceEquals(this, other)) return true; - - return Code == other.Code; - } - - public override bool Equals(object obj) - { - if(ReferenceEquals(null, obj)) return false; - if(ReferenceEquals(this, obj)) return true; - - return obj.GetType() == GetType() && Equals((DensityCode)obj); - } - - public override int GetHashCode() => Code; - } -} \ No newline at end of file diff --git a/DiscImageChef.CommonTypes/Metadata/Dimensions.cs b/DiscImageChef.CommonTypes/Metadata/Dimensions.cs deleted file mode 100644 index 55372a481..000000000 --- a/DiscImageChef.CommonTypes/Metadata/Dimensions.cs +++ /dev/null @@ -1,956 +0,0 @@ -// /*************************************************************************** -// The Disc Image Chef -// ---------------------------------------------------------------------------- -// -// Filename : Dimensions.cs -// Author(s) : Natalia Portillo -// -// Component : XML metadata. -// -// --[ Description ] ---------------------------------------------------------- -// -// Gets physical dimensions of a device/media based on its media type. -// -// --[ 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 Schemas; - -namespace DiscImageChef.CommonTypes.Metadata -{ - public static class Dimensions - { - public static DimensionsType DimensionsFromMediaType(CommonTypes.MediaType dskType) - { - DimensionsType dmns = new DimensionsType(); - - switch(dskType) - { - #region 5.25" floppy disk - case CommonTypes.MediaType.Apple32SS: - case CommonTypes.MediaType.Apple32DS: - case CommonTypes.MediaType.Apple33SS: - case CommonTypes.MediaType.Apple33DS: - case CommonTypes.MediaType.AppleFileWare: - case CommonTypes.MediaType.DOS_525_SS_DD_8: - case CommonTypes.MediaType.DOS_525_SS_DD_9: - case CommonTypes.MediaType.DOS_525_DS_DD_8: - case CommonTypes.MediaType.DOS_525_DS_DD_9: - case CommonTypes.MediaType.DOS_525_HD: - case CommonTypes.MediaType.XDF_525: - case CommonTypes.MediaType.ACORN_525_SS_SD_40: - case CommonTypes.MediaType.ACORN_525_SS_SD_80: - case CommonTypes.MediaType.ACORN_525_SS_DD_40: - case CommonTypes.MediaType.ACORN_525_SS_DD_80: - case CommonTypes.MediaType.ACORN_525_DS_DD: - case CommonTypes.MediaType.ATARI_525_SD: - case CommonTypes.MediaType.ATARI_525_ED: - case CommonTypes.MediaType.ATARI_525_DD: - case CommonTypes.MediaType.CBM_1540: - case CommonTypes.MediaType.CBM_1540_Ext: - case CommonTypes.MediaType.CBM_1571: - case CommonTypes.MediaType.ECMA_66: - case CommonTypes.MediaType.ECMA_70: - case CommonTypes.MediaType.NEC_525_HD: - case CommonTypes.MediaType.ECMA_78: - case CommonTypes.MediaType.ECMA_78_2: - case CommonTypes.MediaType.ECMA_99_8: - case CommonTypes.MediaType.ECMA_99_15: - case CommonTypes.MediaType.ECMA_99_26: - case CommonTypes.MediaType.FDFORMAT_525_DD: - case CommonTypes.MediaType.FDFORMAT_525_HD: - // According to ECMA-99 et al - dmns.Height = 133.3; - dmns.HeightSpecified = true; - dmns.Width = 133.3; - dmns.WidthSpecified = true; - dmns.Thickness = 1.65; - return dmns; - #endregion 5.25" floppy disk - - #region 3.5" floppy disk - case CommonTypes.MediaType.AppleSonySS: - case CommonTypes.MediaType.AppleSonyDS: - case CommonTypes.MediaType.DOS_35_SS_DD_8: - case CommonTypes.MediaType.DOS_35_SS_DD_9: - case CommonTypes.MediaType.DOS_35_DS_DD_8: - case CommonTypes.MediaType.DOS_35_DS_DD_9: - case CommonTypes.MediaType.DOS_35_HD: - case CommonTypes.MediaType.DOS_35_ED: - case CommonTypes.MediaType.DMF: - case CommonTypes.MediaType.DMF_82: - case CommonTypes.MediaType.XDF_35: - case CommonTypes.MediaType.ACORN_35_DS_DD: - case CommonTypes.MediaType.CBM_35_DD: - case CommonTypes.MediaType.CBM_AMIGA_35_DD: - case CommonTypes.MediaType.CBM_AMIGA_35_HD: - case CommonTypes.MediaType.FDFORMAT_35_DD: - case CommonTypes.MediaType.FDFORMAT_35_HD: - case CommonTypes.MediaType.NEC_35_HD_8: - case CommonTypes.MediaType.NEC_35_HD_15: - case CommonTypes.MediaType.Floptical: - case CommonTypes.MediaType.HiFD: - case CommonTypes.MediaType.UHD144: - case CommonTypes.MediaType.Apricot_35: - case CommonTypes.MediaType.FD32MB: - // According to ECMA-100 et al - dmns.Height = 94; - dmns.HeightSpecified = true; - dmns.Width = 90; - dmns.WidthSpecified = true; - dmns.Thickness = 3.3; - return dmns; - #endregion 3.5" floppy disk - - #region 8" floppy disk - case CommonTypes.MediaType.IBM23FD: - case CommonTypes.MediaType.IBM33FD_128: - case CommonTypes.MediaType.IBM33FD_256: - case CommonTypes.MediaType.IBM33FD_512: - case CommonTypes.MediaType.IBM43FD_128: - case CommonTypes.MediaType.IBM43FD_256: - case CommonTypes.MediaType.IBM53FD_256: - case CommonTypes.MediaType.IBM53FD_512: - case CommonTypes.MediaType.IBM53FD_1024: - case CommonTypes.MediaType.RX01: - case CommonTypes.MediaType.RX02: - case CommonTypes.MediaType.NEC_8_SD: - case CommonTypes.MediaType.NEC_8_DD: - case CommonTypes.MediaType.ECMA_54: - case CommonTypes.MediaType.ECMA_59: - case CommonTypes.MediaType.ECMA_69_8: - case CommonTypes.MediaType.ECMA_69_15: - case CommonTypes.MediaType.ECMA_69_26: - // According to ECMA-59 et al - dmns.Height = 203.2; - dmns.HeightSpecified = true; - dmns.Width = 203.2; - dmns.WidthSpecified = true; - dmns.Thickness = 1.65; - return dmns; - #endregion 8" floppy disk - - #region 356mm magneto optical - case CommonTypes.MediaType.ECMA_260: - case CommonTypes.MediaType.ECMA_260_Double: - // According to ECMA-260 et al - dmns.Height = 421.84; - dmns.HeightSpecified = true; - dmns.Width = 443.76; - dmns.WidthSpecified = true; - dmns.Thickness = 25.4; - return dmns; - #endregion 356mm magneto optical - - #region 300mm magneto optical - case CommonTypes.MediaType.ECMA_189: - case CommonTypes.MediaType.ECMA_190: - case CommonTypes.MediaType.ECMA_317: - // According to ECMA-317 et al - dmns.Height = 340; - dmns.HeightSpecified = true; - dmns.Width = 320; - dmns.WidthSpecified = true; - dmns.Thickness = 17; - return dmns; - #endregion 300mm magneto optical - - #region 5.25" magneto optical - case CommonTypes.MediaType.ECMA_153: - case CommonTypes.MediaType.ECMA_153_512: - case CommonTypes.MediaType.ECMA_183_512: - case CommonTypes.MediaType.ECMA_183: - case CommonTypes.MediaType.ECMA_184_512: - case CommonTypes.MediaType.ECMA_184: - case CommonTypes.MediaType.ECMA_195: - case CommonTypes.MediaType.ECMA_195_512: - case CommonTypes.MediaType.ECMA_238: - case CommonTypes.MediaType.ECMA_280: - case CommonTypes.MediaType.ECMA_322: - case CommonTypes.MediaType.ECMA_322_2k: - case CommonTypes.MediaType.UDO: - case CommonTypes.MediaType.UDO2: - case CommonTypes.MediaType.UDO2_WORM: - // According to ECMA-183 et al - dmns.Height = 153; - dmns.HeightSpecified = true; - dmns.Width = 135; - dmns.WidthSpecified = true; - dmns.Thickness = 11; - return dmns; - #endregion 5.25" magneto optical - - #region 3.5" magneto optical - case CommonTypes.MediaType.ECMA_154: - case CommonTypes.MediaType.ECMA_201: - case CommonTypes.MediaType.ECMA_201_ROM: - case CommonTypes.MediaType.ECMA_223: - case CommonTypes.MediaType.ECMA_223_512: - case CommonTypes.MediaType.GigaMo: - case CommonTypes.MediaType.GigaMo2: - // According to ECMA-154 et al - dmns.Height = 94; - dmns.HeightSpecified = true; - dmns.Width = 90; - dmns.WidthSpecified = true; - dmns.Thickness = 6; - return dmns; - #endregion 3.5" magneto optical - - case CommonTypes.MediaType.PD650: - case CommonTypes.MediaType.PD650_WORM: - dmns.Height = 135; - dmns.HeightSpecified = true; - dmns.Width = 124; - dmns.WidthSpecified = true; - dmns.Thickness = 7.8; - return dmns; - case CommonTypes.MediaType.ECMA_239: - dmns.Height = 97; - dmns.HeightSpecified = true; - dmns.Width = 92; - dmns.WidthSpecified = true; - dmns.Thickness = 5; - return dmns; - case CommonTypes.MediaType.MMCmicro: - dmns.Height = 14; - dmns.HeightSpecified = true; - dmns.Width = 12; - dmns.WidthSpecified = true; - dmns.Thickness = 1.1; - return dmns; - case CommonTypes.MediaType.MemoryStickMicro: - dmns.Height = 15; - dmns.HeightSpecified = true; - dmns.Width = 12.5; - dmns.WidthSpecified = true; - dmns.Thickness = 1.2; - return dmns; - case CommonTypes.MediaType.microSD: - dmns.Height = 11; - dmns.HeightSpecified = true; - dmns.Width = 15; - dmns.WidthSpecified = true; - dmns.Thickness = 1; - return dmns; - case CommonTypes.MediaType.miniSD: - dmns.Height = 21.5; - dmns.HeightSpecified = true; - dmns.Width = 20; - dmns.WidthSpecified = true; - dmns.Thickness = 1.4; - return dmns; - case CommonTypes.MediaType.QIC3010: - case CommonTypes.MediaType.QIC3020: - case CommonTypes.MediaType.QIC3080: - case CommonTypes.MediaType.QIC3095: - case CommonTypes.MediaType.QIC320: - case CommonTypes.MediaType.QIC40: - case CommonTypes.MediaType.QIC80: - dmns.Height = 20; - dmns.HeightSpecified = true; - dmns.Width = 21.5; - dmns.WidthSpecified = true; - dmns.Thickness = 1.6; - return dmns; - case CommonTypes.MediaType.RSMMC: - dmns.Height = 18; - dmns.HeightSpecified = true; - dmns.Width = 24; - dmns.WidthSpecified = true; - dmns.Thickness = 1.4; - return dmns; - case CommonTypes.MediaType.MMC: - dmns.Height = 32; - dmns.HeightSpecified = true; - dmns.Width = 24; - dmns.WidthSpecified = true; - dmns.Thickness = 1.4; - return dmns; - case CommonTypes.MediaType.SecureDigital: - dmns.Height = 32; - dmns.HeightSpecified = true; - dmns.Width = 24; - dmns.WidthSpecified = true; - dmns.Thickness = 2.1; - return dmns; - case CommonTypes.MediaType.xD: - dmns.Height = 20; - dmns.HeightSpecified = true; - dmns.Width = 25; - dmns.WidthSpecified = true; - dmns.Thickness = 1.78; - return dmns; - case CommonTypes.MediaType.XQD: - dmns.Height = 38.5; - dmns.HeightSpecified = true; - dmns.Width = 29.8; - dmns.WidthSpecified = true; - dmns.Thickness = 3.8; - return dmns; - case CommonTypes.MediaType.MemoryStickDuo: - case CommonTypes.MediaType.MemoryStickProDuo: - dmns.Height = 20; - dmns.HeightSpecified = true; - dmns.Width = 31; - dmns.WidthSpecified = true; - dmns.Thickness = 1.6; - return dmns; - case CommonTypes.MediaType.Nintendo3DSGameCard: - case CommonTypes.MediaType.NintendoDSGameCard: - case CommonTypes.MediaType.NintendoDSiGameCard: - dmns.Height = 35; - dmns.HeightSpecified = true; - dmns.Width = 33; - dmns.WidthSpecified = true; - dmns.Thickness = 3.8; - return dmns; - case CommonTypes.MediaType.DataPlay: - dmns.Height = 42; - dmns.HeightSpecified = true; - dmns.Width = 33.5; - dmns.WidthSpecified = true; - dmns.Thickness = 3; - return dmns; - case CommonTypes.MediaType.Microdrive: - dmns.Height = 44; - dmns.HeightSpecified = true; - dmns.Width = 34; - dmns.WidthSpecified = true; - dmns.Thickness = 8; - return dmns; - case CommonTypes.MediaType.ExpressCard34: - dmns.Height = 75; - dmns.HeightSpecified = true; - dmns.Width = 34; - dmns.WidthSpecified = true; - dmns.Thickness = 5; - return dmns; - case CommonTypes.MediaType.SmartMedia: - dmns.Height = 45; - dmns.HeightSpecified = true; - dmns.Width = 37; - dmns.WidthSpecified = true; - dmns.Thickness = 0.76; - return dmns; - case CommonTypes.MediaType.MiniCard: - dmns.Height = 45; - dmns.HeightSpecified = true; - dmns.Width = 37; - dmns.WidthSpecified = true; - dmns.Thickness = 3.5; - return dmns; - case CommonTypes.MediaType.PlayStationMemoryCard: - case CommonTypes.MediaType.PlayStationMemoryCard2: - dmns.Height = 55.7; - dmns.HeightSpecified = true; - dmns.Width = 41.5; - dmns.WidthSpecified = true; - dmns.Thickness = 7; - return dmns; - case CommonTypes.MediaType.CFast: - case CommonTypes.MediaType.CompactFlash: - dmns.Height = 36; - dmns.HeightSpecified = true; - dmns.Width = 43; - dmns.WidthSpecified = true; - dmns.Thickness = 3.3; - return dmns; - case CommonTypes.MediaType.CompactFlashType2: - dmns.Height = 36; - dmns.HeightSpecified = true; - dmns.Width = 43; - dmns.WidthSpecified = true; - dmns.Thickness = 5; - return dmns; - case CommonTypes.MediaType.ZXMicrodrive: - dmns.Height = 36; - dmns.HeightSpecified = true; - dmns.Width = 43; - dmns.WidthSpecified = true; - dmns.Thickness = 5; - return dmns; - case CommonTypes.MediaType.MemoryStick: - case CommonTypes.MediaType.MemoryStickPro: - dmns.Height = 21; - dmns.HeightSpecified = true; - dmns.Width = 50; - dmns.WidthSpecified = true; - dmns.Thickness = 2.6; - return dmns; - case CommonTypes.MediaType.PocketZip: - dmns.Height = 54.5; - dmns.HeightSpecified = true; - dmns.Width = 50; - dmns.WidthSpecified = true; - dmns.Thickness = 2; - return dmns; - case CommonTypes.MediaType.ExpressCard54: - dmns.Height = 75; - dmns.HeightSpecified = true; - dmns.Width = 54; - dmns.WidthSpecified = true; - dmns.Thickness = 5; - return dmns; - case CommonTypes.MediaType.PCCardTypeI: - dmns.Height = 85.6; - dmns.HeightSpecified = true; - dmns.Width = 54; - dmns.WidthSpecified = true; - dmns.Thickness = 3.3; - return dmns; - case CommonTypes.MediaType.PCCardTypeII: - dmns.Height = 85.6; - dmns.HeightSpecified = true; - dmns.Width = 54; - dmns.WidthSpecified = true; - dmns.Thickness = 5; - return dmns; - case CommonTypes.MediaType.PCCardTypeIII: - dmns.Height = 85.6; - dmns.HeightSpecified = true; - dmns.Width = 54; - dmns.WidthSpecified = true; - dmns.Thickness = 10.5; - return dmns; - case CommonTypes.MediaType.PCCardTypeIV: - dmns.Height = 85.6; - dmns.HeightSpecified = true; - dmns.Width = 54; - dmns.WidthSpecified = true; - dmns.Thickness = 16; - return dmns; - case CommonTypes.MediaType.DataStore: - dmns.Height = 86.5; - dmns.HeightSpecified = true; - dmns.Width = 54; - dmns.WidthSpecified = true; - dmns.Thickness = 2.5; - return dmns; - case CommonTypes.MediaType.VideoFloppy: - dmns.Height = 54; - dmns.HeightSpecified = true; - dmns.Width = 60; - dmns.WidthSpecified = true; - dmns.Thickness = 3.5; - return dmns; - case CommonTypes.MediaType.VXA1: - case CommonTypes.MediaType.VXA2: - case CommonTypes.MediaType.VXA3: - dmns.Height = 95; - dmns.HeightSpecified = true; - dmns.Width = 62.5; - dmns.WidthSpecified = true; - dmns.Thickness = 15; - return dmns; - case CommonTypes.MediaType.MiniDV: - dmns.Height = 47.5; - dmns.HeightSpecified = true; - dmns.Width = 66; - dmns.WidthSpecified = true; - dmns.Thickness = 12; - return dmns; - case CommonTypes.MediaType.Wafer: - dmns.Height = 46.8; - dmns.HeightSpecified = true; - dmns.Width = 67.1; - dmns.WidthSpecified = true; - dmns.Thickness = 7.9; - return dmns; - case CommonTypes.MediaType.NintendoDiskCard: - dmns.Height = 76.2; - dmns.HeightSpecified = true; - dmns.Width = 71.12; - dmns.WidthSpecified = true; - dmns.Thickness = 0; - return dmns; - case CommonTypes.MediaType.HiMD: - case CommonTypes.MediaType.MD: - case CommonTypes.MediaType.MDData: - case CommonTypes.MediaType.MDData2: - dmns.Height = 68; - dmns.HeightSpecified = true; - dmns.Width = 71.5; - dmns.WidthSpecified = true; - dmns.Thickness = 4.8; - return dmns; - case CommonTypes.MediaType.DAT160: - case CommonTypes.MediaType.DAT320: - case CommonTypes.MediaType.DAT72: - case CommonTypes.MediaType.DDS1: - case CommonTypes.MediaType.DDS2: - case CommonTypes.MediaType.DDS3: - case CommonTypes.MediaType.DDS4: - case CommonTypes.MediaType.DigitalAudioTape: - dmns.Height = 54; - dmns.HeightSpecified = true; - dmns.Width = 73; - dmns.WidthSpecified = true; - dmns.Thickness = 10.5; - return dmns; - case CommonTypes.MediaType.CompactFloppy: - dmns.Height = 100; - dmns.HeightSpecified = true; - dmns.Width = 80; - dmns.WidthSpecified = true; - dmns.Thickness = 5; - return dmns; - case CommonTypes.MediaType.DECtapeII: - dmns.Height = 60; - dmns.HeightSpecified = true; - dmns.Width = 81; - dmns.WidthSpecified = true; - dmns.Thickness = 13; - return dmns; - case CommonTypes.MediaType.Ditto: - dmns.Height = 60; - dmns.HeightSpecified = true; - dmns.Width = 81; - dmns.WidthSpecified = true; - dmns.Thickness = 14; - return dmns; - case CommonTypes.MediaType.DittoMax: - dmns.Height = 126; - dmns.HeightSpecified = true; - dmns.Width = 81; - dmns.WidthSpecified = true; - dmns.Thickness = 14; - return dmns; - case CommonTypes.MediaType.RDX: - case CommonTypes.MediaType.RDX320: - dmns.Height = 119; - dmns.HeightSpecified = true; - dmns.Width = 87; - dmns.WidthSpecified = true; - dmns.Thickness = 23; - return dmns; - case CommonTypes.MediaType.LS120: - case CommonTypes.MediaType.LS240: - dmns.Height = 94; - dmns.HeightSpecified = true; - dmns.Width = 90; - dmns.WidthSpecified = true; - dmns.Thickness = 3.5; - return dmns; - case CommonTypes.MediaType.Travan: - case CommonTypes.MediaType.Travan3: - case CommonTypes.MediaType.Travan4: - case CommonTypes.MediaType.Travan5: - case CommonTypes.MediaType.Travan7: - dmns.Height = 72; - dmns.HeightSpecified = true; - dmns.Width = 92; - dmns.WidthSpecified = true; - dmns.Thickness = 15; - return dmns; - case CommonTypes.MediaType.Travan1Ex: - dmns.Height = 0; - dmns.HeightSpecified = true; - dmns.Width = 92; - dmns.WidthSpecified = true; - dmns.Thickness = 15; - return dmns; - case CommonTypes.MediaType.Travan3Ex: - dmns.Height = 0; - dmns.HeightSpecified = true; - dmns.Width = 92; - dmns.WidthSpecified = true; - dmns.Thickness = 15; - return dmns; - case CommonTypes.MediaType.ADR2120: - case CommonTypes.MediaType.ADR260: - case CommonTypes.MediaType.ADR30: - case CommonTypes.MediaType.ADR50: - dmns.Height = 129; - dmns.HeightSpecified = true; - dmns.Width = 93; - dmns.WidthSpecified = true; - dmns.Thickness = 14.5; - return dmns; - case CommonTypes.MediaType.Data8: - case CommonTypes.MediaType.AIT1: - case CommonTypes.MediaType.AIT1Turbo: - case CommonTypes.MediaType.AIT2: - case CommonTypes.MediaType.AIT2Turbo: - case CommonTypes.MediaType.AIT3: - case CommonTypes.MediaType.AIT3Ex: - case CommonTypes.MediaType.AIT3Turbo: - case CommonTypes.MediaType.AIT4: - case CommonTypes.MediaType.AIT5: - case CommonTypes.MediaType.AITETurbo: - case CommonTypes.MediaType.Exatape106m: - case CommonTypes.MediaType.Exatape160mXL: - case CommonTypes.MediaType.Exatape112m: - case CommonTypes.MediaType.Exatape125m: - case CommonTypes.MediaType.Exatape150m: - case CommonTypes.MediaType.Exatape15m: - case CommonTypes.MediaType.Exatape170m: - case CommonTypes.MediaType.Exatape225m: - case CommonTypes.MediaType.Exatape22m: - case CommonTypes.MediaType.Exatape22mAME: - case CommonTypes.MediaType.Exatape28m: - case CommonTypes.MediaType.Exatape40m: - case CommonTypes.MediaType.Exatape45m: - case CommonTypes.MediaType.Exatape54m: - case CommonTypes.MediaType.Exatape75m: - case CommonTypes.MediaType.Exatape76m: - case CommonTypes.MediaType.Exatape80m: - dmns.Height = 62.5; - dmns.HeightSpecified = true; - dmns.Width = 95; - dmns.WidthSpecified = true; - dmns.Thickness = 15; - return dmns; - case CommonTypes.MediaType.EZ135: - case CommonTypes.MediaType.EZ230: - dmns.Height = 97; - dmns.HeightSpecified = true; - dmns.Width = 98; - dmns.WidthSpecified = true; - dmns.Thickness = 9.5; - return dmns; - case CommonTypes.MediaType.ZIP100: - case CommonTypes.MediaType.ZIP250: - case CommonTypes.MediaType.ZIP750: - dmns.Height = 98.5; - dmns.HeightSpecified = true; - dmns.Width = 98; - dmns.WidthSpecified = true; - dmns.Thickness = 6.5; - return dmns; - case CommonTypes.MediaType.Jaz: - case CommonTypes.MediaType.Jaz2: - dmns.Height = 102; - dmns.HeightSpecified = true; - dmns.Width = 98; - dmns.WidthSpecified = true; - dmns.Thickness = 12; - return dmns; - case CommonTypes.MediaType.Orb: - case CommonTypes.MediaType.Orb5: - dmns.Height = 104; - dmns.HeightSpecified = true; - dmns.Width = 98; - dmns.WidthSpecified = true; - dmns.Thickness = 8; - return dmns; - case CommonTypes.MediaType.SparQ: - dmns.Height = 98; - dmns.HeightSpecified = true; - dmns.Width = 100; - dmns.WidthSpecified = true; - dmns.Thickness = 9.7; - return dmns; - case CommonTypes.MediaType.SLR1: - case CommonTypes.MediaType.SLR2: - case CommonTypes.MediaType.SLR3: - case CommonTypes.MediaType.SLR32: - case CommonTypes.MediaType.SLR32SL: - case CommonTypes.MediaType.SLR4: - case CommonTypes.MediaType.SLR5: - case CommonTypes.MediaType.SLR5SL: - case CommonTypes.MediaType.SLR6: - case CommonTypes.MediaType.SLRtape100: - case CommonTypes.MediaType.SLRtape140: - case CommonTypes.MediaType.SLRtape24: - case CommonTypes.MediaType.SLRtape24SL: - case CommonTypes.MediaType.SLRtape40: - case CommonTypes.MediaType.SLRtape50: - case CommonTypes.MediaType.SLRtape60: - case CommonTypes.MediaType.SLRtape7: - case CommonTypes.MediaType.SLRtape75: - case CommonTypes.MediaType.SLRtape7SL: - dmns.Height = 150; - dmns.HeightSpecified = true; - dmns.Width = 100; - dmns.WidthSpecified = true; - dmns.Thickness = 18; - return dmns; - case CommonTypes.MediaType.N64DD: - dmns.Height = 103.124; - dmns.HeightSpecified = true; - dmns.Width = 101.092; - dmns.WidthSpecified = true; - dmns.Thickness = 10.16; - return dmns; - case CommonTypes.MediaType.CompactTapeI: - case CommonTypes.MediaType.CompactTapeII: - case CommonTypes.MediaType.DLTtapeIII: - case CommonTypes.MediaType.DLTtapeIIIxt: - case CommonTypes.MediaType.DLTtapeIV: - case CommonTypes.MediaType.DLTtapeS4: - case CommonTypes.MediaType.SDLT1: - case CommonTypes.MediaType.SDLT2: - case CommonTypes.MediaType.VStapeI: - dmns.Height = 105; - dmns.HeightSpecified = true; - dmns.Width = 105; - dmns.WidthSpecified = true; - dmns.Thickness = 25; - return dmns; - case CommonTypes.MediaType.LTO: - case CommonTypes.MediaType.LTO2: - case CommonTypes.MediaType.LTO3: - case CommonTypes.MediaType.LTO3WORM: - case CommonTypes.MediaType.LTO4: - case CommonTypes.MediaType.LTO4WORM: - case CommonTypes.MediaType.LTO5: - case CommonTypes.MediaType.LTO5WORM: - case CommonTypes.MediaType.LTO6: - case CommonTypes.MediaType.LTO6WORM: - case CommonTypes.MediaType.LTO7: - case CommonTypes.MediaType.LTO7WORM: - dmns.Height = 101.6; - dmns.HeightSpecified = true; - dmns.Width = 105.41; - dmns.WidthSpecified = true; - dmns.Thickness = 21.59; - return dmns; - case CommonTypes.MediaType.IBM3480: - case CommonTypes.MediaType.IBM3490: - case CommonTypes.MediaType.IBM3490E: - case CommonTypes.MediaType.IBM3592: - dmns.Height = 125.73; - dmns.HeightSpecified = true; - dmns.Width = 107.95; - dmns.WidthSpecified = true; - dmns.Thickness = 25.4; - return dmns; - case CommonTypes.MediaType.T9840A: - case CommonTypes.MediaType.T9840B: - case CommonTypes.MediaType.T9840C: - case CommonTypes.MediaType.T9840D: - case CommonTypes.MediaType.T9940A: - case CommonTypes.MediaType.T9940B: - dmns.Height = 124.46; - dmns.HeightSpecified = true; - dmns.Width = 109.22; - dmns.WidthSpecified = true; - dmns.Thickness = 25.4; - return dmns; - case CommonTypes.MediaType.CompactCassette: - case CommonTypes.MediaType.Dcas25: - case CommonTypes.MediaType.Dcas85: - case CommonTypes.MediaType.Dcas103: - dmns.Height = 63.5; - dmns.HeightSpecified = true; - dmns.Width = 128; - dmns.WidthSpecified = true; - dmns.Thickness = 12; - return dmns; - case CommonTypes.MediaType.IBM3470: - dmns.Height = 58.42; - dmns.HeightSpecified = true; - dmns.Width = 137.16; - dmns.WidthSpecified = true; - dmns.Thickness = 16.51; - return dmns; - case CommonTypes.MediaType.Bernoulli2: - dmns.Height = 136; - dmns.HeightSpecified = true; - dmns.Width = 140; - dmns.WidthSpecified = true; - dmns.Thickness = 9; - return dmns; - case CommonTypes.MediaType.MLR1: - case CommonTypes.MediaType.MLR3: - case CommonTypes.MediaType.MLR1SL: - dmns.Height = 101.6; - dmns.HeightSpecified = true; - dmns.Width = 152.4; - dmns.WidthSpecified = true; - dmns.Thickness = 15.24; - return dmns; - case CommonTypes.MediaType.QIC11: - case CommonTypes.MediaType.QIC120: - case CommonTypes.MediaType.QIC1350: - case CommonTypes.MediaType.QIC150: - case CommonTypes.MediaType.QIC24: - case CommonTypes.MediaType.QIC525: - dmns.Height = 101.6; - dmns.HeightSpecified = true; - dmns.Width = 154.2; - dmns.WidthSpecified = true; - dmns.Thickness = 16.6; - return dmns; - case CommonTypes.MediaType.Bernoulli: - dmns.Height = 275; - dmns.HeightSpecified = true; - dmns.Width = 210; - dmns.WidthSpecified = true; - dmns.Thickness = 0; - return dmns; - case CommonTypes.MediaType.DTF: - case CommonTypes.MediaType.DTF2: - dmns.Height = 144.78; - dmns.HeightSpecified = true; - dmns.Width = 254; - dmns.WidthSpecified = true; - dmns.Thickness = 25.4; - return dmns; - case CommonTypes.MediaType.LD: - case CommonTypes.MediaType.LDROM: - case CommonTypes.MediaType.LDROM2: - case CommonTypes.MediaType.MegaLD: - case CommonTypes.MediaType.LVROM: - dmns.Diameter = 300; - dmns.DiameterSpecified = true; - dmns.Thickness = 2.5; - return dmns; - case CommonTypes.MediaType.REV35: - case CommonTypes.MediaType.REV70: - case CommonTypes.MediaType.REV120: - dmns.Height = 74.8; - dmns.HeightSpecified = true; - dmns.Width = 76.8; - dmns.WidthSpecified = true; - dmns.Thickness = 10; - return dmns; - - #region CD/DVD/BD - case CommonTypes.MediaType.CDDA: - case CommonTypes.MediaType.CDG: - case CommonTypes.MediaType.CDEG: - case CommonTypes.MediaType.CDI: - case CommonTypes.MediaType.CDROM: - case CommonTypes.MediaType.CDROMXA: - case CommonTypes.MediaType.CDPLUS: - case CommonTypes.MediaType.CDMO: - case CommonTypes.MediaType.CDR: - case CommonTypes.MediaType.CDRW: - case CommonTypes.MediaType.CDMRW: - case CommonTypes.MediaType.VCD: - case CommonTypes.MediaType.SVCD: - case CommonTypes.MediaType.PCD: - case CommonTypes.MediaType.SACD: - case CommonTypes.MediaType.DDCD: - case CommonTypes.MediaType.DDCDR: - case CommonTypes.MediaType.DDCDRW: - case CommonTypes.MediaType.DTSCD: - case CommonTypes.MediaType.CDMIDI: - case CommonTypes.MediaType.CDV: - case CommonTypes.MediaType.CD: - case CommonTypes.MediaType.DVDROM: - case CommonTypes.MediaType.DVDR: - case CommonTypes.MediaType.DVDRW: - case CommonTypes.MediaType.DVDPR: - case CommonTypes.MediaType.DVDPRW: - case CommonTypes.MediaType.DVDPRWDL: - case CommonTypes.MediaType.DVDRDL: - case CommonTypes.MediaType.DVDPRDL: - case CommonTypes.MediaType.DVDRAM: - case CommonTypes.MediaType.DVDRWDL: - case CommonTypes.MediaType.DVDDownload: - case CommonTypes.MediaType.HDDVDROM: - case CommonTypes.MediaType.HDDVDRAM: - case CommonTypes.MediaType.HDDVDR: - case CommonTypes.MediaType.HDDVDRW: - case CommonTypes.MediaType.HDDVDRDL: - case CommonTypes.MediaType.HDDVDRWDL: - case CommonTypes.MediaType.BDROM: - case CommonTypes.MediaType.BDR: - case CommonTypes.MediaType.BDRE: - case CommonTypes.MediaType.BDRXL: - case CommonTypes.MediaType.BDREXL: - case CommonTypes.MediaType.PS1CD: - case CommonTypes.MediaType.PS2CD: - case CommonTypes.MediaType.PS2DVD: - case CommonTypes.MediaType.PS3DVD: - case CommonTypes.MediaType.PS3BD: - case CommonTypes.MediaType.PS4BD: - case CommonTypes.MediaType.XGD: - case CommonTypes.MediaType.XGD2: - case CommonTypes.MediaType.XGD3: - case CommonTypes.MediaType.XGD4: - case CommonTypes.MediaType.MEGACD: - case CommonTypes.MediaType.SATURNCD: - case CommonTypes.MediaType.GDROM: - case CommonTypes.MediaType.GDR: - case CommonTypes.MediaType.SuperCDROM2: - case CommonTypes.MediaType.JaguarCD: - case CommonTypes.MediaType.ThreeDO: - case CommonTypes.MediaType.WOD: - case CommonTypes.MediaType.WUOD: - case CommonTypes.MediaType.PCFX: - case CommonTypes.MediaType.CDIREADY: - case CommonTypes.MediaType.FMTOWNS: - case CommonTypes.MediaType.CDTV: - case CommonTypes.MediaType.CD32: - case CommonTypes.MediaType.Nuon: - case CommonTypes.MediaType.Playdia: - case CommonTypes.MediaType.Pippin: - case CommonTypes.MediaType.MilCD: - dmns.Diameter = 120; - dmns.DiameterSpecified = true; - dmns.Thickness = 1.2; - return dmns; - case CommonTypes.MediaType.GOD: - dmns.Diameter = 80; - dmns.DiameterSpecified = true; - dmns.Thickness = 1.2; - return dmns; - case CommonTypes.MediaType.VideoNow: - dmns.Diameter = 85; - dmns.DiameterSpecified = true; - dmns.Thickness = 1.2; - return dmns; - case CommonTypes.MediaType.VideoNowColor: - case CommonTypes.MediaType.VideoNowXp: - dmns.Diameter = 108; - dmns.DiameterSpecified = true; - dmns.Thickness = 1.2; - return dmns; - #endregion CD/DVD/BD - - #region Apple Hard Disks - // TODO: Find Apple Widget size - case CommonTypes.MediaType.AppleProfile: - dmns.Height = 223.8; - dmns.HeightSpecified = true; - dmns.Width = 438.9; - dmns.WidthSpecified = true; - dmns.Thickness = 111.5; - return dmns; - case CommonTypes.MediaType.AppleHD20: - dmns.Height = 246.4; - dmns.HeightSpecified = true; - dmns.Width = 266.7; - dmns.WidthSpecified = true; - dmns.Thickness = 78.7; - return dmns; - #endregion Apple Hard Disks - - case CommonTypes.MediaType.UMD: - dmns.Height = 64; - dmns.HeightSpecified = true; - dmns.Width = 63; - dmns.WidthSpecified = true; - dmns.Thickness = 4; - return dmns; - default: return null; - } - } - } -} \ No newline at end of file diff --git a/DiscImageChef.CommonTypes/Metadata/MediaType.cs b/DiscImageChef.CommonTypes/Metadata/MediaType.cs deleted file mode 100644 index 728956af7..000000000 --- a/DiscImageChef.CommonTypes/Metadata/MediaType.cs +++ /dev/null @@ -1,1883 +0,0 @@ -// /*************************************************************************** -// The Disc Image Chef -// ---------------------------------------------------------------------------- -// -// Filename : MediaType.cs -// Author(s) : Natalia Portillo -// -// Component : XML metadata. -// -// --[ Description ] ---------------------------------------------------------- -// -// Converts a common media type to the XML equivalent. -// -// --[ 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 -// ****************************************************************************/ - -namespace DiscImageChef.CommonTypes.Metadata -{ - public static class MediaType - { - public static void MediaTypeToString(CommonTypes.MediaType dskType, out string discType, out string discSubType) - { - switch(dskType) - { - case CommonTypes.MediaType.BDR: - discType = "Blu-ray"; - discSubType = "BD-R"; - break; - case CommonTypes.MediaType.BDRE: - discType = "Blu-ray"; - discSubType = "BD-RE"; - break; - case CommonTypes.MediaType.BDREXL: - discType = "Blu-ray"; - discSubType = "BD-RE XL"; - break; - case CommonTypes.MediaType.BDROM: - discType = "Blu-ray"; - discSubType = "BD-ROM"; - break; - case CommonTypes.MediaType.BDRXL: - discType = "Blu-ray"; - discSubType = "BD-R XL"; - break; - case CommonTypes.MediaType.CBHD: - discType = "Blu-ray"; - discSubType = "CBHD"; - break; - case CommonTypes.MediaType.CD: - discType = "Compact Disc"; - discSubType = "CD"; - break; - case CommonTypes.MediaType.CDDA: - discType = "Compact Disc"; - discSubType = "CD Digital Audio"; - break; - case CommonTypes.MediaType.CDEG: - discType = "Compact Disc"; - discSubType = "CD+EG"; - break; - case CommonTypes.MediaType.CDG: - discType = "Compact Disc"; - discSubType = "CD+G"; - break; - case CommonTypes.MediaType.CDI: - discType = "Compact Disc"; - discSubType = "CD-i"; - break; - case CommonTypes.MediaType.CDIREADY: - discType = "Compact Disc"; - discSubType = "CD-i Ready"; - break; - case CommonTypes.MediaType.CDMIDI: - discType = "Compact Disc"; - discSubType = "CD+MIDI"; - break; - case CommonTypes.MediaType.CDMO: - discType = "Compact Disc"; - discSubType = "CD-MO"; - break; - case CommonTypes.MediaType.CDMRW: - discType = "Compact Disc"; - discSubType = "CD-MRW"; - break; - case CommonTypes.MediaType.CDPLUS: - discType = "Compact Disc"; - discSubType = "CD+"; - break; - case CommonTypes.MediaType.CDR: - discType = "Compact Disc"; - discSubType = "CD-R"; - break; - case CommonTypes.MediaType.CDROM: - discType = "Compact Disc"; - discSubType = "CD-ROM"; - break; - case CommonTypes.MediaType.CDROMXA: - discType = "Compact Disc"; - discSubType = "CD-ROM XA"; - break; - case CommonTypes.MediaType.CDRW: - discType = "Compact Disc"; - discSubType = "CD-RW"; - break; - case CommonTypes.MediaType.CDV: - discType = "Compact Disc"; - discSubType = "CD-Video"; - break; - case CommonTypes.MediaType.DDCD: - discType = "DDCD"; - discSubType = "DDCD"; - break; - case CommonTypes.MediaType.DDCDR: - discType = "DDCD"; - discSubType = "DDCD-R"; - break; - case CommonTypes.MediaType.DDCDRW: - discType = "DDCD"; - discSubType = "DDCD-RW"; - break; - case CommonTypes.MediaType.DTSCD: - discType = "Compact Disc"; - discSubType = "DTS CD"; - break; - case CommonTypes.MediaType.DVDDownload: - discType = "DVD"; - discSubType = "DVD-Download"; - break; - case CommonTypes.MediaType.DVDPR: - discType = "DVD"; - discSubType = "DVD+R"; - break; - case CommonTypes.MediaType.DVDPRDL: - discType = "DVD"; - discSubType = "DVD+R DL"; - break; - case CommonTypes.MediaType.DVDPRW: - discType = "DVD"; - discSubType = "DVD+RW"; - break; - case CommonTypes.MediaType.DVDPRWDL: - discType = "DVD"; - discSubType = "DVD+RW DL"; - break; - case CommonTypes.MediaType.DVDR: - discType = "DVD"; - discSubType = "DVD-R"; - break; - case CommonTypes.MediaType.DVDRAM: - discType = "DVD"; - discSubType = "DVD-RAM"; - break; - case CommonTypes.MediaType.DVDRDL: - discType = "DVD"; - discSubType = "DVD-R DL"; - break; - case CommonTypes.MediaType.DVDROM: - discType = "DVD"; - discSubType = "DVD-ROM"; - break; - case CommonTypes.MediaType.DVDRW: - discType = "DVD"; - discSubType = "DVD-RW"; - break; - case CommonTypes.MediaType.DVDRWDL: - discType = "DVD"; - discSubType = "DVD-RW DL"; - break; - case CommonTypes.MediaType.EVD: - discType = "EVD"; - discSubType = "EVD"; - break; - case CommonTypes.MediaType.FDDVD: - discType = "FDDVD"; - discSubType = "FDDVD"; - break; - case CommonTypes.MediaType.FVD: - discType = "FVD"; - discSubType = "FVD"; - break; - case CommonTypes.MediaType.GDR: - discType = "GD"; - discSubType = "GD-R"; - break; - case CommonTypes.MediaType.GDROM: - discType = "GD"; - discSubType = "GD-ROM"; - break; - case CommonTypes.MediaType.GOD: - discType = "DVD"; - discSubType = "GameCube Game Disc"; - break; - case CommonTypes.MediaType.WOD: - discType = "DVD"; - discSubType = "Wii Optical Disc"; - break; - case CommonTypes.MediaType.WUOD: - discType = "Blu-ray"; - discSubType = "Wii U Optical Disc"; - break; - case CommonTypes.MediaType.HDDVDR: - discType = "HD DVD"; - discSubType = "HD DVD-R"; - break; - case CommonTypes.MediaType.HDDVDRAM: - discType = "HD DVD"; - discSubType = "HD DVD-RAM"; - break; - case CommonTypes.MediaType.HDDVDRDL: - discType = "HD DVD"; - discSubType = "HD DVD-R DL"; - break; - case CommonTypes.MediaType.HDDVDROM: - discType = "HD DVD"; - discSubType = "HD DVD-ROM"; - break; - case CommonTypes.MediaType.HDDVDRW: - discType = "HD DVD"; - discSubType = "HD DVD-RW"; - break; - case CommonTypes.MediaType.HDDVDRWDL: - discType = "HD DVD"; - discSubType = "HD DVD-RW DL"; - break; - case CommonTypes.MediaType.HDVMD: - discType = "HD VMD"; - discSubType = "HD VMD"; - break; - case CommonTypes.MediaType.HiMD: - discType = "MiniDisc"; - discSubType = "HiMD"; - break; - case CommonTypes.MediaType.HVD: - discType = "HVD"; - discSubType = "HVD"; - break; - case CommonTypes.MediaType.LD: - discType = "LaserDisc"; - discSubType = "LaserDisc"; - break; - case CommonTypes.MediaType.LDROM: - discType = "LaserDisc"; - discSubType = "LD-ROM"; - break; - case CommonTypes.MediaType.LVROM: - discType = "LaserDisc"; - discSubType = "LV-ROM"; - break; - case CommonTypes.MediaType.MegaLD: - discType = "LaserDisc"; - discSubType = "MegaLD"; - break; - case CommonTypes.MediaType.MD: - discType = "MiniDisc"; - discSubType = "MiniDisc"; - break; - case CommonTypes.MediaType.MEGACD: - discType = "Compact Disc"; - discSubType = "Sega Mega CD"; - break; - case CommonTypes.MediaType.PCD: - discType = "Compact Disc"; - discSubType = "Photo CD"; - break; - case CommonTypes.MediaType.PlayStationMemoryCard: - discType = "PlayStation Memory Card"; - discSubType = "PlayStation Memory Card"; - break; - case CommonTypes.MediaType.PlayStationMemoryCard2: - discType = "PlayStation Memory Card"; - discSubType = "PlayStation 2 Memory Card"; - break; - case CommonTypes.MediaType.PS1CD: - discType = "Compact Disc"; - discSubType = "PlayStation Game Disc"; - break; - case CommonTypes.MediaType.PS2CD: - discType = "Compact Disc"; - discSubType = "PlayStation 2 Game Disc"; - break; - case CommonTypes.MediaType.PS2DVD: - discType = "DVD"; - discSubType = "PlayStation 2 Game Disc"; - break; - case CommonTypes.MediaType.PS3BD: - discType = "Blu-ray"; - discSubType = "PlayStation 3 Game Disc"; - break; - case CommonTypes.MediaType.PS3DVD: - discType = "DVD"; - discSubType = "PlayStation 3 Game Disc"; - break; - case CommonTypes.MediaType.PS4BD: - discType = "Blu-ray"; - discSubType = "PlayStation 4 Game Disc"; - break; - case CommonTypes.MediaType.SACD: - discType = "SACD"; - discSubType = "Super Audio CD"; - break; - case CommonTypes.MediaType.SegaCard: - discType = "Sega Card"; - discSubType = "Sega Card"; - break; - case CommonTypes.MediaType.SATURNCD: - discType = "Compact Disc"; - discSubType = "Sega Saturn CD"; - break; - case CommonTypes.MediaType.SVCD: - discType = "Compact Disc"; - discSubType = "Super Video CD"; - break; - case CommonTypes.MediaType.SVOD: - discType = "SVOD"; - discSubType = "SVOD"; - break; - case CommonTypes.MediaType.UDO: - discType = "UDO"; - discSubType = "UDO"; - break; - case CommonTypes.MediaType.UMD: - discType = "UMD"; - discSubType = "Universal Media Disc"; - break; - case CommonTypes.MediaType.VCD: - discType = "Compact Disc"; - discSubType = "Video CD"; - break; - case CommonTypes.MediaType.Nuon: - discType = "DVD"; - discSubType = "Nuon"; - break; - case CommonTypes.MediaType.XGD: - discType = "DVD"; - discSubType = "Xbox Game Disc (XGD)"; - break; - case CommonTypes.MediaType.XGD2: - discType = "DVD"; - discSubType = "Xbox 360 Game Disc (XGD2)"; - break; - case CommonTypes.MediaType.XGD3: - discType = "DVD"; - discSubType = "Xbox 360 Game Disc (XGD3)"; - break; - case CommonTypes.MediaType.XGD4: - discType = "Blu-ray"; - discSubType = "Xbox One Game Disc (XGD4)"; - break; - case CommonTypes.MediaType.FMTOWNS: - discType = "Compact Disc"; - discSubType = "FM-Towns"; - break; - case CommonTypes.MediaType.Apple32SS: - discType = "5.25\" floppy"; - discSubType = "Apple DOS 3.2"; - break; - case CommonTypes.MediaType.Apple32DS: - discType = "5.25\" floppy"; - discSubType = "Apple DOS 3.2 (double-sided)"; - break; - case CommonTypes.MediaType.Apple33SS: - discType = "5.25\" floppy"; - discSubType = "Apple DOS 3.3"; - break; - case CommonTypes.MediaType.Apple33DS: - discType = "5.25\" floppy"; - discSubType = "Apple DOS 3.3 (double-sided)"; - break; - case CommonTypes.MediaType.AppleSonySS: - discType = "3.5\" floppy"; - discSubType = "Apple 400K"; - break; - case CommonTypes.MediaType.AppleSonyDS: - discType = "3.5\" floppy"; - discSubType = "Apple 800K"; - break; - case CommonTypes.MediaType.AppleFileWare: - discType = "5.25\" floppy"; - discSubType = "Apple FileWare"; - break; - case CommonTypes.MediaType.RX50: - discType = "5.25\" floppy"; - discSubType = "DEC RX50"; - break; - case CommonTypes.MediaType.DOS_525_SS_DD_8: - discType = "5.25\" floppy"; - discSubType = "IBM double-density, single-sided, 8 sectors"; - break; - case CommonTypes.MediaType.DOS_525_SS_DD_9: - discType = "5.25\" floppy"; - discSubType = "IBM double-density, single-sided, 9 sectors"; - break; - case CommonTypes.MediaType.DOS_525_DS_DD_8: - discType = "5.25\" floppy"; - discSubType = "IBM double-density, double-sided, 8 sectors"; - break; - case CommonTypes.MediaType.DOS_525_DS_DD_9: - discType = "5.25\" floppy"; - discSubType = "IBM double-density, double-sided, 9 sectors"; - break; - case CommonTypes.MediaType.DOS_525_HD: - discType = "5.25\" floppy"; - discSubType = "IBM high-density"; - break; - case CommonTypes.MediaType.DOS_35_SS_DD_8: - discType = "3.5\" floppy"; - discSubType = "IBM double-density, single-sided, 8 sectors"; - break; - case CommonTypes.MediaType.DOS_35_SS_DD_9: - discType = "3.5\" floppy"; - discSubType = "IBM double-density, single-sided, 9 sectors"; - break; - case CommonTypes.MediaType.DOS_35_DS_DD_8: - discType = "3.5\" floppy"; - discSubType = "IBM double-density, double-sided, 8 sectors"; - break; - case CommonTypes.MediaType.DOS_35_DS_DD_9: - discType = "3.5\" floppy"; - discSubType = "IBM double-density, double-sided, 9 sectors"; - break; - case CommonTypes.MediaType.DOS_35_HD: - discType = "3.5\" floppy"; - discSubType = "IBM high-density"; - break; - case CommonTypes.MediaType.DOS_35_ED: - discType = "3.5\" floppy"; - discSubType = "IBM extra-density"; - break; - case CommonTypes.MediaType.Apricot_35: - discType = "3.5\" floppy"; - discSubType = "Apricot double-density, single-sided, 70 tracks"; - break; - case CommonTypes.MediaType.DMF: - discType = "3.5\" floppy"; - discSubType = "Microsoft DMF"; - break; - case CommonTypes.MediaType.DMF_82: - discType = "3.5\" floppy"; - discSubType = "Microsoft DMF (82-track)"; - break; - case CommonTypes.MediaType.XDF_35: - discType = "3.5\" floppy"; - discSubType = "IBM XDF"; - break; - case CommonTypes.MediaType.XDF_525: - discType = "5.25\" floppy"; - discSubType = "IBM XDF"; - break; - case CommonTypes.MediaType.IBM23FD: - discType = "8\" floppy"; - discSubType = "IBM 23FD"; - break; - case CommonTypes.MediaType.IBM33FD_128: - discType = "8\" floppy"; - discSubType = "IBM 33FD (128 bytes/sector)"; - break; - case CommonTypes.MediaType.IBM33FD_256: - discType = "8\" floppy"; - discSubType = "IBM 33FD (256 bytes/sector)"; - break; - case CommonTypes.MediaType.IBM33FD_512: - discType = "8\" floppy"; - discSubType = "IBM 33FD (512 bytes/sector)"; - break; - case CommonTypes.MediaType.IBM43FD_128: - discType = "8\" floppy"; - discSubType = "IBM 43FD (128 bytes/sector)"; - break; - case CommonTypes.MediaType.IBM43FD_256: - discType = "8\" floppy"; - discSubType = "IBM 43FD (256 bytes/sector)"; - break; - case CommonTypes.MediaType.IBM53FD_256: - discType = "8\" floppy"; - discSubType = "IBM 53FD (256 bytes/sector)"; - break; - case CommonTypes.MediaType.IBM53FD_512: - discType = "8\" floppy"; - discSubType = "IBM 53FD (512 bytes/sector)"; - break; - case CommonTypes.MediaType.IBM53FD_1024: - discType = "8\" floppy"; - discSubType = "IBM 53FD (1024 bytes/sector)"; - break; - case CommonTypes.MediaType.RX01: - discType = "8\" floppy"; - discSubType = "DEC RX-01"; - break; - case CommonTypes.MediaType.RX02: - discType = "8\" floppy"; - discSubType = "DEC RX-02"; - break; - case CommonTypes.MediaType.RX03: - discType = "8\" floppy"; - discSubType = "DEC RX-03"; - break; - case CommonTypes.MediaType.ACORN_525_SS_SD_40: - discType = "5.25\" floppy"; - discSubType = "BBC Micro 100K"; - break; - case CommonTypes.MediaType.ACORN_525_SS_SD_80: - discType = "5.25\" floppy"; - discSubType = "BBC Micro 200K"; - break; - case CommonTypes.MediaType.ACORN_525_SS_DD_40: - discType = "5.25\" floppy"; - discSubType = "Acorn S"; - break; - case CommonTypes.MediaType.ACORN_525_SS_DD_80: - discType = "5.25\" floppy"; - discSubType = "Acorn M"; - break; - case CommonTypes.MediaType.ACORN_525_DS_DD: - discType = "5.25\" floppy"; - discSubType = "Acorn L"; - break; - case CommonTypes.MediaType.ACORN_35_DS_DD: - discType = "3.5\" floppy"; - discSubType = "Acorn Archimedes"; - break; - case CommonTypes.MediaType.ACORN_35_DS_HD: - discType = "3.5\" floppy"; - discSubType = "Acorn Archimedes high-density"; - break; - case CommonTypes.MediaType.ATARI_525_SD: - discType = "5.25\" floppy"; - discSubType = "Atari single-density"; - break; - case CommonTypes.MediaType.ATARI_525_ED: - discType = "5.25\" floppy"; - discSubType = "Atari enhanced-density"; - break; - case CommonTypes.MediaType.ATARI_525_DD: - discType = "5.25\" floppy"; - discSubType = "Atari double-density"; - break; - case CommonTypes.MediaType.ATARI_35_SS_DD: - discType = "3.5\" floppy"; - discSubType = "Atari ST double-density, single-sided, 10 sectors"; - break; - case CommonTypes.MediaType.ATARI_35_DS_DD: - discType = "3.5\" floppy"; - discSubType = "Atari ST double-density, double-sided, 10 sectors"; - break; - case CommonTypes.MediaType.ATARI_35_SS_DD_11: - discType = "3.5\" floppy"; - discSubType = "Atari ST double-density, single-sided, 11 sectors"; - break; - case CommonTypes.MediaType.ATARI_35_DS_DD_11: - discType = "3.5\" floppy"; - discSubType = "Atari ST double-density, double-sided, 11 sectors"; - break; - case CommonTypes.MediaType.CBM_1540: - case CommonTypes.MediaType.CBM_1540_Ext: - discType = "5.25\" floppy"; - discSubType = "Commodore 1540/1541"; - break; - case CommonTypes.MediaType.CBM_1571: - discType = "5.25\" floppy"; - discSubType = "Commodore 1571"; - break; - case CommonTypes.MediaType.CBM_35_DD: - discType = "3.5\" floppy"; - discSubType = "Commodore 1581"; - break; - case CommonTypes.MediaType.CBM_AMIGA_35_DD: - discType = "3.5\" floppy"; - discSubType = "Amiga double-density"; - break; - case CommonTypes.MediaType.CBM_AMIGA_35_HD: - discType = "3.5\" floppy"; - discSubType = "Amiga high-density"; - break; - case CommonTypes.MediaType.NEC_8_SD: - discType = "8\" floppy"; - discSubType = "NEC single-sided"; - break; - case CommonTypes.MediaType.NEC_8_DD: - discType = "8\" floppy"; - discSubType = "NEC double-sided"; - break; - case CommonTypes.MediaType.NEC_525_SS: - discType = "5.25\" floppy"; - discSubType = "NEC single-sided"; - break; - case CommonTypes.MediaType.NEC_525_HD: - discType = "5.25\" floppy"; - discSubType = "NEC high-density"; - break; - case CommonTypes.MediaType.NEC_35_HD_8: - discType = "3.5\" floppy"; - discSubType = "NEC high-density"; - break; - case CommonTypes.MediaType.NEC_35_HD_15: - discType = "3.5\" floppy"; - discSubType = "NEC high-density"; - break; - case CommonTypes.MediaType.NEC_35_TD: - discType = "3.5\" floppy"; - discSubType = "NEC triple-density"; - break; - case CommonTypes.MediaType.SHARP_525_9: - discType = "5.25\" floppy"; - discSubType = "Sharp (9 sectors per track)"; - break; - case CommonTypes.MediaType.SHARP_35_9: - discType = "3.5\" floppy"; - discSubType = "Sharp (9 sectors per track)"; - break; - case CommonTypes.MediaType.ECMA_54: - discType = "8\" floppy"; - discSubType = "ECMA-54"; - break; - case CommonTypes.MediaType.ECMA_59: - discType = "8\" floppy"; - discSubType = "ECMA-59"; - break; - case CommonTypes.MediaType.ECMA_69_8: - case CommonTypes.MediaType.ECMA_69_15: - case CommonTypes.MediaType.ECMA_69_26: - discType = "8\" floppy"; - discSubType = "ECMA-69"; - break; - case CommonTypes.MediaType.ECMA_66: - discType = "5.25\" floppy"; - discSubType = "ECMA-66"; - break; - case CommonTypes.MediaType.ECMA_70: - discType = "5.25\" floppy"; - discSubType = "ECMA-70"; - break; - case CommonTypes.MediaType.ECMA_78: - case CommonTypes.MediaType.ECMA_78_2: - discType = "5.25\" floppy"; - discSubType = "ECMA-78"; - break; - case CommonTypes.MediaType.ECMA_99_8: - case CommonTypes.MediaType.ECMA_99_15: - case CommonTypes.MediaType.ECMA_99_26: - discType = "5.25\" floppy"; - discSubType = "ECMA-99"; - break; - case CommonTypes.MediaType.FDFORMAT_525_DD: - discType = "5.25\" floppy"; - discSubType = "FDFORMAT double-density"; - break; - case CommonTypes.MediaType.FDFORMAT_525_HD: - discType = "5.25\" floppy"; - discSubType = "FDFORMAT high-density"; - break; - case CommonTypes.MediaType.FDFORMAT_35_DD: - discType = "3.5\" floppy"; - discSubType = "FDFORMAT double-density"; - break; - case CommonTypes.MediaType.FDFORMAT_35_HD: - discType = "3.5\" floppy"; - discSubType = "FDFORMAT high-density"; - break; - case CommonTypes.MediaType.ECMA_260: - case CommonTypes.MediaType.ECMA_260_Double: - discType = "356mm magneto-optical"; - discSubType = "ECMA-260 / ISO 15898"; - break; - case CommonTypes.MediaType.ECMA_183_512: - case CommonTypes.MediaType.ECMA_183: - discType = "5.25\" magneto-optical"; - discSubType = "ECMA-183"; - break; - case CommonTypes.MediaType.ECMA_184_512: - case CommonTypes.MediaType.ECMA_184: - discType = "5.25\" magneto-optical"; - discSubType = "ECMA-184"; - break; - case CommonTypes.MediaType.ECMA_154: - discType = "3.5\" magneto-optical"; - discSubType = "ECMA-154"; - break; - case CommonTypes.MediaType.ECMA_201: - case CommonTypes.MediaType.ECMA_201_ROM: - discType = "3.5\" magneto-optical"; - discSubType = "ECMA-201"; - break; - case CommonTypes.MediaType.FlashDrive: - discType = "USB flash drive"; - discSubType = "USB flash drive"; - break; - case CommonTypes.MediaType.SuperCDROM2: - discType = "Compact Disc"; - discSubType = "Super CD-ROM²"; - break; - case CommonTypes.MediaType.LDROM2: - discType = "LaserDisc"; - discSubType = "LD-ROM²"; - break; - case CommonTypes.MediaType.JaguarCD: - discType = "Compact Disc"; - discSubType = "Atari Jaguar CD"; - break; - case CommonTypes.MediaType.MilCD: - discType = "Compact Disc"; - discSubType = "Sega MilCD"; - break; - case CommonTypes.MediaType.ThreeDO: - discType = "Compact Disc"; - discSubType = "3DO"; - break; - case CommonTypes.MediaType.PCFX: - discType = "Compact Disc"; - discSubType = "PC-FX"; - break; - case CommonTypes.MediaType.NeoGeoCD: - discType = "Compact Disc"; - discSubType = "NEO-GEO CD"; - break; - case CommonTypes.MediaType.CDTV: - discType = "Compact Disc"; - discSubType = "Commodore CDTV"; - break; - case CommonTypes.MediaType.CD32: - discType = "Compact Disc"; - discSubType = "Amiga CD32"; - break; - case CommonTypes.MediaType.Playdia: - discType = "Compact Disc"; - discSubType = "Bandai Playdia"; - break; - case CommonTypes.MediaType.Pippin: - discType = "Compact Disc"; - discSubType = "Apple Pippin"; - break; - case CommonTypes.MediaType.ZIP100: - discType = "Iomega ZIP"; - discSubType = "Iomega ZIP100"; - break; - case CommonTypes.MediaType.ZIP250: - discType = "Iomega ZIP"; - discSubType = "Iomega ZIP250"; - break; - case CommonTypes.MediaType.ZIP750: - discType = "Iomega ZIP"; - discSubType = "Iomega ZIP750"; - break; - case CommonTypes.MediaType.AppleProfile: - discType = "Hard Disk Drive"; - discSubType = "Apple Profile"; - break; - case CommonTypes.MediaType.AppleWidget: - discType = "Hard Disk Drive"; - discSubType = "Apple Widget"; - break; - case CommonTypes.MediaType.AppleHD20: - discType = "Hard Disk Drive"; - discSubType = "Apple HD20"; - break; - case CommonTypes.MediaType.PriamDataTower: - discType = "Hard Disk Drive"; - discSubType = "Priam DataTower"; - break; - case CommonTypes.MediaType.DDS1: - discType = "Digital Data Storage"; - discSubType = "DDS"; - break; - case CommonTypes.MediaType.DDS2: - discType = "Digital Data Storage"; - discSubType = "DDS-2"; - break; - case CommonTypes.MediaType.DDS3: - discType = "Digital Data Storage"; - discSubType = "DDS-3"; - break; - case CommonTypes.MediaType.DDS4: - discType = "Digital Data Storage"; - discSubType = "DDS-4"; - break; - case CommonTypes.MediaType.PocketZip: - discType = "Iomega PocketZip"; - discSubType = "Iomega PocketZip"; - break; - case CommonTypes.MediaType.CompactFloppy: - discType = "3\" floppy"; - discSubType = "Compact Floppy"; - break; - case CommonTypes.MediaType.GENERIC_HDD: - discType = "Hard Disk Drive"; - discSubType = "Unknown"; - break; - case CommonTypes.MediaType.MDData: - discType = "MiniDisc"; - discSubType = "MD-DATA"; - break; - case CommonTypes.MediaType.MDData2: - discType = "MiniDisc"; - discSubType = "MD-DATA2"; - break; - case CommonTypes.MediaType.UDO2: - discType = "UDO"; - discSubType = "UDO2"; - break; - case CommonTypes.MediaType.UDO2_WORM: - discType = "UDO"; - discSubType = "UDO2 (WORM)"; - break; - case CommonTypes.MediaType.ADR30: - discType = "Advanced Digital Recording"; - discSubType = "ADR 30"; - break; - case CommonTypes.MediaType.ADR50: - discType = "Advanced Digital Recording"; - discSubType = "ADR 50"; - break; - case CommonTypes.MediaType.ADR260: - discType = "Advanced Digital Recording"; - discSubType = "ADR 2.60"; - break; - case CommonTypes.MediaType.ADR2120: - discType = "Advanced Digital Recording"; - discSubType = "ADR 2.120"; - break; - case CommonTypes.MediaType.AIT1: - discType = "Advanced Intelligent Tape"; - discSubType = "AIT-1"; - break; - case CommonTypes.MediaType.AIT1Turbo: - discType = "Advanced Intelligent Tape"; - discSubType = "AIT-1 Turbo"; - break; - case CommonTypes.MediaType.AIT2: - discType = "Advanced Intelligent Tape"; - discSubType = "AIT-2"; - break; - case CommonTypes.MediaType.AIT2Turbo: - discType = "Advanced Intelligent Tape"; - discSubType = "AIT-2 Turbo"; - break; - case CommonTypes.MediaType.AIT3: - discType = "Advanced Intelligent Tape"; - discSubType = "AIT-3"; - break; - case CommonTypes.MediaType.AIT3Ex: - discType = "Advanced Intelligent Tape"; - discSubType = "AIT-3Ex"; - break; - case CommonTypes.MediaType.AIT3Turbo: - discType = "Advanced Intelligent Tape"; - discSubType = "AIT-3 Turbo"; - break; - case CommonTypes.MediaType.AIT4: - discType = "Advanced Intelligent Tape"; - discSubType = "AIT-4"; - break; - case CommonTypes.MediaType.AIT5: - discType = "Advanced Intelligent Tape"; - discSubType = "AIT-5"; - break; - case CommonTypes.MediaType.AITETurbo: - discType = "Advanced Intelligent Tape"; - discSubType = "AIT-E Turbo"; - break; - case CommonTypes.MediaType.SAIT1: - discType = "Super Advanced Intelligent Tape"; - discSubType = "SAIT-1"; - break; - case CommonTypes.MediaType.SAIT2: - discType = "Super Advanced Intelligent Tape"; - discSubType = "SAIT-2"; - break; - case CommonTypes.MediaType.Bernoulli: - discType = "Iomega Bernoulli"; - discSubType = "Iomega Bernoulli"; - break; - case CommonTypes.MediaType.Bernoulli2: - discType = "Iomega Bernoulli"; - discSubType = "Iomega Bernoulli 2"; - break; - case CommonTypes.MediaType.Ditto: - discType = "Iomega Ditto"; - discSubType = "Iomega Ditto"; - break; - case CommonTypes.MediaType.DittoMax: - discType = "Iomega Ditto"; - discSubType = "Iomega Ditto Max"; - break; - case CommonTypes.MediaType.Jaz: - discType = "Iomega Jaz"; - discSubType = "Iomega Jaz 1GB"; - break; - case CommonTypes.MediaType.Jaz2: - discType = "Iomega Jaz"; - discSubType = "Iomega Jaz 2GB"; - break; - case CommonTypes.MediaType.REV35: - discType = "Iomega REV"; - discSubType = "Iomega REV-35"; - break; - case CommonTypes.MediaType.REV70: - discType = "Iomega REV"; - discSubType = "Iomega REV-70"; - break; - case CommonTypes.MediaType.REV120: - discType = "Iomega REV"; - discSubType = "Iomega REV-120"; - break; - case CommonTypes.MediaType.CompactFlash: - discType = "Compact Flash"; - discSubType = "Compact Flash"; - break; - case CommonTypes.MediaType.CompactFlashType2: - discType = "Compact Flash"; - discSubType = "Compact Flash Type 2"; - break; - case CommonTypes.MediaType.CFast: - discType = "Compact Flash"; - discSubType = "CFast"; - break; - case CommonTypes.MediaType.DigitalAudioTape: - discType = "Digital Audio Tape"; - discSubType = "Digital Audio Tape"; - break; - case CommonTypes.MediaType.DAT72: - discType = "Digital Data Storage"; - discSubType = "DAT-72"; - break; - case CommonTypes.MediaType.DAT160: - discType = "Digital Data Storage"; - discSubType = "DAT-160"; - break; - case CommonTypes.MediaType.DAT320: - discType = "Digital Data Storage"; - discSubType = "DAT-320"; - break; - case CommonTypes.MediaType.DECtapeII: - discType = "DECtape"; - discSubType = "DECtape II"; - break; - case CommonTypes.MediaType.CompactTapeI: - discType = "CompacTape"; - discSubType = "CompacTape"; - break; - case CommonTypes.MediaType.CompactTapeII: - discType = "CompacTape"; - discSubType = "CompacTape II"; - break; - case CommonTypes.MediaType.DLTtapeIII: - discType = "Digital Linear Tape"; - discSubType = "DLTtape III"; - break; - case CommonTypes.MediaType.DLTtapeIIIxt: - discType = "Digital Linear Tape"; - discSubType = "DLTtape IIIXT"; - break; - case CommonTypes.MediaType.DLTtapeIV: - discType = "Digital Linear Tape"; - discSubType = "DLTtape IV"; - break; - case CommonTypes.MediaType.DLTtapeS4: - discType = "Digital Linear Tape"; - discSubType = "DLTtape S4"; - break; - case CommonTypes.MediaType.SDLT1: - discType = "Super Digital Linear Tape"; - discSubType = "SDLTtape I"; - break; - case CommonTypes.MediaType.SDLT2: - discType = "Super Digital Linear Tape"; - discSubType = "SDLTtape II"; - break; - case CommonTypes.MediaType.VStapeI: - discType = "Digital Linear Tape"; - discSubType = "DLTtape VS1"; - break; - case CommonTypes.MediaType.Data8: - discType = "Data8"; - discSubType = "Data8"; - break; - case CommonTypes.MediaType.MiniDV: - discType = "DV tape"; - discSubType = "MiniDV"; - break; - case CommonTypes.MediaType.Exatape15m: - discType = "Exatape"; - discSubType = "Exatape (15m)"; - break; - case CommonTypes.MediaType.Exatape22m: - discType = "Exatape"; - discSubType = "Exatape (22m)"; - break; - case CommonTypes.MediaType.Exatape22mAME: - discType = "Exatape"; - discSubType = "Exatape (22m AME)"; - break; - case CommonTypes.MediaType.Exatape28m: - discType = "Exatape"; - discSubType = "Exatape (28m)"; - break; - case CommonTypes.MediaType.Exatape40m: - discType = "Exatape"; - discSubType = "Exatape (40m)"; - break; - case CommonTypes.MediaType.Exatape45m: - discType = "Exatape"; - discSubType = "Exatape (45m)"; - break; - case CommonTypes.MediaType.Exatape54m: - discType = "Exatape"; - discSubType = "Exatape (54m)"; - break; - case CommonTypes.MediaType.Exatape75m: - discType = "Exatape"; - discSubType = "Exatape (75m)"; - break; - case CommonTypes.MediaType.Exatape76m: - discType = "Exatape"; - discSubType = "Exatape (76m)"; - break; - case CommonTypes.MediaType.Exatape80m: - discType = "Exatape"; - discSubType = "Exatape (80m)"; - break; - case CommonTypes.MediaType.Exatape106m: - discType = "Exatape"; - discSubType = "Exatape (106m)"; - break; - case CommonTypes.MediaType.Exatape112m: - discType = "Exatape"; - discSubType = "Exatape (112m)"; - break; - case CommonTypes.MediaType.Exatape125m: - discType = "Exatape"; - discSubType = "Exatape (125m)"; - break; - case CommonTypes.MediaType.Exatape150m: - discType = "Exatape"; - discSubType = "Exatape (150m)"; - break; - case CommonTypes.MediaType.Exatape160mXL: - discType = "Exatape"; - discSubType = "Exatape XL (160m)"; - break; - case CommonTypes.MediaType.Exatape170m: - discType = "Exatape"; - discSubType = "Exatape (170m)"; - break; - case CommonTypes.MediaType.Exatape225m: - discType = "Exatape"; - discSubType = "Exatape (225m)"; - break; - case CommonTypes.MediaType.EZ135: - discType = "3.5\" SyQuest cartridge"; - discSubType = "EZ135"; - break; - case CommonTypes.MediaType.EZ230: - discType = "3.5\" SyQuest cartridge"; - discSubType = "EZ230"; - break; - case CommonTypes.MediaType.Quest: - discType = "3.5\" SyQuest cartridge"; - discSubType = "Quest"; - break; - case CommonTypes.MediaType.SparQ: - discType = "3.5\" SyQuest cartridge"; - discSubType = "SparQ"; - break; - case CommonTypes.MediaType.SQ100: - discType = "3.9\" SyQuest cartridge"; - discSubType = "SQ100"; - break; - case CommonTypes.MediaType.SQ200: - discType = "3.9\" SyQuest cartridge"; - discSubType = "SQ200"; - break; - case CommonTypes.MediaType.SQ300: - discType = "3.9\" SyQuest cartridge"; - discSubType = "SQ300"; - break; - case CommonTypes.MediaType.SQ310: - discType = "3.5\" SyQuest cartridge"; - discSubType = "SQ310"; - break; - case CommonTypes.MediaType.SQ327: - discType = "3.5\" SyQuest cartridge"; - discSubType = "SQ327"; - break; - case CommonTypes.MediaType.SQ400: - discType = "5.25\" SyQuest cartridge"; - discSubType = "SQ400"; - break; - case CommonTypes.MediaType.SQ800: - discType = "5.25\" SyQuest cartridge"; - discSubType = "SQ800"; - break; - case CommonTypes.MediaType.SQ1500: - discType = "3.5\" SyQuest cartridge"; - discSubType = "SQ1500"; - break; - case CommonTypes.MediaType.SQ2000: - discType = "5.25\" SyQuest cartridge"; - discSubType = "SQ2000"; - break; - case CommonTypes.MediaType.SyJet: - discType = "3.5\" SyQuest cartridge"; - discSubType = "SyJet"; - break; - case CommonTypes.MediaType.LTO: - discType = "Linear Tape-Open"; - discSubType = "LTO"; - break; - case CommonTypes.MediaType.LTO2: - discType = "Linear Tape-Open"; - discSubType = "LTO-2"; - break; - case CommonTypes.MediaType.LTO3: - discType = "Linear Tape-Open"; - discSubType = "LTO-3"; - break; - case CommonTypes.MediaType.LTO3WORM: - discType = "Linear Tape-Open"; - discSubType = "LTO-3 (WORM)"; - break; - case CommonTypes.MediaType.LTO4: - discType = "Linear Tape-Open"; - discSubType = "LTO-4"; - break; - case CommonTypes.MediaType.LTO4WORM: - discType = "Linear Tape-Open"; - discSubType = "LTO-4 (WORM)"; - break; - case CommonTypes.MediaType.LTO5: - discType = "Linear Tape-Open"; - discSubType = "LTO-5"; - break; - case CommonTypes.MediaType.LTO5WORM: - discType = "Linear Tape-Open"; - discSubType = "LTO-5 (WORM)"; - break; - case CommonTypes.MediaType.LTO6: - discType = "Linear Tape-Open"; - discSubType = "LTO-6"; - break; - case CommonTypes.MediaType.LTO6WORM: - discType = "Linear Tape-Open"; - discSubType = "LTO-6 (WORM)"; - break; - case CommonTypes.MediaType.LTO7: - discType = "Linear Tape-Open"; - discSubType = "LTO-7"; - break; - case CommonTypes.MediaType.LTO7WORM: - discType = "Linear Tape-Open"; - discSubType = "LTO-7 (WORM)"; - break; - case CommonTypes.MediaType.MemoryStick: - discType = "Memory Stick"; - discSubType = "Memory Stick"; - break; - case CommonTypes.MediaType.MemoryStickDuo: - discType = "Memory Stick"; - discSubType = "Memory Stick Duo"; - break; - case CommonTypes.MediaType.MemoryStickMicro: - discType = "Memory Stick"; - discSubType = "Memory Stick Micro"; - break; - case CommonTypes.MediaType.MemoryStickPro: - discType = "Memory Stick"; - discSubType = "Memory Stick Pro"; - break; - case CommonTypes.MediaType.MemoryStickProDuo: - discType = "Memory Stick"; - discSubType = "Memory Stick PRO Duo"; - break; - case CommonTypes.MediaType.SecureDigital: - discType = "Secure Digital"; - discSubType = "Secure Digital"; - break; - case CommonTypes.MediaType.miniSD: - discType = "Secure Digital"; - discSubType = "miniSD"; - break; - case CommonTypes.MediaType.microSD: - discType = "Secure Digital"; - discSubType = "microSD"; - break; - case CommonTypes.MediaType.MMC: - discType = "MultiMediaCard"; - discSubType = "MultiMediaCard"; - break; - case CommonTypes.MediaType.MMCmicro: - discType = "MultiMediaCard"; - discSubType = "MMCmicro"; - break; - case CommonTypes.MediaType.RSMMC: - discType = "MultiMediaCard"; - discSubType = "Reduced-Size MultiMediaCard"; - break; - case CommonTypes.MediaType.MMCplus: - discType = "MultiMediaCard"; - discSubType = "MMCplus"; - break; - case CommonTypes.MediaType.MMCmobile: - discType = "MultiMediaCard"; - discSubType = "MMCmobile"; - break; - case CommonTypes.MediaType.MLR1: - discType = "Scalable Linear Recording"; - discSubType = "MLR1"; - break; - case CommonTypes.MediaType.MLR1SL: - discType = "Scalable Linear Recording"; - discSubType = "MLR1 SL"; - break; - case CommonTypes.MediaType.MLR3: - discType = "Scalable Linear Recording"; - discSubType = "MLR3"; - break; - case CommonTypes.MediaType.SLR1: - discType = "Scalable Linear Recording"; - discSubType = "SLR1"; - break; - case CommonTypes.MediaType.SLR2: - discType = "Scalable Linear Recording"; - discSubType = "SLR2"; - break; - case CommonTypes.MediaType.SLR3: - discType = "Scalable Linear Recording"; - discSubType = "SLR3"; - break; - case CommonTypes.MediaType.SLR32: - discType = "Scalable Linear Recording"; - discSubType = "SLR32"; - break; - case CommonTypes.MediaType.SLR32SL: - discType = "Scalable Linear Recording"; - discSubType = "SLR32 SL"; - break; - case CommonTypes.MediaType.SLR4: - discType = "Scalable Linear Recording"; - discSubType = "SLR4"; - break; - case CommonTypes.MediaType.SLR5: - discType = "Scalable Linear Recording"; - discSubType = "SLR5"; - break; - case CommonTypes.MediaType.SLR5SL: - discType = "Scalable Linear Recording"; - discSubType = "SLR5 SL"; - break; - case CommonTypes.MediaType.SLR6: - discType = "Scalable Linear Recording"; - discSubType = "SLR6"; - break; - case CommonTypes.MediaType.SLRtape7: - discType = "Scalable Linear Recording"; - discSubType = "SLRtape7"; - break; - case CommonTypes.MediaType.SLRtape7SL: - discType = "Scalable Linear Recording"; - discSubType = "SLRtape7 SL"; - break; - case CommonTypes.MediaType.SLRtape24: - discType = "Scalable Linear Recording"; - discSubType = "SLRtape24"; - break; - case CommonTypes.MediaType.SLRtape24SL: - discType = "Scalable Linear Recording"; - discSubType = "SLRtape24 SL"; - break; - case CommonTypes.MediaType.SLRtape40: - discType = "Scalable Linear Recording"; - discSubType = "SLRtape40"; - break; - case CommonTypes.MediaType.SLRtape50: - discType = "Scalable Linear Recording"; - discSubType = "SLRtape50"; - break; - case CommonTypes.MediaType.SLRtape60: - discType = "Scalable Linear Recording"; - discSubType = "SLRtape60"; - break; - case CommonTypes.MediaType.SLRtape75: - discType = "Scalable Linear Recording"; - discSubType = "SLRtape75"; - break; - case CommonTypes.MediaType.SLRtape100: - discType = "Scalable Linear Recording"; - discSubType = "SLRtape100"; - break; - case CommonTypes.MediaType.SLRtape140: - discType = "Scalable Linear Recording"; - discSubType = "SLRtape140"; - break; - case CommonTypes.MediaType.QIC11: - discType = "Quarter-inch cartridge"; - discSubType = "QIC-11"; - break; - case CommonTypes.MediaType.QIC24: - discType = "Quarter-inch cartridge"; - discSubType = "QIC-24"; - break; - case CommonTypes.MediaType.QIC40: - discType = "Quarter-inch mini cartridge"; - discSubType = "QIC-40"; - break; - case CommonTypes.MediaType.QIC80: - discType = "Quarter-inch mini cartridge"; - discSubType = "QIC-80"; - break; - case CommonTypes.MediaType.QIC120: - discType = "Quarter-inch cartridge"; - discSubType = "QIC-120"; - break; - case CommonTypes.MediaType.QIC150: - discType = "Quarter-inch cartridge"; - discSubType = "QIC-150"; - break; - case CommonTypes.MediaType.QIC320: - discType = "Quarter-inch cartridge"; - discSubType = "QIC-320"; - break; - case CommonTypes.MediaType.QIC525: - discType = "Quarter-inch cartridge"; - discSubType = "QIC-525"; - break; - case CommonTypes.MediaType.QIC1350: - discType = "Quarter-inch cartridge"; - discSubType = "QIC-1350"; - break; - case CommonTypes.MediaType.QIC3010: - discType = "Quarter-inch cartridge"; - discSubType = "QIC-3010"; - break; - case CommonTypes.MediaType.QIC3020: - discType = "Quarter-inch cartridge"; - discSubType = "QIC-3020"; - break; - case CommonTypes.MediaType.QIC3080: - discType = "Quarter-inch cartridge"; - discSubType = "QIC-3080"; - break; - case CommonTypes.MediaType.QIC3095: - discType = "Quarter-inch cartridge"; - discSubType = "QIC-3095"; - break; - case CommonTypes.MediaType.Travan: - discType = "Travan"; - discSubType = "TR-1"; - break; - case CommonTypes.MediaType.Travan1Ex: - discType = "Travan"; - discSubType = "TR-1 Ex"; - break; - case CommonTypes.MediaType.Travan3: - discType = "Travan"; - discSubType = "TR-3"; - break; - case CommonTypes.MediaType.Travan3Ex: - discType = "Travan"; - discSubType = "TR-3 Ex"; - break; - case CommonTypes.MediaType.Travan4: - discType = "Travan"; - discSubType = "TR-4"; - break; - case CommonTypes.MediaType.Travan5: - discType = "Travan"; - discSubType = "TR-5"; - break; - case CommonTypes.MediaType.Travan7: - discType = "Travan"; - discSubType = "TR-7"; - break; - case CommonTypes.MediaType.VXA1: - discType = "VXA"; - discSubType = "VXA-1"; - break; - case CommonTypes.MediaType.VXA2: - discType = "VXA"; - discSubType = "VXA-2"; - break; - case CommonTypes.MediaType.VXA3: - discType = "VXA"; - discSubType = "VXA-3"; - break; - case CommonTypes.MediaType.ECMA_153: - case CommonTypes.MediaType.ECMA_153_512: - discType = "5.25\" magneto-optical"; - discSubType = "ECMA-153"; - break; - case CommonTypes.MediaType.ECMA_189: - discType = "300mm magneto optical"; - discSubType = "ECMA-189"; - break; - case CommonTypes.MediaType.ECMA_190: - discType = "300mm magneto optical"; - discSubType = "ECMA-190"; - break; - case CommonTypes.MediaType.ECMA_195: - case CommonTypes.MediaType.ECMA_195_512: - discType = "5.25\" magneto-optical"; - discSubType = "ECMA-195"; - break; - case CommonTypes.MediaType.ECMA_223: - case CommonTypes.MediaType.ECMA_223_512: - discType = "3.5\" magneto-optical"; - discSubType = "ECMA-223"; - break; - case CommonTypes.MediaType.ECMA_238: - discType = "5.25\" magneto-optical"; - discSubType = "ECMA-238"; - break; - case CommonTypes.MediaType.ECMA_239: - discType = "3.5\" magneto-optical"; - discSubType = "ECMA-239"; - break; - case CommonTypes.MediaType.ECMA_280: - discType = "5.25\" magneto-optical"; - discSubType = "ECMA-280"; - break; - case CommonTypes.MediaType.ECMA_317: - discType = "300mm magneto optical"; - discSubType = "ECMA-317"; - break; - case CommonTypes.MediaType.ECMA_322: - case CommonTypes.MediaType.ECMA_322_2k: - discType = "5.25\" magneto-optical"; - discSubType = "ECMA-322"; - break; - case CommonTypes.MediaType.GigaMo: - discType = "3.5\" magneto-optical"; - discSubType = "GIGAMO"; - break; - case CommonTypes.MediaType.GigaMo2: - discType = "3.5\" magneto-optical"; - discSubType = "2.3GB GIGAMO"; - break; - case CommonTypes.MediaType.UnknownMO: - discType = "Magneto-optical"; - discSubType = "Unknown"; - break; - case CommonTypes.MediaType.Floptical: - discType = "Floptical"; - discSubType = "Floptical"; - break; - case CommonTypes.MediaType.HiFD: - discType = "HiFD"; - discSubType = "HiFD"; - break; - case CommonTypes.MediaType.LS120: - discType = "SuperDisk"; - discSubType = "LS-120"; - break; - case CommonTypes.MediaType.LS240: - discType = "SuperDisk"; - discSubType = "LS-240"; - break; - case CommonTypes.MediaType.FD32MB: - discType = "3.5\" floppy"; - discSubType = "FD32MB"; - break; - case CommonTypes.MediaType.UHD144: - discType = "UHD144"; - discSubType = "UHD144"; - break; - case CommonTypes.MediaType.VCDHD: - discType = "VCDHD"; - discSubType = "VCDHD"; - break; - case CommonTypes.MediaType.HuCard: - discType = "HuCard"; - discSubType = "HuCard"; - break; - case CommonTypes.MediaType.CompactCassette: - discType = "Compact Cassette"; - discSubType = "Compact Cassette"; - break; - case CommonTypes.MediaType.Dcas25: - discType = "Compact Cassette"; - discSubType = "D/CAS-25"; - break; - case CommonTypes.MediaType.Dcas85: - discType = "Compact Cassette"; - discSubType = "D/CAS-85"; - break; - case CommonTypes.MediaType.Dcas103: - discType = "Compact Cassette"; - discSubType = "D/CAS-103"; - break; - case CommonTypes.MediaType.PCCardTypeI: - discType = "PCMCIA Card"; - discSubType = "PC-Card Type I"; - break; - case CommonTypes.MediaType.PCCardTypeII: - discType = "PCMCIA Card"; - discSubType = "PC-Card Type II"; - break; - case CommonTypes.MediaType.PCCardTypeIII: - discType = "PCMCIA Card"; - discSubType = "PC-Card Type III"; - break; - case CommonTypes.MediaType.PCCardTypeIV: - discType = "PCMCIA Card"; - discSubType = "PC-Card Type IV"; - break; - case CommonTypes.MediaType.ExpressCard34: - discType = "Express Card"; - discSubType = "Express Card (34mm)"; - break; - case CommonTypes.MediaType.ExpressCard54: - discType = "Express Card"; - discSubType = "Express Card (54mm)"; - break; - case CommonTypes.MediaType.FamicomGamePak: - discType = "Nintendo Famicom Game Pak"; - discSubType = "Nintendo Famicom Game Pak"; - break; - case CommonTypes.MediaType.GameBoyAdvanceGamePak: - discType = "Nintendo Game Boy Advance Game Pak"; - discSubType = "Nintendo Game Boy Advance Game Pak"; - break; - case CommonTypes.MediaType.GameBoyGamePak: - discType = "Nintendo Game Boy Game Pak"; - discSubType = "Nintendo Game Boy Game Pak"; - break; - case CommonTypes.MediaType.N64DD: - discType = "Nintendo 64 Disk"; - discSubType = "Nintendo 64 Disk"; - break; - case CommonTypes.MediaType.N64GamePak: - discType = "Nintendo 64 Game Pak"; - discSubType = "Nintendo 64 Game Pak"; - break; - case CommonTypes.MediaType.NESGamePak: - discType = "Nintendo Entertainment System Game Pak"; - discSubType = "Nintendo Entertainment System Game Pak"; - break; - case CommonTypes.MediaType.Nintendo3DSGameCard: - discType = "Nintendo 3DS Game Card"; - discSubType = "Nintendo 3DS Game Card"; - break; - case CommonTypes.MediaType.NintendoDiskCard: - discType = "Nintendo Disk Card"; - discSubType = "Nintendo Disk Card"; - break; - case CommonTypes.MediaType.NintendoDSGameCard: - discType = "Nintendo DS Game Card"; - discSubType = "Nintendo DS Game Card"; - break; - case CommonTypes.MediaType.NintendoDSiGameCard: - discType = "Nintendo DSi Game Card"; - discSubType = "Nintendo DSi Game Card"; - break; - case CommonTypes.MediaType.SNESGamePak: - discType = "Super Nintendo Game Pak"; - discSubType = "Super Nintendo Game Pak"; - break; - case CommonTypes.MediaType.SNESGamePakUS: - discType = "Super Nintendo Game Pak (US)"; - discSubType = "Super Nintendo Game Pak (US)"; - break; - case CommonTypes.MediaType.SwitchGameCard: - discType = "Nintendo Switch Game Card"; - discSubType = "Nintendo Switch Game Card"; - break; - case CommonTypes.MediaType.IBM3470: - discType = "IBM 3470"; - discSubType = "IBM 3470"; - break; - case CommonTypes.MediaType.IBM3480: - discType = "IBM 3480"; - discSubType = "IBM 3480"; - break; - case CommonTypes.MediaType.IBM3490: - discType = "IBM 3490"; - discSubType = "IBM 3490"; - break; - case CommonTypes.MediaType.IBM3490E: - discType = "IBM 3490E"; - discSubType = "IBM 3490E"; - break; - case CommonTypes.MediaType.IBM3592: - discType = "IBM 3592"; - discSubType = "IBM 3592"; - break; - case CommonTypes.MediaType.STK4480: - discType = "STK 4480"; - discSubType = "STK 4480"; - break; - case CommonTypes.MediaType.STK4490: - discType = "STK 4490"; - discSubType = "STK 4490"; - break; - case CommonTypes.MediaType.STK9490: - discType = "STK 9490"; - discSubType = "STK 9490"; - break; - case CommonTypes.MediaType.T9840A: - discType = "STK T-9840"; - discSubType = "STK T-9840A"; - break; - case CommonTypes.MediaType.T9840B: - discType = "STK T-9840"; - discSubType = "STK T-9840B"; - break; - case CommonTypes.MediaType.T9840C: - discType = "STK T-9840"; - discSubType = "STK T-9840C"; - break; - case CommonTypes.MediaType.T9840D: - discType = "STK T-9840"; - discSubType = "STK T-9840D"; - break; - case CommonTypes.MediaType.T9940A: - discType = "STK T-9940"; - discSubType = "STK T-9940A"; - break; - case CommonTypes.MediaType.T9940B: - discType = "STK T-9840"; - discSubType = "STK T-9840B"; - break; - case CommonTypes.MediaType.T10000A: - discType = "STK T-10000"; - discSubType = "STK T-10000A"; - break; - case CommonTypes.MediaType.T10000B: - discType = "STK T-10000"; - discSubType = "STK T-10000B"; - break; - case CommonTypes.MediaType.T10000C: - discType = "STK T-10000"; - discSubType = "STK T-10000C"; - break; - case CommonTypes.MediaType.T10000D: - discType = "STK T-10000"; - discSubType = "STK T-10000D"; - break; - case CommonTypes.MediaType.DemiDiskette: - discType = "DemiDiskette"; - discSubType = "DemiDiskette"; - break; - case CommonTypes.MediaType.QuickDisk: - discType = "QuickDisk"; - discSubType = "QuickDisk"; - break; - case CommonTypes.MediaType.VideoFloppy: - discType = "VideoFloppy"; - discSubType = "VideoFloppy"; - break; - case CommonTypes.MediaType.Wafer: - discType = "Wafer"; - discSubType = "Wafer"; - break; - case CommonTypes.MediaType.ZXMicrodrive: - discType = "ZX Microdrive"; - discSubType = "ZX Microdrive"; - break; - case CommonTypes.MediaType.BeeCard: - discType = "BeeCard"; - discSubType = "BeeCard"; - break; - case CommonTypes.MediaType.Borsu: - discType = "Borsu"; - discSubType = "Borsu"; - break; - case CommonTypes.MediaType.DataStore: - discType = "DataStore"; - discSubType = "DataStore"; - break; - case CommonTypes.MediaType.DIR: - discType = "DIR"; - discSubType = "DIR"; - break; - case CommonTypes.MediaType.DST: - discType = "DST"; - discSubType = "DST"; - break; - case CommonTypes.MediaType.DTF: - discType = "DTF"; - discSubType = "DTF"; - break; - case CommonTypes.MediaType.DTF2: - discType = "DTF2"; - discSubType = "DTF2"; - break; - case CommonTypes.MediaType.Flextra3020: - discType = "Flextra"; - discSubType = "Flextra 3020"; - break; - case CommonTypes.MediaType.Flextra3225: - discType = "Flextra"; - discSubType = "Flextra 3225"; - break; - case CommonTypes.MediaType.HiTC1: - discType = "HiTC"; - discSubType = "HiTC1"; - break; - case CommonTypes.MediaType.HiTC2: - discType = "HiTC"; - discSubType = "HiTC2"; - break; - case CommonTypes.MediaType.LT1: - discType = "LT1"; - discSubType = "LT1"; - break; - case CommonTypes.MediaType.MiniCard: - discType = "MiniCard"; - discSubType = "MiniCard"; - break; - case CommonTypes.MediaType.Orb: - discType = "Orb"; - discSubType = "Orb"; - break; - case CommonTypes.MediaType.Orb5: - discType = "Orb"; - discSubType = "Orb5"; - break; - case CommonTypes.MediaType.SmartMedia: - discType = "SmartMedia"; - discSubType = "SmartMedia"; - break; - case CommonTypes.MediaType.xD: - discType = "xD"; - discSubType = "xD"; - break; - case CommonTypes.MediaType.XQD: - discType = "XQD"; - discSubType = "XQD"; - break; - case CommonTypes.MediaType.DataPlay: - discType = "DataPlay"; - discSubType = "DataPlay"; - break; - case CommonTypes.MediaType.PD650: - discType = "PD650"; - discSubType = "PD650"; - break; - case CommonTypes.MediaType.PD650_WORM: - discType = "PD650"; - discSubType = "PD650 (WORM)"; - break; - case CommonTypes.MediaType.RA60: - discType = "Hard Disk Drive"; - discSubType = "DEC RA-60"; - break; - case CommonTypes.MediaType.RA80: - discType = "Hard Disk Drive"; - discSubType = "DEC RA-80"; - break; - case CommonTypes.MediaType.RA81: - discType = "Hard Disk Drive"; - discSubType = "DEC RA-81"; - break; - case CommonTypes.MediaType.RC25: - discType = "Hard Disk Drive"; - discSubType = "DEC RC-25"; - break; - case CommonTypes.MediaType.RD31: - discType = "Hard Disk Drive"; - discSubType = "DEC RD-31"; - break; - case CommonTypes.MediaType.RD32: - discType = "Hard Disk Drive"; - discSubType = "DEC RD-32"; - break; - case CommonTypes.MediaType.RD51: - discType = "Hard Disk Drive"; - discSubType = "DEC RD-51"; - break; - case CommonTypes.MediaType.RD52: - discType = "Hard Disk Drive"; - discSubType = "DEC RD-52"; - break; - case CommonTypes.MediaType.RD53: - discType = "Hard Disk Drive"; - discSubType = "DEC RD-53"; - break; - case CommonTypes.MediaType.RD54: - discType = "Hard Disk Drive"; - discSubType = "DEC RD-54"; - break; - case CommonTypes.MediaType.RK06: - case CommonTypes.MediaType.RK06_18: - discType = "Hard Disk Drive"; - discSubType = "DEC RK-06"; - break; - case CommonTypes.MediaType.RK07: - case CommonTypes.MediaType.RK07_18: - discType = "Hard Disk Drive"; - discSubType = "DEC RK-07"; - break; - case CommonTypes.MediaType.RM02: - discType = "Hard Disk Drive"; - discSubType = "DEC RM-02"; - break; - case CommonTypes.MediaType.RM03: - discType = "Hard Disk Drive"; - discSubType = "DEC RM-03"; - break; - case CommonTypes.MediaType.RM05: - discType = "Hard Disk Drive"; - discSubType = "DEC RM-05"; - break; - case CommonTypes.MediaType.RP02: - case CommonTypes.MediaType.RP02_18: - discType = "Hard Disk Drive"; - discSubType = "DEC RP-02"; - break; - case CommonTypes.MediaType.RP03: - case CommonTypes.MediaType.RP03_18: - discType = "Hard Disk Drive"; - discSubType = "DEC RP-03"; - break; - case CommonTypes.MediaType.RP04: - case CommonTypes.MediaType.RP04_18: - discType = "Hard Disk Drive"; - discSubType = "DEC RP-04"; - break; - case CommonTypes.MediaType.RP05: - case CommonTypes.MediaType.RP05_18: - discType = "Hard Disk Drive"; - discSubType = "DEC RP-05"; - break; - case CommonTypes.MediaType.RP06: - case CommonTypes.MediaType.RP06_18: - discType = "Hard Disk Drive"; - discSubType = "DEC RP-06"; - break; - case CommonTypes.MediaType.RDX: - discType = "RDX"; - discSubType = "RDX"; - break; - case CommonTypes.MediaType.RDX320: - discType = "RDX"; - discSubType = "RDX 320"; - break; - case CommonTypes.MediaType.Zone_HDD: - discType = "Zoned Hard Disk Drive"; - discSubType = "Unknown"; - break; - case CommonTypes.MediaType.Microdrive: - discType = "Hard Disk Drive"; - discSubType = "Microdrive"; - break; - case CommonTypes.MediaType.VideoNow: - discType = "VideoNow"; - discSubType = "VideoNow"; - break; - case CommonTypes.MediaType.VideoNowColor: - discType = "VideoNow"; - discSubType = "VideoNow Color"; - break; - case CommonTypes.MediaType.VideoNowXp: - discType = "VideoNow"; - discSubType = "VideoNow XP"; - break; - default: - discType = "Unknown"; - discSubType = "Unknown"; - break; - } - } - } -} \ No newline at end of file diff --git a/DiscImageChef.CommonTypes/Metadata/Resume.cs b/DiscImageChef.CommonTypes/Metadata/Resume.cs deleted file mode 100644 index 356da460d..000000000 --- a/DiscImageChef.CommonTypes/Metadata/Resume.cs +++ /dev/null @@ -1,64 +0,0 @@ -// /*************************************************************************** -// The Disc Image Chef -// ---------------------------------------------------------------------------- -// -// Filename : Resume.cs -// Author(s) : Natalia Portillo -// -// Component : XML metadata. -// -// --[ Description ] ---------------------------------------------------------- -// -// Defines XML format of a dump resume file. -// -// --[ 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; -using System.Collections.Generic; -using System.Xml.Serialization; -using Schemas; - -namespace DiscImageChef.CommonTypes.Metadata -{ - [Serializable] - [XmlRoot("DicResume", Namespace = "", IsNullable = false)] - public class Resume - { - [XmlElement(DataType = "dateTime")] - public DateTime CreationDate; - [XmlElement(DataType = "dateTime")] - public DateTime LastWriteDate; - public bool Removable; - public ulong LastBlock; - public ulong NextBlock; - public bool Tape; - - [XmlArrayItem("DumpTry")] - public List Tries; - [XmlArrayItem("Block")] - public List BadBlocks; - } -} \ No newline at end of file diff --git a/DiscImageChef.CommonTypes/Metadata/Statistics.cs b/DiscImageChef.CommonTypes/Metadata/Statistics.cs deleted file mode 100644 index 33cc6ed7b..000000000 --- a/DiscImageChef.CommonTypes/Metadata/Statistics.cs +++ /dev/null @@ -1,199 +0,0 @@ -// /*************************************************************************** -// The Disc Image Chef -// ---------------------------------------------------------------------------- -// -// Filename : Statistics.cs -// Author(s) : Natalia Portillo -// -// Component : XML metadata. -// -// --[ Description ] ---------------------------------------------------------- -// -// Define XML for statistics. -// -// --[ 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 System.Xml.Serialization; - -namespace DiscImageChef.CommonTypes.Metadata -{ - [XmlRoot("DicStats", Namespace = "", IsNullable = false)] - public class Stats - { - public CommandsStats Commands; - [XmlArrayItem("OperatingSystem")] - public List OperatingSystems { get; set; } - [XmlArrayItem("Version")] - public List Versions { get; set; } - [XmlArrayItem("Filesystem")] - public List Filesystems { get; set; } - [XmlArrayItem("Scheme")] - public List Partitions { get; set; } - [XmlArrayItem("Format")] - public List MediaImages { get; set; } - [XmlArrayItem("Filter", IsNullable = true)] - public List Filters { get; set; } - [XmlArrayItem("Device", IsNullable = true)] - public List Devices { get; set; } - [XmlArrayItem("Media")] - public List Medias { get; set; } - public BenchmarkStats Benchmark { get; set; } - public MediaScanStats MediaScan { get; set; } - public VerifyStats Verify { get; set; } - } - - public class StatsDto - { - public List Commands { get; set; } - public List OperatingSystems { get; set; } - public List Versions { get; set; } - public List Filesystems { get; set; } - public List Partitions { get; set; } - public List MediaFormats { get; set; } - public List Filters { get; set; } - public List Devices { get; set; } - public List Medias { get; set; } - } - - public class CommandsStats - { - public long Analyze; - public long Benchmark; - public long Checksum; - public long Compare; - public long ConvertImage; - public long CreateSidecar; - public long Decode; - public long DeviceInfo; - public long DeviceReport; - public long DumpMedia; - public long Entropy; - public long ExtractFiles; - public long Formats; - public long ImageInfo; - public long ListDevices; - public long ListEncodings; - public long Ls; - public long MediaInfo; - public long MediaScan; - public long PrintHex; - public long Verify; - } - - public class VerifiedItems - { - public long Correct; - public long Failed; - } - - public class VerifyStats - { - public VerifiedItems MediaImages; - public ScannedSectors Sectors; - } - - public class ScannedSectors - { - public long Correct; - public long Error; - public long Total; - public long Unverifiable; - } - - public class TimeStats - { - public long LessThan10ms; - public long LessThan150ms; - public long LessThan3ms; - public long LessThan500ms; - public long LessThan50ms; - public long MoreThan500ms; - } - - public class MediaScanStats - { - public ScannedSectors Sectors; - public TimeStats Times; - } - - public class ChecksumStats - { - [XmlAttribute] - public string algorithm; - [XmlText] - public double Value; - } - - public class BenchmarkStats - { - public double All; - [XmlElement("Checksum")] - public List Checksum; - public double Entropy; - public long MaxMemory; - public long MinMemory; - public double Sequential; - } - - public class MediaStats - { - [XmlAttribute] - public bool real; - [XmlAttribute] - public string type; - [XmlText] - public long Value; - } - - public class DeviceStats - { - [XmlIgnore] - public bool ManufacturerSpecified; - public string Manufacturer { get; set; } - public string Model { get; set; } - public string Revision { get; set; } - public string Bus { get; set; } - } - - public class NameValueStats - { - [XmlAttribute] - public string name { get; set; } - [XmlText] - public long Value { get; set; } - } - - public class OsStats - { - [XmlAttribute] - public string name { get; set; } - [XmlAttribute] - public string version { get; set; } - [XmlText] - public long Value { get; set; } - } -} \ No newline at end of file diff --git a/DiscImageChef.CommonTypes/Metadata/Version.cs b/DiscImageChef.CommonTypes/Metadata/Version.cs deleted file mode 100644 index 0284f6061..000000000 --- a/DiscImageChef.CommonTypes/Metadata/Version.cs +++ /dev/null @@ -1,58 +0,0 @@ -// /*************************************************************************** -// The Disc Image Chef -// ---------------------------------------------------------------------------- -// -// Filename : Statistics.cs -// Author(s) : Natalia Portillo -// -// Component : XML metadata. -// -// --[ Description ] ---------------------------------------------------------- -// -// Returns DiscImageChef version in XML software type format. -// -// --[ 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 DiscImageChef.CommonTypes.Interop; -using Schemas; - -namespace DiscImageChef.CommonTypes.Metadata -{ - public static class Version - { - /// - /// Gets XML software type for the running version - /// - /// XML software type - public static SoftwareType GetSoftwareType() => - new SoftwareType - { - Name = "DiscImageChef", - OperatingSystem = DetectOS.GetRealPlatformID().ToString(), - Version = typeof(Version).Assembly.GetName().Version.ToString() - }; - } -} \ No newline at end of file diff --git a/DiscImageChef.CommonTypes/Partition.cs b/DiscImageChef.CommonTypes/Partition.cs deleted file mode 100644 index f933081e3..000000000 --- a/DiscImageChef.CommonTypes/Partition.cs +++ /dev/null @@ -1,113 +0,0 @@ -// /*************************************************************************** -// The Disc Image Chef -// ---------------------------------------------------------------------------- -// -// Filename : Partition.cs -// Author(s) : Natalia Portillo -// -// Component : DiscImageChef common types. -// -// --[ Description ] ---------------------------------------------------------- -// -// Contains common partition types. -// -// --[ 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; - -namespace DiscImageChef.CommonTypes -{ - /// - /// Partition structure. - /// - public struct Partition : IEquatable, IComparable - { - /// Partition number, 0-started - public ulong Sequence; - /// Partition type - public string Type; - /// Partition name (if the scheme supports it) - public string Name; - /// Start of the partition, in bytes - public ulong Offset; - /// LBA of partition start - public ulong Start; - /// Length in bytes of the partition - public ulong Size; - /// Length in sectors of the partition - public ulong Length; - /// Information that does not find space in this struct - public string Description; - /// LBA of last partition sector - public ulong End => Start + Length - 1; - /// Name of partition scheme that contains this partition - public string Scheme; - - /// - /// Compares two partitions - /// - /// Partition to compare with - /// 0 if both partitions start and end at the same sector - public bool Equals(Partition other) => Start == other.Start && Length == other.Length; - - public override bool Equals(object obj) => obj is Partition partition && Equals(partition); - - public override int GetHashCode() => Start.GetHashCode() + End.GetHashCode(); - - /// - /// Compares this partition with another and returns an integer that indicates whether the current partition precedes, - /// follows, or is in the same place as the other partition. - /// - /// Partition to compare with - /// A value that indicates the relative equality of the partitions being compared. - public int CompareTo(Partition other) - { - if(Start == other.Start && End == other.End) return 0; - - if(Start > other.Start || End > other.End) return 1; - - return -1; - } - - // Define the equality operator. - public static bool operator ==(Partition operand1, Partition operand2) => operand1.Equals(operand2); - - // Define the inequality operator. - public static bool operator !=(Partition operand1, Partition operand2) => !operand1.Equals(operand2); - - // Define the is greater than operator. - public static bool operator >(Partition operand1, Partition operand2) => operand1.CompareTo(operand2) == 1; - - // Define the is less than operator. - public static bool operator <(Partition operand1, Partition operand2) => operand1.CompareTo(operand2) == -1; - - // Define the is greater than or equal to operator. - public static bool operator >=(Partition operand1, Partition operand2) => operand1.CompareTo(operand2) >= 0; - - // Define the is less than or equal to operator. - public static bool operator <=(Partition operand1, Partition operand2) => operand1.CompareTo(operand2) <= 0; - } -} \ No newline at end of file diff --git a/DiscImageChef.CommonTypes/PluginBase.cs b/DiscImageChef.CommonTypes/PluginBase.cs deleted file mode 100644 index 264e2604c..000000000 --- a/DiscImageChef.CommonTypes/PluginBase.cs +++ /dev/null @@ -1,152 +0,0 @@ -// /*************************************************************************** -// The Disc Image Chef -// ---------------------------------------------------------------------------- -// -// Filename : PluginBase.cs -// Author(s) : Natalia Portillo -// -// Component : Core algorithms. -// -// --[ Description ] ---------------------------------------------------------- -// -// Class to hold all installed 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; -using System.Collections.Generic; -using System.Linq; -using DiscImageChef.CommonTypes.Interfaces; -using DiscImageChef.Partitions; - -namespace DiscImageChef.CommonTypes -{ - /// - /// Contain all plugins (filesystem, partition and image) - /// - public class PluginBase - { - /// - /// List of checksum plugins - /// - public readonly List Checksums; - /// - /// List of filter plugins - /// - public readonly SortedDictionary Filters; - /// - /// List of floppy image plugins - /// - public readonly SortedDictionary FloppyImages; - /// - /// List of all media image plugins - /// - public readonly SortedDictionary ImagePluginsList; - /// - /// List of all partition plugins - /// - public readonly SortedDictionary PartPluginsList; - /// - /// List of all filesystem plugins - /// - public readonly SortedDictionary PluginsList; - /// - /// List of read-only filesystem plugins - /// - public readonly SortedDictionary ReadOnlyFilesystems; - /// - /// List of writable floppy image plugins - /// - public readonly SortedDictionary WritableFloppyImages; - /// - /// List of writable media image plugins - /// - public readonly SortedDictionary WritableImages; - - /// - /// Initializes the plugins lists - /// - public PluginBase() - { - PluginsList = new SortedDictionary(); - ReadOnlyFilesystems = new SortedDictionary(); - PartPluginsList = new SortedDictionary(); - ImagePluginsList = new SortedDictionary(); - WritableImages = new SortedDictionary(); - Checksums = new List(); - Filters = new SortedDictionary(); - FloppyImages = new SortedDictionary(); - WritableFloppyImages = new SortedDictionary(); - } - - public void AddPlugins(IPluginRegister pluginRegister) - { - foreach(Type type in pluginRegister.GetAllChecksumPlugins() ?? Enumerable.Empty()) - if(type.GetConstructor(Type.EmptyTypes)?.Invoke(new object[] { }) is IChecksum plugin) - Checksums.Add(plugin); - - foreach(Type type in pluginRegister.GetAllFilesystemPlugins() ?? Enumerable.Empty()) - if(type.GetConstructor(Type.EmptyTypes)?.Invoke(new object[] { }) is IFilesystem plugin && - !PluginsList.ContainsKey(plugin.Name.ToLower())) - PluginsList.Add(plugin.Name.ToLower(), plugin); - - foreach(Type type in pluginRegister.GetAllFilterPlugins() ?? Enumerable.Empty()) - if(type.GetConstructor(Type.EmptyTypes)?.Invoke(new object[] { }) is IFilter plugin && - !Filters.ContainsKey(plugin.Name.ToLower())) - Filters.Add(plugin.Name.ToLower(), plugin); - - foreach(Type type in pluginRegister.GetAllFloppyImagePlugins() ?? Enumerable.Empty()) - if(type.GetConstructor(Type.EmptyTypes)?.Invoke(new object[] { }) is IFloppyImage plugin && - !FloppyImages.ContainsKey(plugin.Name.ToLower())) - FloppyImages.Add(plugin.Name.ToLower(), plugin); - - foreach(Type type in pluginRegister.GetAllMediaImagePlugins() ?? Enumerable.Empty()) - if(type.GetConstructor(Type.EmptyTypes)?.Invoke(new object[] { }) is IMediaImage plugin && - !ImagePluginsList.ContainsKey(plugin.Name.ToLower())) - ImagePluginsList.Add(plugin.Name.ToLower(), plugin); - - foreach(Type type in pluginRegister.GetAllPartitionPlugins() ?? Enumerable.Empty()) - if(type.GetConstructor(Type.EmptyTypes)?.Invoke(new object[] { }) is IPartition plugin && - !PartPluginsList.ContainsKey(plugin.Name.ToLower())) - PartPluginsList.Add(plugin.Name.ToLower(), plugin); - - foreach(Type type in pluginRegister.GetAllReadOnlyFilesystemPlugins() ?? Enumerable.Empty()) - if(type.GetConstructor(Type.EmptyTypes)?.Invoke(new object[] { }) is IReadOnlyFilesystem plugin && - !ReadOnlyFilesystems.ContainsKey(plugin.Name.ToLower())) - ReadOnlyFilesystems.Add(plugin.Name.ToLower(), plugin); - - foreach(Type type in pluginRegister.GetAllWritableFloppyImagePlugins() ?? Enumerable.Empty()) - if(type.GetConstructor(Type.EmptyTypes)?.Invoke(new object[] { }) is IWritableFloppyImage plugin && - !WritableFloppyImages.ContainsKey(plugin.Name.ToLower())) - WritableFloppyImages.Add(plugin.Name.ToLower(), plugin); - - foreach(Type type in pluginRegister.GetAllWritableImagePlugins() ?? Enumerable.Empty()) - if(type.GetConstructor(Type.EmptyTypes)?.Invoke(new object[] { }) is IWritableImage plugin && - !WritableImages.ContainsKey(plugin.Name.ToLower())) - WritableImages.Add(plugin.Name.ToLower(), plugin); - } - } -} \ No newline at end of file diff --git a/DiscImageChef.CommonTypes/Structs/Filesystems.cs b/DiscImageChef.CommonTypes/Structs/Filesystems.cs deleted file mode 100644 index f85c27422..000000000 --- a/DiscImageChef.CommonTypes/Structs/Filesystems.cs +++ /dev/null @@ -1,336 +0,0 @@ -// /*************************************************************************** -// The Disc Image Chef -// ---------------------------------------------------------------------------- -// -// Filename : Structs.cs -// Author(s) : Natalia Portillo -// -// Component : DiscImageChef filesystem plugins. -// -// --[ Description ] ---------------------------------------------------------- -// -// Contains enumerations and structures of common usage by filesystem -// 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; -using System.Runtime.InteropServices; - -namespace DiscImageChef.CommonTypes.Structs -{ - /// - /// File attributes. - /// - [Flags] - public enum FileAttributes : ulong - { - /// File has no attributes - None = 0, - /// File is an alias (Mac OS) - Alias = 0x01, - /// Indicates that the file can only be writable appended - AppendOnly = 0x02, - /// File is candidate for archival/backup - Archive = 0x04, - /// File is a block device - BlockDevice = 0x08, - /// File is stored on filesystem block units instead of device sectors - BlockUnits = 0x10, - /// Directory is a bundle or file contains a BNDL resource - Bundle = 0x20, - /// File is a char device - CharDevice = 0x40, - /// File is compressed - Compressed = 0x80, - /// File is compressed and should not be uncompressed on read - CompressedRaw = 0x100, - /// File has compression errors - CompressionError = 0x200, - /// Compressed file is dirty - CompressionDirty = 0x400, - /// File is a device - Device = 0x800, - /// File is a directory - Directory = 0x1000, - /// File is encrypted - Encrypted = 0x2000, - /// File is stored on disk using extents - Extents = 0x4000, - /// File is a FIFO - FIFO = 0x8000, - /// File is a normal file - File = 0x10000, - /// File is a Mac OS file containing desktop databases that has already been added to the desktop database - HasBeenInited = 0x20000, - /// File contains an icon resource / EA - HasCustomIcon = 0x40000, - /// File is a Mac OS extension or control panel lacking INIT resources - HasNoINITs = 0x80000, - /// File is hidden/invisible - Hidden = 0x100000, - /// File cannot be written, deleted, modified or linked to - Immutable = 0x200000, - /// Directory is indexed using hashed trees - IndexedDirectory = 0x400000, - /// File contents are stored alongside its inode (or equivalent) - Inline = 0x800000, - /// File contains integrity checks - IntegrityStream = 0x1000000, - /// File is on desktop - IsOnDesk = 0x2000000, - /// File changes are written to filesystem journal before being written to file itself - Journaled = 0x4000000, - /// Access time will not be modified - NoAccessTime = 0x8000000, - /// File will not be subject to copy-on-write - NoCopyOnWrite = 0x10000000, - /// File will not be backed up - NoDump = 0x20000000, - /// File contents should not be scrubbed - NoScrub = 0x40000000, - /// File contents should not be indexed - NotIndexed = 0x80000000, - /// File is offline - Offline = 0x100000000, - /// File is password protected, but contents are not encrypted on disk - Password = 0x200000000, - /// File is read-only - ReadOnly = 0x400000000, - /// File is a reparse point - ReparsePoint = 0x800000000, - /// When file is removed its content will be overwritten with zeroes - Secured = 0x1000000000, - /// File contents are sparse - Sparse = 0x2000000000, - /// File is a shadow (OS/2) - Shadow = 0x4000000000, - /// File is shared - Shared = 0x8000000000, - /// File is a stationery - Stationery = 0x10000000000, - /// File is a symbolic link - Symlink = 0x20000000000, - /// File writes are synchronously written to disk - Sync = 0x40000000000, - /// File belongs to the operating system - System = 0x80000000000, - /// If file end is a partial block its content will be merged with other files - TailMerged = 0x100000000000, - /// File is temporary - Temporary = 0x200000000000, - /// Subdirectories inside of this directory are not related and should be allocated elsewhere - TopDirectory = 0x400000000000, - /// If file is deleted, contents should be stored, for a possible future undeletion - Undeletable = 0x800000000000, - /// File is a pipe - Pipe = 0x1000000000000, - /// File is a socket - Socket = 0x2000000000000 - } - - /// - /// Information about a file entry - /// - public class FileEntryInfo - { - /// File attributes - public FileAttributes Attributes; - /// File length in blocks - public long Blocks; - /// File block size in bytes - public long BlockSize; - /// If file points to a device, device number. Null if the underlying filesystem does not support them. - public ulong? DeviceNo; - /// POSIX group ID. Null if the underlying filesystem does not support them. - public ulong? GID; - /// inode number for this file (or other unique identifier for the volume) - public ulong Inode; - /// File length in bytes - public long Length; - /// Number of hard links pointing to this file (. and .. entries count as hard links) - public ulong Links; - /// POSIX permissions/mode for this file. Null if the underlying filesystem does not support them. - public uint? Mode; - /// POSIX owner ID. Null if the underlying filesystem does not support them. - public ulong? UID; - /// File creation date in UTC. Null if the underlying filesystem does not support them. - public DateTime? CreationTimeUtc { get; set; } - /// File last access date in UTC. Null if the underlying filesystem does not support them. - public DateTime? AccessTimeUtc { get; set; } - /// File attributes change date in UTC. Null if the underlying filesystem does not support them. - public DateTime? StatusChangeTimeUtc { get; set; } - /// File last backup date in UTC. Null if the underlying filesystem does not support them. - public DateTime? BackupTimeUtc { get; set; } - /// File last modification date in UTC. Null if the underlying filesystem does not support them. - public DateTime? LastWriteTimeUtc { get; set; } - - /// File creation date. Null if the underlying filesystem does not support them. - public DateTime? CreationTime - { - get => CreationTimeUtc?.ToLocalTime(); - set => CreationTimeUtc = value?.ToUniversalTime(); - } - /// File last access date. Null if the underlying filesystem does not support them. - public DateTime? AccessTime - { - get => AccessTimeUtc?.ToLocalTime(); - set => AccessTimeUtc = value?.ToUniversalTime(); - } - /// File attributes change date. Null if the underlying filesystem does not support them. - public DateTime? StatusChangeTime - { - get => StatusChangeTimeUtc?.ToLocalTime(); - set => StatusChangeTimeUtc = value?.ToUniversalTime(); - } - /// File last backup date. Null if the underlying filesystem does not support them. - public DateTime? BackupTime - { - get => BackupTimeUtc?.ToLocalTime(); - set => BackupTimeUtc = value?.ToUniversalTime(); - } - /// File last modification date. Null if the underlying filesystem does not support them. - public DateTime? LastWriteTime - { - get => LastWriteTimeUtc?.ToLocalTime(); - set => LastWriteTimeUtc = value?.ToUniversalTime(); - } - } - - public class FileSystemInfo - { - /// Blocks for this filesystem - public ulong Blocks; - /// Maximum length of filenames on this filesystem - public ushort FilenameLength; - /// Files on this filesystem - public ulong Files; - /// Blocks free on this filesystem - public ulong FreeBlocks; - /// Free inodes on this filesystem - public ulong FreeFiles; - /// Filesystem ID - public FileSystemId Id; - /// ID of plugin for this file - public Guid PluginId; - /// Filesystem type - public string Type; - - public FileSystemInfo() - { - Id = new FileSystemId(); - } - - public FileSystemInfo ShallowCopy() => (FileSystemInfo)MemberwiseClone(); - } - - [StructLayout(LayoutKind.Explicit)] - public struct FileSystemId - { - [FieldOffset(0)] - public bool IsInt; - [FieldOffset(1)] - public bool IsLong; - [FieldOffset(2)] - public bool IsGuid; - - [FieldOffset(3)] - public uint Serial32; - [FieldOffset(3)] - public ulong Serial64; - [FieldOffset(3)] - public Guid uuid; - } - - /// - /// Errors - /// - public enum Errno - { - /// No error happened - NoError = 0, - /// Access denied - AccessDenied = -13, - /// Busy, cannot complete - Busy = -16, - /// File is too large - FileTooLarge = -27, - /// Invalid argument - InvalidArgument = -22, - /// I/O error - InOutError = -5, - /// Is a directory (e.g.: trying to Read() a dir) - IsDirectory = -21, - /// Name is too long - NameTooLong = -36, - /// There is no data available - NoData = 61, - /// There is no such attribute - NoSuchExtendedAttribute = NoData, - /// No such device - NoSuchDevice = -19, - /// No such file or directory - NoSuchFile = -2, - /// Is not a directory (e.g.: trying to ReadDir() a file) - NotDirectory = -20, - /// Not implemented - NotImplemented = -38, - /// Not supported - NotSupported = -252, - /// Link is severed - SeveredLink = -67, - /// Access denied - EACCES = AccessDenied, - /// Busy, cannot complete - EBUSY = Busy, - /// File is too large - EFBIG = FileTooLarge, - /// Invalid argument - EINVAL = InvalidArgument, - /// I/O error - EIO = InOutError, - /// Is a directory (e.g.: trying to Read() a dir) - EISDIR = IsDirectory, - /// Name is too long - ENAMETOOLONG = NameTooLong, - /// There is no such attribute - ENOATTR = NoSuchExtendedAttribute, - /// There is no data available - ENODATA = NoData, - /// No such device - ENODEV = NoSuchDevice, - /// No such file or directory - ENOENT = NoSuchFile, - /// Link is severed - ENOLINK = SeveredLink, - /// Not implemented - ENOSYS = NotImplemented, - /// Is not a directory (e.g.: trying to ReadDir() a file) - ENOTDIR = NotDirectory, - /// Not supported - ENOTSUP = NotSupported - } -} \ No newline at end of file diff --git a/DiscImageChef.CommonTypes/Structs/Images.cs b/DiscImageChef.CommonTypes/Structs/Images.cs deleted file mode 100644 index 27c565103..000000000 --- a/DiscImageChef.CommonTypes/Structs/Images.cs +++ /dev/null @@ -1,194 +0,0 @@ -// /*************************************************************************** -// The Disc Image Chef -// ---------------------------------------------------------------------------- -// -// Filename : IMediaImage.cs -// Author(s) : Natalia Portillo -// -// Component : Disc image plugins. -// -// --[ Description ] ---------------------------------------------------------- -// -// Defines structures to be used by 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; -using System.Collections.Generic; -using DiscImageChef.CommonTypes.Enums; -using DiscImageChef.CommonTypes.Interfaces; - -namespace DiscImageChef.CommonTypes.Structs -{ - /// - /// Contains information about a dump image and its contents - /// - public struct ImageInfo - { - /// Image contains partitions (or tracks for optical media) - public bool HasPartitions; - /// Image contains sessions (optical media only) - public bool HasSessions; - /// Size of the image without headers - public ulong ImageSize; - /// Sectors contained in the image - public ulong Sectors; - /// Size of sectors contained in the image - public uint SectorSize; - /// Media tags contained by the image - public List ReadableMediaTags; - /// Sector tags contained by the image - public List ReadableSectorTags; - /// Image version - public string Version; - /// Application that created the image - public string Application; - /// Version of the application that created the image - public string ApplicationVersion; - /// Who (person) created the image? - public string Creator; - /// Image creation time - public DateTime CreationTime; - /// Image last modification time - public DateTime LastModificationTime; - /// Title of the media represented by the image - public string MediaTitle; - /// Image comments - public string Comments; - /// Manufacturer of the media represented by the image - public string MediaManufacturer; - /// Model of the media represented by the image - public string MediaModel; - /// Serial number of the media represented by the image - public string MediaSerialNumber; - /// Barcode of the media represented by the image - public string MediaBarcode; - /// Part number of the media represented by the image - public string MediaPartNumber; - /// Media type represented by the image - public MediaType MediaType; - /// Number in sequence for the media represented by the image - public int MediaSequence; - /// Last media of the sequence the media represented by the image corresponds to - public int LastMediaSequence; - /// Manufacturer of the drive used to read the media represented by the image - public string DriveManufacturer; - /// Model of the drive used to read the media represented by the image - public string DriveModel; - /// Serial number of the drive used to read the media represented by the image - public string DriveSerialNumber; - /// Firmware revision of the drive used to read the media represented by the image - public string DriveFirmwareRevision; - /// Type of the media represented by the image to use in XML sidecars - public XmlMediaType XmlMediaType; - // CHS geometry... - /// Cylinders of the media represented by the image - public uint Cylinders; - /// Heads of the media represented by the image - public uint Heads; - /// Sectors per track of the media represented by the image (for variable image, the smallest) - public uint SectorsPerTrack; - } - - /// - /// Session defining structure. - /// - public struct Session - { - /// Session number, 1-started - public ushort SessionSequence; - /// First track present on this session - public uint StartTrack; - /// Last track present on this session - public uint EndTrack; - /// First sector present on this session - public ulong StartSector; - /// Last sector present on this session - public ulong EndSector; - } - - /// - /// Track defining structure. - /// - public struct Track - { - /// Track number, 1-started - public uint TrackSequence; - /// Partition type - public TrackType TrackType; - /// Track starting sector - public ulong TrackStartSector; - /// Track ending sector - public ulong TrackEndSector; - /// Track pre-gap - public ulong TrackPregap; - /// Session this track belongs to - public ushort TrackSession; - /// Information that does not find space in this struct - public string TrackDescription; - /// Indexes, 00 to 99 and sector offset - public Dictionary Indexes; - /// Which filter stores this track - public IFilter TrackFilter; - /// Which file stores this track - public string TrackFile; - /// Starting at which byte is this track stored - public ulong TrackFileOffset; - /// What kind of file is storing this track - public string TrackFileType; - /// How many main channel / user data bytes are per sector in this track - public int TrackBytesPerSector; - /// How many main channel bytes per sector are in the file with this track - public int TrackRawBytesPerSector; - /// Which filter stores this track's subchannel - public IFilter TrackSubchannelFilter; - /// Which file stores this track's subchannel - public string TrackSubchannelFile; - /// Starting at which byte are this track's subchannel stored - public ulong TrackSubchannelOffset; - /// Type of subchannel stored for this track - public TrackSubchannelType TrackSubchannelType; - } - - /// - /// Floppy physical characteristics structure. - /// - public struct FloppyInfo - { - /// Physical floppy type. - public FloppyTypes Type; - /// Bitrate in bits per second used to write the floppy, 0 if unknown or track-variable. - public uint Bitrate; - /// Physical magnetic density (coercitivity) of floppy medium. - public FloppyDensities Coercitivity; - /// How many physical tracks are actually written in the floppy image. - public ushort Tracks; - /// How many physical heads are actually written in the floppy image. - public byte Heads; - /// How many tracks per inch are actually written in the floppy image. - public ushort TrackDensity; - } -} \ No newline at end of file diff --git a/DiscImageChef.CommonTypes/Structs/TapeFile.cs b/DiscImageChef.CommonTypes/Structs/TapeFile.cs deleted file mode 100644 index 18d289a9a..000000000 --- a/DiscImageChef.CommonTypes/Structs/TapeFile.cs +++ /dev/null @@ -1,59 +0,0 @@ -// /*************************************************************************** -// The Disc Image Chef -// ---------------------------------------------------------------------------- -// -// Filename : TapeFile.cs -// Author(s) : Natalia Portillo -// -// Component : Disc image plugins. -// -// --[ Description ] ---------------------------------------------------------- -// -// Defines a structure to hold information about a tape file object. -// -// --[ 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 -// ****************************************************************************/ -namespace DiscImageChef.CommonTypes.Structs -{ - public struct TapeFile - { - /// - /// File number - /// - public uint File; - /// - /// Partition number - /// - public byte Partition; - /// - /// First block, inclusive, of the file - /// - public ulong FirstBlock; - /// - /// Last block, inclusive, of the file - /// - public ulong LastBlock; - } -} \ No newline at end of file diff --git a/DiscImageChef.CommonTypes/Structs/TapePartition.cs b/DiscImageChef.CommonTypes/Structs/TapePartition.cs deleted file mode 100644 index a0de7938c..000000000 --- a/DiscImageChef.CommonTypes/Structs/TapePartition.cs +++ /dev/null @@ -1,56 +0,0 @@ -// /*************************************************************************** -// The Disc Image Chef -// ---------------------------------------------------------------------------- -// -// Filename : TapeFile.cs -// Author(s) : Natalia Portillo -// -// Component : Disc image plugins. -// -// --[ Description ] ---------------------------------------------------------- -// -// Defines a structure to hold information about a tape partition. -// -// --[ 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 -// ****************************************************************************/ - -namespace DiscImageChef.CommonTypes.Structs -{ - public struct TapePartition - { - /// - /// Partition number - /// - public byte Number; - /// - /// First block, inclusive, of the partition - /// - public ulong FirstBlock; - /// - /// Last block, inclusive, of the partition - /// - public ulong LastBlock; - } -} \ No newline at end of file