mirror of
https://github.com/aaru-dps/Aaru.git
synced 2025-12-16 19:24:25 +00:00
Move optical disc exclusive methods to new interfaces.
This commit is contained in:
@@ -85,7 +85,7 @@ namespace DiscImageChef.Core.Devices.Dumping
|
||||
/// <exception cref="InvalidOperationException">If the resume file is invalid</exception>
|
||||
/// <exception cref="ArgumentOutOfRangeException">If the track type is unknown (never)</exception>
|
||||
internal static void Dump(Device dev, string devicePath,
|
||||
IWritableImage outputPlugin, ushort retryPasses,
|
||||
IWritableOpticalImage outputPlugin, ushort retryPasses,
|
||||
bool force, bool dumpRaw,
|
||||
bool persistent, bool stopOnError,
|
||||
ref MediaType dskType,
|
||||
|
||||
@@ -77,7 +77,7 @@ namespace DiscImageChef.Core.Devices.Dumping
|
||||
/// <param name="formatOptions">Formats to pass to output file plugin</param>
|
||||
/// <exception cref="NotImplementedException">If trying to dump GOD or WOD, or XGDs without a Kreon drive</exception>
|
||||
internal static void Dump(Device dev, string devicePath,
|
||||
IWritableImage outputPlugin, ushort retryPasses,
|
||||
IWritableOpticalImage outputPlugin, ushort retryPasses,
|
||||
bool force, bool dumpRaw,
|
||||
bool persistent, bool stopOnError, ref MediaType dskType,
|
||||
ref Resume resume, ref DumpLog dumpLog,
|
||||
|
||||
@@ -208,16 +208,20 @@ namespace DiscImageChef.Core.Devices.Dumping
|
||||
return;
|
||||
}
|
||||
|
||||
DumpUmd(dev, devicePath, outputPlugin, retryPasses, force, persistent, stopOnError,
|
||||
ref resume, ref dumpLog,
|
||||
encoding, outputPrefix, outputPath, formatOptions, preSidecar, skip, nometadata, notrim);
|
||||
if(outputPlugin is IWritableOpticalImage opticalPlugin)
|
||||
DumpUmd(dev, devicePath, opticalPlugin, retryPasses, force, persistent, stopOnError,
|
||||
ref resume,
|
||||
ref dumpLog, encoding, outputPrefix, outputPath, formatOptions, preSidecar, skip,
|
||||
nometadata,
|
||||
notrim);
|
||||
else DicConsole.ErrorWriteLine("The specified plugin does not support storing optical disc images.");
|
||||
}
|
||||
|
||||
static void DumpUmd(Device dev, string devicePath,
|
||||
IWritableImage outputPlugin, ushort retryPasses, bool force,
|
||||
bool persistent, bool stopOnError,
|
||||
ref Resume resume, ref DumpLog dumpLog,
|
||||
Encoding encoding, string outputPrefix,
|
||||
static void DumpUmd(Device dev, string devicePath,
|
||||
IWritableOpticalImage outputPlugin, ushort retryPasses,
|
||||
bool force, bool persistent,
|
||||
bool stopOnError, ref Resume resume, ref DumpLog dumpLog,
|
||||
Encoding encoding, string outputPrefix,
|
||||
string outputPath,
|
||||
Dictionary<string, string> formatOptions, CICMMetadataType preSidecar,
|
||||
uint skip,
|
||||
|
||||
@@ -283,19 +283,28 @@ namespace DiscImageChef.Core.Devices.Dumping
|
||||
double imageWriteDuration = 0;
|
||||
|
||||
if(opticalDisc)
|
||||
outputPlugin.SetTracks(new List<Track>
|
||||
{
|
||||
new Track
|
||||
{
|
||||
if(outputPlugin is IWritableOpticalImage opticalPlugin)
|
||||
opticalPlugin.SetTracks(new List<Track>
|
||||
{
|
||||
TrackBytesPerSector = (int)blockSize,
|
||||
TrackEndSector = blocks - 1,
|
||||
TrackSequence = 1,
|
||||
TrackRawBytesPerSector = (int)blockSize,
|
||||
TrackSubchannelType = TrackSubchannelType.None,
|
||||
TrackSession = 1,
|
||||
TrackType = TrackType.Data
|
||||
}
|
||||
});
|
||||
new Track
|
||||
{
|
||||
TrackBytesPerSector = (int)blockSize,
|
||||
TrackEndSector = blocks - 1,
|
||||
TrackSequence = 1,
|
||||
TrackRawBytesPerSector = (int)blockSize,
|
||||
TrackSubchannelType = TrackSubchannelType.None,
|
||||
TrackSession = 1,
|
||||
TrackType = TrackType.Data
|
||||
}
|
||||
});
|
||||
else
|
||||
{
|
||||
dumpLog.WriteLine("The specified plugin does not support storing optical disc images..");
|
||||
DicConsole.ErrorWriteLine("The specified plugin does not support storing optical disc images.");
|
||||
return;
|
||||
}
|
||||
}
|
||||
else if(decMode.HasValue)
|
||||
{
|
||||
bool setGeometry = false;
|
||||
|
||||
@@ -209,9 +209,12 @@ namespace DiscImageChef.Core.Devices.Dumping
|
||||
Ssc.Dump(dev, outputPrefix, devicePath, ref resume, ref dumpLog, preSidecar);
|
||||
return;
|
||||
case PeripheralDeviceTypes.MultiMediaDevice:
|
||||
Mmc.Dump(dev, devicePath, outputPlugin, retryPasses, force, dumpRaw, persistent, stopOnError,
|
||||
ref dskType, ref resume, ref dumpLog, dumpFirstTrackPregap, encoding, outputPrefix,
|
||||
outputPath, formatOptions, preSidecar, skip, nometadata, notrim);
|
||||
if(outputPlugin is IWritableOpticalImage opticalPlugin)
|
||||
Mmc.Dump(dev, devicePath, opticalPlugin, retryPasses, force, dumpRaw, persistent, stopOnError,
|
||||
ref dskType, ref resume, ref dumpLog, dumpFirstTrackPregap, encoding, outputPrefix,
|
||||
outputPath, formatOptions, preSidecar, skip, nometadata, notrim);
|
||||
else
|
||||
DicConsole.ErrorWriteLine("The specified plugin does not support storing optical disc images.");
|
||||
return;
|
||||
default:
|
||||
Sbc.Dump(dev, devicePath, outputPlugin, retryPasses, force, dumpRaw, persistent, stopOnError, null,
|
||||
|
||||
@@ -83,7 +83,7 @@ namespace DiscImageChef.Core.Devices.Dumping
|
||||
/// dump
|
||||
/// </exception>
|
||||
internal static void Dump(Device dev, string devicePath,
|
||||
IWritableImage outputPlugin, ushort retryPasses,
|
||||
IWritableOpticalImage outputPlugin, ushort retryPasses,
|
||||
bool force, bool dumpRaw,
|
||||
bool persistent, bool stopOnError,
|
||||
Dictionary<MediaTagType, byte[]> mediaTags, ref MediaType dskType,
|
||||
|
||||
Reference in New Issue
Block a user