diff --git a/ChangeLog b/ChangeLog index 108c91537..03de02e3e 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,8 @@ +2015-10-05 Natalia Portillo + + * DiscImageChef.sln: + Move decoders to a separate library. + 2015-10-05 Natalia Portillo * DiscImageChef.sln: diff --git a/DiscImageChef/Decoders/BD.cs b/DiscImageChef.Decoders/BD.cs similarity index 98% rename from DiscImageChef/Decoders/BD.cs rename to DiscImageChef.Decoders/BD.cs index cbca55066..d3b9e5a53 100644 --- a/DiscImageChef/Decoders/BD.cs +++ b/DiscImageChef.Decoders/BD.cs @@ -81,7 +81,7 @@ namespace DiscImageChef.Decoders if (DIResponse.Length != 4100) { - if (MainClass.isDebug) + //if (MainClass.isDebug) Console.WriteLine("DEBUG (BD Disc Information): Found incorrect Blu-ray Disc Information size ({0} bytes)", DIResponse.Length); return null; @@ -141,7 +141,7 @@ namespace DiscImageChef.Decoders } default: { - if (MainClass.isDebug) + //if (MainClass.isDebug) Console.WriteLine("DEBUG (BD Disc Information): Found unknown disc type identifier \"{0}\"", Encoding.ASCII.GetString(unit.DiscTypeIdentifier)); break; } @@ -210,7 +210,7 @@ namespace DiscImageChef.Decoders if (BCAResponse.Length != 68) { - if (MainClass.isDebug) + //if (MainClass.isDebug) Console.WriteLine("DEBUG (BD BCA): Found incorrect Blu-ray BCA size ({0} bytes)", BCAResponse.Length); return null; @@ -238,7 +238,7 @@ namespace DiscImageChef.Decoders StringBuilder sb = new StringBuilder(); - if (MainClass.isDebug) + //if (MainClass.isDebug) { sb.AppendFormat("DEBUG (BD BCA): Reserved1 = 0x{0:X2}", response.Reserved1).AppendLine(); sb.AppendFormat("DEBUG (BD BCA): Reserved2 = 0x{0:X2}", response.Reserved2).AppendLine(); @@ -270,7 +270,7 @@ namespace DiscImageChef.Decoders decoded.Signature = BigEndianBitConverter.ToUInt16(DDSResponse, 4); if (decoded.Signature != DDSIdentifier) { - if (MainClass.isDebug) + //if (MainClass.isDebug) Console.WriteLine("DEBUG (BD DDS): Found incorrect DDS signature (0x{0:X4})", decoded.Signature); return null; @@ -312,7 +312,7 @@ namespace DiscImageChef.Decoders StringBuilder sb = new StringBuilder(); - if (MainClass.isDebug) + //if (MainClass.isDebug) { sb.AppendFormat("DEBUG (BD Disc Definition Structure): Reserved1 = 0x{0:X2}", response.Reserved1).AppendLine(); sb.AppendFormat("DEBUG (BD Disc Definition Structure): Reserved2 = 0x{0:X2}", response.Reserved2).AppendLine(); @@ -358,7 +358,7 @@ namespace DiscImageChef.Decoders if (CSResponse.Length != 8) { - if (MainClass.isDebug) + //if (MainClass.isDebug) Console.WriteLine("DEBUG (BD Cartridge Status): Found incorrect Blu-ray Spare Area Information size ({0} bytes)", CSResponse.Length); return null; @@ -392,7 +392,7 @@ namespace DiscImageChef.Decoders StringBuilder sb = new StringBuilder(); - if (MainClass.isDebug) + //if (MainClass.isDebug) { sb.AppendFormat("DEBUG (BD Cartridge Status): Reserved1 = 0x{0:X2}", response.Reserved1).AppendLine(); sb.AppendFormat("DEBUG (BD Cartridge Status): Reserved2 = 0x{0:X2}", response.Reserved2).AppendLine(); @@ -414,7 +414,7 @@ namespace DiscImageChef.Decoders else { sb.AppendLine("Media is not in a cartridge"); - if (MainClass.isDebug) + //if (MainClass.isDebug) { if (response.OUT) sb.AppendLine("Media has out bit marked, shouldn't"); @@ -438,7 +438,7 @@ namespace DiscImageChef.Decoders if (SAIResponse.Length != 16) { - if (MainClass.isDebug) + //if (MainClass.isDebug) Console.WriteLine("DEBUG (BD Spare Area Information): Found incorrect Blu-ray Spare Area Information size ({0} bytes)", SAIResponse.Length); return null; @@ -467,7 +467,7 @@ namespace DiscImageChef.Decoders StringBuilder sb = new StringBuilder(); - if (MainClass.isDebug) + //if (MainClass.isDebug) { sb.AppendFormat("DEBUG (BD Spare Area Information): Reserved1 = 0x{0:X2}", response.Reserved1).AppendLine(); sb.AppendFormat("DEBUG (BD Spare Area Information): Reserved2 = 0x{0:X2}", response.Reserved2).AppendLine(); diff --git a/DiscImageChef/Decoders/CD.cs b/DiscImageChef.Decoders/CD.cs similarity index 99% rename from DiscImageChef/Decoders/CD.cs rename to DiscImageChef.Decoders/CD.cs index a1ad5c8cd..8a432a647 100644 --- a/DiscImageChef/Decoders/CD.cs +++ b/DiscImageChef.Decoders/CD.cs @@ -203,7 +203,7 @@ namespace DiscImageChef.Decoders if (decoded.DataLength + 2 != CDTOCResponse.Length) { - if (MainClass.isDebug) + //if (MainClass.isDebug) Console.WriteLine("DEBUG (CDTOC Decoder): Expected CDTOC size ({0} bytes) is not received size ({1} bytes), not decoding", decoded.DataLength + 2, CDTOCResponse.Length); return null; } @@ -287,7 +287,7 @@ namespace DiscImageChef.Decoders else sb.AppendLine("Digital copy of track is prohibited"); - if (MainClass.isDebug) + //if (MainClass.isDebug) { sb.AppendFormat("Reserved1: {0:X2}", descriptor.Reserved1).AppendLine(); sb.AppendFormat("Reserved2: {0:X2}", descriptor.Reserved2).AppendLine(); @@ -322,7 +322,7 @@ namespace DiscImageChef.Decoders if (decoded.DataLength + 2 != CDSessionInfoResponse.Length) { - if (MainClass.isDebug) + //if (MainClass.isDebug) Console.WriteLine("DEBUG (CDSessionInfo Decoder): Expected CDSessionInfo size ({0} bytes) is not received size ({1} bytes), not decoding", decoded.DataLength + 2, CDSessionInfoResponse.Length); return null; } @@ -406,7 +406,7 @@ namespace DiscImageChef.Decoders else sb.AppendLine("Digital copy of track is prohibited"); - if (MainClass.isDebug) + //if (MainClass.isDebug) { sb.AppendFormat("Reserved1: {0:X2}", descriptor.Reserved1).AppendLine(); sb.AppendFormat("Reserved2: {0:X2}", descriptor.Reserved2).AppendLine(); @@ -441,7 +441,7 @@ namespace DiscImageChef.Decoders if (decoded.DataLength + 2 != CDFullTOCResponse.Length) { - if (MainClass.isDebug) + //if (MainClass.isDebug) Console.WriteLine("DEBUG (CDFullTOC Decoder): Expected CDFullTOC size ({0} bytes) is not received size ({1} bytes), not decoding", decoded.DataLength + 2, CDFullTOCResponse.Length); return null; } @@ -600,7 +600,7 @@ namespace DiscImageChef.Decoders case 0xC1: { sb.AppendFormat("Copy of information of A1 from ATIP found"); - if (MainClass.isDebug) + //if (MainClass.isDebug) { sb.AppendFormat("Min = {0}", descriptor.Min).AppendLine(); sb.AppendFormat("Sec = {0}", descriptor.Sec).AppendLine(); @@ -674,7 +674,7 @@ namespace DiscImageChef.Decoders if (decoded.DataLength + 2 != CDPMAResponse.Length) { - if (MainClass.isDebug) + //if (MainClass.isDebug) Console.WriteLine("DEBUG (CDPMA Decoder): Expected CDPMA size ({0} bytes) is not received size ({1} bytes), not decoding", decoded.DataLength + 2, CDPMAResponse.Length); return null; } @@ -708,14 +708,14 @@ namespace DiscImageChef.Decoders StringBuilder sb = new StringBuilder(); - if (MainClass.isDebug) + //if (MainClass.isDebug) { sb.AppendFormat("Reserved1: 0x{0:X2}", response.Reserved1).AppendLine(); sb.AppendFormat("Reserved2: 0x{0:X2}", response.Reserved2).AppendLine(); } foreach (CDPMADescriptors descriptor in response.PMADescriptors) { - if (MainClass.isDebug) + //if (MainClass.isDebug) sb.AppendFormat("Reserved1: 0x{0:X2}", descriptor.Reserved).AppendLine(); sb.AppendFormat("ADR = {0}", descriptor.ADR).AppendLine(); sb.AppendFormat("CONTROL = {0}", descriptor.CONTROL).AppendLine(); @@ -751,7 +751,7 @@ namespace DiscImageChef.Decoders if (CDATIPResponse.Length != 32) { - if (MainClass.isDebug) + //if (MainClass.isDebug) Console.WriteLine("DEBUG (CDATIP Decoder): Expected CDATIP size (32 bytes) is not received size ({0} bytes), not decoding", CDATIPResponse.Length); return null; } @@ -912,7 +912,7 @@ namespace DiscImageChef.Decoders if (decoded.DataLength + 2 != CDTextResponse.Length) { - if (MainClass.isDebug) + //if (MainClass.isDebug) Console.WriteLine("DEBUG (CD-TEXT Decoder): Expected CD-TEXT size ({0} bytes) is not received size ({1} bytes), not decoding", decoded.DataLength + 2, CDTextResponse.Length); return null; } @@ -942,7 +942,7 @@ namespace DiscImageChef.Decoders StringBuilder sb = new StringBuilder(); - if (MainClass.isDebug) + //if (MainClass.isDebug) { sb.AppendFormat("Reserved1: 0x{0:X2}", response.Reserved1).AppendLine(); sb.AppendFormat("Reserved2: 0x{0:X2}", response.Reserved2).AppendLine(); diff --git a/DiscImageChef.Decoders/ChangeLog b/DiscImageChef.Decoders/ChangeLog new file mode 100644 index 000000000..95be0c1ff --- /dev/null +++ b/DiscImageChef.Decoders/ChangeLog @@ -0,0 +1,12 @@ +2015-10-05 Natalia Portillo + + * CD.cs: + * BD.cs: + * MMC.cs: + * DVD.cs: + * SCSI.cs: + * Floppy.cs: + * Properties/AssemblyInfo.cs: + * DiscImageChef.Decoders.csproj: + Move decoders to a separate library. + diff --git a/DiscImageChef/Decoders/DVD.cs b/DiscImageChef.Decoders/DVD.cs similarity index 100% rename from DiscImageChef/Decoders/DVD.cs rename to DiscImageChef.Decoders/DVD.cs diff --git a/DiscImageChef.Decoders/DiscImageChef.Decoders.csproj b/DiscImageChef.Decoders/DiscImageChef.Decoders.csproj new file mode 100644 index 000000000..cad6d951c --- /dev/null +++ b/DiscImageChef.Decoders/DiscImageChef.Decoders.csproj @@ -0,0 +1,52 @@ + + + + Debug + AnyCPU + 8.0.30703 + 2.0 + {0BEB3088-B634-4289-AE17-CDF2D25D00D5} + Library + DiscImageChef.Decoders + DiscImageChef.Decoders + 2.2 + v3.5 + + + true + full + false + bin\Debug + DEBUG; + prompt + 4 + false + + + full + true + bin\Release + prompt + 4 + false + + + + + + + + + + + + + + + + + {F8BDF57B-1571-4CD0-84B3-B422088D359A} + DiscImageChef.Helpers + + + \ No newline at end of file diff --git a/DiscImageChef/Decoders/Floppy.cs b/DiscImageChef.Decoders/Floppy.cs similarity index 100% rename from DiscImageChef/Decoders/Floppy.cs rename to DiscImageChef.Decoders/Floppy.cs diff --git a/DiscImageChef/Decoders/MMC.cs b/DiscImageChef.Decoders/MMC.cs similarity index 99% rename from DiscImageChef/Decoders/MMC.cs rename to DiscImageChef.Decoders/MMC.cs index 4a0b1d56c..61323d53f 100644 --- a/DiscImageChef/Decoders/MMC.cs +++ b/DiscImageChef.Decoders/MMC.cs @@ -131,7 +131,7 @@ namespace DiscImageChef.Decoders StringBuilder sb = new StringBuilder(); - if (MainClass.isDebug) + //if (MainClass.isDebug) { sb.AppendFormat("DEBUG (AACS Volume Identifier): Reserved1 = 0x{0:X2}", response.Reserved1).AppendLine(); sb.AppendFormat("DEBUG (AACS Volume Identifier): Reserved2 = 0x{0:X2}", response.Reserved2).AppendLine(); @@ -176,7 +176,7 @@ namespace DiscImageChef.Decoders StringBuilder sb = new StringBuilder(); - if (MainClass.isDebug) + //if (MainClass.isDebug) { sb.AppendFormat("DEBUG (AACS Media Serial Number): Reserved1 = 0x{0:X2}", response.Reserved1).AppendLine(); sb.AppendFormat("DEBUG (AACS Media Serial Number): Reserved2 = 0x{0:X2}", response.Reserved2).AppendLine(); @@ -221,7 +221,7 @@ namespace DiscImageChef.Decoders StringBuilder sb = new StringBuilder(); - if (MainClass.isDebug) + //if (MainClass.isDebug) { sb.AppendFormat("DEBUG (AACS Media Identifier): Reserved1 = 0x{0:X2}", response.Reserved1).AppendLine(); sb.AppendFormat("DEBUG (AACS Media Identifier): Reserved2 = 0x{0:X2}", response.Reserved2).AppendLine(); @@ -266,7 +266,7 @@ namespace DiscImageChef.Decoders StringBuilder sb = new StringBuilder(); - if (MainClass.isDebug) + //if (MainClass.isDebug) { sb.AppendFormat("DEBUG (AACS Media Key Block): Reserved = 0x{0:X2}", response.Reserved).AppendLine(); } @@ -311,7 +311,7 @@ namespace DiscImageChef.Decoders StringBuilder sb = new StringBuilder(); - if (MainClass.isDebug) + //if (MainClass.isDebug) { sb.AppendFormat("DEBUG (AACS Data Keys): Reserved1 = 0x{0:X2}", response.Reserved1).AppendLine(); sb.AppendFormat("DEBUG (AACS Data Keys): Reserved2 = 0x{0:X2}", response.Reserved2).AppendLine(); @@ -416,7 +416,7 @@ namespace DiscImageChef.Decoders StringBuilder sb = new StringBuilder(); - if (MainClass.isDebug) + //if (MainClass.isDebug) { sb.AppendFormat("DEBUG (CPRM Media Key Block): Reserved1 = 0x{0:X2}", response.Reserved).AppendLine(); } @@ -578,7 +578,7 @@ namespace DiscImageChef.Decoders if (response.SWPP) sb.AppendLine("Software write protection is set until power down"); - if (MainClass.isDebug) + //if (MainClass.isDebug) { sb.AppendFormat("DEBUG (Write Protection Status): Reserved1 = 0x{0:X2}", response.Reserved1).AppendLine(); sb.AppendFormat("DEBUG (Write Protection Status): Reserved2 = 0x{0:X2}", response.Reserved2).AppendLine(); diff --git a/DiscImageChef.Decoders/Properties/AssemblyInfo.cs b/DiscImageChef.Decoders/Properties/AssemblyInfo.cs new file mode 100644 index 000000000..4dbc185ab --- /dev/null +++ b/DiscImageChef.Decoders/Properties/AssemblyInfo.cs @@ -0,0 +1,27 @@ +using System.Reflection; +using System.Runtime.CompilerServices; + +// Information about this assembly is defined by the following attributes. +// Change them to the values specific to your project. + +[assembly: AssemblyTitle("DiscImageChef.Decoders")] +[assembly: AssemblyDescription("")] +[assembly: AssemblyConfiguration("")] +[assembly: AssemblyCompany("Claunia.com")] +[assembly: AssemblyProduct("")] +[assembly: AssemblyCopyright("© Claunia.com")] +[assembly: AssemblyTrademark("")] +[assembly: AssemblyCulture("")] + +// The assembly version has the format "{Major}.{Minor}.{Build}.{Revision}". +// The form "{Major}.{Minor}.*" will automatically update the build and revision, +// and "{Major}.{Minor}.{Build}.*" will update just the revision. + +[assembly: AssemblyVersion("1.0.*")] + +// The following attributes are used to specify the signing key for the assembly, +// if desired. See the Mono documentation for more information about signing. + +//[assembly: AssemblyDelaySign(false)] +//[assembly: AssemblyKeyFile("")] + diff --git a/DiscImageChef/Decoders/SCSI.cs b/DiscImageChef.Decoders/SCSI.cs similarity index 99% rename from DiscImageChef/Decoders/SCSI.cs rename to DiscImageChef.Decoders/SCSI.cs index c7d6469fe..a331baa73 100644 --- a/DiscImageChef/Decoders/SCSI.cs +++ b/DiscImageChef.Decoders/SCSI.cs @@ -2487,17 +2487,17 @@ namespace DiscImageChef.Decoders if (SCSIInquiryResponse.Length < 36) { - if (MainClass.isDebug) + //if (MainClass.isDebug) Console.WriteLine("DEBUG (SCSI INQUIRY Decoder): INQUIRY response is less than minimum of 36 bytes, decoded data can be incorrect, proceeding anyway."); - else + //else return null; } if (SCSIInquiryResponse.Length != SCSIInquiryResponse[4] + 4) { - if (MainClass.isDebug) + //if (MainClass.isDebug) Console.WriteLine("DEBUG (SCSI INQUIRY Decoder): INQUIRY response length ({0} bytes) is different than specified in length field ({1} bytes), decoded data can be incorrect, proceeding anyway.", SCSIInquiryResponse.Length, SCSIInquiryResponse[4] + 4); - else + //else return null; } @@ -2819,7 +2819,7 @@ namespace DiscImageChef.Decoders sb.AppendLine("Device supports TCQ queue"); if (response.IUS) sb.AppendLine("Device supports information unit transfers"); - if (MainClass.isDebug) + //if (MainClass.isDebug) { if (response.VS1) sb.AppendLine("Vendor specific bit 5 on byte 6 of INQUIRY response is set"); @@ -4292,7 +4292,7 @@ namespace DiscImageChef.Decoders } } - if (MainClass.isDebug) + //if (MainClass.isDebug) { sb.AppendFormat("DEBUG (SCSIInquiry Decoder): Reserved byte 1, bits 6 to 0 = 0x{0:X2}", response.Reserved1).AppendLine(); sb.AppendFormat("DEBUG (SCSIInquiry Decoder): Reserved byte 5, bits 2 to 1 = 0x{0:X2}", response.Reserved2).AppendLine(); diff --git a/DiscImageChef.sln b/DiscImageChef.sln index f056319f8..0cd3b0843 100644 --- a/DiscImageChef.sln +++ b/DiscImageChef.sln @@ -19,12 +19,18 @@ Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "DiscImageChef.Partitions", EndProject Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "DiscImageChef.Filesystems", "DiscImageChef.Filesystems\DiscImageChef.Filesystems.csproj", "{D7016DF2-5A5E-4524-B40D-BA2D59576688}" EndProject +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "DiscImageChef.Decoders", "DiscImageChef.Decoders\DiscImageChef.Decoders.csproj", "{0BEB3088-B634-4289-AE17-CDF2D25D00D5}" +EndProject Global GlobalSection(SolutionConfigurationPlatforms) = preSolution Debug|x86 = Debug|x86 Release|x86 = Release|x86 EndGlobalSection GlobalSection(ProjectConfigurationPlatforms) = postSolution + {0BEB3088-B634-4289-AE17-CDF2D25D00D5}.Debug|x86.ActiveCfg = Debug|Any CPU + {0BEB3088-B634-4289-AE17-CDF2D25D00D5}.Debug|x86.Build.0 = Debug|Any CPU + {0BEB3088-B634-4289-AE17-CDF2D25D00D5}.Release|x86.ActiveCfg = Release|Any CPU + {0BEB3088-B634-4289-AE17-CDF2D25D00D5}.Release|x86.Build.0 = Release|Any CPU {5DEA2811-2FFA-4959-830B-CAD3ACACABEB}.Debug|x86.ActiveCfg = Debug|Any CPU {5DEA2811-2FFA-4959-830B-CAD3ACACABEB}.Debug|x86.Build.0 = Debug|Any CPU {5DEA2811-2FFA-4959-830B-CAD3ACACABEB}.Release|x86.ActiveCfg = Release|Any CPU diff --git a/DiscImageChef/ChangeLog b/DiscImageChef/ChangeLog index fa845fb4e..a38bf2e85 100644 --- a/DiscImageChef/ChangeLog +++ b/DiscImageChef/ChangeLog @@ -1,3 +1,15 @@ +2015-10-05 Natalia Portillo + + * Decoders/BD.cs: + * Decoders/CD.cs: + * Decoders/DVD.cs: + * Decoders/MMC.cs: + * Decoders/SCSI.cs: + * Decoders/Floppy.cs: + * ImagePlugins/2MG.cs: + * DiscImageChef.csproj: + Move decoders to a separate library. + 2015-10-05 Natalia Portillo * Plugins.cs: diff --git a/DiscImageChef/DiscImageChef.csproj b/DiscImageChef/DiscImageChef.csproj index 27ea5bc22..7286ce3eb 100644 --- a/DiscImageChef/DiscImageChef.csproj +++ b/DiscImageChef/DiscImageChef.csproj @@ -49,23 +49,12 @@ - - - - - - - - - - - @@ -178,5 +167,9 @@ {D7016DF2-5A5E-4524-B40D-BA2D59576688} DiscImageChef.Filesystems + + {0BEB3088-B634-4289-AE17-CDF2D25D00D5} + DiscImageChef.Decoders + \ No newline at end of file diff --git a/DiscImageChef/ImagePlugins/2MG.cs b/DiscImageChef/ImagePlugins/2MG.cs deleted file mode 100644 index 72ed2b435..000000000 --- a/DiscImageChef/ImagePlugins/2MG.cs +++ /dev/null @@ -1,12 +0,0 @@ -using System; - -namespace DiscImageChef.ImagePlugins -{ - public class _MG - { - public _MG() - { - } - } -} -