diff --git a/.idea/.idea.DiscImageChef/.idea/contentModel.xml b/.idea/.idea.DiscImageChef/.idea/contentModel.xml
index 34a1ebf7..bb726e68 100644
--- a/.idea/.idea.DiscImageChef/.idea/contentModel.xml
+++ b/.idea/.idea.DiscImageChef/.idea/contentModel.xml
@@ -413,11 +413,12 @@
+
+
-
-
+
@@ -435,6 +436,7 @@
+
@@ -500,10 +502,10 @@
-
+
@@ -609,10 +611,10 @@
-
+
@@ -690,10 +692,10 @@
+
-
diff --git a/DiscImageChef.Core/Devices/Dumping/ATA.cs b/DiscImageChef.Core/Devices/Dumping/ATA.cs
index 2672f917..2dae0eed 100644
--- a/DiscImageChef.Core/Devices/Dumping/ATA.cs
+++ b/DiscImageChef.Core/Devices/Dumping/ATA.cs
@@ -469,10 +469,10 @@ namespace DiscImageChef.Core.Devices.Dumping
(double)blockSize * (double)(blocks + 1) / 1024 / (totalChkDuration / 1000));
PluginBase plugins = new PluginBase();
- plugins.RegisterAllPlugins(encoding);
+ plugins.RegisterAllPlugins();
FiltersList filtersList = new FiltersList();
- Filter inputFilter = filtersList.GetFilter(outputPrefix + ".bin");
+ IFilter inputFilter = filtersList.GetFilter(outputPrefix + ".bin");
if(inputFilter == null)
{
@@ -480,7 +480,7 @@ namespace DiscImageChef.Core.Devices.Dumping
return;
}
- ImagePlugin imageFormat = ImageFormat.Detect(inputFilter);
+ IMediaImage imageFormat = ImageFormat.Detect(inputFilter);
PartitionType[] xmlFileSysInfo = null;
try { if(!imageFormat.OpenImage(inputFilter)) imageFormat = null; }
@@ -513,15 +513,15 @@ namespace DiscImageChef.Core.Devices.Dumping
i, partitions[i].Start, partitions[i].End, partitions[i].Type,
partitions[i].Scheme);
- foreach(Filesystem plugin in plugins.PluginsList.Values)
+ foreach(IFilesystem plugin in plugins.PluginsList.Values)
try
{
if(!plugin.Identify(imageFormat, partitions[i])) continue;
- plugin.GetInformation(imageFormat, partitions[i], out _);
- lstFs.Add(plugin.XmlFSType);
- Statistics.AddFilesystem(plugin.XmlFSType.Type);
- dumpLog.WriteLine("Filesystem {0} found.", plugin.XmlFSType.Type);
+ plugin.GetInformation(imageFormat, partitions[i], out _, encoding);
+ lstFs.Add(plugin.XmlFsType);
+ Statistics.AddFilesystem(plugin.XmlFsType.Type);
+ dumpLog.WriteLine("Filesystem {0} found.", plugin.XmlFsType.Type);
}
#pragma warning disable RECS0022 // A catch clause that catches System.Exception and has an empty body
catch
@@ -548,15 +548,15 @@ namespace DiscImageChef.Core.Devices.Dumping
Size = blocks * blockSize
};
- foreach(Filesystem plugin in plugins.PluginsList.Values)
+ foreach(IFilesystem plugin in plugins.PluginsList.Values)
try
{
if(!plugin.Identify(imageFormat, wholePart)) continue;
- plugin.GetInformation(imageFormat, wholePart, out _);
- lstFs.Add(plugin.XmlFSType);
- Statistics.AddFilesystem(plugin.XmlFSType.Type);
- dumpLog.WriteLine("Filesystem {0} found.", plugin.XmlFSType.Type);
+ plugin.GetInformation(imageFormat, wholePart, out _, encoding);
+ lstFs.Add(plugin.XmlFsType);
+ Statistics.AddFilesystem(plugin.XmlFsType.Type);
+ dumpLog.WriteLine("Filesystem {0} found.", plugin.XmlFsType.Type);
}
#pragma warning disable RECS0022 // A catch clause that catches System.Exception and has an empty body
catch
diff --git a/DiscImageChef.Core/Devices/Dumping/SBC.cs b/DiscImageChef.Core/Devices/Dumping/SBC.cs
index 903a295e..8229560f 100644
--- a/DiscImageChef.Core/Devices/Dumping/SBC.cs
+++ b/DiscImageChef.Core/Devices/Dumping/SBC.cs
@@ -594,9 +594,9 @@ namespace DiscImageChef.Core.Devices.Dumping
(double)blockSize * (double)(blocks + 1) / 1024 / (totalChkDuration / 1000));
PluginBase plugins = new PluginBase();
- plugins.RegisterAllPlugins(encoding);
+ plugins.RegisterAllPlugins();
FiltersList filtersList = new FiltersList();
- Filter inputFilter = filtersList.GetFilter(outputPrefix + outputExtension);
+ IFilter inputFilter = filtersList.GetFilter(outputPrefix + outputExtension);
if(inputFilter == null)
{
@@ -604,7 +604,7 @@ namespace DiscImageChef.Core.Devices.Dumping
return;
}
- ImagePlugin imageFormat = ImageFormat.Detect(inputFilter);
+ IMediaImage imageFormat = ImageFormat.Detect(inputFilter);
PartitionType[] xmlFileSysInfo = null;
try { if(!imageFormat.OpenImage(inputFilter)) imageFormat = null; }
@@ -636,17 +636,17 @@ namespace DiscImageChef.Core.Devices.Dumping
i, partitions[i].Start, partitions[i].End, partitions[i].Type,
partitions[i].Scheme);
- foreach(Filesystem plugin in plugins.PluginsList.Values)
+ foreach(IFilesystem plugin in plugins.PluginsList.Values)
try
{
if(!plugin.Identify(imageFormat, partitions[i])) continue;
- plugin.GetInformation(imageFormat, partitions[i], out _);
- lstFs.Add(plugin.XmlFSType);
- Statistics.AddFilesystem(plugin.XmlFSType.Type);
- dumpLog.WriteLine("Filesystem {0} found.", plugin.XmlFSType.Type);
+ plugin.GetInformation(imageFormat, partitions[i], out _, encoding);
+ lstFs.Add(plugin.XmlFsType);
+ Statistics.AddFilesystem(plugin.XmlFsType.Type);
+ dumpLog.WriteLine("Filesystem {0} found.", plugin.XmlFsType.Type);
- switch(plugin.XmlFSType.Type)
+ switch(plugin.XmlFsType.Type)
{
case "Opera":
dskType = MediaType.ThreeDO;
@@ -682,17 +682,17 @@ namespace DiscImageChef.Core.Devices.Dumping
Partition wholePart =
new Partition {Name = "Whole device", Length = blocks, Size = blocks * blockSize};
- foreach(Filesystem plugin in plugins.PluginsList.Values)
+ foreach(IFilesystem plugin in plugins.PluginsList.Values)
try
{
if(!plugin.Identify(imageFormat, wholePart)) continue;
- plugin.GetInformation(imageFormat, wholePart, out _);
- lstFs.Add(plugin.XmlFSType);
- Statistics.AddFilesystem(plugin.XmlFSType.Type);
- dumpLog.WriteLine("Filesystem {0} found.", plugin.XmlFSType.Type);
+ plugin.GetInformation(imageFormat, wholePart, out _, encoding);
+ lstFs.Add(plugin.XmlFsType);
+ Statistics.AddFilesystem(plugin.XmlFsType.Type);
+ dumpLog.WriteLine("Filesystem {0} found.", plugin.XmlFsType.Type);
- switch(plugin.XmlFSType.Type)
+ switch(plugin.XmlFsType.Type)
{
case "Opera":
dskType = MediaType.ThreeDO;
diff --git a/DiscImageChef.Core/Devices/Dumping/SecureDigital.cs b/DiscImageChef.Core/Devices/Dumping/SecureDigital.cs
index 1f29fcc1..09a34d20 100644
--- a/DiscImageChef.Core/Devices/Dumping/SecureDigital.cs
+++ b/DiscImageChef.Core/Devices/Dumping/SecureDigital.cs
@@ -451,10 +451,10 @@ namespace DiscImageChef.Core.Devices.Dumping
(double)blockSize * (double)(blocks + 1) / 1024 / (totalChkDuration / 1000));
PluginBase plugins = new PluginBase();
- plugins.RegisterAllPlugins(encoding);
+ plugins.RegisterAllPlugins();
FiltersList filtersList = new FiltersList();
- Filter inputFilter = filtersList.GetFilter(outputPrefix + ".bin");
+ IFilter inputFilter = filtersList.GetFilter(outputPrefix + ".bin");
if(inputFilter == null)
{
@@ -462,7 +462,7 @@ namespace DiscImageChef.Core.Devices.Dumping
return;
}
- ImagePlugin imageFormat = ImageFormat.Detect(inputFilter);
+ IMediaImage imageFormat = ImageFormat.Detect(inputFilter);
PartitionType[] xmlFileSysInfo = null;
try { if(!imageFormat.OpenImage(inputFilter)) imageFormat = null; }
@@ -494,15 +494,15 @@ namespace DiscImageChef.Core.Devices.Dumping
i, partitions[i].Start, partitions[i].End, partitions[i].Type,
partitions[i].Scheme);
- foreach(Filesystem plugin in plugins.PluginsList.Values)
+ foreach(IFilesystem plugin in plugins.PluginsList.Values)
try
{
if(!plugin.Identify(imageFormat, partitions[i])) continue;
- plugin.GetInformation(imageFormat, partitions[i], out _);
- lstFs.Add(plugin.XmlFSType);
- Statistics.AddFilesystem(plugin.XmlFSType.Type);
- dumpLog.WriteLine("Filesystem {0} found.", plugin.XmlFSType.Type);
+ plugin.GetInformation(imageFormat, partitions[i], out _, encoding);
+ lstFs.Add(plugin.XmlFsType);
+ Statistics.AddFilesystem(plugin.XmlFsType.Type);
+ dumpLog.WriteLine("Filesystem {0} found.", plugin.XmlFsType.Type);
}
#pragma warning disable RECS0022 // A catch clause that catches System.Exception and has an empty body
catch
@@ -525,15 +525,15 @@ namespace DiscImageChef.Core.Devices.Dumping
Partition wholePart =
new Partition {Name = "Whole device", Length = blocks, Size = blocks * blockSize};
- foreach(Filesystem plugin in plugins.PluginsList.Values)
+ foreach(IFilesystem plugin in plugins.PluginsList.Values)
try
{
if(!plugin.Identify(imageFormat, wholePart)) continue;
- plugin.GetInformation(imageFormat, wholePart, out _);
- lstFs.Add(plugin.XmlFSType);
- Statistics.AddFilesystem(plugin.XmlFSType.Type);
- dumpLog.WriteLine("Filesystem {0} found.", plugin.XmlFSType.Type);
+ plugin.GetInformation(imageFormat, wholePart, out _, encoding);
+ lstFs.Add(plugin.XmlFsType);
+ Statistics.AddFilesystem(plugin.XmlFsType.Type);
+ dumpLog.WriteLine("Filesystem {0} found.", plugin.XmlFsType.Type);
}
#pragma warning disable RECS0022 // A catch clause that catches System.Exception and has an empty body
catch
diff --git a/DiscImageChef.Core/Devices/Dumping/XGD.cs b/DiscImageChef.Core/Devices/Dumping/XGD.cs
index 3ccc18f5..76abd234 100644
--- a/DiscImageChef.Core/Devices/Dumping/XGD.cs
+++ b/DiscImageChef.Core/Devices/Dumping/XGD.cs
@@ -794,9 +794,9 @@ namespace DiscImageChef.Core.Devices.Dumping
(double)BLOCK_SIZE * (double)(blocks + 1) / 1024 / (totalChkDuration / 1000));
PluginBase plugins = new PluginBase();
- plugins.RegisterAllPlugins(encoding);
+ plugins.RegisterAllPlugins();
FiltersList filtersList = new FiltersList();
- Filter inputFilter = filtersList.GetFilter(outputPrefix + ".iso");
+ IFilter inputFilter = filtersList.GetFilter(outputPrefix + ".iso");
if(inputFilter == null)
{
@@ -804,7 +804,7 @@ namespace DiscImageChef.Core.Devices.Dumping
return;
}
- ImagePlugin imageFormat = ImageFormat.Detect(inputFilter);
+ IMediaImage imageFormat = ImageFormat.Detect(inputFilter);
PartitionType[] xmlFileSysInfo = null;
try { if(!imageFormat.OpenImage(inputFilter)) imageFormat = null; }
@@ -836,17 +836,17 @@ namespace DiscImageChef.Core.Devices.Dumping
i, partitions[i].Start, partitions[i].End, partitions[i].Type,
partitions[i].Scheme);
- foreach(Filesystem plugin in plugins.PluginsList.Values)
+ foreach(IFilesystem plugin in plugins.PluginsList.Values)
try
{
if(!plugin.Identify(imageFormat, partitions[i])) continue;
- plugin.GetInformation(imageFormat, partitions[i], out _);
- lstFs.Add(plugin.XmlFSType);
- Statistics.AddFilesystem(plugin.XmlFSType.Type);
- dumpLog.WriteLine("Filesystem {0} found.", plugin.XmlFSType.Type);
+ plugin.GetInformation(imageFormat, partitions[i], out _, encoding);
+ lstFs.Add(plugin.XmlFsType);
+ Statistics.AddFilesystem(plugin.XmlFsType.Type);
+ dumpLog.WriteLine("Filesystem {0} found.", plugin.XmlFsType.Type);
- switch(plugin.XmlFSType.Type)
+ switch(plugin.XmlFsType.Type)
{
case "Opera":
dskType = MediaType.ThreeDO;
@@ -882,17 +882,17 @@ namespace DiscImageChef.Core.Devices.Dumping
Partition wholePart =
new Partition {Name = "Whole device", Length = blocks, Size = blocks * BLOCK_SIZE};
- foreach(Filesystem plugin in plugins.PluginsList.Values)
+ foreach(IFilesystem plugin in plugins.PluginsList.Values)
try
{
if(!plugin.Identify(imageFormat, wholePart)) continue;
- plugin.GetInformation(imageFormat, wholePart, out _);
- lstFs.Add(plugin.XmlFSType);
- Statistics.AddFilesystem(plugin.XmlFSType.Type);
- dumpLog.WriteLine("Filesystem {0} found.", plugin.XmlFSType.Type);
+ plugin.GetInformation(imageFormat, wholePart, out _, encoding);
+ lstFs.Add(plugin.XmlFsType);
+ Statistics.AddFilesystem(plugin.XmlFsType.Type);
+ dumpLog.WriteLine("Filesystem {0} found.", plugin.XmlFsType.Type);
- switch(plugin.XmlFSType.Type)
+ switch(plugin.XmlFsType.Type)
{
case "Opera":
dskType = MediaType.ThreeDO;
diff --git a/DiscImageChef.Core/Filesystems.cs b/DiscImageChef.Core/Filesystems.cs
index 3f050e37..7135807f 100644
--- a/DiscImageChef.Core/Filesystems.cs
+++ b/DiscImageChef.Core/Filesystems.cs
@@ -46,7 +46,7 @@ namespace DiscImageChef.Core
/// Media image
/// List of plugins recognizing the filesystem
/// Partition
- public static void Identify(ImagePlugin imagePlugin, out List idPlugins, Partition partition)
+ public static void Identify(IMediaImage imagePlugin, out List idPlugins, Partition partition)
{
PluginBase plugins = new PluginBase();
plugins.RegisterAllPlugins();
diff --git a/DiscImageChef.Core/ImageFormat.cs b/DiscImageChef.Core/ImageFormat.cs
index e7607c3d..b097ba4f 100644
--- a/DiscImageChef.Core/ImageFormat.cs
+++ b/DiscImageChef.Core/ImageFormat.cs
@@ -45,18 +45,18 @@ namespace DiscImageChef.Core
///
/// Filter
/// Detected image plugin
- public static ImagePlugin Detect(Filter imageFilter)
+ public static IMediaImage Detect(IFilter imageFilter)
{
try
{
PluginBase plugins = new PluginBase();
plugins.RegisterAllPlugins();
- ImagePlugin imageFormat = null;
+ IMediaImage imageFormat = null;
// Check all but RAW plugin
- foreach(ImagePlugin imageplugin in plugins.ImagePluginsList.Values.Where(imageplugin =>
- imageplugin.PluginUuid !=
+ foreach(IMediaImage imageplugin in plugins.ImagePluginsList.Values.Where(imageplugin =>
+ imageplugin.Id !=
new
Guid("12345678-AAAA-BBBB-CCCC-123456789000"))
)
@@ -77,8 +77,8 @@ namespace DiscImageChef.Core
if(imageFormat != null) return imageFormat;
// Check only RAW plugin
- foreach(ImagePlugin imageplugin in plugins.ImagePluginsList.Values.Where(imageplugin =>
- imageplugin.PluginUuid ==
+ foreach(IMediaImage imageplugin in plugins.ImagePluginsList.Values.Where(imageplugin =>
+ imageplugin.Id ==
new
Guid("12345678-AAAA-BBBB-CCCC-123456789000"))
)
diff --git a/DiscImageChef.Core/Partitions.cs b/DiscImageChef.Core/Partitions.cs
index 7d5e92b9..38e81aff 100644
--- a/DiscImageChef.Core/Partitions.cs
+++ b/DiscImageChef.Core/Partitions.cs
@@ -49,7 +49,7 @@ namespace DiscImageChef.Core
///
/// Image
/// List of found partitions
- public static List GetAll(ImagePlugin image)
+ public static List GetAll(IMediaImage image)
{
PluginBase plugins = new PluginBase();
plugins.RegisterAllPlugins();
@@ -58,10 +58,10 @@ namespace DiscImageChef.Core
List checkedLocations = new List();
// Getting all partitions from device (e.g. tracks)
- if(image.ImageInfo.HasPartitions)
+ if(image.Info.HasPartitions)
foreach(Partition imagePartition in image.Partitions)
{
- foreach(PartitionPlugin partitionPlugin in plugins.PartPluginsList.Values)
+ foreach(IPartition partitionPlugin in plugins.PartPluginsList.Values)
if(partitionPlugin.GetInformation(image, out List partitions, imagePartition.Start))
{
foundPartitions.AddRange(partitions);
@@ -74,7 +74,7 @@ namespace DiscImageChef.Core
// Getting all partitions at start of device
else
{
- foreach(PartitionPlugin partitionPlugin in plugins.PartPluginsList.Values)
+ foreach(IPartition partitionPlugin in plugins.PartPluginsList.Values)
if(partitionPlugin.GetInformation(image, out List partitions, 0))
{
foundPartitions.AddRange(partitions);
@@ -95,7 +95,7 @@ namespace DiscImageChef.Core
List childs = new List();
- foreach(PartitionPlugin partitionPlugin in plugins.PartPluginsList.Values)
+ foreach(IPartition partitionPlugin in plugins.PartPluginsList.Values)
{
DicConsole.DebugWriteLine("Partitions", "Trying {0} @ {1}", partitionPlugin.Name,
foundPartitions[0].Start);
@@ -130,7 +130,7 @@ namespace DiscImageChef.Core
}
// Be sure that device partitions are not excluded if not mapped by any scheme...
- if(image.ImageInfo.HasPartitions)
+ if(image.Info.HasPartitions)
{
List startLocations =
childPartitions.Select(detectedPartition => detectedPartition.Start).ToList();
diff --git a/DiscImageChef.Core/PluginBase.cs b/DiscImageChef.Core/PluginBase.cs
index 1436cabf..5a16837c 100644
--- a/DiscImageChef.Core/PluginBase.cs
+++ b/DiscImageChef.Core/PluginBase.cs
@@ -32,6 +32,7 @@
using System;
using System.Collections.Generic;
+using System.Linq;
using System.Reflection;
using System.Text;
using DiscImageChef.Console;
@@ -49,86 +50,75 @@ namespace DiscImageChef.Core
///
/// List of all media image plugins
///
- public SortedDictionary ImagePluginsList;
+ public SortedDictionary ImagePluginsList;
///
/// List of all partition plugins
///
- public SortedDictionary PartPluginsList;
+ public SortedDictionary PartPluginsList;
///
/// List of all filesystem plugins
///
- public SortedDictionary PluginsList;
+ public SortedDictionary PluginsList;
///
/// Initializes the plugins lists
///
public PluginBase()
{
- PluginsList = new SortedDictionary();
- PartPluginsList = new SortedDictionary();
- ImagePluginsList = new SortedDictionary();
+ PluginsList = new SortedDictionary();
+ PartPluginsList = new SortedDictionary();
+ ImagePluginsList = new SortedDictionary();
}
///
/// Fills the plugins lists
///
- /// Which encoding to pass to plugins
- public void RegisterAllPlugins(Encoding encoding = null)
+ public void RegisterAllPlugins()
{
- Assembly assembly = Assembly.GetAssembly(typeof(ImagePlugin));
+ Assembly assembly = Assembly.GetAssembly(typeof(IMediaImage));
- foreach(Type type in assembly.GetTypes())
+ foreach(Type type in assembly.GetTypes().Where(t => t.GetInterfaces().Contains(typeof(IMediaImage))))
try
{
- if(!type.IsSubclassOf(typeof(ImagePlugin))) continue;
-
- ImagePlugin plugin = (ImagePlugin)type.GetConstructor(Type.EmptyTypes)?.Invoke(new object[] { });
+ IMediaImage plugin = (IMediaImage)type.GetConstructor(Type.EmptyTypes)?.Invoke(new object[] { });
RegisterImagePlugin(plugin);
}
catch(Exception exception) { DicConsole.ErrorWriteLine("Exception {0}", exception); }
- assembly = Assembly.GetAssembly(typeof(PartitionPlugin));
+ assembly = Assembly.GetAssembly(typeof(IPartition));
- foreach(Type type in assembly.GetTypes())
+ foreach(Type type in assembly.GetTypes().Where(t => t.GetInterfaces().Contains(typeof(IPartition))))
try
{
- if(!type.IsSubclassOf(typeof(PartitionPlugin))) continue;
-
- PartitionPlugin plugin =
- (PartitionPlugin)type.GetConstructor(Type.EmptyTypes)?.Invoke(new object[] { });
+ IPartition plugin =
+ (IPartition)type.GetConstructor(Type.EmptyTypes)?.Invoke(new object[] { });
RegisterPartPlugin(plugin);
}
catch(Exception exception) { DicConsole.ErrorWriteLine("Exception {0}", exception); }
- assembly = Assembly.GetAssembly(typeof(Filesystem));
+ assembly = Assembly.GetAssembly(typeof(IFilesystem));
- foreach(Type type in assembly.GetTypes())
+ foreach(Type type in assembly.GetTypes().Where(t => t.GetInterfaces().Contains(typeof(IFilesystem))))
try
{
- if(!type.IsSubclassOf(typeof(Filesystem))) continue;
-
- Filesystem plugin;
- if(encoding != null)
- plugin = (Filesystem)type.GetConstructor(new[] {encoding.GetType()})
- ?.Invoke(new object[] {encoding});
- else plugin = (Filesystem)type.GetConstructor(Type.EmptyTypes)?.Invoke(new object[] { });
+ IFilesystem plugin = (IFilesystem)type.GetConstructor(Type.EmptyTypes)?.Invoke(new object[] { });
RegisterPlugin(plugin);
}
catch(Exception exception) { DicConsole.ErrorWriteLine("Exception {0}", exception); }
}
- void RegisterImagePlugin(ImagePlugin plugin)
+ void RegisterImagePlugin(IMediaImage plugin)
{
if(!ImagePluginsList.ContainsKey(plugin.Name.ToLower()))
ImagePluginsList.Add(plugin.Name.ToLower(), plugin);
}
- void RegisterPlugin(Filesystem plugin)
+ void RegisterPlugin(IFilesystem plugin)
{
if(!PluginsList.ContainsKey(plugin.Name.ToLower())) PluginsList.Add(plugin.Name.ToLower(), plugin);
}
- void RegisterPartPlugin(PartitionPlugin partplugin)
+ void RegisterPartPlugin(IPartition partplugin)
{
if(!PartPluginsList.ContainsKey(partplugin.Name.ToLower()))
PartPluginsList.Add(partplugin.Name.ToLower(), partplugin);
diff --git a/DiscImageChef.Core/Sidecar/AudioMedia.cs b/DiscImageChef.Core/Sidecar/AudioMedia.cs
index 5f356ce6..c8d2f88b 100644
--- a/DiscImageChef.Core/Sidecar/AudioMedia.cs
+++ b/DiscImageChef.Core/Sidecar/AudioMedia.cs
@@ -33,6 +33,7 @@
using System;
using System.Collections.Generic;
using System.IO;
+using System.Text;
using DiscImageChef.DiscImages;
using Schemas;
@@ -51,8 +52,8 @@ namespace DiscImageChef.Core
/// Image plugins
/// List of image checksums
/// Metadata sidecar
- static void AudioMedia(ImagePlugin image, Guid filterId, string imagePath, FileInfo fi, PluginBase plugins,
- List imgChecksums, ref CICMMetadataType sidecar)
+ static void AudioMedia(IMediaImage image, Guid filterId, string imagePath, FileInfo fi, PluginBase plugins,
+ List imgChecksums, ref CICMMetadataType sidecar, Encoding encoding)
{
sidecar.AudioMedia = new[]
{
@@ -67,14 +68,14 @@ namespace DiscImageChef.Core
Value = Path.GetFileName(imagePath)
},
Size = fi.Length,
- Sequence = new SequenceType {MediaTitle = image.ImageInfo.MediaTitle}
+ Sequence = new SequenceType {MediaTitle = image.Info.MediaTitle}
}
};
- if(image.ImageInfo.MediaSequence != 0 && image.ImageInfo.LastMediaSequence != 0)
+ if(image.Info.MediaSequence != 0 && image.Info.LastMediaSequence != 0)
{
- sidecar.AudioMedia[0].Sequence.MediaSequence = image.ImageInfo.MediaSequence;
- sidecar.AudioMedia[0].Sequence.TotalMedia = image.ImageInfo.LastMediaSequence;
+ sidecar.AudioMedia[0].Sequence.MediaSequence = image.Info.MediaSequence;
+ sidecar.AudioMedia[0].Sequence.TotalMedia = image.Info.LastMediaSequence;
}
else
{
diff --git a/DiscImageChef.Core/Sidecar/BlockMedia.cs b/DiscImageChef.Core/Sidecar/BlockMedia.cs
index bf609851..1b8b3fd2 100644
--- a/DiscImageChef.Core/Sidecar/BlockMedia.cs
+++ b/DiscImageChef.Core/Sidecar/BlockMedia.cs
@@ -34,6 +34,7 @@ using System;
using System.Collections.Generic;
using System.IO;
using System.Linq;
+using System.Text;
using DiscImageChef.CommonTypes;
using DiscImageChef.Console;
using DiscImageChef.Decoders.ATA;
@@ -60,8 +61,8 @@ namespace DiscImageChef.Core
/// Image plugins
/// List of image checksums
/// Metadata sidecar
- static void BlockMedia(ImagePlugin image, Guid filterId, string imagePath, FileInfo fi, PluginBase plugins,
- List imgChecksums, ref CICMMetadataType sidecar)
+ static void BlockMedia(IMediaImage image, Guid filterId, string imagePath, FileInfo fi, PluginBase plugins,
+ List imgChecksums, ref CICMMetadataType sidecar, Encoding encoding)
{
sidecar.BlockMedia = new[]
{
@@ -76,14 +77,14 @@ namespace DiscImageChef.Core
Value = Path.GetFileName(imagePath)
},
Size = fi.Length,
- Sequence = new SequenceType {MediaTitle = image.ImageInfo.MediaTitle}
+ Sequence = new SequenceType {MediaTitle = image.Info.MediaTitle}
}
};
- if(image.ImageInfo.MediaSequence != 0 && image.ImageInfo.LastMediaSequence != 0)
+ if(image.Info.MediaSequence != 0 && image.Info.LastMediaSequence != 0)
{
- sidecar.BlockMedia[0].Sequence.MediaSequence = image.ImageInfo.MediaSequence;
- sidecar.BlockMedia[0].Sequence.TotalMedia = image.ImageInfo.LastMediaSequence;
+ sidecar.BlockMedia[0].Sequence.MediaSequence = image.Info.MediaSequence;
+ sidecar.BlockMedia[0].Sequence.TotalMedia = image.Info.LastMediaSequence;
}
else
{
@@ -91,7 +92,7 @@ namespace DiscImageChef.Core
sidecar.BlockMedia[0].Sequence.TotalMedia = 1;
}
- foreach(MediaTagType tagType in image.ImageInfo.ReadableMediaTags)
+ foreach(MediaTagType tagType in image.Info.ReadableMediaTags)
switch(tagType)
{
case MediaTagType.ATAPI_IDENTIFY:
@@ -242,7 +243,7 @@ namespace DiscImageChef.Core
}
// If there is only one track, and it's the same as the image file (e.g. ".iso" files), don't re-checksum.
- if(image.PluginUuid == new Guid("12345678-AAAA-BBBB-CCCC-123456789000") &&
+ if(image.Id == new Guid("12345678-AAAA-BBBB-CCCC-123456789000") &&
filterId == new Guid("12345678-AAAA-BBBB-CCCC-123456789000"))
sidecar.BlockMedia[0].ContentChecksums = sidecar.BlockMedia[0].Checksums;
else
@@ -253,7 +254,7 @@ namespace DiscImageChef.Core
//goto skipImageChecksum;
uint sectorsToRead = 512;
- ulong sectors = image.ImageInfo.Sectors;
+ ulong sectors = image.Info.Sectors;
ulong doneSectors = 0;
InitProgress2();
@@ -287,17 +288,17 @@ namespace DiscImageChef.Core
EndProgress2();
}
- MediaType.MediaTypeToString(image.ImageInfo.MediaType, out string dskType, out string dskSubType);
+ MediaType.MediaTypeToString(image.Info.MediaType, out string dskType, out string dskSubType);
sidecar.BlockMedia[0].DiskType = dskType;
sidecar.BlockMedia[0].DiskSubType = dskSubType;
- Statistics.AddMedia(image.ImageInfo.MediaType, false);
+ Statistics.AddMedia(image.Info.MediaType, false);
- sidecar.BlockMedia[0].Dimensions = Dimensions.DimensionsFromMediaType(image.ImageInfo.MediaType);
+ sidecar.BlockMedia[0].Dimensions = Dimensions.DimensionsFromMediaType(image.Info.MediaType);
- sidecar.BlockMedia[0].LogicalBlocks = (long)image.ImageInfo.Sectors;
- sidecar.BlockMedia[0].LogicalBlockSize = (int)image.ImageInfo.SectorSize;
+ sidecar.BlockMedia[0].LogicalBlocks = (long)image.Info.Sectors;
+ sidecar.BlockMedia[0].LogicalBlockSize = (int)image.Info.SectorSize;
// TODO: Detect it
- sidecar.BlockMedia[0].PhysicalBlockSize = (int)image.ImageInfo.SectorSize;
+ sidecar.BlockMedia[0].PhysicalBlockSize = (int)image.Info.SectorSize;
UpdateStatus("Checking filesystems...");
@@ -321,14 +322,14 @@ namespace DiscImageChef.Core
};
List lstFs = new List();
- foreach(Filesystem plugin in plugins.PluginsList.Values)
+ foreach(IFilesystem plugin in plugins.PluginsList.Values)
try
{
if(!plugin.Identify(image, partitions[i])) continue;
- plugin.GetInformation(image, partitions[i], out _);
- lstFs.Add(plugin.XmlFSType);
- Statistics.AddFilesystem(plugin.XmlFSType.Type);
+ plugin.GetInformation(image, partitions[i], out _, encoding);
+ lstFs.Add(plugin.XmlFsType);
+ Statistics.AddFilesystem(plugin.XmlFsType.Type);
}
#pragma warning disable RECS0022 // A catch clause that catches System.Exception and has an empty body
catch
@@ -345,26 +346,26 @@ namespace DiscImageChef.Core
sidecar.BlockMedia[0].FileSystemInformation[0] = new PartitionType
{
StartSector = 0,
- EndSector = (int)(image.ImageInfo.Sectors - 1)
+ EndSector = (int)(image.Info.Sectors - 1)
};
Partition wholePart = new Partition
{
Name = "Whole device",
- Length = image.ImageInfo.Sectors,
- Size = image.ImageInfo.Sectors * image.ImageInfo.SectorSize
+ Length = image.Info.Sectors,
+ Size = image.Info.Sectors * image.Info.SectorSize
};
List lstFs = new List();
- foreach(Filesystem plugin in plugins.PluginsList.Values)
+ foreach(IFilesystem plugin in plugins.PluginsList.Values)
try
{
if(!plugin.Identify(image, wholePart)) continue;
- plugin.GetInformation(image, wholePart, out _);
- lstFs.Add(plugin.XmlFSType);
- Statistics.AddFilesystem(plugin.XmlFSType.Type);
+ plugin.GetInformation(image, wholePart, out _, encoding);
+ lstFs.Add(plugin.XmlFsType);
+ Statistics.AddFilesystem(plugin.XmlFsType.Type);
}
#pragma warning disable RECS0022 // A catch clause that catches System.Exception and has an empty body
catch
@@ -376,17 +377,17 @@ namespace DiscImageChef.Core
if(lstFs.Count > 0) sidecar.BlockMedia[0].FileSystemInformation[0].FileSystems = lstFs.ToArray();
}
- if(image.ImageInfo.Cylinders > 0 && image.ImageInfo.Heads > 0 && image.ImageInfo.SectorsPerTrack > 0)
+ if(image.Info.Cylinders > 0 && image.Info.Heads > 0 && image.Info.SectorsPerTrack > 0)
{
sidecar.BlockMedia[0].CylindersSpecified = true;
sidecar.BlockMedia[0].HeadsSpecified = true;
sidecar.BlockMedia[0].SectorsPerTrackSpecified = true;
- sidecar.BlockMedia[0].Cylinders = image.ImageInfo.Cylinders;
- sidecar.BlockMedia[0].Heads = image.ImageInfo.Heads;
- sidecar.BlockMedia[0].SectorsPerTrack = image.ImageInfo.SectorsPerTrack;
+ sidecar.BlockMedia[0].Cylinders = image.Info.Cylinders;
+ sidecar.BlockMedia[0].Heads = image.Info.Heads;
+ sidecar.BlockMedia[0].SectorsPerTrack = image.Info.SectorsPerTrack;
}
- if(image.ImageInfo.ReadableMediaTags.Contains(MediaTagType.ATA_IDENTIFY))
+ if(image.Info.ReadableMediaTags.Contains(MediaTagType.ATA_IDENTIFY))
{
Identify.IdentifyDevice? ataId = Identify.Decode(image.ReadDiskTag(MediaTagType.ATA_IDENTIFY));
if(ataId.HasValue)
@@ -414,7 +415,7 @@ namespace DiscImageChef.Core
// TODO: This is more of a hack, redo it planned for >4.0
string trkFormat = null;
- switch(image.ImageInfo.MediaType)
+ switch(image.Info.MediaType)
{
case CommonTypes.MediaType.Apple32SS:
case CommonTypes.MediaType.Apple32DS:
@@ -541,14 +542,14 @@ namespace DiscImageChef.Core
ZZZNoFilter scpFilter = new ZZZNoFilter();
scpFilter.Open(scpFilePath);
- if(image.ImageInfo.Heads <= 2 && scpImage.IdentifyImage(scpFilter))
+ if(image.Info.Heads <= 2 && scpImage.IdentifyImage(scpFilter))
{
try { scpImage.OpenImage(scpFilter); }
catch(NotImplementedException) { }
- if(image.ImageInfo.Heads == 2 && scpImage.Header.heads == 0 || image.ImageInfo.Heads == 1 &&
+ if(image.Info.Heads == 2 && scpImage.Header.heads == 0 || image.Info.Heads == 1 &&
(scpImage.Header.heads == 1 || scpImage.Header.heads == 2))
- if(scpImage.Header.end + 1 >= image.ImageInfo.Cylinders)
+ if(scpImage.Header.end + 1 >= image.Info.Cylinders)
{
List scpBlockTrackTypes = new List();
long currentSector = 0;
@@ -558,8 +559,8 @@ namespace DiscImageChef.Core
{
BlockTrackType scpBlockTrackType = new BlockTrackType
{
- Cylinder = t / image.ImageInfo.Heads,
- Head = t % image.ImageInfo.Heads,
+ Cylinder = t / image.Info.Heads,
+ Head = t % image.Info.Heads,
Image = new ImageType
{
format = scpImage.ImageFormat,
@@ -568,13 +569,13 @@ namespace DiscImageChef.Core
}
};
- if(scpBlockTrackType.Cylinder < image.ImageInfo.Cylinders)
+ if(scpBlockTrackType.Cylinder < image.Info.Cylinders)
{
scpBlockTrackType.StartSector = currentSector;
- currentSector += image.ImageInfo.SectorsPerTrack;
+ currentSector += image.Info.SectorsPerTrack;
scpBlockTrackType.EndSector = currentSector - 1;
- scpBlockTrackType.Sectors = image.ImageInfo.SectorsPerTrack;
- scpBlockTrackType.BytesPerSector = (int)image.ImageInfo.SectorSize;
+ scpBlockTrackType.Sectors = image.Info.SectorsPerTrack;
+ scpBlockTrackType.BytesPerSector = (int)image.Info.SectorSize;
scpBlockTrackType.Format = trkFormat;
}
@@ -598,11 +599,11 @@ namespace DiscImageChef.Core
else
DicConsole
.ErrorWriteLine("SuperCardPro image do not contain same number of tracks ({0}) than disk image ({1}), ignoring...",
- scpImage.Header.end + 1, image.ImageInfo.Cylinders);
+ scpImage.Header.end + 1, image.Info.Cylinders);
else
DicConsole
.ErrorWriteLine("SuperCardPro image do not contain same number of heads ({0}) than disk image ({1}), ignoring...",
- 2, image.ImageInfo.Heads);
+ 2, image.Info.Heads);
}
}
#endregion
@@ -630,24 +631,24 @@ namespace DiscImageChef.Core
KryoFlux kfImage = new KryoFlux();
ZZZNoFilter kfFilter = new ZZZNoFilter();
kfFilter.Open(kfFile);
- if(image.ImageInfo.Heads <= 2 && kfImage.IdentifyImage(kfFilter))
+ if(image.Info.Heads <= 2 && kfImage.IdentifyImage(kfFilter))
{
try { kfImage.OpenImage(kfFilter); }
catch(NotImplementedException) { }
- if(kfImage.ImageInfo.Heads == image.ImageInfo.Heads)
- if(kfImage.ImageInfo.Cylinders >= image.ImageInfo.Cylinders)
+ if(kfImage.Info.Heads == image.Info.Heads)
+ if(kfImage.Info.Cylinders >= image.Info.Cylinders)
{
List kfBlockTrackTypes = new List();
long currentSector = 0;
- foreach(KeyValuePair kvp in kfImage.tracks)
+ foreach(KeyValuePair kvp in kfImage.tracks)
{
BlockTrackType kfBlockTrackType = new BlockTrackType
{
- Cylinder = kvp.Key / image.ImageInfo.Heads,
- Head = kvp.Key % image.ImageInfo.Heads,
+ Cylinder = kvp.Key / image.Info.Heads,
+ Head = kvp.Key % image.Info.Heads,
Image = new ImageType
{
format = kfImage.ImageFormat,
@@ -660,13 +661,13 @@ namespace DiscImageChef.Core
}
};
- if(kfBlockTrackType.Cylinder < image.ImageInfo.Cylinders)
+ if(kfBlockTrackType.Cylinder < image.Info.Cylinders)
{
kfBlockTrackType.StartSector = currentSector;
- currentSector += image.ImageInfo.SectorsPerTrack;
+ currentSector += image.Info.SectorsPerTrack;
kfBlockTrackType.EndSector = currentSector - 1;
- kfBlockTrackType.Sectors = image.ImageInfo.SectorsPerTrack;
- kfBlockTrackType.BytesPerSector = (int)image.ImageInfo.SectorSize;
+ kfBlockTrackType.Sectors = image.Info.SectorsPerTrack;
+ kfBlockTrackType.BytesPerSector = (int)image.Info.SectorSize;
kfBlockTrackType.Format = trkFormat;
}
@@ -686,11 +687,11 @@ namespace DiscImageChef.Core
else
DicConsole
.ErrorWriteLine("KryoFlux image do not contain same number of tracks ({0}) than disk image ({1}), ignoring...",
- kfImage.ImageInfo.Cylinders, image.ImageInfo.Cylinders);
+ kfImage.Info.Cylinders, image.Info.Cylinders);
else
DicConsole
.ErrorWriteLine("KryoFluximage do not contain same number of heads ({0}) than disk image ({1}), ignoring...",
- kfImage.ImageInfo.Heads, image.ImageInfo.Heads);
+ kfImage.Info.Heads, image.Info.Heads);
}
}
#endregion
@@ -710,8 +711,8 @@ namespace DiscImageChef.Core
try { dfiImage.OpenImage(dfiFilter); }
catch(NotImplementedException) { }
- if(image.ImageInfo.Heads == dfiImage.ImageInfo.Heads)
- if(dfiImage.ImageInfo.Cylinders >= image.ImageInfo.Cylinders)
+ if(image.Info.Heads == dfiImage.Info.Heads)
+ if(dfiImage.Info.Cylinders >= image.Info.Cylinders)
{
List dfiBlockTrackTypes = new List();
long currentSector = 0;
@@ -721,18 +722,18 @@ namespace DiscImageChef.Core
{
BlockTrackType dfiBlockTrackType = new BlockTrackType
{
- Cylinder = t / image.ImageInfo.Heads,
- Head = t % image.ImageInfo.Heads,
+ Cylinder = t / image.Info.Heads,
+ Head = t % image.Info.Heads,
Image = new ImageType {format = dfiImage.ImageFormat, Value = Path.GetFileName(dfiFilePath)}
};
- if(dfiBlockTrackType.Cylinder < image.ImageInfo.Cylinders)
+ if(dfiBlockTrackType.Cylinder < image.Info.Cylinders)
{
dfiBlockTrackType.StartSector = currentSector;
- currentSector += image.ImageInfo.SectorsPerTrack;
+ currentSector += image.Info.SectorsPerTrack;
dfiBlockTrackType.EndSector = currentSector - 1;
- dfiBlockTrackType.Sectors = image.ImageInfo.SectorsPerTrack;
- dfiBlockTrackType.BytesPerSector = (int)image.ImageInfo.SectorSize;
+ dfiBlockTrackType.Sectors = image.Info.SectorsPerTrack;
+ dfiBlockTrackType.BytesPerSector = (int)image.Info.SectorSize;
dfiBlockTrackType.Format = trkFormat;
}
@@ -756,11 +757,11 @@ namespace DiscImageChef.Core
else
DicConsole
.ErrorWriteLine("DiscFerret image do not contain same number of tracks ({0}) than disk image ({1}), ignoring...",
- dfiImage.ImageInfo.Cylinders, image.ImageInfo.Cylinders);
+ dfiImage.Info.Cylinders, image.Info.Cylinders);
else
DicConsole
.ErrorWriteLine("DiscFerret image do not contain same number of heads ({0}) than disk image ({1}), ignoring...",
- dfiImage.ImageInfo.Heads, image.ImageInfo.Heads);
+ dfiImage.Info.Heads, image.Info.Heads);
#endregion
// TODO: Implement support for getting CHS from SCSI mode pages
diff --git a/DiscImageChef.Core/Sidecar/LinearMedia.cs b/DiscImageChef.Core/Sidecar/LinearMedia.cs
index 9f17c93d..11603121 100644
--- a/DiscImageChef.Core/Sidecar/LinearMedia.cs
+++ b/DiscImageChef.Core/Sidecar/LinearMedia.cs
@@ -33,6 +33,7 @@
using System;
using System.Collections.Generic;
using System.IO;
+using System.Text;
using DiscImageChef.DiscImages;
using Schemas;
@@ -51,8 +52,8 @@ namespace DiscImageChef.Core
/// Image plugins
/// List of image checksums
/// Metadata sidecar
- static void LinearMedia(ImagePlugin image, Guid filterId, string imagePath, FileInfo fi, PluginBase plugins,
- List imgChecksums, ref CICMMetadataType sidecar)
+ static void LinearMedia(IMediaImage image, Guid filterId, string imagePath, FileInfo fi, PluginBase plugins,
+ List imgChecksums, ref CICMMetadataType sidecar, Encoding encoding)
{
sidecar.LinearMedia = new[]
{
diff --git a/DiscImageChef.Core/Sidecar/OpticalDisc.cs b/DiscImageChef.Core/Sidecar/OpticalDisc.cs
index 9acfc0e3..3820cadf 100644
--- a/DiscImageChef.Core/Sidecar/OpticalDisc.cs
+++ b/DiscImageChef.Core/Sidecar/OpticalDisc.cs
@@ -33,6 +33,7 @@
using System;
using System.Collections.Generic;
using System.IO;
+using System.Text;
using DiscImageChef.CommonTypes;
using DiscImageChef.Decoders.CD;
using DiscImageChef.Decoders.DVD;
@@ -57,8 +58,8 @@ namespace DiscImageChef.Core
/// Image plugins
/// List of image checksums
/// Metadata sidecar
- static void OpticalDisc(ImagePlugin image, Guid filterId, string imagePath, FileInfo fi, PluginBase plugins,
- List imgChecksums, ref CICMMetadataType sidecar)
+ static void OpticalDisc(IMediaImage image, Guid filterId, string imagePath, FileInfo fi, PluginBase plugins,
+ List imgChecksums, ref CICMMetadataType sidecar, Encoding encoding)
{
sidecar.OpticalDisc = new[]
{
@@ -73,14 +74,14 @@ namespace DiscImageChef.Core
Value = Path.GetFileName(imagePath)
},
Size = fi.Length,
- Sequence = new SequenceType {MediaTitle = image.ImageInfo.MediaTitle}
+ Sequence = new SequenceType {MediaTitle = image.Info.MediaTitle}
}
};
- if(image.ImageInfo.MediaSequence != 0 && image.ImageInfo.LastMediaSequence != 0)
+ if(image.Info.MediaSequence != 0 && image.Info.LastMediaSequence != 0)
{
- sidecar.OpticalDisc[0].Sequence.MediaSequence = image.ImageInfo.MediaSequence;
- sidecar.OpticalDisc[0].Sequence.TotalMedia = image.ImageInfo.LastMediaSequence;
+ sidecar.OpticalDisc[0].Sequence.MediaSequence = image.Info.MediaSequence;
+ sidecar.OpticalDisc[0].Sequence.TotalMedia = image.Info.LastMediaSequence;
}
else
{
@@ -88,9 +89,9 @@ namespace DiscImageChef.Core
sidecar.OpticalDisc[0].Sequence.TotalMedia = 1;
}
- MediaType dskType = image.ImageInfo.MediaType;
+ MediaType dskType = image.Info.MediaType;
- foreach(MediaTagType tagType in image.ImageInfo.ReadableMediaTags)
+ foreach(MediaTagType tagType in image.Info.ReadableMediaTags)
switch(tagType)
{
case MediaTagType.CD_ATIP:
@@ -341,7 +342,7 @@ namespace DiscImageChef.Core
ulong doneSectors = 0;
// If there is only one track, and it's the same as the image file (e.g. ".iso" files), don't re-checksum.
- if(image.PluginUuid == new Guid("12345678-AAAA-BBBB-CCCC-123456789000") &&
+ if(image.Id == new Guid("12345678-AAAA-BBBB-CCCC-123456789000") &&
// Only if filter is none...
(filterId == new Guid("12345678-AAAA-BBBB-CCCC-123456789000") ||
// ...or AppleDouble
@@ -483,16 +484,16 @@ namespace DiscImageChef.Core
};
List lstFs = new List();
- foreach(Filesystem plugin in plugins.PluginsList.Values)
+ foreach(IFilesystem plugin in plugins.PluginsList.Values)
try
{
if(!plugin.Identify(image, partitions[i])) continue;
- plugin.GetInformation(image, partitions[i], out _);
- lstFs.Add(plugin.XmlFSType);
- Statistics.AddFilesystem(plugin.XmlFSType.Type);
+ plugin.GetInformation(image, partitions[i], out _, encoding);
+ lstFs.Add(plugin.XmlFsType);
+ Statistics.AddFilesystem(plugin.XmlFsType.Type);
- switch(plugin.XmlFSType.Type)
+ switch(plugin.XmlFsType.Type)
{
case "Opera":
dskType = MediaType.ThreeDO;
@@ -535,16 +536,16 @@ namespace DiscImageChef.Core
Size = (ulong)xmlTrk.Size,
Sequence = (ulong)xmlTrk.Sequence.TrackNumber
};
- foreach(Filesystem plugin in plugins.PluginsList.Values)
+ foreach(IFilesystem plugin in plugins.PluginsList.Values)
try
{
if(!plugin.Identify(image, xmlPart)) continue;
- plugin.GetInformation(image, xmlPart, out _);
- lstFs.Add(plugin.XmlFSType);
- Statistics.AddFilesystem(plugin.XmlFSType.Type);
+ plugin.GetInformation(image, xmlPart, out _, encoding);
+ lstFs.Add(plugin.XmlFsType);
+ Statistics.AddFilesystem(plugin.XmlFsType.Type);
- switch(plugin.XmlFSType.Type)
+ switch(plugin.XmlFsType.Type)
{
case "Opera":
dskType = MediaType.ThreeDO;
@@ -593,23 +594,23 @@ namespace DiscImageChef.Core
sidecar.OpticalDisc[0].DiscSubType = dscSubType;
Statistics.AddMedia(dskType, false);
- if(!string.IsNullOrEmpty(image.ImageInfo.DriveManufacturer) ||
- !string.IsNullOrEmpty(image.ImageInfo.DriveModel) ||
- !string.IsNullOrEmpty(image.ImageInfo.DriveFirmwareRevision) ||
- !string.IsNullOrEmpty(image.ImageInfo.DriveSerialNumber))
+ if(!string.IsNullOrEmpty(image.Info.DriveManufacturer) ||
+ !string.IsNullOrEmpty(image.Info.DriveModel) ||
+ !string.IsNullOrEmpty(image.Info.DriveFirmwareRevision) ||
+ !string.IsNullOrEmpty(image.Info.DriveSerialNumber))
sidecar.OpticalDisc[0].DumpHardwareArray = new[]
{
new DumpHardwareType
{
- Extents = new[] {new ExtentType {Start = 0, End = image.ImageInfo.Sectors}},
- Manufacturer = image.ImageInfo.DriveManufacturer,
- Model = image.ImageInfo.DriveModel,
- Firmware = image.ImageInfo.DriveFirmwareRevision,
- Serial = image.ImageInfo.DriveSerialNumber,
+ Extents = new[] {new ExtentType {Start = 0, End = image.Info.Sectors}},
+ Manufacturer = image.Info.DriveManufacturer,
+ Model = image.Info.DriveModel,
+ Firmware = image.Info.DriveFirmwareRevision,
+ Serial = image.Info.DriveSerialNumber,
Software = new SoftwareType
{
- Name = image.ImageInfo.Application,
- Version = image.ImageInfo.ApplicationVersion
+ Name = image.Info.Application,
+ Version = image.Info.ApplicationVersion
}
}
};
diff --git a/DiscImageChef.Core/Sidecar/Sidecar.cs b/DiscImageChef.Core/Sidecar/Sidecar.cs
index 17624174..078af7c4 100644
--- a/DiscImageChef.Core/Sidecar/Sidecar.cs
+++ b/DiscImageChef.Core/Sidecar/Sidecar.cs
@@ -49,11 +49,11 @@ namespace DiscImageChef.Core
/// Filter uuid
/// Encoding for analysis
/// The metadata sidecar
- public static CICMMetadataType Create(ImagePlugin image, string imagePath, Guid filterId, Encoding encoding)
+ public static CICMMetadataType Create(IMediaImage image, string imagePath, Guid filterId, Encoding encoding)
{
CICMMetadataType sidecar = new CICMMetadataType();
PluginBase plugins = new PluginBase();
- plugins.RegisterAllPlugins(encoding);
+ plugins.RegisterAllPlugins();
FileInfo fi = new FileInfo(imagePath);
FileStream fs = new FileStream(imagePath, FileMode.Open, FileAccess.Read);
@@ -93,19 +93,19 @@ namespace DiscImageChef.Core
List imgChecksums = imgChkWorker.End();
- switch(image.ImageInfo.XmlMediaType)
+ switch(image.Info.XmlMediaType)
{
case XmlMediaType.OpticalDisc:
- OpticalDisc(image, filterId, imagePath, fi, plugins, imgChecksums, ref sidecar);
+ OpticalDisc(image, filterId, imagePath, fi, plugins, imgChecksums, ref sidecar, encoding);
break;
case XmlMediaType.BlockMedia:
- BlockMedia(image, filterId, imagePath, fi, plugins, imgChecksums, ref sidecar);
+ BlockMedia(image, filterId, imagePath, fi, plugins, imgChecksums, ref sidecar, encoding);
break;
case XmlMediaType.LinearMedia:
- LinearMedia(image, filterId, imagePath, fi, plugins, imgChecksums, ref sidecar);
+ LinearMedia(image, filterId, imagePath, fi, plugins, imgChecksums, ref sidecar, encoding);
break;
case XmlMediaType.AudioMedia:
- AudioMedia(image, filterId, imagePath, fi, plugins, imgChecksums, ref sidecar);
+ AudioMedia(image, filterId, imagePath, fi, plugins, imgChecksums, ref sidecar, encoding);
break;
}
diff --git a/DiscImageChef.DiscImages/Alcohol120.cs b/DiscImageChef.DiscImages/Alcohol120.cs
index 36719518..c41da625 100644
--- a/DiscImageChef.DiscImages/Alcohol120.cs
+++ b/DiscImageChef.DiscImages/Alcohol120.cs
@@ -47,10 +47,10 @@ using DMI = DiscImageChef.Decoders.Xbox.DMI;
namespace DiscImageChef.DiscImages
{
- public class Alcohol120 : ImagePlugin
+ public class Alcohol120 : IMediaImage
{
AlcoholFooter alcFooter;
- Filter alcImage;
+ IFilter alcImage;
Dictionary alcSessions;
Dictionary> alcToc;
Dictionary alcTrackExtras;
@@ -58,6 +58,7 @@ namespace DiscImageChef.DiscImages
byte[] bca;
byte[] dmi;
byte[] fullToc;
+ ImageInfo imageInfo;
Stream imageStream;
bool isDvd;
Dictionary offsetmap;
@@ -67,9 +68,7 @@ namespace DiscImageChef.DiscImages
public Alcohol120()
{
- Name = "Alcohol 120% Media Descriptor Structure";
- PluginUuid = new Guid("A78FBEBA-0307-4915-BDE3-B8A3B57F843F");
- ImageInfo = new ImageInfo
+ imageInfo = new ImageInfo
{
ReadableSectorTags = new List(),
ReadableMediaTags = new List(),
@@ -94,11 +93,15 @@ namespace DiscImageChef.DiscImages
};
}
- public override string ImageFormat => "Alcohol 120% Media Descriptor Structure";
+ public virtual ImageInfo Info => imageInfo;
+ public virtual string Name => "Alcohol 120% Media Descriptor Structure";
+ public virtual Guid Id => new Guid("A78FBEBA-0307-4915-BDE3-B8A3B57F843F");
- public override List Partitions => partitions;
+ public virtual string ImageFormat => "Alcohol 120% Media Descriptor Structure";
- public override List