mirror of
https://github.com/aaru-dps/Aaru.git
synced 2025-12-16 19:24:25 +00:00
Remove separate dump log, use central log facility.
This commit is contained in:
@@ -60,7 +60,7 @@ partial class Dump
|
||||
|
||||
byte[] syncMark = [0x00, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0x00];
|
||||
|
||||
var testMark = new byte[12];
|
||||
byte[] testMark = new byte[12];
|
||||
Array.Copy(sector, 0, testMark, 0, 12);
|
||||
|
||||
return syncMark.SequenceEqual(testMark) && (sector[0xF] == 0 || sector[0xF] == 1 || sector[0xF] == 2);
|
||||
@@ -79,9 +79,9 @@ partial class Dump
|
||||
|
||||
byte[] syncMark = [0x00, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0x00];
|
||||
|
||||
var testMark = new byte[12];
|
||||
byte[] testMark = new byte[12];
|
||||
|
||||
for(var i = 0; i <= 2336; i++)
|
||||
for(int i = 0; i <= 2336; i++)
|
||||
{
|
||||
Array.Copy(sector, i, testMark, 0, 12);
|
||||
|
||||
@@ -162,7 +162,6 @@ partial class Dump
|
||||
|
||||
if(cdiReadyReadAsAudio)
|
||||
{
|
||||
_dumpLog.WriteLine(Localization.Core.Setting_speed_to_8x_for_CD_i_Ready_reading_as_audio);
|
||||
UpdateStatus?.Invoke(Localization.Core.Setting_speed_to_8x_for_CD_i_Ready_reading_as_audio);
|
||||
|
||||
_dev.SetCdSpeed(out _, RotationalControl.ClvAndImpureCav, 1416, 0, _dev.Timeout, out _);
|
||||
@@ -176,12 +175,11 @@ partial class Dump
|
||||
{
|
||||
currentTry.Extents = ExtentsConverter.ToMetadata(extents);
|
||||
UpdateStatus?.Invoke(Localization.Core.Aborted);
|
||||
_dumpLog.WriteLine(Localization.Core.Aborted);
|
||||
|
||||
break;
|
||||
}
|
||||
|
||||
var firstSectorToRead = (uint)i;
|
||||
uint firstSectorToRead = (uint)i;
|
||||
|
||||
blocksToRead = _maximumReadable;
|
||||
|
||||
@@ -290,8 +288,8 @@ partial class Dump
|
||||
|
||||
if(supportedSubchannel != MmcSubchannel.None)
|
||||
{
|
||||
var data = new byte[sectorSize];
|
||||
var sub = new byte[subSize];
|
||||
byte[] data = new byte[sectorSize];
|
||||
byte[] sub = new byte[subSize];
|
||||
|
||||
Array.Copy(cmdBuf, 0, data, 0, sectorSize);
|
||||
|
||||
@@ -316,7 +314,6 @@ partial class Dump
|
||||
outputOptical,
|
||||
_fixSubchannel,
|
||||
_fixSubchannelCrc,
|
||||
_dumpLog,
|
||||
UpdateStatus,
|
||||
smallestPregapLbaPerTrack,
|
||||
true,
|
||||
@@ -349,10 +346,6 @@ partial class Dump
|
||||
i + r,
|
||||
firstTrack.EndSector));
|
||||
|
||||
_dumpLog.WriteLine(Localization.Core.Adding_CD_i_Ready_hole_from_LBA_0_to_1_inclusive,
|
||||
i + r,
|
||||
firstTrack.EndSector);
|
||||
|
||||
break;
|
||||
}
|
||||
|
||||
@@ -393,11 +386,11 @@ partial class Dump
|
||||
|
||||
if(supportedSubchannel != MmcSubchannel.None)
|
||||
{
|
||||
var data = new byte[sectorSize * blocksToRead];
|
||||
var sub = new byte[subSize * blocksToRead];
|
||||
var tmpData = new byte[sectorSize];
|
||||
byte[] data = new byte[sectorSize * blocksToRead];
|
||||
byte[] sub = new byte[subSize * blocksToRead];
|
||||
byte[] tmpData = new byte[sectorSize];
|
||||
|
||||
for(var b = 0; b < blocksToRead; b++)
|
||||
for(int b = 0; b < blocksToRead; b++)
|
||||
{
|
||||
if(cdiReadyReadAsAudio)
|
||||
{
|
||||
@@ -428,7 +421,6 @@ partial class Dump
|
||||
outputOptical,
|
||||
_fixSubchannel,
|
||||
_fixSubchannelCrc,
|
||||
_dumpLog,
|
||||
UpdateStatus,
|
||||
smallestPregapLbaPerTrack,
|
||||
true,
|
||||
@@ -455,10 +447,10 @@ partial class Dump
|
||||
{
|
||||
if(cdiReadyReadAsAudio)
|
||||
{
|
||||
var tmpData = new byte[sectorSize];
|
||||
var data = new byte[sectorSize * blocksToRead];
|
||||
byte[] tmpData = new byte[sectorSize];
|
||||
byte[] data = new byte[sectorSize * blocksToRead];
|
||||
|
||||
for(var b = 0; b < blocksToRead; b++)
|
||||
for(int b = 0; b < blocksToRead; b++)
|
||||
{
|
||||
Array.Copy(cmdBuf, (int)(b * sectorSize), tmpData, 0, sectorSize);
|
||||
tmpData = Sector.Scramble(tmpData);
|
||||
|
||||
@@ -133,7 +133,6 @@ partial class Dump
|
||||
{
|
||||
currentTry.Extents = ExtentsConverter.ToMetadata(extents);
|
||||
UpdateStatus?.Invoke(Localization.Core.Aborted);
|
||||
_dumpLog.WriteLine(Localization.Core.Aborted);
|
||||
|
||||
break;
|
||||
}
|
||||
@@ -218,7 +217,6 @@ partial class Dump
|
||||
switch(inData)
|
||||
{
|
||||
case false when currentReadSpeed == 0xFFFF:
|
||||
_dumpLog.WriteLine(Localization.Core.Setting_speed_to_8x_for_audio_reading);
|
||||
UpdateStatus?.Invoke(Localization.Core.Setting_speed_to_8x_for_audio_reading);
|
||||
|
||||
_dev.SetCdSpeed(out _, RotationalControl.ClvAndImpureCav, 1416, 0, _dev.Timeout, out _);
|
||||
@@ -228,11 +226,6 @@ partial class Dump
|
||||
break;
|
||||
case true when currentReadSpeed != _speed:
|
||||
{
|
||||
_dumpLog.WriteLine(_speed == 0xFFFF
|
||||
? Localization.Core.Setting_speed_to_MAX_for_data_reading
|
||||
: string.Format(Localization.Core.Setting_speed_to_0_x_for_data_reading,
|
||||
_speed));
|
||||
|
||||
UpdateStatus?.Invoke(_speed == 0xFFFF
|
||||
? Localization.Core.Setting_speed_to_MAX_for_data_reading
|
||||
: string.Format(Localization.Core.Setting_speed_to_0_x_for_data_reading,
|
||||
@@ -814,7 +807,6 @@ partial class Dump
|
||||
outputFormat as IWritableOpticalImage,
|
||||
_fixSubchannel,
|
||||
_fixSubchannelCrc,
|
||||
_dumpLog,
|
||||
UpdateStatus,
|
||||
smallestPregapLbaPerTrack,
|
||||
true,
|
||||
@@ -903,14 +895,12 @@ partial class Dump
|
||||
|
||||
_resume.BadBlocks.Add(i + r);
|
||||
|
||||
AaruLogging.Debug(MODULE_NAME,
|
||||
Localization.Core.READ_error_0,
|
||||
Sense.PrettifySense(senseBuf));
|
||||
AaruLogging.Debug(MODULE_NAME, Localization.Core.READ_error_0, Sense.PrettifySense(senseBuf));
|
||||
|
||||
mhddLog.Write(i + r, cmdDuration < 500 ? 65535 : cmdDuration);
|
||||
|
||||
ibgLog.Write(i + r, 0);
|
||||
_dumpLog.WriteLine(Localization.Core.Skipping_0_blocks_from_errored_block_1, 1, i + r);
|
||||
ibgLog.Write(i + r, 0);
|
||||
AaruLogging.WriteLine(Localization.Core.Skipping_0_blocks_from_errored_block_1, 1, i + r);
|
||||
newTrim = true;
|
||||
}
|
||||
|
||||
@@ -1003,7 +993,6 @@ partial class Dump
|
||||
outputFormat as IWritableOpticalImage,
|
||||
_fixSubchannel,
|
||||
_fixSubchannelCrc,
|
||||
_dumpLog,
|
||||
UpdateStatus,
|
||||
smallestPregapLbaPerTrack,
|
||||
true,
|
||||
@@ -1108,7 +1097,7 @@ partial class Dump
|
||||
mhddLog.Write(i, cmdDuration < 500 ? 65535 : cmdDuration, _skip);
|
||||
|
||||
ibgLog.Write(i, 0);
|
||||
_dumpLog.WriteLine(Localization.Core.Skipping_0_blocks_from_errored_block_1, _skip, i);
|
||||
AaruLogging.WriteLine(Localization.Core.Skipping_0_blocks_from_errored_block_1, _skip, i);
|
||||
i += _skip - blocksToRead;
|
||||
newTrim = true;
|
||||
}
|
||||
@@ -1135,7 +1124,6 @@ partial class Dump
|
||||
|
||||
if(!failedCrossingLeadOut) return;
|
||||
|
||||
_dumpLog.WriteLine(Localization.Core.Failed_crossing_into_Lead_Out);
|
||||
UpdateStatus?.Invoke(Localization.Core.Failed_crossing_into_Lead_Out);
|
||||
}
|
||||
}
|
||||
@@ -127,14 +127,13 @@ sealed partial class Dump
|
||||
|
||||
if(_dumpRaw)
|
||||
{
|
||||
_dumpLog.WriteLine(Localization.Core.Raw_CD_dumping_not_yet_implemented);
|
||||
AaruLogging.WriteLine(Localization.Core.Raw_CD_dumping_not_yet_implemented);
|
||||
StoppingErrorMessage?.Invoke(Localization.Core.Raw_CD_dumping_not_yet_implemented);
|
||||
|
||||
return;
|
||||
}
|
||||
|
||||
tracks = GetCdTracks(_dev,
|
||||
_dumpLog,
|
||||
_force,
|
||||
out lastSector,
|
||||
leadOutStarts,
|
||||
@@ -146,7 +145,7 @@ sealed partial class Dump
|
||||
|
||||
if(tracks is null)
|
||||
{
|
||||
_dumpLog.WriteLine(Localization.Core.Could_not_get_tracks);
|
||||
AaruLogging.WriteLine(Localization.Core.Could_not_get_tracks);
|
||||
StoppingErrorMessage?.Invoke(Localization.Core.Could_not_get_tracks);
|
||||
|
||||
return;
|
||||
@@ -155,11 +154,11 @@ sealed partial class Dump
|
||||
firstLba = (uint)tracks.Min(t => t.StartSector);
|
||||
|
||||
// Check subchannels support
|
||||
supportsPqSubchannel = SupportsPqSubchannel(_dev, _dumpLog, UpdateStatus, firstLba) ||
|
||||
SupportsPqSubchannel(_dev, _dumpLog, UpdateStatus, firstLba + 5);
|
||||
supportsPqSubchannel = SupportsPqSubchannel(_dev, UpdateStatus, firstLba) ||
|
||||
SupportsPqSubchannel(_dev, UpdateStatus, firstLba + 5);
|
||||
|
||||
supportsRwSubchannel = SupportsRwSubchannel(_dev, _dumpLog, UpdateStatus, firstLba) ||
|
||||
SupportsRwSubchannel(_dev, _dumpLog, UpdateStatus, firstLba + 5);
|
||||
supportsRwSubchannel = SupportsRwSubchannel(_dev, UpdateStatus, firstLba) ||
|
||||
SupportsRwSubchannel(_dev, UpdateStatus, firstLba + 5);
|
||||
|
||||
if(supportsRwSubchannel)
|
||||
supportedSubchannel = MmcSubchannel.Raw;
|
||||
@@ -184,8 +183,8 @@ sealed partial class Dump
|
||||
desiredSubchannel = MmcSubchannel.Raw;
|
||||
else
|
||||
{
|
||||
_dumpLog.WriteLine(Localization.Core
|
||||
.Drive_does_not_support_the_requested_subchannel_format_not_continuing);
|
||||
AaruLogging.WriteLine(Localization.Core
|
||||
.Drive_does_not_support_the_requested_subchannel_format_not_continuing);
|
||||
|
||||
StoppingErrorMessage?.Invoke(Localization.Core
|
||||
.Drive_does_not_support_the_requested_subchannel_format_not_continuing);
|
||||
@@ -201,8 +200,8 @@ sealed partial class Dump
|
||||
desiredSubchannel = MmcSubchannel.Q16;
|
||||
else
|
||||
{
|
||||
_dumpLog.WriteLine(Localization.Core
|
||||
.Drive_does_not_support_the_requested_subchannel_format_not_continuing);
|
||||
AaruLogging.WriteLine(Localization.Core
|
||||
.Drive_does_not_support_the_requested_subchannel_format_not_continuing);
|
||||
|
||||
StoppingErrorMessage?.Invoke(Localization.Core
|
||||
.Drive_does_not_support_the_requested_subchannel_format_not_continuing);
|
||||
@@ -216,8 +215,8 @@ sealed partial class Dump
|
||||
desiredSubchannel = MmcSubchannel.Q16;
|
||||
else
|
||||
{
|
||||
_dumpLog.WriteLine(Localization.Core
|
||||
.Drive_does_not_support_the_requested_subchannel_format_not_continuing);
|
||||
AaruLogging.WriteLine(Localization.Core
|
||||
.Drive_does_not_support_the_requested_subchannel_format_not_continuing);
|
||||
|
||||
StoppingErrorMessage?.Invoke(Localization.Core
|
||||
.Drive_does_not_support_the_requested_subchannel_format_not_continuing);
|
||||
@@ -242,12 +241,12 @@ sealed partial class Dump
|
||||
{
|
||||
if(_force || _subchannel == DumpSubchannel.None)
|
||||
{
|
||||
_dumpLog.WriteLine(Localization.Core.Output_format_does_not_support_subchannels_continuing);
|
||||
AaruLogging.WriteLine(Localization.Core.Output_format_does_not_support_subchannels_continuing);
|
||||
UpdateStatus?.Invoke(Localization.Core.Output_format_does_not_support_subchannels_continuing);
|
||||
}
|
||||
else
|
||||
{
|
||||
_dumpLog.WriteLine(Localization.Core.Output_format_does_not_support_subchannels_not_continuing);
|
||||
AaruLogging.WriteLine(Localization.Core.Output_format_does_not_support_subchannels_not_continuing);
|
||||
|
||||
StoppingErrorMessage?.Invoke(Localization.Core
|
||||
.Output_format_does_not_support_subchannels_not_continuing);
|
||||
@@ -261,7 +260,6 @@ sealed partial class Dump
|
||||
switch(supportedSubchannel)
|
||||
{
|
||||
case MmcSubchannel.None:
|
||||
_dumpLog.WriteLine(Localization.Core.Checking_if_drive_supports_reading_without_subchannel);
|
||||
UpdateStatus?.Invoke(Localization.Core.Checking_if_drive_supports_reading_without_subchannel);
|
||||
|
||||
readcd = !_dev.ReadCd(out cmdBuf,
|
||||
@@ -299,16 +297,14 @@ sealed partial class Dump
|
||||
|
||||
if(!readcd)
|
||||
{
|
||||
_dumpLog.WriteLine(Localization.Core.Drive_does_not_support_READ_CD_trying_SCSI_READ_commands);
|
||||
AaruLogging.WriteLine(Localization.Core.Drive_does_not_support_READ_CD_trying_SCSI_READ_commands);
|
||||
ErrorMessage?.Invoke(Localization.Core.Drive_does_not_support_READ_CD_trying_SCSI_READ_commands);
|
||||
|
||||
_dumpLog.WriteLine(Localization.Core.Checking_if_drive_supports_READ_6);
|
||||
UpdateStatus?.Invoke(Localization.Core.Checking_if_drive_supports_READ_6);
|
||||
|
||||
read6 = !_dev.Read6(out cmdBuf, out _, firstLba, 2048, 1, _dev.Timeout, out _) ||
|
||||
!_dev.Read6(out cmdBuf, out _, firstLba + 5, 2048, 1, _dev.Timeout, out _);
|
||||
|
||||
_dumpLog.WriteLine(Localization.Core.Checking_if_drive_supports_READ_10);
|
||||
UpdateStatus?.Invoke(Localization.Core.Checking_if_drive_supports_READ_10);
|
||||
|
||||
read10 =
|
||||
@@ -339,7 +335,6 @@ sealed partial class Dump
|
||||
_dev.Timeout,
|
||||
out _);
|
||||
|
||||
_dumpLog.WriteLine(Localization.Core.Checking_if_drive_supports_READ_12);
|
||||
UpdateStatus?.Invoke(Localization.Core.Checking_if_drive_supports_READ_12);
|
||||
|
||||
read12 =
|
||||
@@ -372,7 +367,6 @@ sealed partial class Dump
|
||||
_dev.Timeout,
|
||||
out _);
|
||||
|
||||
_dumpLog.WriteLine(Localization.Core.Checking_if_drive_supports_READ_16);
|
||||
UpdateStatus?.Invoke(Localization.Core.Checking_if_drive_supports_READ_16);
|
||||
|
||||
read16 =
|
||||
@@ -406,51 +400,34 @@ sealed partial class Dump
|
||||
switch(read6)
|
||||
{
|
||||
case false when !read10 && !read12 && !read16:
|
||||
_dumpLog.WriteLine(Localization.Core.Cannot_read_from_disc_not_continuing);
|
||||
AaruLogging.WriteLine(Localization.Core.Cannot_read_from_disc_not_continuing);
|
||||
StoppingErrorMessage?.Invoke(Localization.Core.Cannot_read_from_disc_not_continuing);
|
||||
|
||||
return;
|
||||
case true:
|
||||
_dumpLog.WriteLine(Localization.Core.Drive_supports_READ_6);
|
||||
UpdateStatus?.Invoke(Localization.Core.Drive_supports_READ_6);
|
||||
|
||||
break;
|
||||
}
|
||||
|
||||
if(read10)
|
||||
{
|
||||
_dumpLog.WriteLine(Localization.Core.Drive_supports_READ_10);
|
||||
UpdateStatus?.Invoke(Localization.Core.Drive_supports_READ_10);
|
||||
}
|
||||
if(read10) UpdateStatus?.Invoke(Localization.Core.Drive_supports_READ_10);
|
||||
|
||||
if(read12)
|
||||
{
|
||||
_dumpLog.WriteLine(Localization.Core.Drive_supports_READ_12);
|
||||
UpdateStatus?.Invoke(Localization.Core.Drive_supports_READ_12);
|
||||
}
|
||||
if(read12) UpdateStatus?.Invoke(Localization.Core.Drive_supports_READ_12);
|
||||
|
||||
if(read16)
|
||||
{
|
||||
_dumpLog.WriteLine(Localization.Core.Drive_supports_READ_16);
|
||||
UpdateStatus?.Invoke(Localization.Core.Drive_supports_READ_16);
|
||||
}
|
||||
if(read16) UpdateStatus?.Invoke(Localization.Core.Drive_supports_READ_16);
|
||||
}
|
||||
|
||||
_dumpLog.WriteLine(Localization.Core.Drive_can_read_without_subchannel);
|
||||
UpdateStatus?.Invoke(Localization.Core.Drive_can_read_without_subchannel);
|
||||
|
||||
subSize = 0;
|
||||
|
||||
break;
|
||||
case MmcSubchannel.Raw:
|
||||
_dumpLog.WriteLine(Localization.Core.Full_raw_subchannel_reading_supported);
|
||||
UpdateStatus?.Invoke(Localization.Core.Full_raw_subchannel_reading_supported);
|
||||
subSize = 96;
|
||||
|
||||
break;
|
||||
case MmcSubchannel.Q16:
|
||||
_dumpLog.WriteLine(Localization.Core.PQ_subchannel_reading_supported);
|
||||
_dumpLog.WriteLine(Localization.Core.WARNING_If_disc_says_CDG_CDEG_CDMIDI_dump_will_be_incorrect);
|
||||
UpdateStatus?.Invoke(Localization.Core.PQ_subchannel_reading_supported);
|
||||
|
||||
UpdateStatus?.Invoke(Localization.Core.WARNING_If_disc_says_CDG_CDEG_CDMIDI_dump_will_be_incorrect);
|
||||
@@ -504,25 +481,17 @@ sealed partial class Dump
|
||||
bcdSubchannel = (tmpBuf[21] & 0x30) > 0;
|
||||
|
||||
if(bcdSubchannel)
|
||||
{
|
||||
_dumpLog.WriteLine(Localization.Core.Drive_returns_subchannel_in_BCD);
|
||||
UpdateStatus?.Invoke(Localization.Core.Drive_returns_subchannel_in_BCD);
|
||||
}
|
||||
else
|
||||
{
|
||||
_dumpLog.WriteLine(Localization.Core.Drive_does_not_returns_subchannel_in_BCD);
|
||||
UpdateStatus?.Invoke(Localization.Core.Drive_does_not_returns_subchannel_in_BCD);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
foreach(Track trk in tracks) trk.SubchannelType = subType;
|
||||
|
||||
_dumpLog.WriteLine(Localization.Core.Calculating_pregaps__can_take_some_time);
|
||||
UpdateStatus?.Invoke(Localization.Core.Calculating_pregaps__can_take_some_time);
|
||||
|
||||
SolveTrackPregaps(_dev,
|
||||
_dumpLog,
|
||||
UpdateStatus,
|
||||
tracks,
|
||||
supportsPqSubchannel,
|
||||
@@ -532,25 +501,18 @@ sealed partial class Dump
|
||||
true);
|
||||
|
||||
if(inexactPositioning)
|
||||
{
|
||||
_dumpLog.WriteLine(Localization.Core.The_drive_has_returned_incorrect_Q_positioning_calculating_pregaps);
|
||||
|
||||
UpdateStatus?.Invoke(Localization.Core.The_drive_has_returned_incorrect_Q_positioning_calculating_pregaps);
|
||||
}
|
||||
|
||||
if(!outputOptical.OpticalCapabilities.HasFlag(OpticalImageCapabilities.CanStoreRawData))
|
||||
{
|
||||
if(!_force)
|
||||
{
|
||||
_dumpLog.WriteLine(Localization.Core.Output_format_does_not_support_storing_raw_data_not_continuing);
|
||||
|
||||
StoppingErrorMessage?.Invoke(Localization.Core
|
||||
.Output_format_does_not_support_storing_raw_data_not_continuing);
|
||||
|
||||
return;
|
||||
}
|
||||
|
||||
_dumpLog.WriteLine(Localization.Core.Output_format_does_not_support_storing_raw_data_continuing);
|
||||
|
||||
ErrorMessage?.Invoke(Localization.Core.Output_format_does_not_support_storing_raw_data_continuing);
|
||||
}
|
||||
@@ -558,8 +520,6 @@ sealed partial class Dump
|
||||
if(!outputOptical.OpticalCapabilities.HasFlag(OpticalImageCapabilities.CanStoreAudioTracks) &&
|
||||
tracks.Any(track => track.Type == TrackType.Audio))
|
||||
{
|
||||
_dumpLog.WriteLine(Localization.Core.Output_format_does_not_support_audio_tracks_cannot_continue);
|
||||
|
||||
StoppingErrorMessage?.Invoke(Localization.Core.Output_format_does_not_support_audio_tracks_cannot_continue);
|
||||
|
||||
return;
|
||||
@@ -571,14 +531,11 @@ sealed partial class Dump
|
||||
{
|
||||
if(!_force)
|
||||
{
|
||||
_dumpLog.WriteLine(Localization.Core.Output_format_does_not_support_pregaps_not_continuing);
|
||||
|
||||
StoppingErrorMessage?.Invoke(Localization.Core.Output_format_does_not_support_pregaps_not_continuing);
|
||||
|
||||
return;
|
||||
}
|
||||
|
||||
_dumpLog.WriteLine(Localization.Core.Output_format_does_not_support_pregaps_continuing);
|
||||
|
||||
ErrorMessage?.Invoke(Localization.Core.Output_format_does_not_support_pregaps_continuing);
|
||||
}
|
||||
@@ -624,7 +581,6 @@ sealed partial class Dump
|
||||
// TODO: Disabled until 6.0
|
||||
/*if(!_force)
|
||||
{*/
|
||||
_dumpLog.WriteLine(Localization.Core.Output_format_does_not_support_sessions);
|
||||
|
||||
StoppingErrorMessage?.Invoke(Localization.Core.Output_format_does_not_support_sessions);
|
||||
|
||||
@@ -641,14 +597,9 @@ sealed partial class Dump
|
||||
foreach(MediaTagType tag in mediaTags.Keys.Where(tag => !outputOptical.SupportedMediaTags.Contains(tag)))
|
||||
{
|
||||
if(_force)
|
||||
{
|
||||
_dumpLog.WriteLine(Localization.Core.Output_format_does_not_support_0_continuing, tag);
|
||||
ErrorMessage?.Invoke(string.Format(Localization.Core.Output_format_does_not_support_0_continuing, tag));
|
||||
}
|
||||
else
|
||||
{
|
||||
_dumpLog.WriteLine(Localization.Core.Output_format_does_not_support_0_not_continuing, tag);
|
||||
|
||||
StoppingErrorMessage?.Invoke(string.Format(Localization.Core
|
||||
.Output_format_does_not_support_0_not_continuing,
|
||||
tag));
|
||||
@@ -678,7 +629,6 @@ sealed partial class Dump
|
||||
leadOutExtents.Add(dataExtentsArray[i].Item2 + 1, dataExtentsArray[i + 1].Item1 - 1);
|
||||
}
|
||||
|
||||
_dumpLog.WriteLine(Localization.Core.Detecting_disc_type);
|
||||
UpdateStatus?.Invoke(Localization.Core.Detecting_disc_type);
|
||||
|
||||
MMC.DetectDiscType(ref dskType,
|
||||
@@ -696,13 +646,11 @@ sealed partial class Dump
|
||||
|
||||
if(hiddenTrack || firstLba > 0)
|
||||
{
|
||||
_dumpLog.WriteLine(Localization.Core.Disc_contains_a_hidden_track);
|
||||
UpdateStatus?.Invoke(Localization.Core.Disc_contains_a_hidden_track);
|
||||
|
||||
if(!outputOptical.OpticalCapabilities.HasFlag(OpticalImageCapabilities.CanStoreHiddenTracks))
|
||||
{
|
||||
StoppingErrorMessage?.Invoke(Localization.Core.Output_format_does_not_support_hidden_tracks);
|
||||
_dumpLog.WriteLine(Localization.Core.Output_format_does_not_support_hidden_tracks);
|
||||
|
||||
return;
|
||||
}
|
||||
@@ -727,11 +675,7 @@ sealed partial class Dump
|
||||
}
|
||||
|
||||
if(tracks.Any(t => t.Type == TrackType.Audio) && desiredSubchannel != MmcSubchannel.Raw)
|
||||
{
|
||||
_dumpLog.WriteLine(Localization.Core.WARNING_If_disc_says_CDG_CDEG_CDMIDI_dump_will_be_incorrect);
|
||||
|
||||
UpdateStatus?.Invoke(Localization.Core.WARNING_If_disc_says_CDG_CDEG_CDMIDI_dump_will_be_incorrect);
|
||||
}
|
||||
|
||||
// Check mode for tracks
|
||||
foreach(Track trk in tracks.Where(t => t.Type != TrackType.Audio))
|
||||
@@ -743,7 +687,6 @@ sealed partial class Dump
|
||||
continue;
|
||||
}
|
||||
|
||||
_dumpLog.WriteLine(Localization.Core.Checking_mode_for_track_0, trk.Sequence);
|
||||
UpdateStatus?.Invoke(string.Format(Localization.Core.Checking_mode_for_track_0, trk.Sequence));
|
||||
|
||||
sense = _dev.ReadCd(out cmdBuf,
|
||||
@@ -765,8 +708,6 @@ sealed partial class Dump
|
||||
|
||||
if(sense)
|
||||
{
|
||||
_dumpLog.WriteLine(Localization.Core.Unable_to_guess_mode_for_track_0_continuing, trk.Sequence);
|
||||
|
||||
UpdateStatus?.Invoke(string.Format(Localization.Core.Unable_to_guess_mode_for_track_0_continuing,
|
||||
trk.Sequence));
|
||||
|
||||
@@ -798,7 +739,6 @@ sealed partial class Dump
|
||||
case 1:
|
||||
case 0x61: // Scrambled
|
||||
UpdateStatus?.Invoke(string.Format(Localization.Core.Track_0_is_MODE1, trk.Sequence));
|
||||
_dumpLog.WriteLine(Localization.Core.Track_0_is_MODE1, trk.Sequence);
|
||||
trk.Type = TrackType.CdMode1;
|
||||
|
||||
break;
|
||||
@@ -807,7 +747,6 @@ sealed partial class Dump
|
||||
if(dskType is MediaType.CDI or MediaType.CDIREADY)
|
||||
{
|
||||
UpdateStatus?.Invoke(string.Format(Localization.Core.Track_0_is_MODE2, trk.Sequence));
|
||||
_dumpLog.WriteLine(Localization.Core.Track_0_is_MODE2, trk.Sequence);
|
||||
trk.Type = TrackType.CdMode2Formless;
|
||||
|
||||
break;
|
||||
@@ -816,14 +755,12 @@ sealed partial class Dump
|
||||
if((cmdBuf[0x012] & 0x20) == 0x20) // mode 2 form 2
|
||||
{
|
||||
UpdateStatus?.Invoke(string.Format(Localization.Core.Track_0_is_MODE2_FORM_2, trk.Sequence));
|
||||
_dumpLog.WriteLine(Localization.Core.Track_0_is_MODE2_FORM_2, trk.Sequence);
|
||||
trk.Type = TrackType.CdMode2Form2;
|
||||
|
||||
break;
|
||||
}
|
||||
|
||||
UpdateStatus?.Invoke(string.Format(Localization.Core.Track_0_is_MODE2_FORM_1, trk.Sequence));
|
||||
_dumpLog.WriteLine(Localization.Core.Track_0_is_MODE2_FORM_1, trk.Sequence);
|
||||
trk.Type = TrackType.CdMode2Form1;
|
||||
|
||||
// These media type specifications do not legally allow mode 2 tracks to be present
|
||||
@@ -835,7 +772,6 @@ sealed partial class Dump
|
||||
trk.Sequence,
|
||||
cmdBuf[15]));
|
||||
|
||||
_dumpLog.WriteLine(Localization.Core.Track_0_is_unknown_mode_1, trk.Sequence, cmdBuf[15]);
|
||||
|
||||
break;
|
||||
}
|
||||
@@ -848,7 +784,6 @@ sealed partial class Dump
|
||||
StoppingErrorMessage?.Invoke(Localization.Core
|
||||
.Output_format_does_not_support_more_than_1_track_not_continuing);
|
||||
|
||||
_dumpLog.WriteLine(Localization.Core.Output_format_does_not_support_more_than_1_track_not_continuing);
|
||||
|
||||
return;
|
||||
}
|
||||
@@ -858,7 +793,6 @@ sealed partial class Dump
|
||||
StoppingErrorMessage?.Invoke(Localization.Core
|
||||
.Output_format_does_not_support_audio_tracks_not_continuing);
|
||||
|
||||
_dumpLog.WriteLine(Localization.Core.Output_format_does_not_support_audio_tracks_not_continuing);
|
||||
|
||||
return;
|
||||
}
|
||||
@@ -868,7 +802,6 @@ sealed partial class Dump
|
||||
StoppingErrorMessage?.Invoke(Localization.Core
|
||||
.Output_format_only_supports_MODE_1_tracks_not_continuing);
|
||||
|
||||
_dumpLog.WriteLine(Localization.Core.Output_format_only_supports_MODE_1_tracks_not_continuing);
|
||||
|
||||
return;
|
||||
}
|
||||
@@ -883,17 +816,11 @@ sealed partial class Dump
|
||||
{
|
||||
if(_force)
|
||||
{
|
||||
_dumpLog.WriteLine(Localization.Core
|
||||
.Output_format_does_not_support_CD_first_track_pregap_continuing);
|
||||
|
||||
ErrorMessage?.Invoke(Localization.Core
|
||||
.Output_format_does_not_support_CD_first_track_pregap_continuing);
|
||||
}
|
||||
else
|
||||
{
|
||||
_dumpLog.WriteLine(Localization.Core
|
||||
.Output_format_does_not_support_CD_first_track_pregap_not_continuing);
|
||||
|
||||
StoppingErrorMessage?.Invoke(Localization.Core
|
||||
.Output_format_does_not_support_CD_first_track_pregap_not_continuing);
|
||||
|
||||
@@ -995,8 +922,6 @@ sealed partial class Dump
|
||||
|
||||
if(_dev.Error || sense)
|
||||
{
|
||||
_dumpLog.WriteLine(Localization.Core.Device_error_0_trying_to_guess_ideal_transfer_length, _dev.LastError);
|
||||
|
||||
StoppingErrorMessage?.Invoke(string.Format(Localization.Core
|
||||
.Device_error_0_trying_to_guess_ideal_transfer_length,
|
||||
_dev.LastError));
|
||||
@@ -1014,13 +939,6 @@ sealed partial class Dump
|
||||
if(_dumpFirstTrackPregap && readcd)
|
||||
ReadCdFirstTrackPregap(blockSize, ref currentSpeed, mediaTags, supportedSubchannel, ref totalDuration);
|
||||
|
||||
_dumpLog.WriteLine(Localization.Core.Reading_0_sectors_at_a_time, _maximumReadable);
|
||||
_dumpLog.WriteLine(Localization.Core.Device_reports_0_blocks_1_bytes, blocks, blocks * blockSize);
|
||||
_dumpLog.WriteLine(Localization.Core.Device_can_read_0_blocks_at_a_time, _maximumReadable);
|
||||
_dumpLog.WriteLine(Localization.Core.Device_reports_0_bytes_per_logical_block, blockSize);
|
||||
_dumpLog.WriteLine(Localization.Core.SCSI_device_type_0, _dev.ScsiType);
|
||||
_dumpLog.WriteLine(Localization.Core.Media_identified_as_0, dskType);
|
||||
|
||||
UpdateStatus?.Invoke(string.Format(Localization.Core.Reading_0_sectors_at_a_time, _maximumReadable));
|
||||
|
||||
UpdateStatus?.Invoke(string.Format(Localization.Core.Device_reports_0_blocks_1_bytes,
|
||||
@@ -1041,8 +959,8 @@ sealed partial class Dump
|
||||
// Cannot create image
|
||||
if(!ret)
|
||||
{
|
||||
_dumpLog.WriteLine(Localization.Core.Error_creating_output_image_not_continuing);
|
||||
_dumpLog.WriteLine(outputOptical.ErrorMessage);
|
||||
AaruLogging.WriteLine(Localization.Core.Error_creating_output_image_not_continuing);
|
||||
AaruLogging.WriteLine(outputOptical.ErrorMessage);
|
||||
|
||||
StoppingErrorMessage?.Invoke(Localization.Core.Error_creating_output_image_not_continuing +
|
||||
Environment.NewLine +
|
||||
@@ -1080,8 +998,8 @@ sealed partial class Dump
|
||||
|
||||
if(!ret && desiredSubchannel == MmcSubchannel.None)
|
||||
{
|
||||
_dumpLog.WriteLine(Localization.Core.Error_sending_tracks_to_output_image_not_continuing);
|
||||
_dumpLog.WriteLine(outputOptical.ErrorMessage);
|
||||
AaruLogging.WriteLine(Localization.Core.Error_sending_tracks_to_output_image_not_continuing);
|
||||
AaruLogging.WriteLine(outputOptical.ErrorMessage);
|
||||
|
||||
StoppingErrorMessage?.Invoke(Localization.Core.Error_sending_tracks_to_output_image_not_continuing +
|
||||
Environment.NewLine +
|
||||
@@ -1095,14 +1013,9 @@ sealed partial class Dump
|
||||
!outputOptical.OpticalCapabilities.HasFlag(OpticalImageCapabilities.CanStoreSubchannelRw))
|
||||
{
|
||||
if(_force)
|
||||
{
|
||||
_dumpLog.WriteLine(Localization.Core.Output_format_does_not_support_subchannels_continuing);
|
||||
ErrorMessage?.Invoke(Localization.Core.Output_format_does_not_support_subchannels_continuing);
|
||||
}
|
||||
else
|
||||
{
|
||||
_dumpLog.WriteLine(Localization.Core.Output_format_does_not_support_subchannels_not_continuing);
|
||||
|
||||
StoppingErrorMessage?.Invoke(Localization.Core
|
||||
.Output_format_does_not_support_subchannels_not_continuing);
|
||||
|
||||
@@ -1112,8 +1025,8 @@ sealed partial class Dump
|
||||
|
||||
if(supportedSubchannel != MmcSubchannel.None)
|
||||
{
|
||||
_dumpLog.WriteLine(string.Format(Localization.Core.Creating_subchannel_log_in_0,
|
||||
_outputPrefix + ".sub.log"));
|
||||
AaruLogging.WriteLine(string.Format(Localization.Core.Creating_subchannel_log_in_0,
|
||||
_outputPrefix + ".sub.log"));
|
||||
|
||||
subLog = new SubchannelLog(_outputPrefix + ".sub.log", bcdSubchannel);
|
||||
}
|
||||
@@ -1125,7 +1038,6 @@ sealed partial class Dump
|
||||
|
||||
if(track is null) continue;
|
||||
|
||||
_dumpLog.WriteLine(Localization.Core.Setting_flags_for_track_0, track.Sequence);
|
||||
UpdateStatus?.Invoke(string.Format(Localization.Core.Setting_flags_for_track_0, track.Sequence));
|
||||
|
||||
outputOptical.WriteSectorTag([kvp.Value], kvp.Key, SectorTagType.CdTrackFlags);
|
||||
@@ -1137,10 +1049,7 @@ sealed partial class Dump
|
||||
sense = _dev.ReadMcn(out mcn, out _, out _, _dev.Timeout, out _);
|
||||
|
||||
if(!sense && mcn != null && mcn != "0000000000000")
|
||||
{
|
||||
UpdateStatus?.Invoke(string.Format(Localization.Core.Found_Media_Catalogue_Number_0, mcn));
|
||||
_dumpLog.WriteLine(Localization.Core.Found_Media_Catalogue_Number_0, mcn);
|
||||
}
|
||||
else
|
||||
mcn = null;
|
||||
}
|
||||
@@ -1157,7 +1066,6 @@ sealed partial class Dump
|
||||
isrcs[(byte)trk.Sequence] = isrc;
|
||||
|
||||
UpdateStatus?.Invoke(string.Format(Localization.Core.Found_ISRC_for_track_0_1, trk.Sequence, isrc));
|
||||
_dumpLog.WriteLine(string.Format(Localization.Core.Found_ISRC_for_track_0_1, trk.Sequence, isrc));
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1170,16 +1078,12 @@ sealed partial class Dump
|
||||
foreach(int sub in _resume.BadSubchannels) subchannelExtents.Add(sub);
|
||||
|
||||
if(_resume.NextBlock < blocks)
|
||||
{
|
||||
for(ulong i = _resume.NextBlock; i < blocks; i++) subchannelExtents.Add((int)i);
|
||||
}
|
||||
for(ulong i = _resume.NextBlock; i < blocks; i++)
|
||||
subchannelExtents.Add((int)i);
|
||||
}
|
||||
|
||||
if(_resume.NextBlock > 0)
|
||||
{
|
||||
UpdateStatus?.Invoke(string.Format(Localization.Core.Resuming_from_block_0, _resume.NextBlock));
|
||||
_dumpLog.WriteLine(Localization.Core.Resuming_from_block_0, _resume.NextBlock);
|
||||
}
|
||||
|
||||
if(_skip < _maximumReadable) _skip = _maximumReadable;
|
||||
|
||||
@@ -1199,7 +1103,6 @@ sealed partial class Dump
|
||||
if(tracks.All(t => t.Type != TrackType.Audio))
|
||||
{
|
||||
// No audio tracks so no need to fix offset
|
||||
_dumpLog.WriteLine(Localization.Core.No_audio_tracks_disabling_offset_fix);
|
||||
UpdateStatus.Invoke(Localization.Core.No_audio_tracks_disabling_offset_fix);
|
||||
|
||||
_fixOffset = false;
|
||||
@@ -1207,9 +1110,6 @@ sealed partial class Dump
|
||||
|
||||
if(!readcd)
|
||||
{
|
||||
_dumpLog.WriteLine(Localization.Core
|
||||
.READ_CD_command_is_not_supported_disabling_offset_fix_Dump_may_not_be_correct);
|
||||
|
||||
UpdateStatus?.Invoke(Localization.Core
|
||||
.READ_CD_command_is_not_supported_disabling_offset_fix_Dump_may_not_be_correct);
|
||||
|
||||
@@ -1218,9 +1118,6 @@ sealed partial class Dump
|
||||
}
|
||||
else if(tracks.Any(t => t.Type == TrackType.Audio))
|
||||
{
|
||||
_dumpLog.WriteLine(Localization.Core
|
||||
.There_are_audio_tracks_and_offset_fixing_is_disabled_dump_may_not_be_correct);
|
||||
|
||||
UpdateStatus?.Invoke(Localization.Core
|
||||
.There_are_audio_tracks_and_offset_fixing_is_disabled_dump_may_not_be_correct);
|
||||
}
|
||||
@@ -1236,7 +1133,6 @@ sealed partial class Dump
|
||||
_debug,
|
||||
_dev,
|
||||
dskType,
|
||||
_dumpLog,
|
||||
tracks,
|
||||
UpdateStatus,
|
||||
out int? driveOffset,
|
||||
@@ -1247,31 +1143,20 @@ sealed partial class Dump
|
||||
{
|
||||
if(driveOffset is null)
|
||||
{
|
||||
_dumpLog.WriteLine(Localization.Core.Drive_reading_offset_not_found_in_database);
|
||||
UpdateStatus?.Invoke(Localization.Core.Drive_reading_offset_not_found_in_database);
|
||||
_dumpLog.WriteLine(Localization.Core.Disc_offset_cannot_be_calculated);
|
||||
UpdateStatus?.Invoke(Localization.Core.Disc_offset_cannot_be_calculated);
|
||||
|
||||
if(tracks.Any(t => t.Type == TrackType.Audio))
|
||||
{
|
||||
_dumpLog.WriteLine(Localization.Core.Dump_may_not_be_correct);
|
||||
|
||||
UpdateStatus?.Invoke(Localization.Core.Dump_may_not_be_correct);
|
||||
}
|
||||
|
||||
if(_fixOffset) _fixOffset = false;
|
||||
}
|
||||
else
|
||||
{
|
||||
_dumpLog.WriteLine(string.Format(Localization.Core.Drive_reading_offset_is_0_bytes_1_samples,
|
||||
driveOffset,
|
||||
driveOffset / 4));
|
||||
|
||||
UpdateStatus?.Invoke(string.Format(Localization.Core.Drive_reading_offset_is_0_bytes_1_samples,
|
||||
driveOffset,
|
||||
driveOffset / 4));
|
||||
|
||||
_dumpLog.WriteLine(Localization.Core.Disc_write_offset_is_unknown_dump_may_not_be_correct);
|
||||
UpdateStatus?.Invoke(Localization.Core.Disc_write_offset_is_unknown_dump_may_not_be_correct);
|
||||
|
||||
offsetBytes = driveOffset.Value;
|
||||
@@ -1294,13 +1179,8 @@ sealed partial class Dump
|
||||
|
||||
if(driveOffset is null)
|
||||
{
|
||||
_dumpLog.WriteLine(Localization.Core.Drive_reading_offset_not_found_in_database);
|
||||
UpdateStatus?.Invoke(Localization.Core.Drive_reading_offset_not_found_in_database);
|
||||
|
||||
_dumpLog.WriteLine(string.Format(Localization.Core.Combined_disc_and_drive_offset_are_0_bytes_1_samples,
|
||||
offsetBytes,
|
||||
offsetBytes / 4));
|
||||
|
||||
UpdateStatus?.Invoke(string.Format(Localization.Core
|
||||
.Combined_disc_and_drive_offset_are_0_bytes_1_samples,
|
||||
offsetBytes,
|
||||
@@ -1308,19 +1188,12 @@ sealed partial class Dump
|
||||
}
|
||||
else
|
||||
{
|
||||
_dumpLog.WriteLine(string.Format(Localization.Core.Drive_reading_offset_is_0_bytes_1_samples,
|
||||
driveOffset,
|
||||
driveOffset / 4));
|
||||
|
||||
UpdateStatus?.Invoke(string.Format(Localization.Core.Drive_reading_offset_is_0_bytes_1_samples,
|
||||
driveOffset,
|
||||
driveOffset / 4));
|
||||
|
||||
discOffset = offsetBytes - driveOffset;
|
||||
|
||||
_dumpLog.WriteLine(string.Format(Localization.Core.Disc_offset_is_0_bytes_1_samples,
|
||||
discOffset,
|
||||
discOffset / 4));
|
||||
|
||||
UpdateStatus?.Invoke(string.Format(Localization.Core.Disc_offset_is_0_bytes_1_samples,
|
||||
discOffset,
|
||||
@@ -1364,10 +1237,6 @@ sealed partial class Dump
|
||||
// Set speed
|
||||
if(_speedMultiplier >= 0)
|
||||
{
|
||||
_dumpLog.WriteLine(_speed == 0xFFFF
|
||||
? Localization.Core.Setting_speed_to_MAX_for_data_reading
|
||||
: string.Format(Localization.Core.Setting_speed_to_0_x_for_data_reading, _speed));
|
||||
|
||||
UpdateStatus?.Invoke(_speed == 0xFFFF
|
||||
? Localization.Core.Setting_speed_to_MAX_for_data_reading
|
||||
: string.Format(Localization.Core.Setting_speed_to_0_x_for_data_reading, _speed));
|
||||
@@ -1390,9 +1259,6 @@ sealed partial class Dump
|
||||
|
||||
if(!supportsLongSectors)
|
||||
{
|
||||
_dumpLog.WriteLine(Localization.Core
|
||||
.Dumping_CD_i_Ready_requires_the_output_image_format_to_support_long_sectors);
|
||||
|
||||
StoppingErrorMessage?.Invoke(Localization.Core
|
||||
.Dumping_CD_i_Ready_requires_the_output_image_format_to_support_long_sectors);
|
||||
|
||||
@@ -1401,9 +1267,6 @@ sealed partial class Dump
|
||||
|
||||
if(!readcd)
|
||||
{
|
||||
_dumpLog.WriteLine(Localization.Core
|
||||
.Dumping_CD_i_Ready_requires_the_drive_to_support_the_READ_CD_command);
|
||||
|
||||
StoppingErrorMessage?.Invoke(Localization.Core
|
||||
.Dumping_CD_i_Ready_requires_the_drive_to_support_the_READ_CD_command);
|
||||
|
||||
@@ -1442,9 +1305,6 @@ sealed partial class Dump
|
||||
|
||||
if(offsetBytes % sectorSize != 0) sectorsForOffset++;
|
||||
|
||||
_dumpLog.WriteLine(Localization.Core
|
||||
.Enabling_skipping_CD_i_Ready_hole_because_drive_returns_data_as_audio);
|
||||
|
||||
UpdateStatus?.Invoke(Localization.Core
|
||||
.Enabling_skipping_CD_i_Ready_hole_because_drive_returns_data_as_audio);
|
||||
|
||||
@@ -1452,13 +1312,8 @@ sealed partial class Dump
|
||||
|
||||
if(driveOffset is null)
|
||||
{
|
||||
_dumpLog.WriteLine(Localization.Core.Drive_reading_offset_not_found_in_database);
|
||||
UpdateStatus?.Invoke(Localization.Core.Drive_reading_offset_not_found_in_database);
|
||||
|
||||
_dumpLog.WriteLine(string.Format(Localization.Core
|
||||
.Combined_disc_and_drive_offset_are_0_bytes_1_samples,
|
||||
offsetBytes,
|
||||
offsetBytes / 4));
|
||||
|
||||
UpdateStatus?.Invoke(string.Format(Localization.Core
|
||||
.Combined_disc_and_drive_offset_are_0_bytes_1_samples,
|
||||
@@ -1467,19 +1322,12 @@ sealed partial class Dump
|
||||
}
|
||||
else
|
||||
{
|
||||
_dumpLog.WriteLine(string.Format(Localization.Core.Drive_reading_offset_is_0_bytes_1_samples,
|
||||
driveOffset,
|
||||
driveOffset / 4));
|
||||
|
||||
UpdateStatus?.Invoke(string.Format(Localization.Core.Drive_reading_offset_is_0_bytes_1_samples,
|
||||
driveOffset,
|
||||
driveOffset / 4));
|
||||
|
||||
discOffset = offsetBytes - driveOffset;
|
||||
|
||||
_dumpLog.WriteLine(string.Format(Localization.Core.Disc_offset_is_0_bytes_1_samples,
|
||||
discOffset,
|
||||
discOffset / 4));
|
||||
|
||||
UpdateStatus?.Invoke(string.Format(Localization.Core.Disc_offset_is_0_bytes_1_samples,
|
||||
discOffset,
|
||||
@@ -1490,9 +1338,6 @@ sealed partial class Dump
|
||||
|
||||
if(!_skipCdireadyHole)
|
||||
{
|
||||
_dumpLog.WriteLine(Localization.Core
|
||||
.There_will_be_thousand_of_errors_between_track_0_and_track_1_that_is_normal_and_you_can_ignore_them);
|
||||
|
||||
UpdateStatus?.Invoke(Localization.Core
|
||||
.There_will_be_thousand_of_errors_between_track_0_and_track_1_that_is_normal_and_you_can_ignore_them);
|
||||
}
|
||||
@@ -1592,18 +1437,6 @@ sealed partial class Dump
|
||||
.Per(imageWriteDuration.Seconds())
|
||||
.Humanize()));
|
||||
|
||||
_dumpLog.WriteLine(string.Format(Localization.Core.Dump_finished_in_0,
|
||||
_dumpStopwatch.Elapsed.Humanize(minUnit: TimeUnit.Second)));
|
||||
|
||||
_dumpLog.WriteLine(string.Format(Localization.Core.Average_dump_speed_0,
|
||||
ByteSize.FromBytes(blockSize * (blocks + 1))
|
||||
.Per(totalDuration.Milliseconds())
|
||||
.Humanize()));
|
||||
|
||||
_dumpLog.WriteLine(string.Format(Localization.Core.Average_write_speed_0,
|
||||
ByteSize.FromBytes(blockSize * (blocks + 1))
|
||||
.Per(imageWriteDuration.Seconds())
|
||||
.Humanize()));
|
||||
|
||||
TrimCdUserData(audioExtents,
|
||||
blockSize,
|
||||
@@ -1661,9 +1494,8 @@ sealed partial class Dump
|
||||
supportsLongSectors);
|
||||
|
||||
foreach(Tuple<ulong, ulong> leadoutExtent in leadOutExtents.ToArray())
|
||||
{
|
||||
for(ulong e = leadoutExtent.Item1; e <= leadoutExtent.Item2; e++) subchannelExtents.Remove((int)e);
|
||||
}
|
||||
for(ulong e = leadoutExtent.Item1; e <= leadoutExtent.Item2; e++)
|
||||
subchannelExtents.Remove((int)e);
|
||||
|
||||
if(subchannelExtents.Count > 0 && _retryPasses > 0 && _retrySubchannel)
|
||||
{
|
||||
@@ -1697,7 +1529,6 @@ sealed partial class Dump
|
||||
if(ret || _force) continue;
|
||||
|
||||
// Cannot write tag to image
|
||||
_dumpLog.WriteLine(string.Format(Localization.Core.Cannot_write_tag_0, tag.Key));
|
||||
StoppingErrorMessage?.Invoke(outputOptical.ErrorMessage);
|
||||
|
||||
return;
|
||||
@@ -1706,7 +1537,8 @@ sealed partial class Dump
|
||||
|
||||
_resume.BadBlocks.Sort();
|
||||
|
||||
foreach(ulong bad in _resume.BadBlocks) _dumpLog.WriteLine(Localization.Core.Sector_0_could_not_be_read, bad);
|
||||
foreach(ulong bad in _resume.BadBlocks)
|
||||
AaruLogging.Information(Localization.Core.Sector_0_could_not_be_read, bad);
|
||||
|
||||
currentTry.Extents = ExtentsConverter.ToMetadata(extents);
|
||||
|
||||
@@ -1723,7 +1555,6 @@ sealed partial class Dump
|
||||
trackFlags,
|
||||
blocks,
|
||||
subLog,
|
||||
_dumpLog,
|
||||
InitProgress,
|
||||
UpdateProgress,
|
||||
EndProgress,
|
||||
@@ -1755,14 +1586,10 @@ sealed partial class Dump
|
||||
continue;
|
||||
|
||||
UpdateStatus?.Invoke(string.Format(Localization.Core.Setting_ISRC_for_track_0_to_1, isrc.Key, isrc.Value));
|
||||
_dumpLog.WriteLine(Localization.Core.Setting_ISRC_for_track_0_to_1, isrc.Key, isrc.Value);
|
||||
}
|
||||
|
||||
if(mcn != null && outputOptical.WriteMediaTag(Encoding.ASCII.GetBytes(mcn), MediaTagType.CD_MCN))
|
||||
{
|
||||
UpdateStatus?.Invoke(string.Format(Localization.Core.Setting_disc_Media_Catalogue_Number_to_0, mcn));
|
||||
_dumpLog.WriteLine(Localization.Core.Setting_disc_Media_Catalogue_Number_to_0, mcn);
|
||||
}
|
||||
|
||||
foreach(Track trk in tracks)
|
||||
{
|
||||
@@ -1783,7 +1610,6 @@ sealed partial class Dump
|
||||
|
||||
outputOptical.SetTracks(tracks.ToList());
|
||||
|
||||
_dumpLog.WriteLine(Localization.Core.Closing_output_file);
|
||||
UpdateStatus?.Invoke(Localization.Core.Closing_output_file);
|
||||
_imageCloseStopwatch.Restart();
|
||||
outputOptical.Close();
|
||||
@@ -1796,7 +1622,7 @@ sealed partial class Dump
|
||||
|
||||
if(_aborted)
|
||||
{
|
||||
_dumpLog.WriteLine(Localization.Core.Aborted);
|
||||
AaruLogging.WriteLine(Localization.Core.Aborted);
|
||||
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -197,7 +197,6 @@ partial class Dump
|
||||
md10 = Modes.EncodeMode10(md, _dev.ScsiType);
|
||||
|
||||
UpdateStatus?.Invoke(Localization.Core.Sending_MODE_SELECT_to_drive_return_damaged_blocks);
|
||||
_dumpLog.WriteLine(Localization.Core.Sending_MODE_SELECT_to_drive_return_damaged_blocks);
|
||||
sense = _dev.ModeSelect(md6, out senseBuf, true, false, _dev.Timeout, out _);
|
||||
|
||||
if(sense) sense = _dev.ModeSelect10(md10, out senseBuf, true, false, _dev.Timeout, out _);
|
||||
@@ -208,9 +207,6 @@ partial class Dump
|
||||
.Drive_did_not_accept_MODE_SELECT_command_for_persistent_error_reading);
|
||||
|
||||
AaruLogging.Debug(Localization.Core.Error_0, Sense.PrettifySense(senseBuf));
|
||||
|
||||
_dumpLog.WriteLine(Localization.Core
|
||||
.Drive_did_not_accept_MODE_SELECT_command_for_persistent_error_reading);
|
||||
}
|
||||
else
|
||||
runningPersistent = true;
|
||||
@@ -228,7 +224,7 @@ partial class Dump
|
||||
if(_aborted)
|
||||
{
|
||||
currentTry.Extents = ExtentsConverter.ToMetadata(extents);
|
||||
_dumpLog.WriteLine(Localization.Core.Aborted);
|
||||
AaruLogging.WriteLine(Localization.Core.Aborted);
|
||||
|
||||
break;
|
||||
}
|
||||
@@ -469,8 +465,9 @@ partial class Dump
|
||||
|
||||
// MEDIUM ERROR, retry with ignore error below
|
||||
if(decSense is { ASC: 0x11 })
|
||||
if(!sectorsNotEvenPartial.Contains(badSector))
|
||||
sectorsNotEvenPartial.Add(badSector);
|
||||
{
|
||||
if(!sectorsNotEvenPartial.Contains(badSector)) sectorsNotEvenPartial.Add(badSector);
|
||||
}
|
||||
}
|
||||
|
||||
// Because one block has been partially used to fix the offset
|
||||
@@ -499,7 +496,6 @@ partial class Dump
|
||||
badSector,
|
||||
pass));
|
||||
|
||||
_dumpLog.WriteLine(Localization.Core.Correctly_retried_sector_0_in_pass_1, badSector, pass);
|
||||
sectorsNotEvenPartial.Remove(badSector);
|
||||
}
|
||||
else
|
||||
@@ -532,7 +528,6 @@ partial class Dump
|
||||
outputOptical,
|
||||
_fixSubchannel,
|
||||
_fixSubchannelCrc,
|
||||
_dumpLog,
|
||||
UpdateStatus,
|
||||
smallestPregapLbaPerTrack,
|
||||
true,
|
||||
@@ -600,7 +595,7 @@ partial class Dump
|
||||
md6 = Modes.EncodeMode6(md, _dev.ScsiType);
|
||||
md10 = Modes.EncodeMode10(md, _dev.ScsiType);
|
||||
|
||||
_dumpLog.WriteLine(Localization.Core.Sending_MODE_SELECT_to_drive_ignore_error_correction);
|
||||
AaruLogging.WriteLine(Localization.Core.Sending_MODE_SELECT_to_drive_ignore_error_correction);
|
||||
sense = _dev.ModeSelect(md6, out senseBuf, true, false, _dev.Timeout, out _);
|
||||
|
||||
if(sense) sense = _dev.ModeSelect10(md10, out senseBuf, true, false, _dev.Timeout, out _);
|
||||
@@ -618,7 +613,7 @@ partial class Dump
|
||||
if(_aborted)
|
||||
{
|
||||
currentTry.Extents = ExtentsConverter.ToMetadata(extents);
|
||||
_dumpLog.WriteLine(Localization.Core.Aborted);
|
||||
AaruLogging.WriteLine(Localization.Core.Aborted);
|
||||
|
||||
break;
|
||||
}
|
||||
@@ -657,7 +652,7 @@ partial class Dump
|
||||
continue;
|
||||
}
|
||||
|
||||
_dumpLog.WriteLine(Localization.Core.Got_partial_data_for_sector_0_in_pass_1, badSector, pass);
|
||||
AaruLogging.WriteLine(Localization.Core.Got_partial_data_for_sector_0_in_pass_1, badSector, pass);
|
||||
|
||||
if(supportedSubchannel != MmcSubchannel.None)
|
||||
{
|
||||
@@ -686,7 +681,6 @@ partial class Dump
|
||||
outputOptical,
|
||||
_fixSubchannel,
|
||||
_fixSubchannelCrc,
|
||||
_dumpLog,
|
||||
UpdateStatus,
|
||||
smallestPregapLbaPerTrack,
|
||||
true,
|
||||
@@ -722,7 +716,7 @@ partial class Dump
|
||||
md6 = Modes.EncodeMode6(md, _dev.ScsiType);
|
||||
md10 = Modes.EncodeMode10(md, _dev.ScsiType);
|
||||
|
||||
_dumpLog.WriteLine(Localization.Core.Sending_MODE_SELECT_to_drive_return_device_to_previous_status);
|
||||
AaruLogging.WriteLine(Localization.Core.Sending_MODE_SELECT_to_drive_return_device_to_previous_status);
|
||||
sense = _dev.ModeSelect(md6, out senseBuf, true, false, _dev.Timeout, out _);
|
||||
|
||||
if(sense) _dev.ModeSelect10(md10, out senseBuf, true, false, _dev.Timeout, out _);
|
||||
@@ -790,7 +784,7 @@ partial class Dump
|
||||
|
||||
if(_aborted)
|
||||
{
|
||||
_dumpLog.WriteLine(Localization.Core.Aborted);
|
||||
AaruLogging.WriteLine(Localization.Core.Aborted);
|
||||
|
||||
break;
|
||||
}
|
||||
@@ -862,7 +856,6 @@ partial class Dump
|
||||
outputOptical,
|
||||
_fixSubchannel,
|
||||
_fixSubchannelCrc,
|
||||
_dumpLog,
|
||||
UpdateStatus,
|
||||
smallestPregapLbaPerTrack,
|
||||
true,
|
||||
@@ -873,8 +866,6 @@ partial class Dump
|
||||
UpdateStatus?.Invoke(string.Format(Localization.Core.Correctly_retried_sector_0_subchannel_in_pass_1,
|
||||
badSector,
|
||||
pass));
|
||||
|
||||
_dumpLog.WriteLine(Localization.Core.Correctly_retried_sector_0_subchannel_in_pass_1, badSector, pass);
|
||||
}
|
||||
|
||||
if(pass < _retryPasses && !_aborted && subchannelExtents.Count > 0)
|
||||
|
||||
@@ -44,6 +44,7 @@ using Aaru.CommonTypes.Extents;
|
||||
using Aaru.CommonTypes.Interfaces;
|
||||
using Aaru.Core.Logging;
|
||||
using Aaru.Devices;
|
||||
using Aaru.Logging;
|
||||
using Humanizer;
|
||||
using Humanizer.Bytes;
|
||||
using Track = Aaru.CommonTypes.Structs.Track;
|
||||
@@ -91,12 +92,11 @@ partial class Dump
|
||||
{
|
||||
byte[] cmdBuf = null; // Data buffer
|
||||
const uint sectorSize = 2352; // Full sector size
|
||||
var sense = true; // Sense indicator
|
||||
bool sense = true; // Sense indicator
|
||||
byte[] senseBuf = null;
|
||||
var outputOptical = _outputPlugin as IWritableOpticalImage;
|
||||
|
||||
UpdateStatus?.Invoke(Localization.Core.Reading_lead_outs);
|
||||
_dumpLog.WriteLine(Localization.Core.Reading_lead_outs);
|
||||
|
||||
InitProgress?.Invoke();
|
||||
|
||||
@@ -107,7 +107,7 @@ partial class Dump
|
||||
if(_aborted)
|
||||
{
|
||||
currentTry.Extents = ExtentsConverter.ToMetadata(extents);
|
||||
_dumpLog.WriteLine(Localization.Core.Aborted);
|
||||
AaruLogging.WriteLine(Localization.Core.Aborted);
|
||||
|
||||
break;
|
||||
}
|
||||
@@ -205,10 +205,10 @@ partial class Dump
|
||||
|
||||
if(supportedSubchannel != MmcSubchannel.None)
|
||||
{
|
||||
var data = new byte[sectorSize * _maximumReadable];
|
||||
var sub = new byte[subSize * _maximumReadable];
|
||||
byte[] data = new byte[sectorSize * _maximumReadable];
|
||||
byte[] sub = new byte[subSize * _maximumReadable];
|
||||
|
||||
for(var b = 0; b < _maximumReadable; b++)
|
||||
for(int b = 0; b < _maximumReadable; b++)
|
||||
{
|
||||
Array.Copy(cmdBuf, (int)(0 + b * blockSize), data, sectorSize * b, sectorSize);
|
||||
|
||||
@@ -232,7 +232,6 @@ partial class Dump
|
||||
outputOptical,
|
||||
_fixSubchannel,
|
||||
_fixSubchannelCrc,
|
||||
_dumpLog,
|
||||
UpdateStatus,
|
||||
smallestPregapLbaPerTrack,
|
||||
true,
|
||||
@@ -332,11 +331,11 @@ partial class Dump
|
||||
{
|
||||
byte[] cmdBuf = null; // Data buffer
|
||||
const uint sectorSize = 2352; // Full sector size
|
||||
var sense = true; // Sense indicator
|
||||
bool sense = true; // Sense indicator
|
||||
byte[] senseBuf = null;
|
||||
var outputOptical = _outputPlugin as IWritableOpticalImage;
|
||||
|
||||
_dumpLog.WriteLine("Retrying lead-outs");
|
||||
AaruLogging.WriteLine("Retrying lead-outs");
|
||||
|
||||
InitProgress?.Invoke();
|
||||
|
||||
@@ -347,7 +346,7 @@ partial class Dump
|
||||
if(_aborted)
|
||||
{
|
||||
currentTry.Extents = ExtentsConverter.ToMetadata(extents);
|
||||
_dumpLog.WriteLine(Localization.Core.Aborted);
|
||||
AaruLogging.WriteLine(Localization.Core.Aborted);
|
||||
|
||||
break;
|
||||
}
|
||||
@@ -445,10 +444,10 @@ partial class Dump
|
||||
|
||||
if(supportedSubchannel != MmcSubchannel.None)
|
||||
{
|
||||
var data = new byte[sectorSize * _maximumReadable];
|
||||
var sub = new byte[subSize * _maximumReadable];
|
||||
byte[] data = new byte[sectorSize * _maximumReadable];
|
||||
byte[] sub = new byte[subSize * _maximumReadable];
|
||||
|
||||
for(var b = 0; b < _maximumReadable; b++)
|
||||
for(int b = 0; b < _maximumReadable; b++)
|
||||
{
|
||||
Array.Copy(cmdBuf, (int)(0 + b * blockSize), data, sectorSize * b, sectorSize);
|
||||
|
||||
@@ -472,7 +471,6 @@ partial class Dump
|
||||
outputOptical,
|
||||
_fixSubchannel,
|
||||
_fixSubchannelCrc,
|
||||
_dumpLog,
|
||||
UpdateStatus,
|
||||
smallestPregapLbaPerTrack,
|
||||
true,
|
||||
|
||||
@@ -42,7 +42,6 @@ using Aaru.Checksums;
|
||||
using Aaru.CommonTypes;
|
||||
using Aaru.CommonTypes.Enums;
|
||||
using Aaru.CommonTypes.Structs;
|
||||
using Aaru.Core.Logging;
|
||||
using Aaru.Devices;
|
||||
using Aaru.Logging;
|
||||
using Humanizer;
|
||||
@@ -70,7 +69,6 @@ partial class Dump
|
||||
int firstTrackPregapSectorsGood = 0;
|
||||
var firstTrackPregapMs = new MemoryStream();
|
||||
|
||||
_dumpLog.WriteLine(Localization.Core.Reading_first_track_pregap);
|
||||
UpdateStatus?.Invoke(Localization.Core.Reading_first_track_pregap);
|
||||
InitProgress?.Invoke();
|
||||
_speedStopwatch.Restart();
|
||||
@@ -81,7 +79,6 @@ partial class Dump
|
||||
{
|
||||
if(_aborted)
|
||||
{
|
||||
_dumpLog.WriteLine(Localization.Core.Aborted);
|
||||
UpdateStatus?.Invoke(Localization.Core.Aborted);
|
||||
|
||||
break;
|
||||
@@ -145,8 +142,6 @@ partial class Dump
|
||||
UpdateStatus?.Invoke(string.Format(Localization.Core.Got_0_first_track_pregap_sectors,
|
||||
firstTrackPregapSectorsGood));
|
||||
|
||||
_dumpLog.WriteLine(Localization.Core.Got_0_first_track_pregap_sectors, firstTrackPregapSectorsGood);
|
||||
|
||||
firstTrackPregapMs.Close();
|
||||
}
|
||||
|
||||
@@ -160,8 +155,8 @@ partial class Dump
|
||||
/// <param name="dbDev">Database entry for device</param>
|
||||
/// <param name="inexactPositioning">Set if we found the drive does not return the exact subchannel we requested</param>
|
||||
/// <param name="dumping">Set if dumping, otherwise media info</param>
|
||||
public static void SolveTrackPregaps(Device dev, DumpLog dumpLog, UpdateStatusHandler updateStatus, Track[] tracks,
|
||||
bool supportsPqSubchannel, bool supportsRwSubchannel,
|
||||
public static void SolveTrackPregaps(Device dev, UpdateStatusHandler updateStatus, Track[] tracks,
|
||||
bool supportsPqSubchannel, bool supportsRwSubchannel,
|
||||
Database.Models.Device dbDev, out bool inexactPositioning, bool dumping)
|
||||
{
|
||||
bool sense = true; // Sense indicator
|
||||
@@ -190,18 +185,15 @@ partial class Dump
|
||||
}
|
||||
|
||||
AaruLogging.Debug(PREGAP_MODULE_NAME,
|
||||
bcd switch
|
||||
{
|
||||
true => Localization.Core.Subchannel_is_BCD,
|
||||
false => Localization.Core.Subchannel_is_not_BCD,
|
||||
_ => Localization.Core.Could_not_detect_drive_subchannel_BCD
|
||||
});
|
||||
bcd switch
|
||||
{
|
||||
true => Localization.Core.Subchannel_is_BCD,
|
||||
false => Localization.Core.Subchannel_is_not_BCD,
|
||||
_ => Localization.Core.Could_not_detect_drive_subchannel_BCD
|
||||
});
|
||||
|
||||
if(bcd is null)
|
||||
{
|
||||
dumpLog?.WriteLine(Localization.Core
|
||||
.Could_not_detect_if_drive_subchannel_is_BCD_or_not_pregaps_could_not_be_calculated_dump_may_be_incorrect);
|
||||
|
||||
updateStatus?.Invoke(Localization.Core
|
||||
.Could_not_detect_if_drive_subchannel_is_BCD_or_not_pregaps_could_not_be_calculated_dump_may_be_incorrect);
|
||||
|
||||
@@ -236,8 +228,8 @@ partial class Dump
|
||||
if(dumping && dev.Manufacturer.ToLowerInvariant().StartsWith("plextor", StringComparison.Ordinal))
|
||||
{
|
||||
AaruLogging.Debug(PREGAP_MODULE_NAME,
|
||||
Localization.Core.Skipping_track_0_due_to_Plextor_firmware_bug,
|
||||
track.Sequence);
|
||||
Localization.Core.Skipping_track_0_due_to_Plextor_firmware_bug,
|
||||
track.Sequence);
|
||||
|
||||
continue;
|
||||
}
|
||||
@@ -264,10 +256,10 @@ partial class Dump
|
||||
if(sense)
|
||||
{
|
||||
AaruLogging.Debug(PREGAP_MODULE_NAME,
|
||||
Localization.Core.LBA_0_Try_1_Sense_2,
|
||||
lba,
|
||||
retries + 1,
|
||||
sense);
|
||||
Localization.Core.LBA_0_Try_1_Sense_2,
|
||||
lba,
|
||||
retries + 1,
|
||||
sense);
|
||||
|
||||
continue;
|
||||
}
|
||||
@@ -277,25 +269,25 @@ partial class Dump
|
||||
CRC16CcittContext.Data(subBuf, 10, out crc);
|
||||
|
||||
AaruLogging.Debug(PREGAP_MODULE_NAME,
|
||||
Localization.Core
|
||||
.LBA_0_Try_1_Sense_2_Q_3_4_5_6_7_8_9_10_11_12_CRC_13_14_Calculated_CRC_15_16,
|
||||
lba,
|
||||
retries + 1,
|
||||
sense,
|
||||
subBuf[0],
|
||||
subBuf[1],
|
||||
subBuf[2],
|
||||
subBuf[3],
|
||||
subBuf[4],
|
||||
subBuf[5],
|
||||
subBuf[6],
|
||||
subBuf[7],
|
||||
subBuf[8],
|
||||
subBuf[9],
|
||||
subBuf[10],
|
||||
subBuf[11],
|
||||
crc[0],
|
||||
crc[1]);
|
||||
Localization.Core
|
||||
.LBA_0_Try_1_Sense_2_Q_3_4_5_6_7_8_9_10_11_12_CRC_13_14_Calculated_CRC_15_16,
|
||||
lba,
|
||||
retries + 1,
|
||||
sense,
|
||||
subBuf[0],
|
||||
subBuf[1],
|
||||
subBuf[2],
|
||||
subBuf[3],
|
||||
subBuf[4],
|
||||
subBuf[5],
|
||||
subBuf[6],
|
||||
subBuf[7],
|
||||
subBuf[8],
|
||||
subBuf[9],
|
||||
subBuf[10],
|
||||
subBuf[11],
|
||||
crc[0],
|
||||
crc[1]);
|
||||
|
||||
crcOk = crc[0] == subBuf[10] && crc[1] == subBuf[11];
|
||||
|
||||
@@ -330,25 +322,25 @@ partial class Dump
|
||||
if(crcOk)
|
||||
{
|
||||
AaruLogging.Debug(PREGAP_MODULE_NAME,
|
||||
Localization.Core
|
||||
.LBA_0_Try_1_Sense_2_Q_FIXED_3_4_5_6_7_8_9_10_11_12_CRC_13_14_Calculated_CRC_15_16,
|
||||
lba,
|
||||
retries + 1,
|
||||
sense,
|
||||
subBuf[0],
|
||||
subBuf[1],
|
||||
subBuf[2],
|
||||
subBuf[3],
|
||||
subBuf[4],
|
||||
subBuf[5],
|
||||
subBuf[6],
|
||||
subBuf[7],
|
||||
subBuf[8],
|
||||
subBuf[9],
|
||||
subBuf[10],
|
||||
subBuf[11],
|
||||
crc[0],
|
||||
crc[1]);
|
||||
Localization.Core
|
||||
.LBA_0_Try_1_Sense_2_Q_FIXED_3_4_5_6_7_8_9_10_11_12_CRC_13_14_Calculated_CRC_15_16,
|
||||
lba,
|
||||
retries + 1,
|
||||
sense,
|
||||
subBuf[0],
|
||||
subBuf[1],
|
||||
subBuf[2],
|
||||
subBuf[3],
|
||||
subBuf[4],
|
||||
subBuf[5],
|
||||
subBuf[6],
|
||||
subBuf[7],
|
||||
subBuf[8],
|
||||
subBuf[9],
|
||||
subBuf[10],
|
||||
subBuf[11],
|
||||
crc[0],
|
||||
crc[1]);
|
||||
}
|
||||
else
|
||||
continue;
|
||||
@@ -404,25 +396,25 @@ partial class Dump
|
||||
CRC16CcittContext.Data(subBuf, 10, out crc);
|
||||
|
||||
AaruLogging.Debug(PREGAP_MODULE_NAME,
|
||||
Localization.Core
|
||||
.LBA_0_Try_1_Sense_2_Q_3_4_5_6_7_8_9_10_11_12_CRC_13_14_Calculated_CRC_15_16,
|
||||
lba,
|
||||
retries + 1,
|
||||
sense,
|
||||
subBuf[0],
|
||||
subBuf[1],
|
||||
subBuf[2],
|
||||
subBuf[3],
|
||||
subBuf[4],
|
||||
subBuf[5],
|
||||
subBuf[6],
|
||||
subBuf[7],
|
||||
subBuf[8],
|
||||
subBuf[9],
|
||||
subBuf[10],
|
||||
subBuf[11],
|
||||
crc[0],
|
||||
crc[1]);
|
||||
Localization.Core
|
||||
.LBA_0_Try_1_Sense_2_Q_3_4_5_6_7_8_9_10_11_12_CRC_13_14_Calculated_CRC_15_16,
|
||||
lba,
|
||||
retries + 1,
|
||||
sense,
|
||||
subBuf[0],
|
||||
subBuf[1],
|
||||
subBuf[2],
|
||||
subBuf[3],
|
||||
subBuf[4],
|
||||
subBuf[5],
|
||||
subBuf[6],
|
||||
subBuf[7],
|
||||
subBuf[8],
|
||||
subBuf[9],
|
||||
subBuf[10],
|
||||
subBuf[11],
|
||||
crc[0],
|
||||
crc[1]);
|
||||
|
||||
crcOk = crc[0] == subBuf[10] && crc[1] == subBuf[11];
|
||||
|
||||
@@ -457,25 +449,25 @@ partial class Dump
|
||||
if(crcOk)
|
||||
{
|
||||
AaruLogging.Debug(PREGAP_MODULE_NAME,
|
||||
Localization.Core
|
||||
.LBA_0_Try_1_Sense_2_Q_FIXED_3_4_5_6_7_8_9_10_11_12_CRC_13_14_Calculated_CRC_15_16,
|
||||
lba,
|
||||
retries + 1,
|
||||
sense,
|
||||
subBuf[0],
|
||||
subBuf[1],
|
||||
subBuf[2],
|
||||
subBuf[3],
|
||||
subBuf[4],
|
||||
subBuf[5],
|
||||
subBuf[6],
|
||||
subBuf[7],
|
||||
subBuf[8],
|
||||
subBuf[9],
|
||||
subBuf[10],
|
||||
subBuf[11],
|
||||
crc[0],
|
||||
crc[1]);
|
||||
Localization.Core
|
||||
.LBA_0_Try_1_Sense_2_Q_FIXED_3_4_5_6_7_8_9_10_11_12_CRC_13_14_Calculated_CRC_15_16,
|
||||
lba,
|
||||
retries + 1,
|
||||
sense,
|
||||
subBuf[0],
|
||||
subBuf[1],
|
||||
subBuf[2],
|
||||
subBuf[3],
|
||||
subBuf[4],
|
||||
subBuf[5],
|
||||
subBuf[6],
|
||||
subBuf[7],
|
||||
subBuf[8],
|
||||
subBuf[9],
|
||||
subBuf[10],
|
||||
subBuf[11],
|
||||
crc[0],
|
||||
crc[1]);
|
||||
|
||||
break;
|
||||
}
|
||||
@@ -497,27 +489,17 @@ partial class Dump
|
||||
if(previousTrack.Type == TrackType.Audio && track.Type != TrackType.Audio ||
|
||||
previousTrack.Type != TrackType.Audio && track.Type == TrackType.Audio)
|
||||
{
|
||||
dumpLog?.WriteLine(Localization.Core
|
||||
.Could_not_read_subchannel_for_this_track_supposing_hundred_fifty_sectors);
|
||||
|
||||
updateStatus?.Invoke(Localization.Core
|
||||
.Could_not_read_subchannel_for_this_track_supposing_hundred_fifty_sectors);
|
||||
}
|
||||
else
|
||||
{
|
||||
dumpLog?.WriteLine(Localization.Core
|
||||
.Could_not_read_subchannel_for_this_track_supposing_zero_sectors);
|
||||
|
||||
updateStatus?.Invoke(Localization.Core
|
||||
.Could_not_read_subchannel_for_this_track_supposing_zero_sectors);
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
dumpLog?.WriteLine(string.Format(Localization.Core
|
||||
.Could_not_read_subchannel_for_this_track_supposing_0_sectors,
|
||||
pregaps[track.Sequence]));
|
||||
|
||||
updateStatus?.Invoke(string.Format(Localization.Core
|
||||
.Could_not_read_subchannel_for_this_track_supposing_0_sectors,
|
||||
pregaps[track.Sequence]));
|
||||
@@ -526,9 +508,6 @@ partial class Dump
|
||||
break;
|
||||
}
|
||||
|
||||
dumpLog?.WriteLine(string.Format(Localization.Core.Could_not_read_subchannel_for_sector_0,
|
||||
lba));
|
||||
|
||||
updateStatus?.Invoke(string.Format(Localization.Core.Could_not_read_subchannel_for_sector_0,
|
||||
lba));
|
||||
|
||||
@@ -538,9 +517,6 @@ partial class Dump
|
||||
continue;
|
||||
}
|
||||
|
||||
dumpLog?.WriteLine(string.Format(Localization.Core.Could_not_get_correct_subchannel_for_sector_0,
|
||||
lba));
|
||||
|
||||
updateStatus?.Invoke(string.Format(Localization.Core.Could_not_get_correct_subchannel_for_sector_0,
|
||||
lba));
|
||||
}
|
||||
@@ -612,9 +588,9 @@ partial class Dump
|
||||
if(diff != 0)
|
||||
{
|
||||
AaruLogging.Debug(PREGAP_MODULE_NAME,
|
||||
Localization.Core.Invalid_Q_position_for_LBA_0_got_1,
|
||||
lba,
|
||||
posQ);
|
||||
Localization.Core.Invalid_Q_position_for_LBA_0_got_1,
|
||||
lba,
|
||||
posQ);
|
||||
|
||||
inexactPositioning = true;
|
||||
}
|
||||
@@ -636,9 +612,9 @@ partial class Dump
|
||||
if(crcOk || pregapQ - pregaps[track.Sequence] < 10)
|
||||
{
|
||||
AaruLogging.Debug(PREGAP_MODULE_NAME,
|
||||
Localization.Core.Pregap_for_track_0_1,
|
||||
track.Sequence,
|
||||
pregapQ);
|
||||
Localization.Core.Pregap_for_track_0_1,
|
||||
track.Sequence,
|
||||
pregapQ);
|
||||
|
||||
pregaps[track.Sequence] = pregapQ;
|
||||
}
|
||||
@@ -680,8 +656,6 @@ partial class Dump
|
||||
trk.StartSector -= trk.Pregap;
|
||||
|
||||
#if DEBUG
|
||||
dumpLog?.WriteLine(string.Format(Localization.Core.Track_0_pregap_is_1_sectors, trk.Sequence, trk.Pregap));
|
||||
|
||||
updateStatus?.Invoke(string.Format(Localization.Core.Track_0_pregap_is_1_sectors,
|
||||
trk.Sequence,
|
||||
trk.Pregap));
|
||||
|
||||
@@ -63,9 +63,6 @@ partial class Dump
|
||||
|
||||
if(runOutSectors.Count == 0) return;
|
||||
|
||||
_dumpLog.WriteLine(string.Format(Localization.Core._0_sectors_at_the_end_of_the_disc_are_unreadable,
|
||||
runOutSectors.Count));
|
||||
|
||||
UpdateStatus?.Invoke(string.Format(Localization.Core._0_sectors_at_the_end_of_the_disc_are_unreadable,
|
||||
runOutSectors.Count));
|
||||
|
||||
@@ -75,7 +72,7 @@ partial class Dump
|
||||
|
||||
if(track is null) continue;
|
||||
|
||||
var sector = new byte[2352];
|
||||
byte[] sector = new byte[2352];
|
||||
|
||||
switch(track.Type)
|
||||
{
|
||||
|
||||
@@ -35,7 +35,6 @@
|
||||
// ReSharper disable TooWideLocalVariableScope
|
||||
|
||||
using Aaru.CommonTypes;
|
||||
using Aaru.Core.Logging;
|
||||
using Aaru.Devices;
|
||||
|
||||
namespace Aaru.Core.Devices.Dumping;
|
||||
@@ -48,9 +47,8 @@ partial class Dump
|
||||
/// <param name="updateStatus">Progress update callback</param>
|
||||
/// <param name="lba">LBA to try</param>
|
||||
/// <returns><c>true</c> if read correctly, <c>false</c> otherwise</returns>
|
||||
public static bool SupportsRwSubchannel(Device dev, DumpLog dumpLog, UpdateStatusHandler updateStatus, uint lba)
|
||||
public static bool SupportsRwSubchannel(Device dev, UpdateStatusHandler updateStatus, uint lba)
|
||||
{
|
||||
dumpLog?.WriteLine(Localization.Core.Checking_if_drive_supports_full_raw_subchannel_reading);
|
||||
updateStatus?.Invoke(Localization.Core.Checking_if_drive_supports_full_raw_subchannel_reading);
|
||||
|
||||
return !dev.ReadCd(out _,
|
||||
@@ -77,9 +75,8 @@ partial class Dump
|
||||
/// <param name="updateStatus">Progress update callback</param>
|
||||
/// <param name="lba">LBA to try</param>
|
||||
/// <returns><c>true</c> if read correctly, <c>false</c> otherwise</returns>
|
||||
public static bool SupportsPqSubchannel(Device dev, DumpLog dumpLog, UpdateStatusHandler updateStatus, uint lba)
|
||||
public static bool SupportsPqSubchannel(Device dev, UpdateStatusHandler updateStatus, uint lba)
|
||||
{
|
||||
dumpLog?.WriteLine(Localization.Core.Checking_if_drive_supports_PQ_subchannel_reading);
|
||||
updateStatus?.Invoke(Localization.Core.Checking_if_drive_supports_PQ_subchannel_reading);
|
||||
|
||||
return !dev.ReadCd(out _,
|
||||
|
||||
@@ -61,7 +61,6 @@ partial class Dump
|
||||
firstTrackLastSession = 1;
|
||||
|
||||
// ATIP exists on blank CDs
|
||||
_dumpLog.WriteLine(Localization.Core.Reading_ATIP);
|
||||
UpdateStatus?.Invoke(Localization.Core.Reading_ATIP);
|
||||
sense = _dev.ReadAtip(out cmdBuf, out _, _dev.Timeout, out _);
|
||||
|
||||
@@ -81,7 +80,6 @@ partial class Dump
|
||||
}
|
||||
}
|
||||
|
||||
_dumpLog.WriteLine(Localization.Core.Reading_Disc_Information);
|
||||
UpdateStatus?.Invoke(Localization.Core.Reading_Disc_Information);
|
||||
|
||||
sense = _dev.ReadDiscInformation(out cmdBuf,
|
||||
@@ -105,7 +103,6 @@ partial class Dump
|
||||
}
|
||||
}
|
||||
|
||||
_dumpLog.WriteLine(Localization.Core.Reading_PMA);
|
||||
UpdateStatus?.Invoke(Localization.Core.Reading_PMA);
|
||||
sense = _dev.ReadPma(out cmdBuf, out _, _dev.Timeout, out _);
|
||||
|
||||
@@ -117,7 +114,6 @@ partial class Dump
|
||||
_mediaGraph?.PaintRecordableInformationGood();
|
||||
}
|
||||
|
||||
_dumpLog.WriteLine(Localization.Core.Reading_Session_Information);
|
||||
UpdateStatus?.Invoke(Localization.Core.Reading_Session_Information);
|
||||
sense = _dev.ReadSessionInfo(out cmdBuf, out _, _dev.Timeout, out _);
|
||||
|
||||
@@ -132,7 +128,6 @@ partial class Dump
|
||||
}
|
||||
}
|
||||
|
||||
_dumpLog.WriteLine(Localization.Core.Reading_CD_Text_from_Lead_In);
|
||||
UpdateStatus?.Invoke(Localization.Core.Reading_CD_Text_from_Lead_In);
|
||||
sense = _dev.ReadCdText(out cmdBuf, out _, _dev.Timeout, out _);
|
||||
|
||||
|
||||
@@ -40,7 +40,6 @@ using System.Linq;
|
||||
using Aaru.CommonTypes;
|
||||
using Aaru.CommonTypes.Enums;
|
||||
using Aaru.CommonTypes.Structs;
|
||||
using Aaru.Core.Logging;
|
||||
using Aaru.Decoders.CD;
|
||||
using Aaru.Devices;
|
||||
|
||||
@@ -60,9 +59,9 @@ partial class Dump
|
||||
/// <param name="trackFlags">Track flags</param>
|
||||
/// <param name="updateStatus">Update status handler</param>
|
||||
/// <returns>List of tracks</returns>
|
||||
public static Track[] GetCdTracks(Device dev, DumpLog dumpLog, bool force, out long lastSector,
|
||||
Dictionary<int, long> leadOutStarts, Dictionary<MediaTagType, byte[]> mediaTags,
|
||||
ErrorMessageHandler stoppingErrorMessage, out FullTOC.CDFullTOC? toc,
|
||||
public static Track[] GetCdTracks(Device dev, bool force, out long lastSector, Dictionary<int, long> leadOutStarts,
|
||||
Dictionary<MediaTagType, byte[]> mediaTags,
|
||||
ErrorMessageHandler stoppingErrorMessage, out FullTOC.CDFullTOC? toc,
|
||||
Dictionary<byte, byte> trackFlags, UpdateStatusHandler updateStatus)
|
||||
{
|
||||
byte[] cmdBuf; // Data buffer
|
||||
@@ -76,7 +75,6 @@ partial class Dump
|
||||
|
||||
// We discarded all discs that falsify a TOC before requesting a real TOC
|
||||
// No TOC, no CD (or an empty one)
|
||||
dumpLog?.WriteLine(Localization.Core.Reading_full_TOC);
|
||||
updateStatus?.Invoke(Localization.Core.Reading_full_TOC);
|
||||
sense = dev.ReadRawToc(out cmdBuf, out _, 0, dev.Timeout, out _);
|
||||
|
||||
@@ -93,7 +91,6 @@ partial class Dump
|
||||
}
|
||||
|
||||
updateStatus?.Invoke(Localization.Core.Building_track_map);
|
||||
dumpLog?.WriteLine(Localization.Core.Building_track_map);
|
||||
|
||||
if(toc.HasValue)
|
||||
{
|
||||
@@ -179,16 +176,12 @@ partial class Dump
|
||||
else
|
||||
{
|
||||
updateStatus?.Invoke(Localization.Core.Cannot_read_RAW_TOC_requesting_processed_one);
|
||||
dumpLog?.WriteLine(Localization.Core.Cannot_read_RAW_TOC_requesting_processed_one);
|
||||
sense = dev.ReadToc(out cmdBuf, out _, false, 0, dev.Timeout, out _);
|
||||
|
||||
TOC.CDTOC? oldToc = TOC.Decode(cmdBuf);
|
||||
|
||||
if((sense || !oldToc.HasValue) && !force)
|
||||
{
|
||||
dumpLog?.WriteLine(Localization.Core
|
||||
.Could_not_read_TOC_if_you_want_to_continue_use_force_and_will_try_from_LBA_0_to_360000);
|
||||
|
||||
stoppingErrorMessage?.Invoke(Localization.Core
|
||||
.Could_not_read_TOC_if_you_want_to_continue_use_force_and_will_try_from_LBA_0_to_360000);
|
||||
|
||||
@@ -237,7 +230,6 @@ partial class Dump
|
||||
if(trackList.Count == 0)
|
||||
{
|
||||
updateStatus?.Invoke(Localization.Core.No_tracks_found_adding_a_single_track_from_zero_to_Lead_Out);
|
||||
dumpLog?.WriteLine(Localization.Core.No_tracks_found_adding_a_single_track_from_zero_to_Lead_Out);
|
||||
|
||||
trackList.Add(new Track
|
||||
{
|
||||
@@ -258,7 +250,7 @@ partial class Dump
|
||||
|
||||
if(!sense)
|
||||
{
|
||||
var temp = new byte[8];
|
||||
byte[] temp = new byte[8];
|
||||
|
||||
Array.Copy(cmdBuf, 0, temp, 0, 8);
|
||||
Array.Reverse(temp);
|
||||
@@ -278,14 +270,12 @@ partial class Dump
|
||||
stoppingErrorMessage?.Invoke(Localization.Core
|
||||
.Could_not_find_Lead_Out_if_you_want_to_continue_use_force_option);
|
||||
|
||||
dumpLog?.WriteLine(Localization.Core.Could_not_find_Lead_Out_if_you_want_to_continue_use_force_option);
|
||||
|
||||
return null;
|
||||
}
|
||||
|
||||
updateStatus?.Invoke(Localization.Core.WARNING_Could_not_find_Lead_Out_start_will_try_to_read_up_to);
|
||||
|
||||
dumpLog?.WriteLine(Localization.Core.WARNING_Could_not_find_Lead_Out_start_will_try_to_read_up_to);
|
||||
lastSector = 360000;
|
||||
|
||||
return trackList.ToArray();
|
||||
|
||||
@@ -84,7 +84,7 @@ partial class Dump
|
||||
Dictionary<byte, string> isrcs, ref string mcn, HashSet<int> subchannelExtents,
|
||||
Dictionary<byte, int> smallestPregapLbaPerTrack)
|
||||
{
|
||||
var sense = true; // Sense indicator
|
||||
bool sense = true; // Sense indicator
|
||||
byte[] cmdBuf = null; // Data buffer
|
||||
double cmdDuration = 0; // Command execution time
|
||||
const uint sectorSize = 2352; // Full sector size
|
||||
@@ -103,14 +103,13 @@ partial class Dump
|
||||
if(_resume.BadBlocks.Count <= 0 || _aborted || !_trim || !newTrim) return;
|
||||
|
||||
UpdateStatus?.Invoke(Localization.Core.Trimming_skipped_sectors);
|
||||
_dumpLog.WriteLine(Localization.Core.Trimming_skipped_sectors);
|
||||
InitProgress?.Invoke();
|
||||
_trimStopwatch.Restart();
|
||||
|
||||
trimStart:
|
||||
ulong[] tmpArray = _resume.BadBlocks.ToArray();
|
||||
|
||||
for(var b = 0; b < tmpArray.Length; b++)
|
||||
for(int b = 0; b < tmpArray.Length; b++)
|
||||
{
|
||||
ulong badSector = tmpArray[b];
|
||||
|
||||
@@ -118,7 +117,6 @@ partial class Dump
|
||||
{
|
||||
currentTry.Extents = ExtentsConverter.ToMetadata(extents);
|
||||
UpdateStatus?.Invoke(Localization.Core.Aborted);
|
||||
_dumpLog.WriteLine(Localization.Core.Aborted);
|
||||
|
||||
break;
|
||||
}
|
||||
@@ -128,7 +126,7 @@ partial class Dump
|
||||
Track track = tracks.OrderBy(t => t.StartSector).LastOrDefault(t => badSector >= t.StartSector);
|
||||
|
||||
byte sectorsToTrim = 1;
|
||||
var badSectorToRead = (uint)badSector;
|
||||
uint badSectorToRead = (uint)badSector;
|
||||
|
||||
if(_fixOffset && audioExtents.Contains(badSector) && offsetBytes != 0)
|
||||
{
|
||||
@@ -292,7 +290,7 @@ partial class Dump
|
||||
{
|
||||
case 0:
|
||||
|
||||
for(var c = 16; c < 2352; c++)
|
||||
for(int c = 16; c < 2352; c++)
|
||||
{
|
||||
if(cmdBuf[c] == 0x00) continue;
|
||||
|
||||
@@ -419,8 +417,8 @@ partial class Dump
|
||||
|
||||
if(supportedSubchannel != MmcSubchannel.None)
|
||||
{
|
||||
var data = new byte[sectorSize];
|
||||
var sub = new byte[subSize];
|
||||
byte[] data = new byte[sectorSize];
|
||||
byte[] sub = new byte[subSize];
|
||||
Array.Copy(cmdBuf, 0, data, 0, sectorSize);
|
||||
Array.Copy(cmdBuf, sectorSize, sub, 0, subSize);
|
||||
|
||||
@@ -446,7 +444,6 @@ partial class Dump
|
||||
outputOptical,
|
||||
_fixSubchannel,
|
||||
_fixSubchannelCrc,
|
||||
_dumpLog,
|
||||
UpdateStatus,
|
||||
smallestPregapLbaPerTrack,
|
||||
true,
|
||||
@@ -480,8 +477,5 @@ partial class Dump
|
||||
|
||||
UpdateStatus?.Invoke(string.Format(Localization.Core.Trimming_finished_in_0,
|
||||
_trimStopwatch.Elapsed.Humanize(minUnit: TimeUnit.Second)));
|
||||
|
||||
_dumpLog.WriteLine(string.Format(Localization.Core.Trimming_finished_in_0,
|
||||
_trimStopwatch.Elapsed.Humanize(minUnit: TimeUnit.Second)));
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user