Move decoders to a separate library.

This commit is contained in:
2015-10-05 20:27:44 +01:00
parent 80a1e37009
commit 1afeb5e545
14 changed files with 154 additions and 59 deletions

View File

@@ -1,3 +1,8 @@
2015-10-05 Natalia Portillo <claunia@claunia.com>
* DiscImageChef.sln:
Move decoders to a separate library.
2015-10-05 Natalia Portillo <claunia@claunia.com>
* DiscImageChef.sln:

View File

@@ -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();

View File

@@ -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();

View File

@@ -0,0 +1,12 @@
2015-10-05 Natalia Portillo <claunia@claunia.com>
* CD.cs:
* BD.cs:
* MMC.cs:
* DVD.cs:
* SCSI.cs:
* Floppy.cs:
* Properties/AssemblyInfo.cs:
* DiscImageChef.Decoders.csproj:
Move decoders to a separate library.

View File

@@ -0,0 +1,52 @@
<?xml version="1.0" encoding="utf-8"?>
<Project DefaultTargets="Build" ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<PropertyGroup>
<Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
<Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
<ProductVersion>8.0.30703</ProductVersion>
<SchemaVersion>2.0</SchemaVersion>
<ProjectGuid>{0BEB3088-B634-4289-AE17-CDF2D25D00D5}</ProjectGuid>
<OutputType>Library</OutputType>
<RootNamespace>DiscImageChef.Decoders</RootNamespace>
<AssemblyName>DiscImageChef.Decoders</AssemblyName>
<ReleaseVersion>2.2</ReleaseVersion>
<TargetFrameworkVersion>v3.5</TargetFrameworkVersion>
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
<DebugSymbols>true</DebugSymbols>
<DebugType>full</DebugType>
<Optimize>false</Optimize>
<OutputPath>bin\Debug</OutputPath>
<DefineConstants>DEBUG;</DefineConstants>
<ErrorReport>prompt</ErrorReport>
<WarningLevel>4</WarningLevel>
<ConsolePause>false</ConsolePause>
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
<DebugType>full</DebugType>
<Optimize>true</Optimize>
<OutputPath>bin\Release</OutputPath>
<ErrorReport>prompt</ErrorReport>
<WarningLevel>4</WarningLevel>
<ConsolePause>false</ConsolePause>
</PropertyGroup>
<ItemGroup>
<Reference Include="System" />
</ItemGroup>
<ItemGroup>
<Compile Include="Properties\AssemblyInfo.cs" />
<Compile Include="BD.cs" />
<Compile Include="CD.cs" />
<Compile Include="DVD.cs" />
<Compile Include="Floppy.cs" />
<Compile Include="MMC.cs" />
<Compile Include="SCSI.cs" />
</ItemGroup>
<Import Project="$(MSBuildBinPath)\Microsoft.CSharp.targets" />
<ItemGroup>
<ProjectReference Include="..\DiscImageChef.Helpers\DiscImageChef.Helpers.csproj">
<Project>{F8BDF57B-1571-4CD0-84B3-B422088D359A}</Project>
<Name>DiscImageChef.Helpers</Name>
</ProjectReference>
</ItemGroup>
</Project>

View File

@@ -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();

View File

@@ -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("")]

View File

@@ -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();

View File

@@ -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

View File

@@ -1,3 +1,15 @@
2015-10-05 Natalia Portillo <claunia@claunia.com>
* 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 <claunia@claunia.com>
* Plugins.cs:

View File

@@ -49,23 +49,12 @@
<Compile Include="Commands\Commands.cs" />
<Compile Include="Commands\PrintHex.cs" />
<Compile Include="Commands\Decode.cs" />
<Compile Include="Decoders\SCSI.cs" />
<Compile Include="Decoders\CD.cs" />
<Compile Include="Decoders\MMC.cs" />
<Compile Include="Decoders\BD.cs" />
<Compile Include="Decoders\DVD.cs" />
<Compile Include="Commands\Entropy.cs" />
<Compile Include="Decoders\Floppy.cs" />
<Compile Include="DetectImageFormat.cs" />
</ItemGroup>
<Import Project="$(MSBuildBinPath)\Microsoft.CSharp.targets" />
<ItemGroup>
<Folder Include="Plugins\" />
<Folder Include="PartPlugins\" />
<Folder Include="ImagePlugins\" />
<Folder Include="Commands\" />
<Folder Include="Checksums\" />
<Folder Include="Decoders\" />
</ItemGroup>
<ProjectExtensions>
<MonoDevelop>
@@ -178,5 +167,9 @@
<Project>{D7016DF2-5A5E-4524-B40D-BA2D59576688}</Project>
<Name>DiscImageChef.Filesystems</Name>
</ProjectReference>
<ProjectReference Include="..\DiscImageChef.Decoders\DiscImageChef.Decoders.csproj">
<Project>{0BEB3088-B634-4289-AE17-CDF2D25D00D5}</Project>
<Name>DiscImageChef.Decoders</Name>
</ProjectReference>
</ItemGroup>
</Project>

View File

@@ -1,12 +0,0 @@
using System;
namespace DiscImageChef.ImagePlugins
{
public class _MG
{
public _MG()
{
}
}
}