Remove DiscImageChef.CommonTypes dependence on DiscImageChef.Decoders.

This commit is contained in:
2020-01-11 20:55:47 +00:00
parent afa1525f0c
commit 1a2a4242eb
7 changed files with 2513 additions and 65 deletions

View File

@@ -39,9 +39,9 @@
using System;
using System.ComponentModel;
using System.Xml.Serialization;
using DiscImageChef.Decoders.ATA;
using DiscImageChef.Decoders.SCSI;
using DiscImageChef.Decoders.SCSI.MMC;
using DiscImageChef.CommonTypes.Structs.Devices.ATA;
using DiscImageChef.CommonTypes.Structs.Devices.SCSI;
using DiscImageChef.CommonTypes.Structs.Devices.SCSI.Modes;
using Newtonsoft.Json;
// ReSharper disable InconsistentNaming
@@ -484,57 +484,57 @@ namespace DiscImageChef.CommonTypes.Metadata
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; }
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 ModePage_2A_WriteDescriptor[] WriteSpeedPerformanceDescriptors { get; set; }
[XmlIgnore]
public bool MaximumSpeedSpecified { get; set; }

View File

@@ -43,9 +43,9 @@ 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 DiscImageChef.CommonTypes.Structs.Devices.ATA;
using DiscImageChef.CommonTypes.Structs.Devices.SCSI;
using DiscImageChef.CommonTypes.Structs.Devices.SCSI.Modes;
using Newtonsoft.Json;
// ReSharper disable VirtualMemberNeverOverridden.Global
@@ -474,10 +474,10 @@ namespace DiscImageChef.CommonTypes.Metadata
if(ata.WRVSectorCountMode2Specified)
identifyDevice.WRVSectorCountMode2 = ata.WRVSectorCountMode2;
Identify = Decoders.ATA.Identify.Encode(identifyDevice);
Identify = Structs.Devices.ATA.Identify.Encode(identifyDevice);
}
public Identify.IdentifyDevice? IdentifyDevice => Decoders.ATA.Identify.Decode(Identify);
public Identify.IdentifyDevice? IdentifyDevice => Structs.Devices.ATA.Identify.Decode(Identify);
[JsonIgnore]
public int Id { get; set; }
@@ -550,7 +550,7 @@ namespace DiscImageChef.CommonTypes.Metadata
if(InquiryData != null)
return;
var inq = new Inquiry.SCSIInquiry();
var inq = new Inquiry();
if(scsi.Inquiry.ANSIVersionSpecified)
inq.ANSIVersion = scsi.Inquiry.ANSIVersion;
@@ -620,10 +620,10 @@ namespace DiscImageChef.CommonTypes.Metadata
inq.WBus16 = scsi.Inquiry.WideBus16;
inq.WBus32 = scsi.Inquiry.WideBus32;
InquiryData = Decoders.SCSI.Inquiry.Encode(inq);
InquiryData = Structs.Devices.SCSI.Inquiry.Encode(inq);
}
public Inquiry.SCSIInquiry? Inquiry => Decoders.SCSI.Inquiry.Decode(InquiryData);
public Inquiry? Inquiry => Structs.Devices.SCSI.Inquiry.Decode(InquiryData);
[JsonIgnore]
public int Id { get; set; }
@@ -766,7 +766,7 @@ namespace DiscImageChef.CommonTypes.Metadata
public Mmc(mmcType mmc)
{
if(mmc.ModeSense2A != null)
ModeSense2AData = Modes.EncodeModePage_2A(new Modes.ModePage_2A
ModeSense2AData = ModePage_2A.Encode(new ModePage_2A
{
AccurateCDDA = mmc.ModeSense2A.AccurateCDDA, BCK = mmc.ModeSense2A.BCK,
BufferSize = mmc.ModeSense2A.BufferSize,
@@ -833,7 +833,7 @@ namespace DiscImageChef.CommonTypes.Metadata
[JsonIgnore]
public int Id { get; set; }
public virtual Modes.ModePage_2A ModeSense2A => Modes.DecodeModePage_2A(ModeSense2AData);
public virtual ModePage_2A ModeSense2A => ModePage_2A.Decode(ModeSense2AData);
public virtual MmcFeatures Features { get; set; }
public virtual List<TestedMedia> TestedMedia { get; set; }
public byte[] ModeSense2AData { get; set; }