Moved disc image plugins to a separate library.

This commit is contained in:
2015-10-05 19:45:07 +01:00
parent 9530cc1a7a
commit 4a3583d13e
29 changed files with 450 additions and 211 deletions

View File

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

View File

@@ -0,0 +1,7 @@
2015-10-05 Natalia Portillo <claunia@claunia.com>
* Partition.cs:
* Properties/AssemblyInfo.cs:
* DiscImageChef.CommonTypes.csproj:
Moved disc image plugins to a separate library.

View File

@@ -0,0 +1,41 @@
<?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>{F2B84194-26EB-4227-B1C5-6602517E85AE}</ProjectGuid>
<OutputType>Library</OutputType>
<RootNamespace>DiscImageChef.CommonTypes</RootNamespace>
<AssemblyName>DiscImageChef.CommonTypes</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="Partition.cs" />
</ItemGroup>
<Import Project="$(MSBuildBinPath)\Microsoft.CSharp.targets" />
</Project>

View File

@@ -0,0 +1,28 @@
using System;
namespace DiscImageChef.CommonTypes
{
/// <summary>
/// Partition structure.
/// </summary>
public struct Partition
{
/// <summary>Partition number, 0-started</summary>
public ulong PartitionSequence;
/// <summary>Partition type</summary>
public string PartitionType;
/// <summary>Partition name (if the scheme supports it)</summary>
public string PartitionName;
/// <summary>Start of the partition, in bytes</summary>
public ulong PartitionStart;
/// <summary>LBA of partition start</summary>
public ulong PartitionStartSector;
/// <summary>Length in bytes of the partition</summary>
public ulong PartitionLength;
/// <summary>Length in sectors of the partition</summary>
public ulong PartitionSectors;
/// <summary>Information that does not find space in this struct</summary>
public string PartitionDescription;
}
}

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.CommonTypes")]
[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

@@ -169,7 +169,7 @@ namespace DiscImageChef.ImagePlugins
#endregion #endregion
public Apple2MG(PluginBase Core) public Apple2MG()
{ {
Name = "Apple 2IMG"; Name = "Apple 2IMG";
PluginUUID = new Guid("CBAF8824-BA5F-415F-953A-19A03519B2D1"); PluginUUID = new Guid("CBAF8824-BA5F-415F-953A-19A03519B2D1");
@@ -273,12 +273,12 @@ namespace DiscImageChef.ImagePlugins
if (ImageHeader.dataSize == 0x00800C00) if (ImageHeader.dataSize == 0x00800C00)
{ {
ImageHeader.dataSize = 0x000C8000; ImageHeader.dataSize = 0x000C8000;
if (MainClass.isDebug) ////if (MainClass.isDebug)
Console.WriteLine("DEBUG (2MG plugin): Detected incorrect endian on data size field, correcting."); Console.WriteLine("DEBUG (2MG plugin): Detected incorrect endian on data size field, correcting.");
} }
if (MainClass.isDebug) ////if (MainClass.isDebug)
{ //{
Console.WriteLine("DEBUG (2MG plugin): ImageHeader.magic = \"{0}\"", Encoding.ASCII.GetString(magic)); Console.WriteLine("DEBUG (2MG plugin): ImageHeader.magic = \"{0}\"", Encoding.ASCII.GetString(magic));
Console.WriteLine("DEBUG (2MG plugin): ImageHeader.creator = \"{0}\"", Encoding.ASCII.GetString(creator)); Console.WriteLine("DEBUG (2MG plugin): ImageHeader.creator = \"{0}\"", Encoding.ASCII.GetString(creator));
Console.WriteLine("DEBUG (2MG plugin): ImageHeader.headerSize = {0}", ImageHeader.headerSize); Console.WriteLine("DEBUG (2MG plugin): ImageHeader.headerSize = {0}", ImageHeader.headerSize);
@@ -296,7 +296,7 @@ namespace DiscImageChef.ImagePlugins
Console.WriteLine("DEBUG (2MG plugin): ImageHeader.reserved2 = 0x{0:X8}", ImageHeader.reserved2); Console.WriteLine("DEBUG (2MG plugin): ImageHeader.reserved2 = 0x{0:X8}", ImageHeader.reserved2);
Console.WriteLine("DEBUG (2MG plugin): ImageHeader.reserved3 = 0x{0:X8}", ImageHeader.reserved3); Console.WriteLine("DEBUG (2MG plugin): ImageHeader.reserved3 = 0x{0:X8}", ImageHeader.reserved3);
Console.WriteLine("DEBUG (2MG plugin): ImageHeader.reserved4 = 0x{0:X8}", ImageHeader.reserved4); Console.WriteLine("DEBUG (2MG plugin): ImageHeader.reserved4 = 0x{0:X8}", ImageHeader.reserved4);
} //}
if (ImageHeader.dataSize == 0 && ImageHeader.blocks == 0 && ImageHeader.imageFormat != ProDOSSectorOrder) if (ImageHeader.dataSize == 0 && ImageHeader.blocks == 0 && ImageHeader.imageFormat != ProDOSSectorOrder)
return false; return false;
@@ -584,7 +584,7 @@ namespace DiscImageChef.ImagePlugins
return null; return null;
} }
public override List<DiscImageChef.PartPlugins.Partition> GetPartitions() public override List<CommonTypes.Partition> GetPartitions()
{ {
throw new FeatureUnsupportedImageException("Feature not supported by image format"); throw new FeatureUnsupportedImageException("Feature not supported by image format");
} }

View File

@@ -252,7 +252,7 @@ namespace DiscImageChef.ImagePlugins
Dictionary<UInt32, UInt64> offsetmap; Dictionary<UInt32, UInt64> offsetmap;
// Dictionary, index is track #, value is TrackFile // Dictionary, index is track #, value is TrackFile
CDRWinDisc discimage; CDRWinDisc discimage;
List<PartPlugins.Partition> partitions; List<CommonTypes.Partition> partitions;
#endregion #endregion
@@ -286,7 +286,7 @@ namespace DiscImageChef.ImagePlugins
#region Methods #region Methods
public CDRWin(PluginBase Core) public CDRWin()
{ {
Name = "CDRWin cuesheet"; Name = "CDRWin cuesheet";
PluginUUID = new Guid("664568B2-15D4-4E64-8A7A-20BDA8B8386F"); PluginUUID = new Guid("664568B2-15D4-4E64-8A7A-20BDA8B8386F");
@@ -479,7 +479,7 @@ namespace DiscImageChef.ImagePlugins
if (MatchDiskType.Success && !intrack) if (MatchDiskType.Success && !intrack)
{ {
if (MainClass.isDebug) ////if (MainClass.isDebug)
Console.WriteLine("DEBUG (CDRWin plugin): Found REM ORIGINAL MEDIA TYPE at line {0}", line); Console.WriteLine("DEBUG (CDRWin plugin): Found REM ORIGINAL MEDIA TYPE at line {0}", line);
discimage.disktypestr = MatchDiskType.Groups[1].Value; discimage.disktypestr = MatchDiskType.Groups[1].Value;
} }
@@ -489,7 +489,7 @@ namespace DiscImageChef.ImagePlugins
} }
else if (MatchSession.Success) else if (MatchSession.Success)
{ {
if (MainClass.isDebug) ////if (MainClass.isDebug)
Console.WriteLine("DEBUG (CDRWin plugin): Found REM SESSION at line {0}", line); Console.WriteLine("DEBUG (CDRWin plugin): Found REM SESSION at line {0}", line);
currentsession = Byte.Parse(MatchSession.Groups[1].Value); currentsession = Byte.Parse(MatchSession.Groups[1].Value);
@@ -497,19 +497,19 @@ namespace DiscImageChef.ImagePlugins
} }
else if (MatchLBA.Success) else if (MatchLBA.Success)
{ {
if (MainClass.isDebug) ////if (MainClass.isDebug)
Console.WriteLine("DEBUG (CDRWin plugin): Found REM MSF at line {0}", line); Console.WriteLine("DEBUG (CDRWin plugin): Found REM MSF at line {0}", line);
// Just ignored // Just ignored
} }
else if (MatchLeadOut.Success) else if (MatchLeadOut.Success)
{ {
if (MainClass.isDebug) ////if (MainClass.isDebug)
Console.WriteLine("DEBUG (CDRWin plugin): Found REM LEAD-OUT at line {0}", line); Console.WriteLine("DEBUG (CDRWin plugin): Found REM LEAD-OUT at line {0}", line);
// Just ignored // Just ignored
} }
else if (MatchComment.Success) else if (MatchComment.Success)
{ {
if (MainClass.isDebug) ////if (MainClass.isDebug)
Console.WriteLine("DEBUG (CDRWin plugin): Found REM at line {0}", line); Console.WriteLine("DEBUG (CDRWin plugin): Found REM at line {0}", line);
if (discimage.comment == "") if (discimage.comment == "")
discimage.comment = MatchComment.Groups[1].Value; // First comment discimage.comment = MatchComment.Groups[1].Value; // First comment
@@ -538,7 +538,7 @@ namespace DiscImageChef.ImagePlugins
if (MatchArranger.Success) if (MatchArranger.Success)
{ {
if (MainClass.isDebug) ////if (MainClass.isDebug)
Console.WriteLine("DEBUG (CDRWin plugin): Found ARRANGER at line {0}", line); Console.WriteLine("DEBUG (CDRWin plugin): Found ARRANGER at line {0}", line);
if (intrack) if (intrack)
currenttrack.arranger = MatchArranger.Groups[1].Value; currenttrack.arranger = MatchArranger.Groups[1].Value;
@@ -547,7 +547,7 @@ namespace DiscImageChef.ImagePlugins
} }
else if (MatchBarCode.Success) else if (MatchBarCode.Success)
{ {
if (MainClass.isDebug) ////if (MainClass.isDebug)
Console.WriteLine("DEBUG (CDRWin plugin): Found UPC_EAN at line {0}", line); Console.WriteLine("DEBUG (CDRWin plugin): Found UPC_EAN at line {0}", line);
if (!intrack) if (!intrack)
discimage.barcode = MatchBarCode.Groups[1].Value; discimage.barcode = MatchBarCode.Groups[1].Value;
@@ -556,7 +556,7 @@ namespace DiscImageChef.ImagePlugins
} }
else if (MatchCDText.Success) else if (MatchCDText.Success)
{ {
if (MainClass.isDebug) ////if (MainClass.isDebug)
Console.WriteLine("DEBUG (CDRWin plugin): Found CDTEXTFILE at line {0}", line); Console.WriteLine("DEBUG (CDRWin plugin): Found CDTEXTFILE at line {0}", line);
if (!intrack) if (!intrack)
discimage.cdtextfile = MatchCDText.Groups[1].Value; discimage.cdtextfile = MatchCDText.Groups[1].Value;
@@ -565,7 +565,7 @@ namespace DiscImageChef.ImagePlugins
} }
else if (MatchComposer.Success) else if (MatchComposer.Success)
{ {
if (MainClass.isDebug) ////if (MainClass.isDebug)
Console.WriteLine("DEBUG (CDRWin plugin): Found COMPOSER at line {0}", line); Console.WriteLine("DEBUG (CDRWin plugin): Found COMPOSER at line {0}", line);
if (intrack) if (intrack)
currenttrack.arranger = MatchComposer.Groups[1].Value; currenttrack.arranger = MatchComposer.Groups[1].Value;
@@ -574,7 +574,7 @@ namespace DiscImageChef.ImagePlugins
} }
else if (MatchDiskID.Success) else if (MatchDiskID.Success)
{ {
if (MainClass.isDebug) ////if (MainClass.isDebug)
Console.WriteLine("DEBUG (CDRWin plugin): Found DISC_ID at line {0}", line); Console.WriteLine("DEBUG (CDRWin plugin): Found DISC_ID at line {0}", line);
if (!intrack) if (!intrack)
discimage.disk_id = MatchDiskID.Groups[1].Value; discimage.disk_id = MatchDiskID.Groups[1].Value;
@@ -583,7 +583,7 @@ namespace DiscImageChef.ImagePlugins
} }
else if (MatchFile.Success) else if (MatchFile.Success)
{ {
if (MainClass.isDebug) ////if (MainClass.isDebug)
Console.WriteLine("DEBUG (CDRWin plugin): Found FILE at line {0}", line); Console.WriteLine("DEBUG (CDRWin plugin): Found FILE at line {0}", line);
if (currenttrack.sequence != 0) if (currenttrack.sequence != 0)
@@ -664,7 +664,7 @@ namespace DiscImageChef.ImagePlugins
} }
// File does exist, process it // File does exist, process it
if (MainClass.isDebug) ////if (MainClass.isDebug)
Console.WriteLine("DEBUG (CDRWin plugin): File \"{0}\" found", currentfile.datafile); Console.WriteLine("DEBUG (CDRWin plugin): File \"{0}\" found", currentfile.datafile);
switch (currentfile.filetype) switch (currentfile.filetype)
@@ -686,14 +686,14 @@ namespace DiscImageChef.ImagePlugins
else if (MatchFlags.Success) else if (MatchFlags.Success)
{ {
// TODO: Implement FLAGS support. // TODO: Implement FLAGS support.
if (MainClass.isDebug) ////if (MainClass.isDebug)
Console.WriteLine("DEBUG (CDRWin plugin): Found FLAGS at line {0}", line); Console.WriteLine("DEBUG (CDRWin plugin): Found FLAGS at line {0}", line);
if (!intrack) if (!intrack)
throw new FeatureUnsupportedImageException(String.Format("Found FLAGS field in incorrect place at line {0}", line)); throw new FeatureUnsupportedImageException(String.Format("Found FLAGS field in incorrect place at line {0}", line));
} }
else if (MatchGenre.Success) else if (MatchGenre.Success)
{ {
if (MainClass.isDebug) ////if (MainClass.isDebug)
Console.WriteLine("DEBUG (CDRWin plugin): Found GENRE at line {0}", line); Console.WriteLine("DEBUG (CDRWin plugin): Found GENRE at line {0}", line);
if (intrack) if (intrack)
currenttrack.genre = MatchGenre.Groups[1].Value; currenttrack.genre = MatchGenre.Groups[1].Value;
@@ -702,7 +702,7 @@ namespace DiscImageChef.ImagePlugins
} }
else if (MatchIndex.Success) else if (MatchIndex.Success)
{ {
if (MainClass.isDebug) ////if (MainClass.isDebug)
Console.WriteLine("DEBUG (CDRWin plugin): Found INDEX at line {0}", line); Console.WriteLine("DEBUG (CDRWin plugin): Found INDEX at line {0}", line);
if (!intrack) if (!intrack)
throw new FeatureUnsupportedImageException(String.Format("Found INDEX before a track {0}", line)); throw new FeatureUnsupportedImageException(String.Format("Found INDEX before a track {0}", line));
@@ -720,7 +720,7 @@ namespace DiscImageChef.ImagePlugins
{ {
cuetracks[currenttrack.sequence - 2].sectors = offset - currentfileoffsetsector; cuetracks[currenttrack.sequence - 2].sectors = offset - currentfileoffsetsector;
currentfile.offset += cuetracks[currenttrack.sequence - 2].sectors * cuetracks[currenttrack.sequence - 2].bps; currentfile.offset += cuetracks[currenttrack.sequence - 2].sectors * cuetracks[currenttrack.sequence - 2].bps;
if (MainClass.isDebug) ////if (MainClass.isDebug)
{ {
Console.WriteLine("DEBUG (CDRWin plugin): Sets currentfile.offset to {0} at line 553", currentfile.offset); Console.WriteLine("DEBUG (CDRWin plugin): Sets currentfile.offset to {0} at line 553", currentfile.offset);
Console.WriteLine("DEBUG (CDRWin plugin): cuetracks[currenttrack.sequence-2].sectors = {0}", cuetracks[currenttrack.sequence - 2].sectors); Console.WriteLine("DEBUG (CDRWin plugin): cuetracks[currenttrack.sequence-2].sectors = {0}", cuetracks[currenttrack.sequence - 2].sectors);
@@ -731,7 +731,7 @@ namespace DiscImageChef.ImagePlugins
if ((index == 0 || (index == 1 && !currenttrack.indexes.ContainsKey(0))) && currenttrack.sequence == 1) if ((index == 0 || (index == 1 && !currenttrack.indexes.ContainsKey(0))) && currenttrack.sequence == 1)
{ {
if (MainClass.isDebug) ////if (MainClass.isDebug)
Console.WriteLine("DEBUG (CDRWin plugin): Sets currentfile.offset to {0} at line 559", offset * currenttrack.bps); Console.WriteLine("DEBUG (CDRWin plugin): Sets currentfile.offset to {0} at line 559", offset * currenttrack.bps);
currentfile.offset = offset * currenttrack.bps; currentfile.offset = offset * currenttrack.bps;
} }
@@ -742,7 +742,7 @@ namespace DiscImageChef.ImagePlugins
} }
else if (MatchISRC.Success) else if (MatchISRC.Success)
{ {
if (MainClass.isDebug) ////if (MainClass.isDebug)
Console.WriteLine("DEBUG (CDRWin plugin): Found ISRC at line {0}", line); Console.WriteLine("DEBUG (CDRWin plugin): Found ISRC at line {0}", line);
if (!intrack) if (!intrack)
throw new FeatureUnsupportedImageException(String.Format("Found ISRC before a track {0}", line)); throw new FeatureUnsupportedImageException(String.Format("Found ISRC before a track {0}", line));
@@ -750,7 +750,7 @@ namespace DiscImageChef.ImagePlugins
} }
else if (MatchMCN.Success) else if (MatchMCN.Success)
{ {
if (MainClass.isDebug) ////if (MainClass.isDebug)
Console.WriteLine("DEBUG (CDRWin plugin): Found CATALOG at line {0}", line); Console.WriteLine("DEBUG (CDRWin plugin): Found CATALOG at line {0}", line);
if (!intrack) if (!intrack)
discimage.mcn = MatchMCN.Groups[1].Value; discimage.mcn = MatchMCN.Groups[1].Value;
@@ -759,7 +759,7 @@ namespace DiscImageChef.ImagePlugins
} }
else if (MatchPerformer.Success) else if (MatchPerformer.Success)
{ {
if (MainClass.isDebug) //if (MainClass.isDebug)
Console.WriteLine("DEBUG (CDRWin plugin): Found PERFORMER at line {0}", line); Console.WriteLine("DEBUG (CDRWin plugin): Found PERFORMER at line {0}", line);
if (intrack) if (intrack)
currenttrack.performer = MatchPerformer.Groups[1].Value; currenttrack.performer = MatchPerformer.Groups[1].Value;
@@ -768,7 +768,7 @@ namespace DiscImageChef.ImagePlugins
} }
else if (MatchPostgap.Success) else if (MatchPostgap.Success)
{ {
if (MainClass.isDebug) //if (MainClass.isDebug)
Console.WriteLine("DEBUG (CDRWin plugin): Found POSTGAP at line {0}", line); Console.WriteLine("DEBUG (CDRWin plugin): Found POSTGAP at line {0}", line);
if (intrack) if (intrack)
{ {
@@ -779,7 +779,7 @@ namespace DiscImageChef.ImagePlugins
} }
else if (MatchPregap.Success) else if (MatchPregap.Success)
{ {
if (MainClass.isDebug) //if (MainClass.isDebug)
Console.WriteLine("DEBUG (CDRWin plugin): Found PREGAP at line {0}", line); Console.WriteLine("DEBUG (CDRWin plugin): Found PREGAP at line {0}", line);
if (intrack) if (intrack)
{ {
@@ -790,7 +790,7 @@ namespace DiscImageChef.ImagePlugins
} }
else if (MatchSongWriter.Success) else if (MatchSongWriter.Success)
{ {
if (MainClass.isDebug) //if (MainClass.isDebug)
Console.WriteLine("DEBUG (CDRWin plugin): Found SONGWRITER at line {0}", line); Console.WriteLine("DEBUG (CDRWin plugin): Found SONGWRITER at line {0}", line);
if (intrack) if (intrack)
currenttrack.songwriter = MatchSongWriter.Groups[1].Value; currenttrack.songwriter = MatchSongWriter.Groups[1].Value;
@@ -799,7 +799,7 @@ namespace DiscImageChef.ImagePlugins
} }
else if (MatchTitle.Success) else if (MatchTitle.Success)
{ {
if (MainClass.isDebug) //if (MainClass.isDebug)
Console.WriteLine("DEBUG (CDRWin plugin): Found TITLE at line {0}", line); Console.WriteLine("DEBUG (CDRWin plugin): Found TITLE at line {0}", line);
if (intrack) if (intrack)
currenttrack.title = MatchTitle.Groups[1].Value; currenttrack.title = MatchTitle.Groups[1].Value;
@@ -808,7 +808,7 @@ namespace DiscImageChef.ImagePlugins
} }
else if (MatchTrack.Success) else if (MatchTrack.Success)
{ {
if (MainClass.isDebug) //if (MainClass.isDebug)
Console.WriteLine("DEBUG (CDRWin plugin): Found TRACK at line {0}", line); Console.WriteLine("DEBUG (CDRWin plugin): Found TRACK at line {0}", line);
if (currentfile.datafile == "") if (currentfile.datafile == "")
throw new FeatureUnsupportedImageException(String.Format("Found TRACK field before a file is defined at line {0}", line)); throw new FeatureUnsupportedImageException(String.Format("Found TRACK field before a file is defined at line {0}", line));
@@ -825,7 +825,7 @@ namespace DiscImageChef.ImagePlugins
currenttrack = new CDRWinTrack(); currenttrack = new CDRWinTrack();
currenttrack.indexes = new Dictionary<int, ulong>(); currenttrack.indexes = new Dictionary<int, ulong>();
currenttrack.sequence = uint.Parse(MatchTrack.Groups[1].Value); currenttrack.sequence = uint.Parse(MatchTrack.Groups[1].Value);
if (MainClass.isDebug) //if (MainClass.isDebug)
Console.WriteLine("DEBUG (CDRWin plugin): Setting currenttrack.sequence to {0}", currenttrack.sequence); Console.WriteLine("DEBUG (CDRWin plugin): Setting currenttrack.sequence to {0}", currenttrack.sequence);
currentfile.sequence = currenttrack.sequence; currentfile.sequence = currenttrack.sequence;
currenttrack.bps = CDRWinTrackTypeToBytesPerSector(MatchTrack.Groups[2].Value); currenttrack.bps = CDRWinTrackTypeToBytesPerSector(MatchTrack.Groups[2].Value);
@@ -946,7 +946,7 @@ namespace DiscImageChef.ImagePlugins
discimage.disktype = DiskType.CD; discimage.disktype = DiskType.CD;
} }
if (MainClass.isDebug) //if (MainClass.isDebug)
{ {
// DEBUG information // DEBUG information
Console.WriteLine("DEBUG (CDRWin plugin): Disc image parsing results"); Console.WriteLine("DEBUG (CDRWin plugin): Disc image parsing results");
@@ -1070,10 +1070,10 @@ namespace DiscImageChef.ImagePlugins
} }
} }
if (MainClass.isDebug) //if (MainClass.isDebug)
Console.WriteLine("DEBUG (CDRWin plugin): Building offset map"); Console.WriteLine("DEBUG (CDRWin plugin): Building offset map");
partitions = new List<DiscImageChef.PartPlugins.Partition>(); partitions = new List<CommonTypes.Partition>();
ulong byte_offset = 0; ulong byte_offset = 0;
ulong sector_offset = 0; ulong sector_offset = 0;
@@ -1089,7 +1089,7 @@ namespace DiscImageChef.ImagePlugins
if (discimage.tracks[i].sequence == 1 && i != 0) if (discimage.tracks[i].sequence == 1 && i != 0)
throw new ImageNotSupportedException("Unordered tracks"); throw new ImageNotSupportedException("Unordered tracks");
PartPlugins.Partition partition = new DiscImageChef.PartPlugins.Partition(); CommonTypes.Partition partition = new CommonTypes.Partition();
if (discimage.tracks[i].pregap > 0) if (discimage.tracks[i].pregap > 0)
{ {
@@ -1121,7 +1121,7 @@ namespace DiscImageChef.ImagePlugins
} }
partitions.Add(partition); partitions.Add(partition);
partition = new DiscImageChef.PartPlugins.Partition(); partition = new CommonTypes.Partition();
} }
index_zero |= discimage.tracks[i].indexes.TryGetValue(0, out index_zero_offset); index_zero |= discimage.tracks[i].indexes.TryGetValue(0, out index_zero_offset);
@@ -1159,7 +1159,7 @@ namespace DiscImageChef.ImagePlugins
} }
partitions.Add(partition); partitions.Add(partition);
partition = new DiscImageChef.PartPlugins.Partition(); partition = new CommonTypes.Partition();
} }
// Index 01 // Index 01
@@ -1191,14 +1191,14 @@ namespace DiscImageChef.ImagePlugins
} }
partitions.Add(partition); partitions.Add(partition);
partition = new DiscImageChef.PartPlugins.Partition(); partition = new CommonTypes.Partition();
} }
// Print offset map // Print offset map
if (MainClass.isDebug) //if (MainClass.isDebug)
{ {
Console.WriteLine("DEBUG (CDRWin plugin) printing partition map"); Console.WriteLine("DEBUG (CDRWin plugin) printing partition map");
foreach (DiscImageChef.PartPlugins.Partition partition in partitions) foreach (CommonTypes.Partition partition in partitions)
{ {
Console.WriteLine("DEBUG (CDRWin plugin): Partition sequence: {0}", partition.PartitionSequence); Console.WriteLine("DEBUG (CDRWin plugin): Partition sequence: {0}", partition.PartitionSequence);
Console.WriteLine("DEBUG (CDRWin plugin): \tPartition name: {0}", partition.PartitionName); Console.WriteLine("DEBUG (CDRWin plugin): \tPartition name: {0}", partition.PartitionName);
@@ -1910,7 +1910,7 @@ namespace DiscImageChef.ImagePlugins
return ImageInfo.diskType; return ImageInfo.diskType;
} }
public override List<PartPlugins.Partition> GetPartitions() public override List<CommonTypes.Partition> GetPartitions()
{ {
return partitions; return partitions;
} }

View File

@@ -0,0 +1,15 @@
2015-10-05 Natalia Portillo <claunia@claunia.com>
* VHD.cs:
* Nero.cs:
* CDRWin.cs:
* TeleDisk.cs:
* Apple2MG.cs:
* ImageInfo.cs:
* DiskCopy42.cs:
* ImagePlugin.cs:
* ZZZRawImage.cs:
* Properties/AssemblyInfo.cs:
* DiscImageChef.DiscImages.csproj:
Moved disc image plugins to a separate library.

View File

@@ -0,0 +1,63 @@
<?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>{74032CBC-339B-42F3-AF6F-E96C261F3E6A}</ProjectGuid>
<OutputType>Library</OutputType>
<RootNamespace>DiscImageChef.DiscImages</RootNamespace>
<AssemblyName>DiscImageChef.DiscImages</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="Apple2MG.cs" />
<Compile Include="CDRWin.cs" />
<Compile Include="DiskCopy42.cs" />
<Compile Include="ImageInfo.cs" />
<Compile Include="ImagePlugin.cs" />
<Compile Include="Nero.cs" />
<Compile Include="TeleDisk.cs" />
<Compile Include="VHD.cs" />
<Compile Include="ZZZRawImage.cs" />
</ItemGroup>
<Import Project="$(MSBuildBinPath)\Microsoft.CSharp.targets" />
<ItemGroup>
<ProjectReference Include="..\DiscImageChef.CommonTypes\DiscImageChef.CommonTypes.csproj">
<Project>{F2B84194-26EB-4227-B1C5-6602517E85AE}</Project>
<Name>DiscImageChef.CommonTypes</Name>
</ProjectReference>
<ProjectReference Include="..\DiscImageChef.Checksums\DiscImageChef.Checksums.csproj">
<Project>{CC48B324-A532-4A45-87A6-6F91F7141E8D}</Project>
<Name>DiscImageChef.Checksums</Name>
</ProjectReference>
<ProjectReference Include="..\DiscImageChef.Helpers\DiscImageChef.Helpers.csproj">
<Project>{F8BDF57B-1571-4CD0-84B3-B422088D359A}</Project>
<Name>DiscImageChef.Helpers</Name>
</ProjectReference>
</ItemGroup>
</Project>

View File

@@ -126,7 +126,7 @@ namespace DiscImageChef.ImagePlugins
#endregion #endregion
public DiskCopy42(PluginBase Core) public DiskCopy42()
{ {
Name = "Apple DiskCopy 4.2"; Name = "Apple DiskCopy 4.2";
PluginUUID = new Guid("0240B7B1-E959-4CDC-B0BD-386D6E467B88"); PluginUUID = new Guid("0240B7B1-E959-4CDC-B0BD-386D6E467B88");
@@ -181,7 +181,7 @@ namespace DiscImageChef.ImagePlugins
tmp_header.valid = buffer[0x52]; tmp_header.valid = buffer[0x52];
tmp_header.reserved = buffer[0x53]; tmp_header.reserved = buffer[0x53];
if (MainClass.isDebug) //if (MainClass.isDebug)
{ {
Console.WriteLine("DEBUG (DC42 plugin): tmp_header.diskName = \"{0}\"", tmp_header.diskName); Console.WriteLine("DEBUG (DC42 plugin): tmp_header.diskName = \"{0}\"", tmp_header.diskName);
Console.WriteLine("DEBUG (DC42 plugin): tmp_header.dataSize = {0} bytes", tmp_header.dataSize); Console.WriteLine("DEBUG (DC42 plugin): tmp_header.dataSize = {0} bytes", tmp_header.dataSize);
@@ -205,7 +205,7 @@ namespace DiscImageChef.ImagePlugins
if (tmp_header.format != kSonyFormat400K && tmp_header.format != kSonyFormat800K && tmp_header.format != kSonyFormat720K && if (tmp_header.format != kSonyFormat400K && tmp_header.format != kSonyFormat800K && tmp_header.format != kSonyFormat720K &&
tmp_header.format != kSonyFormat1440K && tmp_header.format != kSonyFormat1680K && tmp_header.format != kSigmaFormatTwiggy) tmp_header.format != kSonyFormat1440K && tmp_header.format != kSonyFormat1680K && tmp_header.format != kSigmaFormatTwiggy)
{ {
if (MainClass.isDebug) //if (MainClass.isDebug)
Console.WriteLine("Unknown tmp_header.format = 0x{0:X2} value", tmp_header.format); Console.WriteLine("Unknown tmp_header.format = 0x{0:X2} value", tmp_header.format);
return false; return false;
@@ -214,7 +214,7 @@ namespace DiscImageChef.ImagePlugins
if (tmp_header.fmtByte != kSonyFmtByte400K && tmp_header.fmtByte != kSonyFmtByte800K && tmp_header.fmtByte != kSonyFmtByte800KIncorrect && if (tmp_header.fmtByte != kSonyFmtByte400K && tmp_header.fmtByte != kSonyFmtByte800K && tmp_header.fmtByte != kSonyFmtByte800KIncorrect &&
tmp_header.fmtByte != kSonyFmtByteProDos && tmp_header.fmtByte != kInvalidFmtByte && tmp_header.fmtByte != kSigmaFmtByteTwiggy) tmp_header.fmtByte != kSonyFmtByteProDos && tmp_header.fmtByte != kInvalidFmtByte && tmp_header.fmtByte != kSigmaFmtByteTwiggy)
{ {
if (MainClass.isDebug) //if (MainClass.isDebug)
Console.WriteLine("Unknown tmp_header.fmtByte = 0x{0:X2} value", tmp_header.fmtByte); Console.WriteLine("Unknown tmp_header.fmtByte = 0x{0:X2} value", tmp_header.fmtByte);
return false; return false;
@@ -222,7 +222,7 @@ namespace DiscImageChef.ImagePlugins
if (tmp_header.fmtByte == kInvalidFmtByte) if (tmp_header.fmtByte == kInvalidFmtByte)
{ {
if (MainClass.isDebug) //if (MainClass.isDebug)
Console.WriteLine("Image says it's unformatted"); Console.WriteLine("Image says it's unformatted");
return false; return false;
@@ -258,7 +258,7 @@ namespace DiscImageChef.ImagePlugins
header.valid = buffer[0x52]; header.valid = buffer[0x52];
header.reserved = buffer[0x53]; header.reserved = buffer[0x53];
if (MainClass.isDebug) //if (MainClass.isDebug)
{ {
Console.WriteLine("DEBUG (DC42 plugin): header.diskName = \"{0}\"", header.diskName); Console.WriteLine("DEBUG (DC42 plugin): header.diskName = \"{0}\"", header.diskName);
Console.WriteLine("DEBUG (DC42 plugin): header.dataSize = {0} bytes", header.dataSize); Console.WriteLine("DEBUG (DC42 plugin): header.dataSize = {0} bytes", header.dataSize);
@@ -282,7 +282,7 @@ namespace DiscImageChef.ImagePlugins
if (header.format != kSonyFormat400K && header.format != kSonyFormat800K && header.format != kSonyFormat720K && if (header.format != kSonyFormat400K && header.format != kSonyFormat800K && header.format != kSonyFormat720K &&
header.format != kSonyFormat1440K && header.format != kSonyFormat1680K && header.format != kSigmaFormatTwiggy) header.format != kSonyFormat1440K && header.format != kSonyFormat1680K && header.format != kSigmaFormatTwiggy)
{ {
if (MainClass.isDebug) //if (MainClass.isDebug)
Console.WriteLine("DEBUG (DC42 plugin): Unknown header.format = 0x{0:X2} value", header.format); Console.WriteLine("DEBUG (DC42 plugin): Unknown header.format = 0x{0:X2} value", header.format);
return false; return false;
@@ -291,7 +291,7 @@ namespace DiscImageChef.ImagePlugins
if (header.fmtByte != kSonyFmtByte400K && header.fmtByte != kSonyFmtByte800K && header.fmtByte != kSonyFmtByte800KIncorrect && if (header.fmtByte != kSonyFmtByte400K && header.fmtByte != kSonyFmtByte800K && header.fmtByte != kSonyFmtByte800KIncorrect &&
header.fmtByte != kSonyFmtByteProDos && header.fmtByte != kInvalidFmtByte && header.fmtByte != kSigmaFmtByteTwiggy) header.fmtByte != kSonyFmtByteProDos && header.fmtByte != kInvalidFmtByte && header.fmtByte != kSigmaFmtByteTwiggy)
{ {
if (MainClass.isDebug) //if (MainClass.isDebug)
Console.WriteLine("DEBUG (DC42 plugin): Unknown tmp_header.fmtByte = 0x{0:X2} value", header.fmtByte); Console.WriteLine("DEBUG (DC42 plugin): Unknown tmp_header.fmtByte = 0x{0:X2} value", header.fmtByte);
return false; return false;
@@ -299,7 +299,7 @@ namespace DiscImageChef.ImagePlugins
if (header.fmtByte == kInvalidFmtByte) if (header.fmtByte == kInvalidFmtByte)
{ {
if (MainClass.isDebug) //if (MainClass.isDebug)
Console.WriteLine("DEBUG (DC42 plugin): Image says it's unformatted"); Console.WriteLine("DEBUG (DC42 plugin): Image says it's unformatted");
return false; return false;
@@ -317,7 +317,7 @@ namespace DiscImageChef.ImagePlugins
{ {
if (header.tagSize / 12 != ImageInfo.sectors) if (header.tagSize / 12 != ImageInfo.sectors)
{ {
if (MainClass.isDebug) //if (MainClass.isDebug)
Console.WriteLine("DEBUG (DC42 plugin): header.tagSize / 12 != sectors"); Console.WriteLine("DEBUG (DC42 plugin): header.tagSize / 12 != sectors");
return false; return false;
@@ -398,17 +398,17 @@ namespace DiscImageChef.ImagePlugins
UInt32 dataChk; UInt32 dataChk;
UInt32 tagsChk = 0; UInt32 tagsChk = 0;
if (MainClass.isDebug) //if (MainClass.isDebug)
Console.WriteLine("DEBUG (DC42 plugin): Reading data"); Console.WriteLine("DEBUG (DC42 plugin): Reading data");
FileStream datastream = new FileStream(dc42ImagePath, FileMode.Open, FileAccess.Read); FileStream datastream = new FileStream(dc42ImagePath, FileMode.Open, FileAccess.Read);
datastream.Seek((long)(dataOffset), SeekOrigin.Begin); datastream.Seek((long)(dataOffset), SeekOrigin.Begin);
datastream.Read(data, 0, (int)header.dataSize); datastream.Read(data, 0, (int)header.dataSize);
datastream.Close(); datastream.Close();
if (MainClass.isDebug) //if (MainClass.isDebug)
Console.WriteLine("DEBUG (DC42 plugin): Calculating data checksum"); Console.WriteLine("DEBUG (DC42 plugin): Calculating data checksum");
dataChk = DC42CheckSum(data); dataChk = DC42CheckSum(data);
if (MainClass.isDebug) //if (MainClass.isDebug)
{ {
Console.WriteLine("DEBUG (DC42 plugin): Calculated data checksum = 0x{0:X8}", dataChk); Console.WriteLine("DEBUG (DC42 plugin): Calculated data checksum = 0x{0:X8}", dataChk);
Console.WriteLine("DEBUG (DC42 plugin): Stored data checksum = 0x{0:X8}", header.dataChecksum); Console.WriteLine("DEBUG (DC42 plugin): Stored data checksum = 0x{0:X8}", header.dataChecksum);
@@ -416,17 +416,17 @@ namespace DiscImageChef.ImagePlugins
if (header.tagSize > 0) if (header.tagSize > 0)
{ {
if (MainClass.isDebug) //if (MainClass.isDebug)
Console.WriteLine("DEBUG (DC42 plugin): Reading tags"); Console.WriteLine("DEBUG (DC42 plugin): Reading tags");
FileStream tagstream = new FileStream(dc42ImagePath, FileMode.Open, FileAccess.Read); FileStream tagstream = new FileStream(dc42ImagePath, FileMode.Open, FileAccess.Read);
tagstream.Seek((long)(tagOffset), SeekOrigin.Begin); tagstream.Seek((long)(tagOffset), SeekOrigin.Begin);
tagstream.Read(tags, 0, (int)header.tagSize); tagstream.Read(tags, 0, (int)header.tagSize);
tagstream.Close(); tagstream.Close();
if (MainClass.isDebug) //if (MainClass.isDebug)
Console.WriteLine("DEBUG (DC42 plugin): Calculating tag checksum"); Console.WriteLine("DEBUG (DC42 plugin): Calculating tag checksum");
tagsChk = DC42CheckSum(tags); tagsChk = DC42CheckSum(tags);
if (MainClass.isDebug) //if (MainClass.isDebug)
{ {
Console.WriteLine("DEBUG (DC42 plugin): Calculated tag checksum = 0x{0:X8}", tagsChk); Console.WriteLine("DEBUG (DC42 plugin): Calculated tag checksum = 0x{0:X8}", tagsChk);
Console.WriteLine("DEBUG (DC42 plugin): Stored tag checksum = 0x{0:X8}", header.tagChecksum); Console.WriteLine("DEBUG (DC42 plugin): Stored tag checksum = 0x{0:X8}", header.tagChecksum);
@@ -647,7 +647,7 @@ namespace DiscImageChef.ImagePlugins
return ImageInfo.driveSerialNumber; return ImageInfo.driveSerialNumber;
} }
public override List<PartPlugins.Partition> GetPartitions() public override List<CommonTypes.Partition> GetPartitions()
{ {
throw new FeatureUnsupportedImageException("Feature not supported by image format"); throw new FeatureUnsupportedImageException("Feature not supported by image format");
} }

View File

@@ -342,7 +342,7 @@ namespace DiscImageChef.ImagePlugins
/// reads can be relative to them. /// reads can be relative to them.
/// </summary> /// </summary>
/// <returns>The partitions.</returns> /// <returns>The partitions.</returns>
public abstract List<PartPlugins.Partition> GetPartitions(); public abstract List<CommonTypes.Partition> GetPartitions();
/// <summary> /// <summary>
/// Gets the disc track extents (start, length). /// Gets the disc track extents (start, length).

View File

@@ -855,13 +855,13 @@ namespace DiscImageChef.ImagePlugins
Dictionary<uint, NeroTrack> neroTracks; Dictionary<uint, NeroTrack> neroTracks;
Dictionary<UInt32, UInt64> offsetmap; Dictionary<UInt32, UInt64> offsetmap;
List<Session> imageSessions; List<Session> imageSessions;
List<PartPlugins.Partition> ImagePartitions; List<CommonTypes.Partition> ImagePartitions;
#endregion #endregion
#region Methods #region Methods
public Nero(PluginBase Core) public Nero()
{ {
Name = "Nero Burning ROM image"; Name = "Nero Burning ROM image";
PluginUUID = new Guid("D160F9FF-5941-43FC-B037-AD81DD141F05"); PluginUUID = new Guid("D160F9FF-5941-43FC-B037-AD81DD141F05");
@@ -874,7 +874,7 @@ namespace DiscImageChef.ImagePlugins
neroTracks = new Dictionary<uint, NeroTrack>(); neroTracks = new Dictionary<uint, NeroTrack>();
offsetmap = new Dictionary<uint, ulong>(); offsetmap = new Dictionary<uint, ulong>();
imageSessions = new List<Session>(); imageSessions = new List<Session>();
ImagePartitions = new List<PartPlugins.Partition>(); ImagePartitions = new List<CommonTypes.Partition>();
} }
// Due to .cue format, this method must parse whole file, ignoring errors (those will be thrown by OpenImage()). // Due to .cue format, this method must parse whole file, ignoring errors (those will be thrown by OpenImage()).
@@ -900,7 +900,7 @@ namespace DiscImageChef.ImagePlugins
footerV2.ChunkID = BigEndianBitConverter.ToUInt32(buffer, 0); footerV2.ChunkID = BigEndianBitConverter.ToUInt32(buffer, 0);
footerV2.FirstChunkOffset = BigEndianBitConverter.ToUInt64(buffer, 4); footerV2.FirstChunkOffset = BigEndianBitConverter.ToUInt64(buffer, 4);
if (MainClass.isDebug) //if (MainClass.isDebug)
{ {
Console.WriteLine("DEBUG (Nero plugin): imageInfo.Length = {0}", imageInfo.Length); Console.WriteLine("DEBUG (Nero plugin): imageInfo.Length = {0}", imageInfo.Length);
Console.WriteLine("DEBUG (Nero plugin): footerV1.ChunkID = 0x{0:X2} (\"{1}\")", footerV1.ChunkID, System.Text.Encoding.ASCII.GetString(BigEndianBitConverter.GetBytes(footerV1.ChunkID))); Console.WriteLine("DEBUG (Nero plugin): footerV1.ChunkID = 0x{0:X2} (\"{1}\")", footerV1.ChunkID, System.Text.Encoding.ASCII.GetString(BigEndianBitConverter.GetBytes(footerV1.ChunkID)));
@@ -948,7 +948,7 @@ namespace DiscImageChef.ImagePlugins
footerV2.ChunkID = BigEndianBitConverter.ToUInt32(buffer, 0); footerV2.ChunkID = BigEndianBitConverter.ToUInt32(buffer, 0);
footerV2.FirstChunkOffset = BigEndianBitConverter.ToUInt64(buffer, 4); footerV2.FirstChunkOffset = BigEndianBitConverter.ToUInt64(buffer, 4);
if (MainClass.isDebug) //if (MainClass.isDebug)
{ {
Console.WriteLine("DEBUG (Nero plugin): imageInfo.Length = {0}", imageInfo.Length); Console.WriteLine("DEBUG (Nero plugin): imageInfo.Length = {0}", imageInfo.Length);
Console.WriteLine("DEBUG (Nero plugin): footerV1.ChunkID = 0x{0:X2} (\"{1}\")", footerV1.ChunkID, System.Text.Encoding.ASCII.GetString(BigEndianBitConverter.GetBytes(footerV1.ChunkID))); Console.WriteLine("DEBUG (Nero plugin): footerV1.ChunkID = 0x{0:X2} (\"{1}\")", footerV1.ChunkID, System.Text.Encoding.ASCII.GetString(BigEndianBitConverter.GetBytes(footerV1.ChunkID)));
@@ -993,7 +993,7 @@ namespace DiscImageChef.ImagePlugins
ChunkID = BigEndianBitConverter.ToUInt32(ChunkHeaderBuffer, 0); ChunkID = BigEndianBitConverter.ToUInt32(ChunkHeaderBuffer, 0);
ChunkLength = BigEndianBitConverter.ToUInt32(ChunkHeaderBuffer, 4); ChunkLength = BigEndianBitConverter.ToUInt32(ChunkHeaderBuffer, 4);
if (MainClass.isDebug) //if (MainClass.isDebug)
{ {
Console.WriteLine("DEBUG (Nero plugin): ChunkID = 0x{0:X2} (\"{1}\")", ChunkID, System.Text.Encoding.ASCII.GetString(BigEndianBitConverter.GetBytes(ChunkID))); Console.WriteLine("DEBUG (Nero plugin): ChunkID = 0x{0:X2} (\"{1}\")", ChunkID, System.Text.Encoding.ASCII.GetString(BigEndianBitConverter.GetBytes(ChunkID)));
Console.WriteLine("DEBUG (Nero plugin): ChunkLength = {0}", ChunkLength); Console.WriteLine("DEBUG (Nero plugin): ChunkLength = {0}", ChunkLength);
@@ -1003,7 +1003,7 @@ namespace DiscImageChef.ImagePlugins
{ {
case NeroV1CUEID: case NeroV1CUEID:
{ {
if (MainClass.isDebug) //if (MainClass.isDebug)
Console.WriteLine("DEBUG (Nero plugin): Found \"CUES\" chunk, parsing {0} bytes", ChunkLength); Console.WriteLine("DEBUG (Nero plugin): Found \"CUES\" chunk, parsing {0} bytes", ChunkLength);
neroCuesheetV1 = new NeroV1Cuesheet(); neroCuesheetV1 = new NeroV1Cuesheet();
@@ -1024,7 +1024,7 @@ namespace DiscImageChef.ImagePlugins
_entry.Second = tmpbuffer[6]; _entry.Second = tmpbuffer[6];
_entry.Frame = tmpbuffer[7]; _entry.Frame = tmpbuffer[7];
if (MainClass.isDebug) //if (MainClass.isDebug)
{ {
Console.WriteLine("DEBUG (Nero plugin): Cuesheet entry {0}", (i / 8) + 1); Console.WriteLine("DEBUG (Nero plugin): Cuesheet entry {0}", (i / 8) + 1);
Console.WriteLine("DEBUG (Nero plugin):\t _entry[{0}].Mode = {1:X2}", (i / 8) + 1, _entry.Mode); Console.WriteLine("DEBUG (Nero plugin):\t _entry[{0}].Mode = {1:X2}", (i / 8) + 1, _entry.Mode);
@@ -1043,7 +1043,7 @@ namespace DiscImageChef.ImagePlugins
} }
case NeroV2CUEID: case NeroV2CUEID:
{ {
if (MainClass.isDebug) //if (MainClass.isDebug)
Console.WriteLine("DEBUG (Nero plugin): Found \"CUEX\" chunk, parsing {0} bytes", ChunkLength); Console.WriteLine("DEBUG (Nero plugin): Found \"CUEX\" chunk, parsing {0} bytes", ChunkLength);
neroCuesheetV2 = new NeroV2Cuesheet(); neroCuesheetV2 = new NeroV2Cuesheet();
@@ -1062,7 +1062,7 @@ namespace DiscImageChef.ImagePlugins
_entry.Dummy = tmpbuffer[3]; _entry.Dummy = tmpbuffer[3];
_entry.LBAStart = BigEndianBitConverter.ToInt32(tmpbuffer, 4); _entry.LBAStart = BigEndianBitConverter.ToInt32(tmpbuffer, 4);
if (MainClass.isDebug) //if (MainClass.isDebug)
{ {
Console.WriteLine("DEBUG (Nero plugin): Cuesheet entry {0}", (i / 8) + 1); Console.WriteLine("DEBUG (Nero plugin): Cuesheet entry {0}", (i / 8) + 1);
Console.WriteLine("DEBUG (Nero plugin):\t _entry[{0}].Mode = 0x{1:X2}", (i / 8) + 1, _entry.Mode); Console.WriteLine("DEBUG (Nero plugin):\t _entry[{0}].Mode = 0x{1:X2}", (i / 8) + 1, _entry.Mode);
@@ -1079,7 +1079,7 @@ namespace DiscImageChef.ImagePlugins
} }
case NeroV1DAOID: case NeroV1DAOID:
{ {
if (MainClass.isDebug) //if (MainClass.isDebug)
Console.WriteLine("DEBUG (Nero plugin): Found \"DAOI\" chunk, parsing {0} bytes", ChunkLength); Console.WriteLine("DEBUG (Nero plugin): Found \"DAOI\" chunk, parsing {0} bytes", ChunkLength);
neroDAOV1 = new NeroV1DAO(); neroDAOV1 = new NeroV1DAO();
@@ -1102,7 +1102,7 @@ namespace DiscImageChef.ImagePlugins
if (!ImageInfo.readableSectorTags.Contains(SectorTagType.CDTrackISRC)) if (!ImageInfo.readableSectorTags.Contains(SectorTagType.CDTrackISRC))
ImageInfo.readableSectorTags.Add(SectorTagType.CDTrackISRC); ImageInfo.readableSectorTags.Add(SectorTagType.CDTrackISRC);
if (MainClass.isDebug) //if (MainClass.isDebug)
{ {
Console.WriteLine("DEBUG (Nero plugin): neroDAOV1.ChunkSizeLe = {0} bytes", neroDAOV1.ChunkSizeLe); Console.WriteLine("DEBUG (Nero plugin): neroDAOV1.ChunkSizeLe = {0} bytes", neroDAOV1.ChunkSizeLe);
Console.WriteLine("DEBUG (Nero plugin): neroDAOV1.UPC = \"{0}\"", StringHandlers.CToString(neroDAOV1.UPC)); Console.WriteLine("DEBUG (Nero plugin): neroDAOV1.UPC = \"{0}\"", StringHandlers.CToString(neroDAOV1.UPC));
@@ -1127,7 +1127,7 @@ namespace DiscImageChef.ImagePlugins
_entry.Index1 = BigEndianBitConverter.ToUInt32(tmpbuffer, 22); _entry.Index1 = BigEndianBitConverter.ToUInt32(tmpbuffer, 22);
_entry.EndOfTrack = BigEndianBitConverter.ToUInt32(tmpbuffer, 26); _entry.EndOfTrack = BigEndianBitConverter.ToUInt32(tmpbuffer, 26);
if (MainClass.isDebug) //if (MainClass.isDebug)
{ {
Console.WriteLine("DEBUG (Nero plugin): Disc-At-Once entry {0}", (i / 32) + 1); Console.WriteLine("DEBUG (Nero plugin): Disc-At-Once entry {0}", (i / 32) + 1);
Console.WriteLine("DEBUG (Nero plugin):\t _entry[{0}].ISRC = \"{1}\"", (i / 32) + 1, StringHandlers.CToString(_entry.ISRC)); Console.WriteLine("DEBUG (Nero plugin):\t _entry[{0}].ISRC = \"{1}\"", (i / 32) + 1, StringHandlers.CToString(_entry.ISRC));
@@ -1169,7 +1169,7 @@ namespace DiscImageChef.ImagePlugins
} }
case NeroV2DAOID: case NeroV2DAOID:
{ {
if (MainClass.isDebug) //if (MainClass.isDebug)
Console.WriteLine("DEBUG (Nero plugin): Found \"DAOX\" chunk, parsing {0} bytes", ChunkLength); Console.WriteLine("DEBUG (Nero plugin): Found \"DAOX\" chunk, parsing {0} bytes", ChunkLength);
neroDAOV2 = new NeroV2DAO(); neroDAOV2 = new NeroV2DAO();
@@ -1194,7 +1194,7 @@ namespace DiscImageChef.ImagePlugins
UPC = neroDAOV2.UPC; UPC = neroDAOV2.UPC;
if (MainClass.isDebug) //if (MainClass.isDebug)
{ {
Console.WriteLine("DEBUG (Nero plugin): neroDAOV2.ChunkSizeLe = {0} bytes", neroDAOV2.ChunkSizeLe); Console.WriteLine("DEBUG (Nero plugin): neroDAOV2.ChunkSizeLe = {0} bytes", neroDAOV2.ChunkSizeLe);
Console.WriteLine("DEBUG (Nero plugin): neroDAOV2.UPC = \"{0}\"", StringHandlers.CToString(neroDAOV2.UPC)); Console.WriteLine("DEBUG (Nero plugin): neroDAOV2.UPC = \"{0}\"", StringHandlers.CToString(neroDAOV2.UPC));
@@ -1217,7 +1217,7 @@ namespace DiscImageChef.ImagePlugins
_entry.Index1 = BigEndianBitConverter.ToUInt64(tmpbuffer, 26); _entry.Index1 = BigEndianBitConverter.ToUInt64(tmpbuffer, 26);
_entry.EndOfTrack = BigEndianBitConverter.ToUInt64(tmpbuffer, 34); _entry.EndOfTrack = BigEndianBitConverter.ToUInt64(tmpbuffer, 34);
if (MainClass.isDebug) //if (MainClass.isDebug)
{ {
Console.WriteLine("DEBUG (Nero plugin): Disc-At-Once entry {0}", (i / 32) + 1); Console.WriteLine("DEBUG (Nero plugin): Disc-At-Once entry {0}", (i / 32) + 1);
Console.WriteLine("DEBUG (Nero plugin):\t _entry[{0}].ISRC = \"{1}\"", (i / 32) + 1, StringHandlers.CToString(_entry.ISRC)); Console.WriteLine("DEBUG (Nero plugin):\t _entry[{0}].ISRC = \"{1}\"", (i / 32) + 1, StringHandlers.CToString(_entry.ISRC));
@@ -1259,7 +1259,7 @@ namespace DiscImageChef.ImagePlugins
} }
case NeroCDTextID: case NeroCDTextID:
{ {
if (MainClass.isDebug) //if (MainClass.isDebug)
Console.WriteLine("DEBUG (Nero plugin): Found \"CDTX\" chunk, parsing {0} bytes", ChunkLength); Console.WriteLine("DEBUG (Nero plugin): Found \"CDTX\" chunk, parsing {0} bytes", ChunkLength);
neroCDTXT = new NeroCDText(); neroCDTXT = new NeroCDText();
@@ -1281,7 +1281,7 @@ namespace DiscImageChef.ImagePlugins
Array.Copy(tmpbuffer, 4, _entry.Text, 0, 12); Array.Copy(tmpbuffer, 4, _entry.Text, 0, 12);
_entry.CRC = BigEndianBitConverter.ToUInt16(tmpbuffer, 16); _entry.CRC = BigEndianBitConverter.ToUInt16(tmpbuffer, 16);
if (MainClass.isDebug) //if (MainClass.isDebug)
{ {
Console.WriteLine("DEBUG (Nero plugin): CD-TEXT entry {0}", (i / 18) + 1); Console.WriteLine("DEBUG (Nero plugin): CD-TEXT entry {0}", (i / 18) + 1);
Console.WriteLine("DEBUG (Nero plugin):\t _entry[{0}].PackType = 0x{1:X2}", (i / 18) + 1, _entry.PackType); Console.WriteLine("DEBUG (Nero plugin):\t _entry[{0}].PackType = 0x{1:X2}", (i / 18) + 1, _entry.PackType);
@@ -1299,7 +1299,7 @@ namespace DiscImageChef.ImagePlugins
} }
case NeroV1TAOID: case NeroV1TAOID:
{ {
if (MainClass.isDebug) //if (MainClass.isDebug)
Console.WriteLine("DEBUG (Nero plugin): Found \"ETNF\" chunk, parsing {0} bytes", ChunkLength); Console.WriteLine("DEBUG (Nero plugin): Found \"ETNF\" chunk, parsing {0} bytes", ChunkLength);
neroTAOV1 = new NeroV1TAO(); neroTAOV1 = new NeroV1TAO();
@@ -1319,7 +1319,7 @@ namespace DiscImageChef.ImagePlugins
_entry.StartLBA = BigEndianBitConverter.ToUInt32(tmpbuffer, 12); _entry.StartLBA = BigEndianBitConverter.ToUInt32(tmpbuffer, 12);
_entry.Unknown = BigEndianBitConverter.ToUInt32(tmpbuffer, 16); _entry.Unknown = BigEndianBitConverter.ToUInt32(tmpbuffer, 16);
if (MainClass.isDebug) //if (MainClass.isDebug)
{ {
Console.WriteLine("DEBUG (Nero plugin): Track-at-Once entry {0}", (i / 20) + 1); Console.WriteLine("DEBUG (Nero plugin): Track-at-Once entry {0}", (i / 20) + 1);
Console.WriteLine("DEBUG (Nero plugin):\t _entry[{0}].Offset = {1}", (i / 20) + 1, _entry.Offset); Console.WriteLine("DEBUG (Nero plugin):\t _entry[{0}].Offset = {1}", (i / 20) + 1, _entry.Offset);
@@ -1357,7 +1357,7 @@ namespace DiscImageChef.ImagePlugins
} }
case NeroV2TAOID: case NeroV2TAOID:
{ {
if (MainClass.isDebug) //if (MainClass.isDebug)
Console.WriteLine("DEBUG (Nero plugin): Found \"ETN2\" chunk, parsing {0} bytes", ChunkLength); Console.WriteLine("DEBUG (Nero plugin): Found \"ETN2\" chunk, parsing {0} bytes", ChunkLength);
neroTAOV2 = new NeroV2TAO(); neroTAOV2 = new NeroV2TAO();
@@ -1378,7 +1378,7 @@ namespace DiscImageChef.ImagePlugins
_entry.Unknown = BigEndianBitConverter.ToUInt32(tmpbuffer, 24); _entry.Unknown = BigEndianBitConverter.ToUInt32(tmpbuffer, 24);
_entry.Sectors = BigEndianBitConverter.ToUInt32(tmpbuffer, 28); _entry.Sectors = BigEndianBitConverter.ToUInt32(tmpbuffer, 28);
if (MainClass.isDebug) //if (MainClass.isDebug)
{ {
Console.WriteLine("DEBUG (Nero plugin): Track-at-Once entry {0}", (i / 32) + 1); Console.WriteLine("DEBUG (Nero plugin): Track-at-Once entry {0}", (i / 32) + 1);
Console.WriteLine("DEBUG (Nero plugin):\t _entry[{0}].Offset = {1}", (i / 32) + 1, _entry.Offset); Console.WriteLine("DEBUG (Nero plugin):\t _entry[{0}].Offset = {1}", (i / 32) + 1, _entry.Offset);
@@ -1417,7 +1417,7 @@ namespace DiscImageChef.ImagePlugins
} }
case NeroSessionID: case NeroSessionID:
{ {
if (MainClass.isDebug) //if (MainClass.isDebug)
Console.WriteLine("DEBUG (Nero plugin): Found \"SINF\" chunk, parsing {0} bytes", ChunkLength); Console.WriteLine("DEBUG (Nero plugin): Found \"SINF\" chunk, parsing {0} bytes", ChunkLength);
UInt32 sessionTracks; UInt32 sessionTracks;
@@ -1426,7 +1426,7 @@ namespace DiscImageChef.ImagePlugins
sessionTracks = BigEndianBitConverter.ToUInt32(tmpbuffer, 0); sessionTracks = BigEndianBitConverter.ToUInt32(tmpbuffer, 0);
neroSessions.Add(currentsession, sessionTracks); neroSessions.Add(currentsession, sessionTracks);
if (MainClass.isDebug) //if (MainClass.isDebug)
Console.WriteLine("DEBUG (Nero plugin): \tSession {0} has {1} tracks", currentsession, sessionTracks); Console.WriteLine("DEBUG (Nero plugin): \tSession {0} has {1} tracks", currentsession, sessionTracks);
currentsession++; currentsession++;
@@ -1434,7 +1434,7 @@ namespace DiscImageChef.ImagePlugins
} }
case NeroDiskTypeID: case NeroDiskTypeID:
{ {
if (MainClass.isDebug) //if (MainClass.isDebug)
Console.WriteLine("DEBUG (Nero plugin): Found \"MTYP\" chunk, parsing {0} bytes", ChunkLength); Console.WriteLine("DEBUG (Nero plugin): Found \"MTYP\" chunk, parsing {0} bytes", ChunkLength);
neroMediaTyp = new NeroMediaType(); neroMediaTyp = new NeroMediaType();
@@ -1446,7 +1446,7 @@ namespace DiscImageChef.ImagePlugins
imageStream.Read(tmpbuffer, 0, 4); imageStream.Read(tmpbuffer, 0, 4);
neroMediaTyp.Type = BigEndianBitConverter.ToUInt32(tmpbuffer, 0); neroMediaTyp.Type = BigEndianBitConverter.ToUInt32(tmpbuffer, 0);
if (MainClass.isDebug) //if (MainClass.isDebug)
Console.WriteLine("DEBUG (Nero plugin): \tMedia type is {0} ({1})", (NeroMediaTypes)neroMediaTyp.Type, neroMediaTyp.Type); Console.WriteLine("DEBUG (Nero plugin): \tMedia type is {0} ({1})", (NeroMediaTypes)neroMediaTyp.Type, neroMediaTyp.Type);
ImageInfo.diskType = NeroMediaTypeToDiskType((NeroMediaTypes)neroMediaTyp.Type); ImageInfo.diskType = NeroMediaTypeToDiskType((NeroMediaTypes)neroMediaTyp.Type);
@@ -1455,7 +1455,7 @@ namespace DiscImageChef.ImagePlugins
} }
case NeroDiscInfoID: case NeroDiscInfoID:
{ {
if (MainClass.isDebug) //if (MainClass.isDebug)
Console.WriteLine("DEBUG (Nero plugin): Found \"DINF\" chunk, parsing {0} bytes", ChunkLength); Console.WriteLine("DEBUG (Nero plugin): Found \"DINF\" chunk, parsing {0} bytes", ChunkLength);
neroDiscInfo = new NeroDiscInformation(); neroDiscInfo = new NeroDiscInformation();
@@ -1465,14 +1465,14 @@ namespace DiscImageChef.ImagePlugins
imageStream.Read(tmpbuffer, 0, 4); imageStream.Read(tmpbuffer, 0, 4);
neroDiscInfo.Unknown = BigEndianBitConverter.ToUInt32(tmpbuffer, 0); neroDiscInfo.Unknown = BigEndianBitConverter.ToUInt32(tmpbuffer, 0);
if (MainClass.isDebug) //if (MainClass.isDebug)
Console.WriteLine("DEBUG (Nero plugin): \tneroDiscInfo.Unknown = 0x{0:X4} ({0})", neroDiscInfo.Unknown); Console.WriteLine("DEBUG (Nero plugin): \tneroDiscInfo.Unknown = 0x{0:X4} ({0})", neroDiscInfo.Unknown);
break; break;
} }
case NeroReloID: case NeroReloID:
{ {
if (MainClass.isDebug) //if (MainClass.isDebug)
Console.WriteLine("DEBUG (Nero plugin): Found \"RELO\" chunk, parsing {0} bytes", ChunkLength); Console.WriteLine("DEBUG (Nero plugin): Found \"RELO\" chunk, parsing {0} bytes", ChunkLength);
neroRELO = new NeroRELOChunk(); neroRELO = new NeroRELOChunk();
@@ -1482,14 +1482,14 @@ namespace DiscImageChef.ImagePlugins
imageStream.Read(tmpbuffer, 0, 4); imageStream.Read(tmpbuffer, 0, 4);
neroRELO.Unknown = BigEndianBitConverter.ToUInt32(tmpbuffer, 0); neroRELO.Unknown = BigEndianBitConverter.ToUInt32(tmpbuffer, 0);
if (MainClass.isDebug) //if (MainClass.isDebug)
Console.WriteLine("DEBUG (Nero plugin): \tneroRELO.Unknown = 0x{0:X4} ({0})", neroRELO.Unknown); Console.WriteLine("DEBUG (Nero plugin): \tneroRELO.Unknown = 0x{0:X4} ({0})", neroRELO.Unknown);
break; break;
} }
case NeroTOCID: case NeroTOCID:
{ {
if (MainClass.isDebug) //if (MainClass.isDebug)
Console.WriteLine("DEBUG (Nero plugin): Found \"TOCT\" chunk, parsing {0} bytes", ChunkLength); Console.WriteLine("DEBUG (Nero plugin): Found \"TOCT\" chunk, parsing {0} bytes", ChunkLength);
neroTOC = new NeroTOCChunk(); neroTOC = new NeroTOCChunk();
@@ -1499,21 +1499,21 @@ namespace DiscImageChef.ImagePlugins
imageStream.Read(tmpbuffer, 0, 2); imageStream.Read(tmpbuffer, 0, 2);
neroTOC.Unknown = BigEndianBitConverter.ToUInt16(tmpbuffer, 0); neroTOC.Unknown = BigEndianBitConverter.ToUInt16(tmpbuffer, 0);
if (MainClass.isDebug) //if (MainClass.isDebug)
Console.WriteLine("DEBUG (Nero plugin): \tneroTOC.Unknown = 0x{0:X4} ({0})", neroTOC.Unknown); Console.WriteLine("DEBUG (Nero plugin): \tneroTOC.Unknown = 0x{0:X4} ({0})", neroTOC.Unknown);
break; break;
} }
case NeroEndID: case NeroEndID:
{ {
if (MainClass.isDebug) //if (MainClass.isDebug)
Console.WriteLine("DEBUG (Nero plugin): Found \"END!\" chunk, finishing parse"); Console.WriteLine("DEBUG (Nero plugin): Found \"END!\" chunk, finishing parse");
parsing = false; parsing = false;
break; break;
} }
default: default:
{ {
if (MainClass.isDebug) //if (MainClass.isDebug)
Console.WriteLine("DEBUG (Nero plugin): Unknown chunk ID \"{0}\", skipping...", System.Text.Encoding.ASCII.GetString(BigEndianBitConverter.GetBytes(ChunkID))); Console.WriteLine("DEBUG (Nero plugin): Unknown chunk ID \"{0}\", skipping...", System.Text.Encoding.ASCII.GetString(BigEndianBitConverter.GetBytes(ChunkID)));
imageStream.Seek(ChunkLength, SeekOrigin.Current); imageStream.Seek(ChunkLength, SeekOrigin.Current);
break; break;
@@ -1556,7 +1556,7 @@ namespace DiscImageChef.ImagePlugins
if (neroSessions.Count == 0) if (neroSessions.Count == 0)
neroSessions.Add(1, currenttrack); neroSessions.Add(1, currenttrack);
if (MainClass.isDebug) //if (MainClass.isDebug)
Console.WriteLine("DEBUG (Nero plugin): Building offset, track and session maps"); Console.WriteLine("DEBUG (Nero plugin): Building offset, track and session maps");
currentsession = 1; currentsession = 1;
@@ -1570,7 +1570,7 @@ namespace DiscImageChef.ImagePlugins
NeroTrack _neroTrack; NeroTrack _neroTrack;
if (neroTracks.TryGetValue(i, out _neroTrack)) if (neroTracks.TryGetValue(i, out _neroTrack))
{ {
if (MainClass.isDebug) //if (MainClass.isDebug)
{ {
Console.WriteLine("DEBUG (Nero plugin): \tcurrentsession = {0}", currentsession); Console.WriteLine("DEBUG (Nero plugin): \tcurrentsession = {0}", currentsession);
Console.WriteLine("DEBUG (Nero plugin): \tcurrentsessionmaxtrack = {0}", currentsessionmaxtrack); Console.WriteLine("DEBUG (Nero plugin): \tcurrentsessionmaxtrack = {0}", currentsessionmaxtrack);
@@ -1591,7 +1591,7 @@ namespace DiscImageChef.ImagePlugins
_track.TrackType = NeroTrackModeToTrackType((DAOMode)_neroTrack.Mode); _track.TrackType = NeroTrackModeToTrackType((DAOMode)_neroTrack.Mode);
imageTracks.Add(_track); imageTracks.Add(_track);
if (MainClass.isDebug) //if (MainClass.isDebug)
{ {
Console.WriteLine("DEBUG (Nero plugin): \t\t _track.TrackDescription = {0}", _track.TrackDescription); Console.WriteLine("DEBUG (Nero plugin): \t\t _track.TrackDescription = {0}", _track.TrackDescription);
Console.WriteLine("DEBUG (Nero plugin): \t\t _track.TrackEndSector = {0}", _track.TrackEndSector); Console.WriteLine("DEBUG (Nero plugin): \t\t _track.TrackEndSector = {0}", _track.TrackEndSector);
@@ -1621,14 +1621,14 @@ namespace DiscImageChef.ImagePlugins
} }
offsetmap.Add(_track.TrackSequence, _track.TrackStartSector); offsetmap.Add(_track.TrackSequence, _track.TrackStartSector);
if (MainClass.isDebug) //if (MainClass.isDebug)
Console.WriteLine("DEBUG (Nero plugin): \t\t Offset[{0}]: {1}", _track.TrackSequence, _track.TrackStartSector); Console.WriteLine("DEBUG (Nero plugin): \t\t Offset[{0}]: {1}", _track.TrackSequence, _track.TrackStartSector);
PartPlugins.Partition partition; CommonTypes.Partition partition;
if (_neroTrack.Index0 < _neroTrack.Index1) if (_neroTrack.Index0 < _neroTrack.Index1)
{ {
partition = new PartPlugins.Partition(); partition = new CommonTypes.Partition();
partition.PartitionDescription = String.Format("Track {0} Index 0", _track.TrackSequence); partition.PartitionDescription = String.Format("Track {0} Index 0", _track.TrackSequence);
partition.PartitionLength = (_neroTrack.Index1 - _neroTrack.Index0); partition.PartitionLength = (_neroTrack.Index1 - _neroTrack.Index0);
partition.PartitionName = StringHandlers.CToString(_neroTrack.ISRC); partition.PartitionName = StringHandlers.CToString(_neroTrack.ISRC);
@@ -1641,7 +1641,7 @@ namespace DiscImageChef.ImagePlugins
PartitionSequence++; PartitionSequence++;
} }
partition = new PartPlugins.Partition(); partition = new CommonTypes.Partition();
partition.PartitionDescription = String.Format("Track {0} Index 1", _track.TrackSequence); partition.PartitionDescription = String.Format("Track {0} Index 1", _track.TrackSequence);
partition.PartitionLength = (_neroTrack.EndOfTrack - _neroTrack.Index1); partition.PartitionLength = (_neroTrack.EndOfTrack - _neroTrack.Index1);
partition.PartitionName = StringHandlers.CToString(_neroTrack.ISRC); partition.PartitionName = StringHandlers.CToString(_neroTrack.ISRC);
@@ -2247,7 +2247,7 @@ namespace DiscImageChef.ImagePlugins
return ImageInfo.diskType; return ImageInfo.diskType;
} }
public override List<PartPlugins.Partition> GetPartitions() public override List<CommonTypes.Partition> GetPartitions()
{ {
return ImagePartitions; return ImagePartitions;
} }

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.DiscImages")]
[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

@@ -201,7 +201,7 @@ namespace DiscImageChef.ImagePlugins
#endregion #endregion
public TeleDisk(PluginBase Core) public TeleDisk()
{ {
Name = "Sydex TeleDisk"; Name = "Sydex TeleDisk";
PluginUUID = new Guid("0240B7B1-E959-4CDC-B0BD-386D6E467B88"); PluginUUID = new Guid("0240B7B1-E959-4CDC-B0BD-386D6E467B88");
@@ -255,7 +255,7 @@ namespace DiscImageChef.ImagePlugins
Array.Copy(headerBytes, headerBytesForCRC, 10); Array.Copy(headerBytes, headerBytesForCRC, 10);
UInt16 calculatedHeaderCRC = TeleDiskCRC(0x0000, headerBytesForCRC); UInt16 calculatedHeaderCRC = TeleDiskCRC(0x0000, headerBytesForCRC);
if (MainClass.isDebug) //if (MainClass.isDebug)
{ {
Console.WriteLine("DEBUG (TeleDisk plugin): header.signature = 0x{0:X4}", header.signature); Console.WriteLine("DEBUG (TeleDisk plugin): header.signature = 0x{0:X4}", header.signature);
Console.WriteLine("DEBUG (TeleDisk plugin): header.sequence = 0x{0:X2}", header.sequence); Console.WriteLine("DEBUG (TeleDisk plugin): header.sequence = 0x{0:X2}", header.sequence);
@@ -321,7 +321,7 @@ namespace DiscImageChef.ImagePlugins
Array.Copy(headerBytes, headerBytesForCRC, 10); Array.Copy(headerBytes, headerBytesForCRC, 10);
UInt16 calculatedHeaderCRC = TeleDiskCRC(0x0000, headerBytesForCRC); UInt16 calculatedHeaderCRC = TeleDiskCRC(0x0000, headerBytesForCRC);
if (MainClass.isDebug) //if (MainClass.isDebug)
{ {
Console.WriteLine("DEBUG (TeleDisk plugin): header.signature = 0x{0:X4}", header.signature); Console.WriteLine("DEBUG (TeleDisk plugin): header.signature = 0x{0:X4}", header.signature);
Console.WriteLine("DEBUG (TeleDisk plugin): header.sequence = 0x{0:X2}", header.sequence); Console.WriteLine("DEBUG (TeleDisk plugin): header.sequence = 0x{0:X2}", header.sequence);
@@ -343,7 +343,7 @@ namespace DiscImageChef.ImagePlugins
if (header.crc != calculatedHeaderCRC) if (header.crc != calculatedHeaderCRC)
{ {
ADiskCRCHasFailed = true; ADiskCRCHasFailed = true;
if (MainClass.isDebug) //if (MainClass.isDebug)
Console.WriteLine("DEBUG (TeleDisk plugin): Calculated CRC does not coincide with stored one."); Console.WriteLine("DEBUG (TeleDisk plugin): Calculated CRC does not coincide with stored one.");
} }
@@ -388,7 +388,7 @@ namespace DiscImageChef.ImagePlugins
UInt16 cmtcrc = TeleDiskCRC(0, commentBlockForCRC); UInt16 cmtcrc = TeleDiskCRC(0, commentBlockForCRC);
if (MainClass.isDebug) //if (MainClass.isDebug)
{ {
Console.WriteLine("DEBUG (TeleDisk plugin): Comment header"); Console.WriteLine("DEBUG (TeleDisk plugin): Comment header");
Console.WriteLine("DEBUG (TeleDisk plugin): \tcommentheader.crc = 0x{0:X4}", commentHeader.crc); Console.WriteLine("DEBUG (TeleDisk plugin): \tcommentheader.crc = 0x{0:X4}", commentHeader.crc);
@@ -413,7 +413,7 @@ namespace DiscImageChef.ImagePlugins
ImageInfo.imageComments = System.Text.Encoding.ASCII.GetString(commentBlock); ImageInfo.imageComments = System.Text.Encoding.ASCII.GetString(commentBlock);
if (MainClass.isDebug) //if (MainClass.isDebug)
{ {
Console.WriteLine("DEBUG (TeleDisk plugin): Comment"); Console.WriteLine("DEBUG (TeleDisk plugin): Comment");
Console.WriteLine("DEBUG (TeleDisk plugin): {0}", ImageInfo.imageComments); Console.WriteLine("DEBUG (TeleDisk plugin): {0}", ImageInfo.imageComments);
@@ -428,13 +428,13 @@ namespace DiscImageChef.ImagePlugins
ImageInfo.imageCreationTime = fi.CreationTimeUtc; ImageInfo.imageCreationTime = fi.CreationTimeUtc;
ImageInfo.imageLastModificationTime = fi.LastWriteTimeUtc; ImageInfo.imageLastModificationTime = fi.LastWriteTimeUtc;
if (MainClass.isDebug) //if (MainClass.isDebug)
{ {
Console.WriteLine("DEBUG (TeleDisk plugin): Image created on {0}", ImageInfo.imageCreationTime); Console.WriteLine("DEBUG (TeleDisk plugin): Image created on {0}", ImageInfo.imageCreationTime);
Console.WriteLine("DEBUG (TeleDisk plugin): Image modified on {0}", ImageInfo.imageLastModificationTime); Console.WriteLine("DEBUG (TeleDisk plugin): Image modified on {0}", ImageInfo.imageLastModificationTime);
} }
if (MainClass.isDebug) //if (MainClass.isDebug)
Console.WriteLine("DEBUG (TeleDisk plugin): Parsing image"); Console.WriteLine("DEBUG (TeleDisk plugin): Parsing image");
totalDiskSize = 0; totalDiskSize = 0;
@@ -459,7 +459,7 @@ namespace DiscImageChef.ImagePlugins
TDTrackCalculatedCRC = (byte)(TeleDiskCRC(0, TDTrackForCRC) & 0xFF); TDTrackCalculatedCRC = (byte)(TeleDiskCRC(0, TDTrackForCRC) & 0xFF);
if (MainClass.isDebug) //if (MainClass.isDebug)
{ {
Console.WriteLine("DEBUG (TeleDisk plugin): Track follows"); Console.WriteLine("DEBUG (TeleDisk plugin): Track follows");
Console.WriteLine("DEBUG (TeleDisk plugin): \tTrack cylinder: {0}\t", TDTrack.cylinder); Console.WriteLine("DEBUG (TeleDisk plugin): \tTrack cylinder: {0}\t", TDTrack.cylinder);
@@ -472,7 +472,7 @@ namespace DiscImageChef.ImagePlugins
if (TDTrack.sectors == 0xFF) // End of disk image if (TDTrack.sectors == 0xFF) // End of disk image
{ {
if (MainClass.isDebug) //if (MainClass.isDebug)
{ {
Console.WriteLine("DEBUG (TeleDisk plugin): End of disk image arrived"); Console.WriteLine("DEBUG (TeleDisk plugin): End of disk image arrived");
Console.WriteLine("DEBUG (TeleDisk plugin): Total of {0} data sectors, for {1} bytes", sectorsData.Count, totalDiskSize); Console.WriteLine("DEBUG (TeleDisk plugin): Total of {0} data sectors, for {1} bytes", sectorsData.Count, totalDiskSize);
@@ -503,7 +503,7 @@ namespace DiscImageChef.ImagePlugins
TDSector.flags = (byte)stream.ReadByte(); TDSector.flags = (byte)stream.ReadByte();
TDSector.crc = (byte)stream.ReadByte(); TDSector.crc = (byte)stream.ReadByte();
if (MainClass.isDebug) //if (MainClass.isDebug)
{ {
Console.WriteLine("DEBUG (TeleDisk plugin): \tSector follows"); Console.WriteLine("DEBUG (TeleDisk plugin): \tSector follows");
Console.WriteLine("DEBUG (TeleDisk plugin): \t\tAddressMark cylinder: {0}", TDSector.cylinder); Console.WriteLine("DEBUG (TeleDisk plugin): \t\tAddressMark cylinder: {0}", TDSector.cylinder);
@@ -524,7 +524,7 @@ namespace DiscImageChef.ImagePlugins
TDData.dataEncoding = (byte)stream.ReadByte(); TDData.dataEncoding = (byte)stream.ReadByte();
data = new byte[TDData.dataSize]; data = new byte[TDData.dataSize];
stream.Read(data, 0, TDData.dataSize); stream.Read(data, 0, TDData.dataSize);
if (MainClass.isDebug) //if (MainClass.isDebug)
{ {
Console.WriteLine("DEBUG (TeleDisk plugin): \t\tData size (in-image): {0}", TDData.dataSize); Console.WriteLine("DEBUG (TeleDisk plugin): \t\tData size (in-image): {0}", TDData.dataSize);
Console.WriteLine("DEBUG (TeleDisk plugin): \t\tData encoding: 0x{0:X2}", TDData.dataEncoding); Console.WriteLine("DEBUG (TeleDisk plugin): \t\tData encoding: 0x{0:X2}", TDData.dataEncoding);
@@ -536,7 +536,7 @@ namespace DiscImageChef.ImagePlugins
if (TDSectorCalculatedCRC != TDSector.crc) if (TDSectorCalculatedCRC != TDSector.crc)
{ {
if (MainClass.isDebug) //if (MainClass.isDebug)
Console.WriteLine("DEBUG (TeleDisk plugin): Sector LBA {0} calculated CRC 0x{1:X2} differs from stored CRC 0x{2:X2}", LBA, TDSectorCalculatedCRC, TDSector.crc); Console.WriteLine("DEBUG (TeleDisk plugin): Sector LBA {0} calculated CRC 0x{1:X2} differs from stored CRC 0x{2:X2}", LBA, TDSectorCalculatedCRC, TDSector.crc);
if ((TDSector.flags & FlagsSectorNoID) != FlagsSectorNoID) if ((TDSector.flags & FlagsSectorNoID) != FlagsSectorNoID)
if (!sectorsData.ContainsKey(LBA) && (TDSector.flags & FlagsSectorDuplicate) != FlagsSectorDuplicate) if (!sectorsData.ContainsKey(LBA) && (TDSector.flags & FlagsSectorDuplicate) != FlagsSectorDuplicate)
@@ -574,7 +574,7 @@ namespace DiscImageChef.ImagePlugins
} }
ArrayHelpers.ArrayFill(decodedData, (byte)0); ArrayHelpers.ArrayFill(decodedData, (byte)0);
} }
if (MainClass.isDebug) //if (MainClass.isDebug)
Console.WriteLine("DEBUG (TeleDisk plugin): \t\tLBA: {0}", LBA); Console.WriteLine("DEBUG (TeleDisk plugin): \t\tLBA: {0}", LBA);
if ((TDSector.flags & FlagsSectorNoID) != FlagsSectorNoID) if ((TDSector.flags & FlagsSectorNoID) != FlagsSectorNoID)
@@ -583,13 +583,13 @@ namespace DiscImageChef.ImagePlugins
{ {
if ((TDSector.flags & FlagsSectorDuplicate) == FlagsSectorDuplicate) if ((TDSector.flags & FlagsSectorDuplicate) == FlagsSectorDuplicate)
{ {
if (MainClass.isDebug) //if (MainClass.isDebug)
Console.WriteLine("DEBUG (TeleDisk plugin): \t\tSector {0} on cylinder {1} head {2} is duplicate, and marked so", Console.WriteLine("DEBUG (TeleDisk plugin): \t\tSector {0} on cylinder {1} head {2} is duplicate, and marked so",
TDSector.sectorNumber, TDSector.cylinder, TDSector.head); TDSector.sectorNumber, TDSector.cylinder, TDSector.head);
} }
else else
{ {
if (MainClass.isDebug) //if (MainClass.isDebug)
Console.WriteLine("DEBUG (TeleDisk plugin): \t\tSector {0} on cylinder {1} head {2} is duplicate, but is not marked so", Console.WriteLine("DEBUG (TeleDisk plugin): \t\tSector {0} on cylinder {1} head {2} is duplicate, but is not marked so",
TDSector.sectorNumber, TDSector.cylinder, TDSector.head); TDSector.sectorNumber, TDSector.cylinder, TDSector.head);
} }
@@ -840,7 +840,7 @@ namespace DiscImageChef.ImagePlugins
ins += 4; ins += 4;
outs += decodedPiece.Length; outs += decodedPiece.Length;
} }
if (MainClass.isDebug) //if (MainClass.isDebug)
{ {
Console.WriteLine("DEBUG (TeleDisk plugin): (Block pattern decoder): Input data size: {0} bytes", encodedData.Length); Console.WriteLine("DEBUG (TeleDisk plugin): (Block pattern decoder): Input data size: {0} bytes", encodedData.Length);
Console.WriteLine("DEBUG (TeleDisk plugin): (Block pattern decoder): Processed input: {0} bytes", ins); Console.WriteLine("DEBUG (TeleDisk plugin): (Block pattern decoder): Processed input: {0} bytes", ins);
@@ -881,7 +881,7 @@ namespace DiscImageChef.ImagePlugins
outs += Piece.Length; outs += Piece.Length;
} }
} }
if (MainClass.isDebug) //if (MainClass.isDebug)
{ {
Console.WriteLine("DEBUG (TeleDisk plugin): (RLE decoder): Input data size: {0} bytes", encodedData.Length); Console.WriteLine("DEBUG (TeleDisk plugin): (RLE decoder): Input data size: {0} bytes", encodedData.Length);
Console.WriteLine("DEBUG (TeleDisk plugin): (RLE decoder): Processed input: {0} bytes", ins); Console.WriteLine("DEBUG (TeleDisk plugin): (RLE decoder): Processed input: {0} bytes", ins);
@@ -967,7 +967,7 @@ namespace DiscImageChef.ImagePlugins
return DiskType.ECMA_78_2; return DiskType.ECMA_78_2;
default: default:
{ {
if (MainClass.isDebug) //if (MainClass.isDebug)
Console.WriteLine("DEBUG (TeleDisk plugin): Unknown 5,25\" disk with {0} bytes", totalDiskSize); Console.WriteLine("DEBUG (TeleDisk plugin): Unknown 5,25\" disk with {0} bytes", totalDiskSize);
return DiskType.Unknown; return DiskType.Unknown;
} }
@@ -1012,7 +1012,7 @@ namespace DiscImageChef.ImagePlugins
return DiskType.SHARP_35; return DiskType.SHARP_35;
default: default:
{ {
if (MainClass.isDebug) //if (MainClass.isDebug)
Console.WriteLine("DEBUG (TeleDisk plugin): Unknown 3,5\" disk with {0} bytes", totalDiskSize); Console.WriteLine("DEBUG (TeleDisk plugin): Unknown 3,5\" disk with {0} bytes", totalDiskSize);
return DiskType.Unknown; return DiskType.Unknown;
} }
@@ -1061,7 +1061,7 @@ namespace DiscImageChef.ImagePlugins
return DiskType.ECMA_69_26; return DiskType.ECMA_69_26;
default: default:
{ {
if (MainClass.isDebug) //if (MainClass.isDebug)
Console.WriteLine("DEBUG (TeleDisk plugin): Unknown 8\" disk with {0} bytes", totalDiskSize); Console.WriteLine("DEBUG (TeleDisk plugin): Unknown 8\" disk with {0} bytes", totalDiskSize);
return DiskType.Unknown; return DiskType.Unknown;
} }
@@ -1069,7 +1069,7 @@ namespace DiscImageChef.ImagePlugins
} }
default: default:
{ {
if (MainClass.isDebug) //if (MainClass.isDebug)
Console.WriteLine("DEBUG (TeleDisk plugin): Unknown drive type {1} with {0} bytes", totalDiskSize, header.driveType); Console.WriteLine("DEBUG (TeleDisk plugin): Unknown drive type {1} with {0} bytes", totalDiskSize, header.driveType);
return DiskType.Unknown; return DiskType.Unknown;
} }
@@ -1156,7 +1156,7 @@ namespace DiscImageChef.ImagePlugins
return ImageInfo.driveSerialNumber; return ImageInfo.driveSerialNumber;
} }
public override List<PartPlugins.Partition> GetPartitions() public override List<CommonTypes.Partition> GetPartitions()
{ {
throw new FeatureUnsupportedImageException("Feature not supported by image format"); throw new FeatureUnsupportedImageException("Feature not supported by image format");
} }

View File

@@ -365,7 +365,7 @@ namespace DiscImageChef.ImagePlugins
#endregion #endregion
public VHD(PluginBase Core) public VHD()
{ {
Name = "VirtualPC"; Name = "VirtualPC";
PluginUUID = new Guid("8014d88f-64cd-4484-9441-7635c632958a"); PluginUUID = new Guid("8014d88f-64cd-4484-9441-7635c632958a");
@@ -459,7 +459,7 @@ namespace DiscImageChef.ImagePlugins
UInt32 headerCalculatedChecksum = VHDChecksum(header); UInt32 headerCalculatedChecksum = VHDChecksum(header);
UInt32 footerCalculatedChecksum = VHDChecksum(footer); UInt32 footerCalculatedChecksum = VHDChecksum(footer);
if (MainClass.isDebug) //if (MainClass.isDebug)
{ {
Console.WriteLine("DEBUG (VirtualPC plugin): Header checksum = 0x{0:X8}, calculated = 0x{1:X8}", headerChecksum, headerCalculatedChecksum); Console.WriteLine("DEBUG (VirtualPC plugin): Header checksum = 0x{0:X8}, calculated = 0x{1:X8}", headerChecksum, headerCalculatedChecksum);
Console.WriteLine("DEBUG (VirtualPC plugin): Header checksum = 0x{0:X8}, calculated = 0x{1:X8}", footerChecksum, footerCalculatedChecksum); Console.WriteLine("DEBUG (VirtualPC plugin): Header checksum = 0x{0:X8}, calculated = 0x{1:X8}", footerChecksum, footerCalculatedChecksum);
@@ -503,7 +503,7 @@ namespace DiscImageChef.ImagePlugins
thisDateTime = new DateTime(2000, 1, 1, 0, 0, 0, DateTimeKind.Utc); thisDateTime = new DateTime(2000, 1, 1, 0, 0, 0, DateTimeKind.Utc);
thisDateTime = thisDateTime.AddSeconds(thisFooter.timestamp); thisDateTime = thisDateTime.AddSeconds(thisFooter.timestamp);
if (MainClass.isDebug) //if (MainClass.isDebug)
{ {
Checksums.SHA1Context sha1Ctx = new Checksums.SHA1Context(); Checksums.SHA1Context sha1Ctx = new Checksums.SHA1Context();
sha1Ctx.Init(); sha1Ctx.Init();
@@ -655,7 +655,7 @@ namespace DiscImageChef.ImagePlugins
UInt32 dynamicChecksumCalculated = VHDChecksum(dynamicBytes); UInt32 dynamicChecksumCalculated = VHDChecksum(dynamicBytes);
if (MainClass.isDebug) //if (MainClass.isDebug)
Console.WriteLine("DEBUG (VirtualPC plugin): Dynamic header checksum = 0x{0:X8}, calculated = 0x{1:X8}", dynamicChecksum, dynamicChecksumCalculated); Console.WriteLine("DEBUG (VirtualPC plugin): Dynamic header checksum = 0x{0:X8}, calculated = 0x{1:X8}", dynamicChecksum, dynamicChecksumCalculated);
if (dynamicChecksum != dynamicChecksumCalculated) if (dynamicChecksum != dynamicChecksumCalculated)
@@ -694,7 +694,7 @@ namespace DiscImageChef.ImagePlugins
parentDateTime = new DateTime(2000, 1, 1, 0, 0, 0, DateTimeKind.Utc); parentDateTime = new DateTime(2000, 1, 1, 0, 0, 0, DateTimeKind.Utc);
parentDateTime = parentDateTime.AddSeconds(thisDynamic.parentTimestamp); parentDateTime = parentDateTime.AddSeconds(thisDynamic.parentTimestamp);
if (MainClass.isDebug) //if (MainClass.isDebug)
{ {
Checksums.SHA1Context sha1Ctx = new Checksums.SHA1Context(); Checksums.SHA1Context sha1Ctx = new Checksums.SHA1Context();
sha1Ctx.Init(); sha1Ctx.Init();
@@ -738,7 +738,7 @@ namespace DiscImageChef.ImagePlugins
for (int i = 0; i < thisDynamic.maxTableEntries; i++) for (int i = 0; i < thisDynamic.maxTableEntries; i++)
blockAllocationTable[i] = BigEndianBitConverter.ToUInt32(bat, 4 * i); blockAllocationTable[i] = BigEndianBitConverter.ToUInt32(bat, 4 * i);
if (MainClass.isDebug) //if (MainClass.isDebug)
{ {
DateTime endTime = DateTime.UtcNow; DateTime endTime = DateTime.UtcNow;
Console.WriteLine("DEBUG (VirtualPC plugin): Filling the BAT took {0} seconds", (endTime-startTime).TotalSeconds); Console.WriteLine("DEBUG (VirtualPC plugin): Filling the BAT took {0} seconds", (endTime-startTime).TotalSeconds);
@@ -769,7 +769,7 @@ namespace DiscImageChef.ImagePlugins
Array.Copy(batSector.blockPointer, 0, blockAllocationTable, (i * 512) / 4, blockAllocationTable.Length - (i * 512) / 4); Array.Copy(batSector.blockPointer, 0, blockAllocationTable, (i * 512) / 4, blockAllocationTable.Length - (i * 512) / 4);
} }
if (MainClass.isDebug) //if (MainClass.isDebug)
{ {
DateTime endTime = DateTime.UtcNow; DateTime endTime = DateTime.UtcNow;
Console.WriteLine("DEBUG (VirtualPC plugin): Filling the BAT took {0} seconds", (endTime - startTime).TotalSeconds); Console.WriteLine("DEBUG (VirtualPC plugin): Filling the BAT took {0} seconds", (endTime - startTime).TotalSeconds);
@@ -777,7 +777,7 @@ namespace DiscImageChef.ImagePlugins
// Too noisy // Too noisy
/* /*
if (MainClass.isDebug) //if (MainClass.isDebug)
{ {
for (int i = 0; i < thisDynamic.maxTableEntries; i++) for (int i = 0; i < thisDynamic.maxTableEntries; i++)
Console.WriteLine("DEBUG (VirtualPC plugin): blockAllocationTable[{0}] = {1}", i, blockAllocationTable[i]); Console.WriteLine("DEBUG (VirtualPC plugin): blockAllocationTable[{0}] = {1}", i, blockAllocationTable[i]);
@@ -791,7 +791,7 @@ namespace DiscImageChef.ImagePlugins
/ 8 / 8
// and aligned to 512 byte boundary // and aligned to 512 byte boundary
/ 512)); / 512));
if (MainClass.isDebug) //if (MainClass.isDebug)
Console.WriteLine("DEBUG (VirtualPC plugin): Bitmap is {0} sectors", bitmapSize); Console.WriteLine("DEBUG (VirtualPC plugin): Bitmap is {0} sectors", bitmapSize);
} }
@@ -815,7 +815,7 @@ namespace DiscImageChef.ImagePlugins
imageStream.Seek((long)thisDynamic.locatorEntries[i].platformDataOffset, SeekOrigin.Begin); imageStream.Seek((long)thisDynamic.locatorEntries[i].platformDataOffset, SeekOrigin.Begin);
imageStream.Read(locatorEntriesData[i], 0, (int)thisDynamic.locatorEntries[i].platformDataLength); imageStream.Read(locatorEntriesData[i], 0, (int)thisDynamic.locatorEntries[i].platformDataLength);
if (MainClass.isDebug) //if (MainClass.isDebug)
{ {
switch (thisDynamic.locatorEntries[i].platformCode) switch (thisDynamic.locatorEntries[i].platformCode)
{ {
@@ -861,7 +861,7 @@ namespace DiscImageChef.ImagePlugins
parentPath = parentPath.Remove(0, 16); parentPath = parentPath.Remove(0, 16);
else else
{ {
if (MainClass.isDebug) //if (MainClass.isDebug)
Console.WriteLine("DEBUG (VirtualPC plugin) Unsupported protocol classified found in URI parent path: \"{0}\"", parentPath); Console.WriteLine("DEBUG (VirtualPC plugin) Unsupported protocol classified found in URI parent path: \"{0}\"", parentPath);
parentPath = null; parentPath = null;
} }
@@ -870,7 +870,7 @@ namespace DiscImageChef.ImagePlugins
if (parentPath != null) if (parentPath != null)
{ {
if (MainClass.isDebug) //if (MainClass.isDebug)
Console.WriteLine("DEBUG (VirtualPC plugin) Possible parent path: \"{0}\"", parentPath); Console.WriteLine("DEBUG (VirtualPC plugin) Possible parent path: \"{0}\"", parentPath);
locatorFound |= File.Exists(parentPath); locatorFound |= File.Exists(parentPath);
@@ -885,10 +885,11 @@ namespace DiscImageChef.ImagePlugins
throw new FileNotFoundException("(VirtualPC plugin): Cannot find parent file for differencing disk image"); throw new FileNotFoundException("(VirtualPC plugin): Cannot find parent file for differencing disk image");
else else
{ {
PluginBase plugins = new PluginBase(); parentImage = new VHD();
/* PluginBase plugins = new PluginBase();
plugins.RegisterAllPlugins(); plugins.RegisterAllPlugins();
if (!plugins.ImagePluginsList.TryGetValue(Name.ToLower(), out parentImage)) if (!plugins.ImagePluginsList.TryGetValue(Name.ToLower(), out parentImage))
throw new SystemException("(VirtualPC plugin): Unable to open myself"); throw new SystemException("(VirtualPC plugin): Unable to open myself");*/
if (!parentImage.IdentifyImage(parentPath)) if (!parentImage.IdentifyImage(parentPath))
throw new ImageNotSupportedException("(VirtualPC plugin): Parent image is not a Virtual PC disk image"); throw new ImageNotSupportedException("(VirtualPC plugin): Parent image is not a Virtual PC disk image");
@@ -1025,7 +1026,7 @@ namespace DiscImageChef.ImagePlugins
bool dirty = false || (bitmap[bitmapByte] & mask) == mask; bool dirty = false || (bitmap[bitmapByte] & mask) == mask;
/* /*
if (MainClass.isDebug) //if (MainClass.isDebug)
{ {
Console.WriteLine("DEBUG (VirtualPC plugin): bitmapSize = {0}", bitmapSize); Console.WriteLine("DEBUG (VirtualPC plugin): bitmapSize = {0}", bitmapSize);
Console.WriteLine("DEBUG (VirtualPC plugin): blockNumber = {0}", blockNumber); Console.WriteLine("DEBUG (VirtualPC plugin): blockNumber = {0}", blockNumber);
@@ -1044,7 +1045,7 @@ namespace DiscImageChef.ImagePlugins
if (dirty) if (dirty)
{ {
/* Too noisy /* Too noisy
if (MainClass.isDebug) //if (MainClass.isDebug)
Console.WriteLine("DEBUG (VirtualPC plugin): Sector {0} is dirty", sectorAddress); Console.WriteLine("DEBUG (VirtualPC plugin): Sector {0} is dirty", sectorAddress);
*/ */
@@ -1061,7 +1062,7 @@ namespace DiscImageChef.ImagePlugins
} }
/* Too noisy /* Too noisy
if (MainClass.isDebug) //if (MainClass.isDebug)
Console.WriteLine("DEBUG (VirtualPC plugin): Sector {0} is clean", sectorAddress); Console.WriteLine("DEBUG (VirtualPC plugin): Sector {0} is clean", sectorAddress);
*/ */
@@ -1300,7 +1301,7 @@ namespace DiscImageChef.ImagePlugins
return null; return null;
} }
public override List<DiscImageChef.PartPlugins.Partition> GetPartitions() public override List<CommonTypes.Partition> GetPartitions()
{ {
throw new FeatureUnsupportedImageException("Feature not supported by image format"); throw new FeatureUnsupportedImageException("Feature not supported by image format");
} }

View File

@@ -52,7 +52,7 @@ namespace DiscImageChef.ImagePlugins
#endregion #endregion
public ZZZRawImage(PluginBase Core) public ZZZRawImage()
{ {
Name = "Raw Disk Image"; Name = "Raw Disk Image";
// Non-random UUID to recognize this specific plugin // Non-random UUID to recognize this specific plugin
@@ -623,7 +623,7 @@ namespace DiscImageChef.ImagePlugins
return ImageInfo.driveSerialNumber; return ImageInfo.driveSerialNumber;
} }
public override List<PartPlugins.Partition> GetPartitions() public override List<CommonTypes.Partition> GetPartitions()
{ {
throw new FeatureUnsupportedImageException("Feature not supported by image format"); throw new FeatureUnsupportedImageException("Feature not supported by image format");
} }

View File

@@ -11,6 +11,10 @@ Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "DiscImageChef.Checksums", "
EndProject EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "DiscImageChef.Helpers", "DiscImageChef.Helpers\DiscImageChef.Helpers.csproj", "{F8BDF57B-1571-4CD0-84B3-B422088D359A}" Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "DiscImageChef.Helpers", "DiscImageChef.Helpers\DiscImageChef.Helpers.csproj", "{F8BDF57B-1571-4CD0-84B3-B422088D359A}"
EndProject EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "DiscImageChef.DiscImages", "DiscImageChef.DiscImages\DiscImageChef.DiscImages.csproj", "{74032CBC-339B-42F3-AF6F-E96C261F3E6A}"
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "DiscImageChef.CommonTypes", "DiscImageChef.CommonTypes\DiscImageChef.CommonTypes.csproj", "{F2B84194-26EB-4227-B1C5-6602517E85AE}"
EndProject
Global Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution GlobalSection(SolutionConfigurationPlatforms) = preSolution
Debug|x86 = Debug|x86 Debug|x86 = Debug|x86
@@ -21,6 +25,10 @@ Global
{5DEA2811-2FFA-4959-830B-CAD3ACACABEB}.Debug|x86.Build.0 = 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 {5DEA2811-2FFA-4959-830B-CAD3ACACABEB}.Release|x86.ActiveCfg = Release|Any CPU
{5DEA2811-2FFA-4959-830B-CAD3ACACABEB}.Release|x86.Build.0 = Release|Any CPU {5DEA2811-2FFA-4959-830B-CAD3ACACABEB}.Release|x86.Build.0 = Release|Any CPU
{74032CBC-339B-42F3-AF6F-E96C261F3E6A}.Debug|x86.ActiveCfg = Debug|Any CPU
{74032CBC-339B-42F3-AF6F-E96C261F3E6A}.Debug|x86.Build.0 = Debug|Any CPU
{74032CBC-339B-42F3-AF6F-E96C261F3E6A}.Release|x86.ActiveCfg = Release|Any CPU
{74032CBC-339B-42F3-AF6F-E96C261F3E6A}.Release|x86.Build.0 = Release|Any CPU
{7A4B05BE-73C9-4F34-87FE-E80CCF1F732D}.Debug|x86.ActiveCfg = Debug|x86 {7A4B05BE-73C9-4F34-87FE-E80CCF1F732D}.Debug|x86.ActiveCfg = Debug|x86
{7A4B05BE-73C9-4F34-87FE-E80CCF1F732D}.Debug|x86.Build.0 = Debug|x86 {7A4B05BE-73C9-4F34-87FE-E80CCF1F732D}.Debug|x86.Build.0 = Debug|x86
{7A4B05BE-73C9-4F34-87FE-E80CCF1F732D}.Release|x86.ActiveCfg = Release|x86 {7A4B05BE-73C9-4F34-87FE-E80CCF1F732D}.Release|x86.ActiveCfg = Release|x86
@@ -31,6 +39,10 @@ Global
{CC48B324-A532-4A45-87A6-6F91F7141E8D}.Debug|x86.Build.0 = Debug|Any CPU {CC48B324-A532-4A45-87A6-6F91F7141E8D}.Debug|x86.Build.0 = Debug|Any CPU
{CC48B324-A532-4A45-87A6-6F91F7141E8D}.Release|x86.ActiveCfg = Release|Any CPU {CC48B324-A532-4A45-87A6-6F91F7141E8D}.Release|x86.ActiveCfg = Release|Any CPU
{CC48B324-A532-4A45-87A6-6F91F7141E8D}.Release|x86.Build.0 = Release|Any CPU {CC48B324-A532-4A45-87A6-6F91F7141E8D}.Release|x86.Build.0 = Release|Any CPU
{F2B84194-26EB-4227-B1C5-6602517E85AE}.Debug|x86.ActiveCfg = Debug|Any CPU
{F2B84194-26EB-4227-B1C5-6602517E85AE}.Debug|x86.Build.0 = Debug|Any CPU
{F2B84194-26EB-4227-B1C5-6602517E85AE}.Release|x86.ActiveCfg = Release|Any CPU
{F2B84194-26EB-4227-B1C5-6602517E85AE}.Release|x86.Build.0 = Release|Any CPU
{F8BDF57B-1571-4CD0-84B3-B422088D359A}.Debug|x86.ActiveCfg = Debug|Any CPU {F8BDF57B-1571-4CD0-84B3-B422088D359A}.Debug|x86.ActiveCfg = Debug|Any CPU
{F8BDF57B-1571-4CD0-84B3-B422088D359A}.Debug|x86.Build.0 = Debug|Any CPU {F8BDF57B-1571-4CD0-84B3-B422088D359A}.Debug|x86.Build.0 = Debug|Any CPU
{F8BDF57B-1571-4CD0-84B3-B422088D359A}.Release|x86.ActiveCfg = Release|Any CPU {F8BDF57B-1571-4CD0-84B3-B422088D359A}.Release|x86.ActiveCfg = Release|Any CPU

View File

@@ -1,3 +1,27 @@
2015-10-05 Natalia Portillo <claunia@claunia.com>
* Plugins.cs:
* PartPlugins/RDB.cs:
* PartPlugins/MBR.cs:
* ImagePlugins/VHD.cs:
* PartPlugins/NeXT.cs:
* Commands/Analyze.cs:
* ImagePlugins/Nero.cs:
* DiscImageChef.csproj:
* DetectImageFormat.cs:
* PartPlugins/Atari.cs:
* ImagePlugins/CDRWin.cs:
* PartPlugins/AppleMap.cs:
* ImagePlugins/Apple2MG.cs:
* ImagePlugins/TeleDisk.cs:
* PartPlugins/PartPlugin.cs:
* ImagePlugins/ImageInfo.cs:
* ImagePlugins/DiskCopy42.cs:
* ImagePlugins/ImagePlugin.cs:
* ImagePlugins/ZZZRawImage.cs:
* ImagePlugins/DetectImageFormat.cs:
Moved disc image plugins to a separate library.
2015-10-05 Natalia Portillo <claunia@claunia.com> 2015-10-05 Natalia Portillo <claunia@claunia.com>
* Swapping.cs: * Swapping.cs:

View File

@@ -114,13 +114,13 @@ namespace DiscImageChef.Commands
if (options.SearchForPartitions) if (options.SearchForPartitions)
{ {
List<Partition> partitions = new List<Partition>(); List<CommonTypes.Partition> partitions = new List<CommonTypes.Partition>();
string partition_scheme = ""; string partition_scheme = "";
// TODO: Solve possibility of multiple partition schemes (CUE + MBR, MBR + RDB, CUE + APM, etc) // TODO: Solve possibility of multiple partition schemes (CUE + MBR, MBR + RDB, CUE + APM, etc)
foreach (PartPlugin _partplugin in plugins.PartPluginsList.Values) foreach (PartPlugin _partplugin in plugins.PartPluginsList.Values)
{ {
List<Partition> _partitions; List<CommonTypes.Partition> _partitions;
if (_partplugin.GetInformation(_imageFormat, out _partitions)) if (_partplugin.GetInformation(_imageFormat, out _partitions))
{ {

View File

@@ -64,12 +64,7 @@
<Compile Include="Plugins\SolarFS.cs" /> <Compile Include="Plugins\SolarFS.cs" />
<Compile Include="Plugins\UNIXBFS.cs" /> <Compile Include="Plugins\UNIXBFS.cs" />
<Compile Include="Plugins\SysV.cs" /> <Compile Include="Plugins\SysV.cs" />
<Compile Include="ImagePlugins\ImagePlugin.cs" />
<Compile Include="ImagePlugins\CDRWin.cs" />
<Compile Include="ImagePlugins\DiskCopy42.cs" />
<Compile Include="Plugins\LisaFS.cs" /> <Compile Include="Plugins\LisaFS.cs" />
<Compile Include="ImagePlugins\TeleDisk.cs" />
<Compile Include="ImagePlugins\ZZZRawImage.cs" />
<Compile Include="Options.cs" /> <Compile Include="Options.cs" />
<Compile Include="Commands\Formats.cs" /> <Compile Include="Commands\Formats.cs" />
<Compile Include="Commands\Analyze.cs" /> <Compile Include="Commands\Analyze.cs" />
@@ -77,9 +72,6 @@
<Compile Include="Commands\Checksum.cs" /> <Compile Include="Commands\Checksum.cs" />
<Compile Include="Commands\Verify.cs" /> <Compile Include="Commands\Verify.cs" />
<Compile Include="Commands\Commands.cs" /> <Compile Include="Commands\Commands.cs" />
<Compile Include="ImagePlugins\DetectImageFormat.cs" />
<Compile Include="ImagePlugins\ImageInfo.cs" />
<Compile Include="ImagePlugins\Nero.cs" />
<Compile Include="Commands\PrintHex.cs" /> <Compile Include="Commands\PrintHex.cs" />
<Compile Include="Commands\Decode.cs" /> <Compile Include="Commands\Decode.cs" />
<Compile Include="Decoders\SCSI.cs" /> <Compile Include="Decoders\SCSI.cs" />
@@ -88,13 +80,12 @@
<Compile Include="Decoders\BD.cs" /> <Compile Include="Decoders\BD.cs" />
<Compile Include="Decoders\DVD.cs" /> <Compile Include="Decoders\DVD.cs" />
<Compile Include="Plugins\ProDOS.cs" /> <Compile Include="Plugins\ProDOS.cs" />
<Compile Include="ImagePlugins\Apple2MG.cs" />
<Compile Include="PartPlugins\RDB.cs" /> <Compile Include="PartPlugins\RDB.cs" />
<Compile Include="Plugins\AmigaDOS.cs" /> <Compile Include="Plugins\AmigaDOS.cs" />
<Compile Include="PartPlugins\Atari.cs" /> <Compile Include="PartPlugins\Atari.cs" />
<Compile Include="ImagePlugins\VHD.cs" />
<Compile Include="Commands\Entropy.cs" /> <Compile Include="Commands\Entropy.cs" />
<Compile Include="Decoders\Floppy.cs" /> <Compile Include="Decoders\Floppy.cs" />
<Compile Include="DetectImageFormat.cs" />
</ItemGroup> </ItemGroup>
<Import Project="$(MSBuildBinPath)\Microsoft.CSharp.targets" /> <Import Project="$(MSBuildBinPath)\Microsoft.CSharp.targets" />
<ItemGroup> <ItemGroup>
@@ -200,5 +191,13 @@
<Project>{F8BDF57B-1571-4CD0-84B3-B422088D359A}</Project> <Project>{F8BDF57B-1571-4CD0-84B3-B422088D359A}</Project>
<Name>DiscImageChef.Helpers</Name> <Name>DiscImageChef.Helpers</Name>
</ProjectReference> </ProjectReference>
<ProjectReference Include="..\DiscImageChef.DiscImages\DiscImageChef.DiscImages.csproj">
<Project>{74032CBC-339B-42F3-AF6F-E96C261F3E6A}</Project>
<Name>DiscImageChef.DiscImages</Name>
</ProjectReference>
<ProjectReference Include="..\DiscImageChef.CommonTypes\DiscImageChef.CommonTypes.csproj">
<Project>{F2B84194-26EB-4227-B1C5-6602517E85AE}</Project>
<Name>DiscImageChef.CommonTypes</Name>
</ProjectReference>
</ItemGroup> </ItemGroup>
</Project> </Project>

View File

@@ -60,7 +60,7 @@ namespace DiscImageChef.PartPlugins
PluginUUID = new Guid("36405F8D-4F1A-07F5-209C-223D735D6D22"); PluginUUID = new Guid("36405F8D-4F1A-07F5-209C-223D735D6D22");
} }
public override bool GetInformation(ImagePlugins.ImagePlugin imagePlugin, out List<Partition> partitions) public override bool GetInformation(ImagePlugins.ImagePlugin imagePlugin, out List<CommonTypes.Partition> partitions)
{ {
ulong apm_entries; ulong apm_entries;
uint sector_size; uint sector_size;
@@ -70,7 +70,7 @@ namespace DiscImageChef.PartPlugins
else else
sector_size = imagePlugin.GetSectorSize(); sector_size = imagePlugin.GetSectorSize();
partitions = new List<Partition>(); partitions = new List<CommonTypes.Partition>();
AppleMapBootEntry APMB = new AppleMapBootEntry(); AppleMapBootEntry APMB = new AppleMapBootEntry();
AppleMapPartitionEntry APMEntry; AppleMapPartitionEntry APMEntry;
@@ -143,7 +143,7 @@ namespace DiscImageChef.PartPlugins
if (APMEntry.signature == APM_ENTRY || APMEntry.signature == APM_OLDENT) // It should have partition entry signature if (APMEntry.signature == APM_ENTRY || APMEntry.signature == APM_OLDENT) // It should have partition entry signature
{ {
Partition _partition = new Partition(); CommonTypes.Partition _partition = new CommonTypes.Partition();
StringBuilder sb = new StringBuilder(); StringBuilder sb = new StringBuilder();
_partition.PartitionSequence = i; _partition.PartitionSequence = i;

View File

@@ -61,9 +61,9 @@ namespace DiscImageChef.PartPlugins
PluginUUID = new Guid("d1dd0f24-ec39-4c4d-9072-be31919a3b5e"); PluginUUID = new Guid("d1dd0f24-ec39-4c4d-9072-be31919a3b5e");
} }
public override bool GetInformation(ImagePlugins.ImagePlugin imagePlugin, out List<Partition> partitions) public override bool GetInformation(ImagePlugins.ImagePlugin imagePlugin, out List<CommonTypes.Partition> partitions)
{ {
partitions = new List<Partition>(); partitions = new List<CommonTypes.Partition>();
if (imagePlugin.GetSectorSize() < 512) if (imagePlugin.GetSectorSize() < 512)
return false; return false;
@@ -155,7 +155,7 @@ namespace DiscImageChef.PartPlugins
if (sectorSize == 2448 || sectorSize == 2352) if (sectorSize == 2448 || sectorSize == 2352)
sectorSize = 2048; sectorSize = 2048;
Partition part = new Partition(); CommonTypes.Partition part = new CommonTypes.Partition();
part.PartitionLength = table.entries[i].length * sectorSize; part.PartitionLength = table.entries[i].length * sectorSize;
part.PartitionSectors = table.entries[i].length; part.PartitionSectors = table.entries[i].length;
part.PartitionSequence = partitionSequence; part.PartitionSequence = partitionSequence;
@@ -235,7 +235,7 @@ namespace DiscImageChef.PartPlugins
if (sectorSize == 2448 || sectorSize == 2352) if (sectorSize == 2448 || sectorSize == 2352)
sectorSize = 2048; sectorSize = 2048;
Partition part = new Partition(); CommonTypes.Partition part = new CommonTypes.Partition();
part.PartitionLength = extendedTable.entries[j].length * sectorSize; part.PartitionLength = extendedTable.entries[j].length * sectorSize;
part.PartitionSectors = extendedTable.entries[j].length; part.PartitionSectors = extendedTable.entries[j].length;
part.PartitionSequence = partitionSequence; part.PartitionSequence = partitionSequence;
@@ -306,7 +306,7 @@ namespace DiscImageChef.PartPlugins
if (sectorSize == 2448 || sectorSize == 2352) if (sectorSize == 2448 || sectorSize == 2352)
sectorSize = 2048; sectorSize = 2048;
Partition part = new Partition(); CommonTypes.Partition part = new CommonTypes.Partition();
part.PartitionLength = table.icdEntries[i].length * sectorSize; part.PartitionLength = table.icdEntries[i].length * sectorSize;
part.PartitionSectors = table.icdEntries[i].length; part.PartitionSectors = table.icdEntries[i].length;
part.PartitionSequence = partitionSequence; part.PartitionSequence = partitionSequence;

View File

@@ -53,13 +53,13 @@ namespace DiscImageChef.PartPlugins
PluginUUID = new Guid("5E8A34E8-4F1A-59E6-4BF7-7EA647063A76"); PluginUUID = new Guid("5E8A34E8-4F1A-59E6-4BF7-7EA647063A76");
} }
public override bool GetInformation(ImagePlugins.ImagePlugin imagePlugin, out List<Partition> partitions) public override bool GetInformation(ImagePlugins.ImagePlugin imagePlugin, out List<CommonTypes.Partition> partitions)
{ {
byte cyl_sect1, cyl_sect2; // For decoding cylinder and sector byte cyl_sect1, cyl_sect2; // For decoding cylinder and sector
UInt16 signature; UInt16 signature;
ulong counter = 0; ulong counter = 0;
partitions = new List<Partition>(); partitions = new List<CommonTypes.Partition>();
if (imagePlugin.GetSectorSize() < 512) if (imagePlugin.GetSectorSize() < 512)
return false; return false;
@@ -153,7 +153,7 @@ namespace DiscImageChef.PartPlugins
// TODO: Handle disklabels bigger than 1 sector or search max no_parts // TODO: Handle disklabels bigger than 1 sector or search max no_parts
for (int j = 0; j < no_parts; j++) for (int j = 0; j < no_parts; j++)
{ {
Partition part = new Partition(); CommonTypes.Partition part = new CommonTypes.Partition();
byte bsd_type; byte bsd_type;
part.PartitionSectors = BitConverter.ToUInt32(disklabel_sector, 134 + j * 16 + 4); part.PartitionSectors = BitConverter.ToUInt32(disklabel_sector, 134 + j * 16 + 4);
@@ -254,7 +254,7 @@ namespace DiscImageChef.PartPlugins
if ((vtoc_ent.flags & 0x200) == 0x200 && vtoc_ent.tag != UNIX_TAG_EMPTY && vtoc_ent.tag != UNIX_TAG_WHOLE) if ((vtoc_ent.flags & 0x200) == 0x200 && vtoc_ent.tag != UNIX_TAG_EMPTY && vtoc_ent.tag != UNIX_TAG_WHOLE)
{ {
Partition part = new Partition(); CommonTypes.Partition part = new CommonTypes.Partition();
// TODO: Check if device bps == disklabel bps // TODO: Check if device bps == disklabel bps
part.PartitionStartSector = vtoc_ent.start; part.PartitionStartSector = vtoc_ent.start;
part.PartitionSectors = vtoc_ent.length; part.PartitionSectors = vtoc_ent.length;
@@ -292,7 +292,7 @@ namespace DiscImageChef.PartPlugins
{ {
for (int j = 0; j < 16; j++) for (int j = 0; j < 16; j++)
{ {
Partition part = new Partition(); CommonTypes.Partition part = new CommonTypes.Partition();
part.PartitionStartSector = BitConverter.ToUInt32(disklabel_sector, 68 + j * 12 + 4); part.PartitionStartSector = BitConverter.ToUInt32(disklabel_sector, 68 + j * 12 + 4);
part.PartitionSectors = BitConverter.ToUInt32(disklabel_sector, 68 + j * 12 + 8); part.PartitionSectors = BitConverter.ToUInt32(disklabel_sector, 68 + j * 12 + 8);
part.PartitionStart = part.PartitionStartSector * imagePlugin.GetSectorSize(); // 68+4+j*12 part.PartitionStart = part.PartitionStartSector * imagePlugin.GetSectorSize(); // 68+4+j*12
@@ -323,7 +323,7 @@ namespace DiscImageChef.PartPlugins
if (type == 0x81) if (type == 0x81)
{ {
Partition part = new Partition(); CommonTypes.Partition part = new CommonTypes.Partition();
minix_subs = true; minix_subs = true;
part.PartitionDescription = "Minix subpartition"; part.PartitionDescription = "Minix subpartition";
part.PartitionType = "Minix"; part.PartitionType = "Minix";
@@ -348,7 +348,7 @@ namespace DiscImageChef.PartPlugins
if (valid) if (valid)
{ {
Partition part = new Partition(); CommonTypes.Partition part = new CommonTypes.Partition();
if (entry.lba_start > 0 && entry.lba_sectors > 0) if (entry.lba_start > 0 && entry.lba_sectors > 0)
{ {
part.PartitionStartSector = entry.lba_start; part.PartitionStartSector = entry.lba_start;
@@ -455,7 +455,7 @@ namespace DiscImageChef.PartPlugins
// TODO: Handle disklabels bigger than 1 sector or search max no_parts // TODO: Handle disklabels bigger than 1 sector or search max no_parts
for (int j = 0; j < no_parts; j++) for (int j = 0; j < no_parts; j++)
{ {
Partition part = new Partition(); CommonTypes.Partition part = new CommonTypes.Partition();
byte bsd_type; byte bsd_type;
part.PartitionSectors = BitConverter.ToUInt32(disklabel_sector, 134 + j * 16 + 4); part.PartitionSectors = BitConverter.ToUInt32(disklabel_sector, 134 + j * 16 + 4);
@@ -556,7 +556,7 @@ namespace DiscImageChef.PartPlugins
if ((vtoc_ent.flags & 0x200) == 0x200 && vtoc_ent.tag != UNIX_TAG_EMPTY && vtoc_ent.tag != UNIX_TAG_WHOLE) if ((vtoc_ent.flags & 0x200) == 0x200 && vtoc_ent.tag != UNIX_TAG_EMPTY && vtoc_ent.tag != UNIX_TAG_WHOLE)
{ {
Partition part = new Partition(); CommonTypes.Partition part = new CommonTypes.Partition();
// TODO: Check if device bps == disklabel bps // TODO: Check if device bps == disklabel bps
part.PartitionStartSector = vtoc_ent.start; part.PartitionStartSector = vtoc_ent.start;
part.PartitionSectors = vtoc_ent.length; part.PartitionSectors = vtoc_ent.length;
@@ -594,7 +594,7 @@ namespace DiscImageChef.PartPlugins
{ {
for (int j = 0; j < 16; j++) for (int j = 0; j < 16; j++)
{ {
Partition part = new Partition(); CommonTypes.Partition part = new CommonTypes.Partition();
part.PartitionStartSector = BitConverter.ToUInt32(disklabel_sector, 68 + j * 12 + 4); part.PartitionStartSector = BitConverter.ToUInt32(disklabel_sector, 68 + j * 12 + 4);
part.PartitionSectors = BitConverter.ToUInt32(disklabel_sector, 68 + j * 12 + 8); part.PartitionSectors = BitConverter.ToUInt32(disklabel_sector, 68 + j * 12 + 8);
part.PartitionStart = part.PartitionStartSector * imagePlugin.GetSectorSize(); // 68+4+j*12 part.PartitionStart = part.PartitionStartSector * imagePlugin.GetSectorSize(); // 68+4+j*12
@@ -625,7 +625,7 @@ namespace DiscImageChef.PartPlugins
if (type == 0x81) if (type == 0x81)
{ {
Partition part = new Partition(); CommonTypes.Partition part = new CommonTypes.Partition();
minix_subs = true; minix_subs = true;
part.PartitionDescription = "Minix subpartition"; part.PartitionDescription = "Minix subpartition";
part.PartitionType = "Minix"; part.PartitionType = "Minix";
@@ -651,7 +651,7 @@ namespace DiscImageChef.PartPlugins
if (ext_valid) if (ext_valid)
{ {
Partition part = new Partition(); CommonTypes.Partition part = new CommonTypes.Partition();
if (entry2.lba_start > 0 && entry2.lba_sectors > 0) if (entry2.lba_start > 0 && entry2.lba_sectors > 0)
{ {
part.PartitionStartSector = entry2.lba_start; part.PartitionStartSector = entry2.lba_start;

View File

@@ -62,7 +62,7 @@ namespace DiscImageChef.PartPlugins
PluginUUID = new Guid("246A6D93-4F1A-1F8A-344D-50187A5513A9"); PluginUUID = new Guid("246A6D93-4F1A-1F8A-344D-50187A5513A9");
} }
public override bool GetInformation(ImagePlugins.ImagePlugin imagePlugin, out List<Partition> partitions) public override bool GetInformation(ImagePlugins.ImagePlugin imagePlugin, out List<CommonTypes.Partition> partitions)
{ {
byte[] cString; byte[] cString;
bool magic_found; bool magic_found;
@@ -77,7 +77,7 @@ namespace DiscImageChef.PartPlugins
else else
sector_size = imagePlugin.GetSectorSize(); sector_size = imagePlugin.GetSectorSize();
partitions = new List<Partition>(); partitions = new List<CommonTypes.Partition>();
entry_sector = imagePlugin.ReadSector(0); // Starts on sector 0 on NeXT machines, CDs and floppies entry_sector = imagePlugin.ReadSector(0); // Starts on sector 0 on NeXT machines, CDs and floppies
magic = BigEndianBitConverter.ToUInt32(entry_sector, 0x00); magic = BigEndianBitConverter.ToUInt32(entry_sector, 0x00);
@@ -133,7 +133,7 @@ namespace DiscImageChef.PartPlugins
if (entry.sectors > 0 && entry.sectors < 0xFFFFFFFF && entry.start < 0xFFFFFFFF) if (entry.sectors > 0 && entry.sectors < 0xFFFFFFFF && entry.start < 0xFFFFFFFF)
{ {
Partition part = new Partition(); CommonTypes.Partition part = new CommonTypes.Partition();
StringBuilder sb = new StringBuilder(); StringBuilder sb = new StringBuilder();
part.PartitionLength = (ulong)entry.sectors * sector_size; part.PartitionLength = (ulong)entry.sectors * sector_size;

View File

@@ -61,29 +61,6 @@ namespace DiscImageChef.PartPlugins
/// <returns><c>true</c>, if partitioning scheme is recognized, <c>false</c> otherwise.</returns> /// <returns><c>true</c>, if partitioning scheme is recognized, <c>false</c> otherwise.</returns>
/// <param name="imagePlugin">Disk image.</param> /// <param name="imagePlugin">Disk image.</param>
/// <param name="partitions">Returns list of partitions.</param> /// <param name="partitions">Returns list of partitions.</param>
public abstract bool GetInformation(ImagePlugins.ImagePlugin imagePlugin, out List<Partition> partitions); public abstract bool GetInformation(ImagePlugins.ImagePlugin imagePlugin, out List<CommonTypes.Partition> partitions);
}
/// <summary>
/// Partition structure.
/// </summary>
public struct Partition
{
/// <summary>Partition number, 0-started</summary>
public ulong PartitionSequence;
/// <summary>Partition type</summary>
public string PartitionType;
/// <summary>Partition name (if the scheme supports it)</summary>
public string PartitionName;
/// <summary>Start of the partition, in bytes</summary>
public ulong PartitionStart;
/// <summary>LBA of partition start</summary>
public ulong PartitionStartSector;
/// <summary>Length in bytes of the partition</summary>
public ulong PartitionLength;
/// <summary>Length in sectors of the partition</summary>
public ulong PartitionSectors;
/// <summary>Information that does not find space in this struct</summary>
public string PartitionDescription;
} }
} }

View File

@@ -889,9 +889,9 @@ namespace DiscImageChef.PartPlugins
public byte[] loadData; public byte[] loadData;
} }
public override bool GetInformation(ImagePlugins.ImagePlugin imagePlugin, out List<Partition> partitions) public override bool GetInformation(ImagePlugins.ImagePlugin imagePlugin, out List<CommonTypes.Partition> partitions)
{ {
partitions = new List<Partition>(); partitions = new List<CommonTypes.Partition>();
BigEndianBitConverter.IsLittleEndian = BitConverter.IsLittleEndian; BigEndianBitConverter.IsLittleEndian = BitConverter.IsLittleEndian;
ulong RDBBlock = 0; ulong RDBBlock = 0;
bool foundRDB = false; bool foundRDB = false;
@@ -1363,7 +1363,7 @@ namespace DiscImageChef.PartPlugins
ulong sequence = 0; ulong sequence = 0;
foreach (PartitionEntry RDBEntry in PartitionEntries) foreach (PartitionEntry RDBEntry in PartitionEntries)
{ {
Partition entry = new Partition(); CommonTypes.Partition entry = new CommonTypes.Partition();
entry.PartitionDescription = AmigaDOSTypeToDescriptionString(RDBEntry.dosEnvVec.dosType); entry.PartitionDescription = AmigaDOSTypeToDescriptionString(RDBEntry.dosEnvVec.dosType);
entry.PartitionName = RDBEntry.driveName; entry.PartitionName = RDBEntry.driveName;

View File

@@ -60,7 +60,7 @@ namespace DiscImageChef
public void RegisterAllPlugins() public void RegisterAllPlugins()
{ {
Assembly assembly = Assembly.GetExecutingAssembly(); Assembly assembly = Assembly.GetAssembly(typeof(ImagePlugin));
foreach (Type type in assembly.GetTypes()) foreach (Type type in assembly.GetTypes())
{ {
@@ -68,9 +68,22 @@ namespace DiscImageChef
{ {
if (type.IsSubclassOf(typeof(ImagePlugin))) if (type.IsSubclassOf(typeof(ImagePlugin)))
{ {
ImagePlugin plugin = (ImagePlugin)type.GetConstructor(new [] { typeof(PluginBase) }).Invoke(new object[] { this }); ImagePlugin plugin = (ImagePlugin)type.GetConstructor(Type.EmptyTypes).Invoke(new object[] { });
RegisterImagePlugin(plugin); RegisterImagePlugin(plugin);
} }
}
catch (Exception exception)
{
Console.WriteLine(exception);
}
}
assembly = Assembly.GetExecutingAssembly();
foreach (Type type in assembly.GetTypes())
{
try
{
if (type.IsSubclassOf(typeof(Plugin))) if (type.IsSubclassOf(typeof(Plugin)))
{ {
Plugin plugin = (Plugin)type.GetConstructor(new [] { typeof(PluginBase) }).Invoke(new object[] { this }); Plugin plugin = (Plugin)type.GetConstructor(new [] { typeof(PluginBase) }).Invoke(new object[] { this });