Move optical disc exclusive methods to new interfaces.

This commit is contained in:
2019-01-20 20:11:10 +00:00
parent 287d761dff
commit 640c57b87a
144 changed files with 869 additions and 2708 deletions

View File

@@ -64,9 +64,15 @@ namespace DiscImageChef.Core
{
List<EntropyResults> entropyResultses = new List<EntropyResults>();
if(!(inputFormat is IOpticalMediaImage opticalMediaImage))
{
DicConsole.ErrorWriteLine("The selected image does not support tracks.");
return entropyResultses.ToArray();
}
try
{
List<Track> inputTracks = inputFormat.Tracks;
List<Track> inputTracks = opticalMediaImage.Tracks;
InitProgressEvent?.Invoke();
@@ -93,7 +99,7 @@ namespace DiscImageChef.Core
?.Invoke($"Entropying sector {i + 1} of track {currentTrack.TrackSequence}",
(long)(currentTrack.TrackEndSector - (i + 1)),
(long)trackEntropy.Sectors);
byte[] sector = inputFormat.ReadSector(i, currentTrack.TrackSequence);
byte[] sector = opticalMediaImage.ReadSector(i, currentTrack.TrackSequence);
if(duplicatedSectors)
{