Use Aaru Metadata instead of CICM Metadata.

This commit is contained in:
2022-12-15 22:21:07 +00:00
parent 031f871a2d
commit cfbcde35f5
346 changed files with 11377 additions and 8653 deletions

View File

@@ -37,13 +37,13 @@
using System;
using System.Collections.Generic;
using System.Linq;
using Aaru.CommonTypes.AaruMetadata;
using Aaru.CommonTypes.Extents;
using Aaru.CommonTypes.Interfaces;
using Aaru.CommonTypes.Structs;
using Aaru.Core.Logging;
using Aaru.Decoders.CD;
using Aaru.Devices;
using Schemas;
using Track = Aaru.CommonTypes.Structs.Track;
namespace Aaru.Core.Devices.Dumping;
@@ -146,7 +146,7 @@ partial class Dump
/// <param name="mcn">Disc media catalogue number</param>
/// <param name="subchannelExtents">List of subchannels not yet dumped correctly</param>
/// <param name="smallestPregapLbaPerTrack">List of smallest pregap relative address per track</param>
void ReadCdiReady(uint blockSize, ref double currentSpeed, DumpHardwareType currentTry, ExtentsULong extents,
void ReadCdiReady(uint blockSize, ref double currentSpeed, DumpHardware currentTry, ExtentsULong extents,
IbgLog ibgLog, ref double imageWriteDuration, ExtentsULong leadOutExtents, ref double maxSpeed,
MhddLog mhddLog, ref double minSpeed, uint subSize, MmcSubchannel supportedSubchannel,
ref double totalDuration, Track[] tracks, SubchannelLog subLog, MmcSubchannel desiredSubchannel,
@@ -242,7 +242,7 @@ partial class Dump
if(!sense &&
!_dev.Error)
{
mhddLog.Write(i + r, cmdDuration, 1);
mhddLog.Write(i + r, cmdDuration);
ibgLog.Write(i + r, currentSpeed * 1024);
extents.Add(i + r, 1, true);
DateTime writeStart = DateTime.Now;
@@ -324,7 +324,7 @@ partial class Dump
FixOffsetData(offsetBytes, sectorSize, sectorsForOffset, supportedSubchannel, ref blocksToRead,
subSize, ref cmdBuf, blockSize, false);
mhddLog.Write(i, cmdDuration, 1);
mhddLog.Write(i, cmdDuration);
ibgLog.Write(i, currentSpeed * 1024);
extents.Add(i, blocksToRead, true);
DateTime writeStart = DateTime.Now;

View File

@@ -38,16 +38,16 @@ using System;
using System.Collections.Generic;
using System.IO;
using System.Linq;
using Aaru.CommonTypes.AaruMetadata;
using Aaru.CommonTypes.Enums;
using Aaru.CommonTypes.Extents;
using Aaru.CommonTypes.Interfaces;
using Aaru.CommonTypes.Structs;
using Aaru.Console;
using Aaru.Core.Logging;
using Aaru.Decoders.CD;
using Aaru.Decoders.SCSI;
using Aaru.Devices;
using Schemas;
using Track = Aaru.CommonTypes.Structs.Track;
using TrackType = Aaru.CommonTypes.Enums.TrackType;
namespace Aaru.Core.Devices.Dumping;
@@ -89,7 +89,7 @@ partial class Dump
/// <param name="subchannelExtents">List of subchannels not yet dumped correctly</param>
/// <param name="smallestPregapLbaPerTrack">List of smallest pregap relative address per track</param>
void ReadCdData(ExtentsULong audioExtents, ulong blocks, uint blockSize, ref double currentSpeed,
DumpHardwareType currentTry, ExtentsULong extents, IbgLog ibgLog, ref double imageWriteDuration,
DumpHardware currentTry, ExtentsULong extents, IbgLog ibgLog, ref double imageWriteDuration,
long lastSector, ExtentsULong leadOutExtents, ref double maxSpeed, MhddLog mhddLog,
ref double minSpeed, out bool newTrim, bool nextData, int offsetBytes, bool read6, bool read10,
bool read12, bool read16, bool readcd, int sectorsForOffset, uint subSize,
@@ -476,7 +476,7 @@ partial class Dump
if(!sense &&
!_dev.Error)
{
mhddLog.Write(i + r, cmdDuration, 1);
mhddLog.Write(i + r, cmdDuration);
ibgLog.Write(i + r, currentSpeed * 1024);
extents.Add(i + r, 1, true);
DateTime writeStart = DateTime.Now;
@@ -596,7 +596,7 @@ partial class Dump
AaruConsole.DebugWriteLine("Dump-Media", Localization.Core.READ_error_0,
Sense.PrettifySense(senseBuf));
mhddLog.Write(i + r, cmdDuration < 500 ? 65535 : cmdDuration, 1);
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);

View File

@@ -39,10 +39,10 @@ using System.Collections.Generic;
using System.Linq;
using System.Text;
using Aaru.CommonTypes;
using Aaru.CommonTypes.AaruMetadata;
using Aaru.CommonTypes.Enums;
using Aaru.CommonTypes.Extents;
using Aaru.CommonTypes.Interfaces;
using Aaru.CommonTypes.Structs;
using Aaru.Console;
using Aaru.Core.Graphics;
using Aaru.Core.Logging;
@@ -50,7 +50,7 @@ using Aaru.Core.Media.Detection;
using Aaru.Database.Models;
using Aaru.Decoders.CD;
using Aaru.Devices;
using Schemas;
using Track = Aaru.CommonTypes.Structs.Track;
using TrackType = Aaru.CommonTypes.Enums.TrackType;
using Version = Aaru.CommonTypes.Interop.Version;
@@ -69,7 +69,7 @@ sealed partial class Dump
uint blockSize; // Size of the read sector in bytes
CdOffset cdOffset; // Read offset from database
byte[] cmdBuf; // Data buffer
DumpHardwareType currentTry = null; // Current dump hardware try
DumpHardware currentTry = null; // Current dump hardware try
double currentSpeed = 0; // Current read speed
int? discOffset = null; // Disc write offset
DateTime dumpStart = DateTime.UtcNow; // Time of dump start
@@ -1380,14 +1380,14 @@ sealed partial class Dump
ApplicationVersion = Version.GetVersion()
};
if(!outputOptical.SetMetadata(metadata))
if(!outputOptical.SetImageInfo(metadata))
ErrorMessage?.Invoke(Localization.Core.Error_0_setting_metadata + Environment.NewLine +
outputOptical.ErrorMessage);
outputOptical.SetDumpHardware(_resume.Tries);
if(_preSidecar != null)
outputOptical.SetCicmMetadata(_preSidecar);
outputOptical.SetMetadata(_preSidecar);
foreach(KeyValuePair<byte, string> isrc in isrcs)
{

View File

@@ -37,16 +37,16 @@
using System;
using System.Collections.Generic;
using System.Linq;
using Aaru.CommonTypes.AaruMetadata;
using Aaru.CommonTypes.Extents;
using Aaru.CommonTypes.Interfaces;
using Aaru.CommonTypes.Structs;
using Aaru.CommonTypes.Structs.Devices.SCSI;
using Aaru.Console;
using Aaru.Core.Logging;
using Aaru.Decoders.CD;
using Aaru.Decoders.SCSI;
using Aaru.Devices;
using Schemas;
using Track = Aaru.CommonTypes.Structs.Track;
using TrackType = Aaru.CommonTypes.Enums.TrackType;
namespace Aaru.Core.Devices.Dumping;
@@ -72,7 +72,7 @@ partial class Dump
/// <param name="mcn">Disc media catalogue number</param>
/// <param name="subchannelExtents">List of subchannels not yet dumped correctly</param>
/// <param name="smallestPregapLbaPerTrack">List of smallest pregap relative address per track</param>
void RetryCdUserData(ExtentsULong audioExtents, uint blockSize, DumpHardwareType currentTry, ExtentsULong extents,
void RetryCdUserData(ExtentsULong audioExtents, uint blockSize, DumpHardware currentTry, ExtentsULong extents,
int offsetBytes, bool readcd, int sectorsForOffset, uint subSize,
MmcSubchannel supportedSubchannel, ref double totalDuration, SubchannelLog subLog,
MmcSubchannel desiredSubchannel, Track[] tracks, Dictionary<byte, string> isrcs,

View File

@@ -38,13 +38,13 @@ using System;
using System.Collections.Generic;
using System.Diagnostics.CodeAnalysis;
using System.Linq;
using Aaru.CommonTypes.AaruMetadata;
using Aaru.CommonTypes.Enums;
using Aaru.CommonTypes.Extents;
using Aaru.CommonTypes.Interfaces;
using Aaru.CommonTypes.Structs;
using Aaru.Core.Logging;
using Aaru.Devices;
using Schemas;
using Track = Aaru.CommonTypes.Structs.Track;
namespace Aaru.Core.Devices.Dumping;
@@ -79,7 +79,7 @@ partial class Dump
// TODO: Use it
[SuppressMessage("ReSharper", "UnusedMember.Local")]
void DumpCdLeadOuts(uint blockSize, ref double currentSpeed, DumpHardwareType currentTry, ExtentsULong extents,
void DumpCdLeadOuts(uint blockSize, ref double currentSpeed, DumpHardware currentTry, ExtentsULong extents,
IbgLog ibgLog, ref double imageWriteDuration, ExtentsULong leadOutExtents, ref double maxSpeed,
MhddLog mhddLog, ref double minSpeed, bool read6, bool read10, bool read12, bool read16,
bool readcd, MmcSubchannel supportedSubchannel, uint subSize, ref double totalDuration,
@@ -145,7 +145,7 @@ partial class Dump
if(!sense &&
!_dev.Error)
{
mhddLog.Write(i, cmdDuration, 1);
mhddLog.Write(i, cmdDuration);
ibgLog.Write(i, currentSpeed * 1024);
extents.Add(i, _maximumReadable, true);
leadOutExtents.Remove(i);
@@ -252,7 +252,7 @@ partial class Dump
// TODO: Use it
[SuppressMessage("ReSharper", "UnusedMember.Local")]
void RetryCdLeadOuts(uint blockSize, ref double currentSpeed, DumpHardwareType currentTry, ExtentsULong extents,
void RetryCdLeadOuts(uint blockSize, ref double currentSpeed, DumpHardware currentTry, ExtentsULong extents,
IbgLog ibgLog, ref double imageWriteDuration, ExtentsULong leadOutExtents, ref double maxSpeed,
MhddLog mhddLog, ref double minSpeed, bool read6, bool read10, bool read12, bool read16,
bool readcd, MmcSubchannel supportedSubchannel, uint subSize, ref double totalDuration,
@@ -380,7 +380,7 @@ partial class Dump
imageWriteDuration += (DateTime.Now - writeStart).TotalSeconds;
mhddLog.Write(i, cmdDuration < 500 ? 65535 : cmdDuration, 1);
mhddLog.Write(i, cmdDuration < 500 ? 65535 : cmdDuration);
ibgLog.Write(i, 0);
}

View File

@@ -37,14 +37,14 @@
using System;
using System.Collections.Generic;
using System.Linq;
using Aaru.CommonTypes.AaruMetadata;
using Aaru.CommonTypes.Extents;
using Aaru.CommonTypes.Interfaces;
using Aaru.CommonTypes.Structs;
using Aaru.Core.Logging;
using Aaru.Decoders.CD;
using Aaru.Decoders.SCSI;
using Aaru.Devices;
using Schemas;
using Track = Aaru.CommonTypes.Structs.Track;
namespace Aaru.Core.Devices.Dumping;
@@ -74,7 +74,7 @@ partial class Dump
/// <param name="mcn">Disc media catalogue number</param>
/// <param name="subchannelExtents">List of subchannels not yet dumped correctly</param>
/// <param name="smallestPregapLbaPerTrack">List of smallest pregap relative address per track</param>
void TrimCdUserData(ExtentsULong audioExtents, uint blockSize, DumpHardwareType currentTry, ExtentsULong extents,
void TrimCdUserData(ExtentsULong audioExtents, uint blockSize, DumpHardware currentTry, ExtentsULong extents,
bool newTrim, int offsetBytes, bool read6, bool read10, bool read12, bool read16, bool readcd,
int sectorsForOffset, uint subSize, MmcSubchannel supportedSubchannel, bool supportsLongSectors,
ref double totalDuration, SubchannelLog subLog, MmcSubchannel desiredSubchannel, Track[] tracks,