Centralize abort for dumpers

This commit is contained in:
2019-04-20 16:40:12 +01:00
parent b7b086b644
commit bc8052f0ae
10 changed files with 56 additions and 61 deletions

View File

@@ -64,20 +64,18 @@ namespace DiscImageChef.Core.Devices.Dumping
/// <param name="dskType">Disc type as detected in SCSI or MMC layer</param>
internal void Sbc(Dictionary<MediaTagType, byte[]> mediaTags, ref MediaType dskType, bool opticalDisc)
{
bool sense;
byte scsiMediumType = 0;
byte scsiDensityCode = 0;
bool containsFloppyPage = false;
const ushort SBC_PROFILE = 0x0001;
DateTime start;
DateTime end;
double totalDuration = 0;
double currentSpeed = 0;
double maxSpeed = double.MinValue;
double minSpeed = double.MaxValue;
byte[] readBuffer;
bool aborted = false;
System.Console.CancelKeyPress += (sender, e) => e.Cancel = aborted = true;
bool sense;
byte scsiMediumType = 0;
byte scsiDensityCode = 0;
bool containsFloppyPage = false;
const ushort SBC_PROFILE = 0x0001;
DateTime start;
DateTime end;
double totalDuration = 0;
double currentSpeed = 0;
double maxSpeed = double.MinValue;
double minSpeed = double.MaxValue;
byte[] readBuffer;
Modes.DecodedMode? decMode = null;
dumpLog.WriteLine("Initializing reader.");