From ac71520e69e4c3ff1373b76b64da6d338646ebc9 Mon Sep 17 00:00:00 2001 From: Natalia Portillo Date: Sat, 23 Aug 2025 00:13:52 +0100 Subject: [PATCH] Humanize settings. --- Aaru.CommonTypes/Enums/Images.cs | 5 + Aaru.CommonTypes/MediaType.cs | 499 ++++++++++++++---- Aaru.Core/Devices/Dumping/CompactDisc/Dump.cs | 12 +- .../Devices/Dumping/LinearMemory/Retrode.cs | 2 +- Aaru.Core/Devices/Dumping/MiniDisc.cs | 2 +- .../Dumping/PlayStationPortable/UMD.cs | 2 +- Aaru.Core/Devices/Dumping/SSC.cs | 12 +- Aaru.Core/Devices/Dumping/Sbc/Dump.cs | 2 +- Aaru.Core/ImageInfo.cs | 4 +- Aaru.Images/Aaru.Images.csproj | 1 + Aaru.Images/AaruFormat/Read.cs | 396 ++++++-------- Aaru.Images/AaruFormat/Write.cs | 493 ++++++++--------- Aaru.Images/Alcohol120/Read.cs | 146 ++--- Aaru.Images/BlindWrite4/Read.cs | 8 +- Aaru.Images/BlindWrite5/Read.cs | 3 +- Aaru.Images/CDRWin/Properties.cs | 2 +- Aaru.Images/CloneCD/Read.cs | 48 +- Aaru.Images/DiscJuggler/Read.cs | 21 +- Aaru.Images/GDI/Read.cs | 62 +-- Aaru/Commands/Device/Info.cs | 2 +- Aaru/Commands/Media/Info.cs | 5 +- 21 files changed, 962 insertions(+), 765 deletions(-) diff --git a/Aaru.CommonTypes/Enums/Images.cs b/Aaru.CommonTypes/Enums/Images.cs index f29756966..88e9987c6 100644 --- a/Aaru.CommonTypes/Enums/Images.cs +++ b/Aaru.CommonTypes/Enums/Images.cs @@ -40,6 +40,7 @@ // ReSharper disable UnusedMember.Global using System; +using System.ComponentModel; using System.Diagnostics.CodeAnalysis; namespace Aaru.CommonTypes.Enums; @@ -52,12 +53,16 @@ public enum TrackType : byte /// Data track (not any of the below defined ones) Data = 1, /// Data track, compact disc mode 1 + [Description("MODE 1")] CdMode1 = 2, /// Data track, compact disc mode 2, formless + [Description("MODE 2 (Formless)")] CdMode2Formless = 3, /// Data track, compact disc mode 2, form 1 + [Description("MODE 2 FORM 1")] CdMode2Form1 = 4, /// Data track, compact disc mode 2, form 2 + [Description("MODE 2 FORM 2")] CdMode2Form2 = 5 } diff --git a/Aaru.CommonTypes/MediaType.cs b/Aaru.CommonTypes/MediaType.cs index 3957cb013..29557dced 100644 --- a/Aaru.CommonTypes/MediaType.cs +++ b/Aaru.CommonTypes/MediaType.cs @@ -40,6 +40,7 @@ // TODO: Rename contents using System; +using System.ComponentModel; #pragma warning disable 1591 @@ -66,16 +67,20 @@ public enum MediaType : uint /// Unknown disk type Unknown = 0, /// Unknown magneto-optical + [Description("Unknown magneto-optical")] UnknownMO = 1, /// Generic hard disk + [Description("Generic hard disk")] GENERIC_HDD = 2, /// Microdrive type hard disk Microdrive = 3, /// Zoned hard disk + [Description("Zoned hard disk")] Zone_HDD = 4, /// USB flash drives FlashDrive = 5, /// Unknown data tape + [Description("Unknown data tape")] UnknownTape = 6, #endregion Generics, types 0 to 9 @@ -85,56 +90,81 @@ public enum MediaType : uint /// Any unknown or standard violating CD CD = 10, /// CD Digital Audio (Red Book) + [Description("CD-DA")] CDDA = 11, /// CD+G (Red Book) + [Description("CD+G")] CDG = 12, /// CD+EG (Red Book) + [Description("CD+EG")] CDEG = 13, /// CD-i (Green Book) + [Description("CD-i")] CDI = 14, /// CD-ROM (Yellow Book) + [Description("CD-ROM")] CDROM = 15, /// CD-ROM XA (Yellow Book) + [Description("CD-ROM XA")] CDROMXA = 16, /// CD+ (Blue Book) + [Description("CD+")] CDPLUS = 17, /// CD-MO (Orange Book) + [Description("CD-MO")] CDMO = 18, /// CD-Recordable (Orange Book) + [Description("CD-R")] CDR = 19, /// CD-ReWritable (Orange Book) + [Description("CD-RW")] CDRW = 20, /// Mount-Rainier CD-RW + [Description("CD-MRW")] CDMRW = 21, /// Video CD (White Book) + [Description("Video CD")] VCD = 22, /// Super Video CD (White Book) + [Description("Super Video CD")] SVCD = 23, /// Photo CD (Beige Book) + [Description("Photo CD")] PCD = 24, /// Super Audio CD (Scarlet Book) + [Description("Super Audio CD")] SACD = 25, /// Double-Density CD-ROM (Purple Book) + [Description("DDCD-ROM")] DDCD = 26, /// DD CD-R (Purple Book) + [Description("DDCD-R")] DDCDR = 27, /// DD CD-RW (Purple Book) + [Description("DDCD-RW")] DDCDRW = 28, /// DTS audio CD (non-standard) + [Description("DTS CD")] DTSCD = 29, /// CD-MIDI (Red Book) + [Description("CD-MIDI")] CDMIDI = 30, /// CD-Video (ISO/IEC 61104) + [Description("CD-Video")] CDV = 31, /// 120mm, Phase-Change, 1298496 sectors, 512 bytes/sector, PD650, ECMA-240, ISO 15485 + [Description("PD-650")] PD650 = 32, /// 120mm, Write-Once, 1281856 sectors, 512 bytes/sector, PD650, ECMA-240, ISO 15485 + [Description("PD-650 (WORM)")] PD650_WORM = 33, /// /// CD-i Ready, contains a track before the first TOC track, in mode 2, and all TOC tracks are Audio. Subchannel /// marks track as audio pause. /// + [Description("CD-i Ready")] CDIREADY = 34, + [Description("FM-Towns")] FMTOWNS = 35, #endregion Somewhat standard Compact Disc formats, types 10 to 39 @@ -142,26 +172,37 @@ public enum MediaType : uint #region Standard DVD formats, types 40 to 50 /// DVD-ROM (applies to DVD Video and DVD Audio) + [Description("DVD-ROM")] DVDROM = 40, /// DVD-R + [Description("DVD-R")] DVDR = 41, /// DVD-RW + [Description("DVD-RW")] DVDRW = 42, /// DVD+R + [Description("DVD+R")] DVDPR = 43, /// DVD+RW + [Description("DVD+RW")] DVDPRW = 44, /// DVD+RW DL + [Description("DVD+RW DL")] DVDPRWDL = 45, /// DVD-R DL + [Description("DVD-R DL")] DVDRDL = 46, /// DVD+R DL + [Description("DVD+R DL")] DVDPRDL = 47, /// DVD-RAM + [Description("DVD-RAM")] DVDRAM = 48, /// DVD-RW DL + [Description("DVD-RW DL")] DVDRWDL = 49, /// DVD-Download + [Description("DVD-Download")] DVDDownload = 50, #endregion Standard DVD formats, types 40 to 50 @@ -169,16 +210,22 @@ public enum MediaType : uint #region Standard HD-DVD formats, types 51 to 59 /// HD DVD-ROM (applies to HD DVD Video) + [Description("HD DVD-ROM")] HDDVDROM = 51, /// HD DVD-RAM + [Description("HD DVD-RAM")] HDDVDRAM = 52, /// HD DVD-R + [Description("HD DVD-R")] HDDVDR = 53, /// HD DVD-RW + [Description("HD DVD-RW")] HDDVDRW = 54, /// HD DVD-R DL + [Description("HD DVD-R DL")] HDDVDRDL = 55, /// HD DVD-RW DL + [Description("HD DVD-RW DL")] HDDVDRWDL = 56, #endregion Standard HD-DVD formats, types 51 to 59 @@ -186,16 +233,22 @@ public enum MediaType : uint #region Standard Blu-ray formats, types 60 to 69 /// BD-ROM (and BD Video) + [Description("BD-ROM")] BDROM = 60, /// BD-R + [Description("BD-R")] BDR = 61, /// BD-RE + [Description("BD-RE")] BDRE = 62, /// BD-R XL + [Description("BD-R XL")] BDRXL = 63, /// BD-RE XL + [Description("BD-RE XL")] BDREXL = 64, /// Ultra HD Blu-ray + [Description("Ultra HD Blu-ray")] UHDBD = 65, #endregion Standard Blu-ray formats, types 60 to 69 @@ -226,8 +279,10 @@ public enum MediaType : uint #region LaserDisc based, types 80 to 89 /// Pioneer LaserDisc + [Description("LaserDisc")] LD = 80, /// Pioneer LaserDisc data + [Description("LD-ROM")] LDROM = 81, LDROM2 = 82, LVROM = 83, @@ -240,18 +295,25 @@ public enum MediaType : uint #region MiniDisc based, types 90 to 99 /// Sony Hi-MD + [Description("Hi-MD")] HiMD = 90, /// Sony MiniDisc + [Description("MiniDisc")] MD = 91, /// Sony MD-Data + [Description("MD-Data")] MDData = 92, /// Sony MD-Data2 + [Description("MD-Data2")] MDData2 = 93, /// Sony MiniDisc, 60 minutes, formatted with Hi-MD format + [Description("MiniDisc (60 minutes, Hi-MD format)")] MD60 = 94, /// Sony MiniDisc, 74 minutes, formatted with Hi-MD format + [Description("MiniDisc (74 minutes, Hi-MD format")] MD74 = 95, /// Sony MiniDisc, 80 minutes, formatted with Hi-MD format + [Description("MiniDisc (80 minutes, Hi-MD format)")] MD80 = 96, #endregion MiniDisc based, types 90 to 99 @@ -259,34 +321,48 @@ public enum MediaType : uint #region Plasmon UDO, types 100 to 109 /// 5.25", Phase-Change, 1834348 sectors, 8192 bytes/sector, Ultra Density Optical, ECMA-350, ISO 17345 + [Description("UDO")] UDO = 100, /// 5.25", Phase-Change, 3669724 sectors, 8192 bytes/sector, Ultra Density Optical 2, ECMA-380, ISO 11976 + [Description("UDO 2")] UDO2 = 101, /// 5.25", Write-Once, 3668759 sectors, 8192 bytes/sector, Ultra Density Optical 2, ECMA-380, ISO 11976 + [Description("UDO 2 (WORM)")] UDO2_WORM = 102, #endregion Plasmon UDO, types 100 to 109 #region Sony game media, types 110 to 129 - PlayStationMemoryCard = 110, + [Description("PlayStation Memory Card")] + PlayStationMemoryCard = 110, + [Description("PlayStation 2 Memory Card")] PlayStationMemoryCard2 = 111, /// Sony PlayStation game CD + [Description("PlayStation game")] PS1CD = 112, /// Sony PlayStation 2 game CD + [Description("PlayStation 2 game CD")] PS2CD = 113, /// Sony PlayStation 2 game DVD + [Description("PlayStation 2 game DVD")] PS2DVD = 114, /// Sony PlayStation 3 game DVD + [Description("PlayStation 3 game DVD")] PS3DVD = 115, /// Sony PlayStation 3 game Blu-ray + [Description("PlayStation 3 game Blu-ray")] PS3BD = 116, /// Sony PlayStation 4 game Blu-ray + [Description("PlayStation 4 game")] PS4BD = 117, /// Sony PlayStation Portable Universal Media Disc (ECMA-365) + [Description("PlayStation Portable UMD")] UMD = 118, + [Description("PlayStation Vita game card")] PlayStationVitaGameCard = 119, /// Sony PlayStation 5 game Ultra HD Blu-ray + [Description("PlayStation 5 game")] PS5BD = 120, #endregion Sony game media, types 110 to 129 @@ -294,12 +370,16 @@ public enum MediaType : uint #region Microsoft game media, types 130 to 149 /// Microsoft X-box Game Disc + [Description("X-box Game Disc")] XGD = 130, /// Microsoft X-box 360 Game Disc + [Description("X-box 360 Game Disc")] XGD2 = 131, /// Microsoft X-box 360 Game Disc + [Description("X-box 360 Game Disc (XGD3)")] XGD3 = 132, /// Microsoft X-box One Game Disc + [Description("X-box One/Series Game Disc")] XGD4 = 133, #endregion Microsoft game media, types 130 to 149 @@ -307,45 +387,67 @@ public enum MediaType : uint #region Sega game media, types 150 to 169 /// Sega MegaCD + [Description("Sega Mega CD game")] MEGACD = 150, /// Sega Saturn disc + [Description("Sega Saturn game")] SATURNCD = 151, /// Sega/Yamaha Gigabyte Disc + [Description("Sega/Yamaha Gigabyte disc")] GDROM = 152, /// Sega/Yamaha recordable Gigabyte Disc + [Description("Sega/Yamaha recordable Gigabyte disc")] GDR = 153, - SegaCard = 154, - MilCD = 155, - MegaDriveCartridge = 156, - _32XCartridge = 157, - SegaPicoCartridge = 158, + [Description("Sega card")] + SegaCard = 154, + [Description("MilCD")] + MilCD = 155, + [Description("Sega Genesis / Mega Drive cartridge")] + MegaDriveCartridge = 156, + [Description("Sega 32X cartridge")] + _32XCartridge = 157, + [Description("Sega Pico cartridge")] + SegaPicoCartridge = 158, + [Description("Sega Master System cartridge")] MasterSystemCartridge = 159, - GameGearCartridge = 160, - SegaSaturnCartridge = 161, + [Description("Sega Game Gear cartridge")] + GameGearCartridge = 160, + [Description("Sega Saturn cartridge")] + SegaSaturnCartridge = 161, #endregion Sega game media, types 150 to 169 #region Other game media, types 170 to 179 /// PC-Engine / TurboGrafx cartridge + [Description("HuCard")] HuCard = 170, /// PC-Engine / TurboGrafx CD + [Description("Super CD-ROM²")] SuperCDROM2 = 171, /// Atari Jaguar CD + [Description("Atari Jaguar CD")] JaguarCD = 172, /// 3DO CD + [Description("3DO game")] ThreeDO = 173, /// NEC PC-FX + [Description("PC-FX game")] PCFX = 174, /// NEO-GEO CD + [Description("NeoGeo CD game")] NeoGeoCD = 175, /// Commodore CDTV + [Description("Commodore CDTV disc")] CDTV = 176, /// Amiga CD32 + [Description("Amiga CD32 game")] CD32 = 177, /// Nuon (DVD based videogame console) + [Description("Nuon game")] Nuon = 178, /// Bandai Playdia + [Description("Playdia game")] Playdia = 179, #endregion Other game media, types 170 to 179 @@ -353,18 +455,25 @@ public enum MediaType : uint #region Apple standard floppy format, types 180 to 189 /// 5.25", SS, DD, 35 tracks, 13 spt, 256 bytes/sector, GCR + [Description("Apple DOS 3.2 single-sided floppy")] Apple32SS = 180, /// 5.25", DS, DD, 35 tracks, 13 spt, 256 bytes/sector, GCR + [Description("Apple DOS 3.2 double-sided floppy")] Apple32DS = 181, /// 5.25", SS, DD, 35 tracks, 16 spt, 256 bytes/sector, GCR + [Description("Apple DOS 3.3 single-sided floppy")] Apple33SS = 182, /// 5.25", DS, DD, 35 tracks, 16 spt, 256 bytes/sector, GCR + [Description("Apple DOS 3.3 double-sided floppy")] Apple33DS = 183, /// 3.5", SS, DD, 80 tracks, 8 to 12 spt, 512 bytes/sector, GCR + [Description("Apple Sony single-sided floppy")] AppleSonySS = 184, /// 3.5", DS, DD, 80 tracks, 8 to 12 spt, 512 bytes/sector, GCR + [Description("Apple Sony double-sided floppy")] AppleSonyDS = 185, /// 5.25", DS, ?D, ?? tracks, ?? spt, 512 bytes/sector, GCR, opposite side heads, aka Twiggy + [Description("Apple FileWare floppy")] AppleFileWare = 186, #endregion Apple standard floppy format @@ -372,40 +481,55 @@ public enum MediaType : uint #region IBM/Microsoft PC floppy formats, types 190 to 209 /// 5.25", SS, DD, 40 tracks, 8 spt, 512 bytes/sector, MFM + [Description("IBM PC 5.25\" single-sided floppy (8 sectors)")] DOS_525_SS_DD_8 = 190, /// 5.25", SS, DD, 40 tracks, 9 spt, 512 bytes/sector, MFM + [Description("IBM PC 5.25\" single-sided floppy (9 sectors)")] DOS_525_SS_DD_9 = 191, /// 5.25", DS, DD, 40 tracks, 8 spt, 512 bytes/sector, MFM + [Description("IBM PC 5.25\" double-sided floppy (8 sectors)")] DOS_525_DS_DD_8 = 192, /// 5.25", DS, DD, 40 tracks, 9 spt, 512 bytes/sector, MFM + [Description("IBM PC 5.25\" double-sided floppy (9 sectors)")] DOS_525_DS_DD_9 = 193, /// 5.25", DS, HD, 80 tracks, 15 spt, 512 bytes/sector, MFM + [Description("IBM PC 5.25\" high density floppy")] DOS_525_HD = 194, /// 3.5", SS, DD, 80 tracks, 8 spt, 512 bytes/sector, MFM + [Description("IBM PC 3.5\" single-sided floppy (8 sectors)")] DOS_35_SS_DD_8 = 195, /// 3.5", SS, DD, 80 tracks, 9 spt, 512 bytes/sector, MFM + [Description("IBM PC 3.5\" single-sided floppy (9 sectors)")] DOS_35_SS_DD_9 = 196, /// 3.5", DS, DD, 80 tracks, 8 spt, 512 bytes/sector, MFM + [Description("IBM PC 3.5\" double-sided floppy (8 sectors)")] DOS_35_DS_DD_8 = 197, /// 3.5", DS, DD, 80 tracks, 9 spt, 512 bytes/sector, MFM + [Description("IBM PC 3.5\" double-sided floppy (9 sectors)")] DOS_35_DS_DD_9 = 198, /// 3.5", DS, HD, 80 tracks, 18 spt, 512 bytes/sector, MFM + [Description("IBM PC 3.5\" high density floppy")] DOS_35_HD = 199, /// 3.5", DS, ED, 80 tracks, 36 spt, 512 bytes/sector, MFM + [Description("IBM PC 3.5\" extended density floppy")] DOS_35_ED = 200, /// 3.5", DS, HD, 80 tracks, 21 spt, 512 bytes/sector, MFM + [Description("Microsoft 3.5\" DMF floppy")] DMF = 201, /// 3.5", DS, HD, 82 tracks, 21 spt, 512 bytes/sector, MFM + [Description("Microsoft 3.5\" DMF floppy (82 tracks)")] DMF_82 = 202, /// /// 5.25", DS, HD, 80 tracks, ? spt, ??? + ??? + ??? bytes/sector, MFM track 0 = ??15 sectors, 512 bytes/sector, /// falsified to DOS as 19 spt, 512 bps /// + [Description("IBM 5.25\" XDF floppy")] XDF_525 = 203, /// /// 3.5", DS, HD, 80 tracks, 4 spt, 8192 + 2048 + 1024 + 512 bytes/sector, MFM track 0 = 19 sectors, 512 /// bytes/sector, falsified to DOS as 23 spt, 512 bps /// + [Description("IBM 3.5\" XDF floppy")] XDF_35 = 204, #endregion IBM/Microsoft PC standard floppy formats, types 190 to 209 @@ -413,31 +537,40 @@ public enum MediaType : uint #region IBM standard floppy formats, types 210 to 219 /// 8", SS, SD, 32 tracks, 8 spt, 319 bytes/sector, FM + [Description("IBM 23FD floppy")] IBM23FD = 210, /// 8", SS, SD, 73 tracks, 26 spt, 128 bytes/sector, FM + [Description("IBM 33FD floppy (128bps)")] IBM33FD_128 = 211, /// 8", SS, SD, 74 tracks, 15 spt, 256 bytes/sector, FM, track 0 = 26 sectors, 128 bytes/sector + [Description("IBM 33FD floppy (256bps)")] IBM33FD_256 = 212, /// 8", SS, SD, 74 tracks, 8 spt, 512 bytes/sector, FM, track 0 = 26 sectors, 128 bytes/sector + [Description("IBM 33FD floppy (512bps)")] IBM33FD_512 = 213, /// 8", DS, SD, 74 tracks, 26 spt, 128 bytes/sector, FM, track 0 = 26 sectors, 128 bytes/sector + [Description("IBM 43FD floppy (128bps)")] IBM43FD_128 = 214, /// 8", DS, SD, 74 tracks, 26 spt, 256 bytes/sector, FM, track 0 = 26 sectors, 128 bytes/sector + [Description("IBM 43FD floppy (256bps)")] IBM43FD_256 = 215, /// /// 8", DS, DD, 74 tracks, 26 spt, 256 bytes/sector, MFM, track 0 side 0 = 26 sectors, 128 bytes/sector, track 0 /// side 1 = 26 sectors, 256 bytes/sector /// + [Description("IBM 53FD floppy (256bps)")] IBM53FD_256 = 216, /// /// 8", DS, DD, 74 tracks, 15 spt, 512 bytes/sector, MFM, track 0 side 0 = 26 sectors, 128 bytes/sector, track 0 /// side 1 = 26 sectors, 256 bytes/sector /// + [Description("IBM 43FD floppy (512bps)")] IBM53FD_512 = 217, /// /// 8", DS, DD, 74 tracks, 8 spt, 1024 bytes/sector, MFM, track 0 side 0 = 26 sectors, 128 bytes/sector, track 0 /// side 1 = 26 sectors, 256 bytes/sector /// + [Description("IBM 43FD floppy (1024bps)")] IBM53FD_1024 = 218, #endregion IBM standard floppy formats, types 210 to 219 @@ -445,12 +578,16 @@ public enum MediaType : uint #region DEC standard floppy formats, types 220 to 229 /// 8", SS, DD, 77 tracks, 26 spt, 128 bytes/sector, FM + [Description("DEC RX01 floppy")] RX01 = 220, /// 8", SS, DD, 77 tracks, 26 spt, 256 bytes/sector, FM/MFM + [Description("DEC RX02 floppy")] RX02 = 221, /// 8", DS, DD, 77 tracks, 26 spt, 256 bytes/sector, FM/MFM + [Description("DEC RX03 floppy")] RX03 = 222, /// 5.25", SS, DD, 80 tracks, 10 spt, 512 bytes/sector, MFM + [Description("DEC RX50 floppy")] RX50 = 223, #endregion DEC standard floppy formats, types 220 to 229 @@ -458,18 +595,25 @@ public enum MediaType : uint #region Acorn standard floppy formats, types 230 to 239 /// 5,25", SS, SD, 40 tracks, 10 spt, 256 bytes/sector, FM + [Description("Acorn 5.25\" single density (40 tracks) floppy")] ACORN_525_SS_SD_40 = 230, /// 5,25", SS, SD, 80 tracks, 10 spt, 256 bytes/sector, FM + [Description("Acorn 5.25\" single density (80 tracks) floppy")] ACORN_525_SS_SD_80 = 231, /// 5,25", SS, DD, 40 tracks, 16 spt, 256 bytes/sector, MFM + [Description("Acorn 5.25\" double density (40 tracks) floppy")] ACORN_525_SS_DD_40 = 232, /// 5,25", SS, DD, 80 tracks, 16 spt, 256 bytes/sector, MFM + [Description("Acorn 5.25\" double density (80 tracks) floppy")] ACORN_525_SS_DD_80 = 233, /// 5,25", DS, DD, 80 tracks, 16 spt, 256 bytes/sector, MFM + [Description("Acorn 5.25\" double sided double density (40 tracks) floppy")] ACORN_525_DS_DD = 234, /// 3,5", DS, DD, 80 tracks, 5 spt, 1024 bytes/sector, MFM + [Description("Acorn 3.5\" double density floppy")] ACORN_35_DS_DD = 235, /// 3,5", DS, HD, 80 tracks, 10 spt, 1024 bytes/sector, MFM + [Description("Acorn 3.5\" high density floppy")] ACORN_35_DS_HD = 236, #endregion Acorn standard floppy formats, types 230 to 239 @@ -477,18 +621,25 @@ public enum MediaType : uint #region Atari standard floppy formats, types 240 to 249 /// 5,25", SS, SD, 40 tracks, 18 spt, 128 bytes/sector, FM + [Description("Atari 5.25\" single density floppy")] ATARI_525_SD = 240, /// 5,25", SS, ED, 40 tracks, 26 spt, 128 bytes/sector, MFM + [Description("Atari 5.25\" extended density floppy")] ATARI_525_ED = 241, /// 5,25", SS, DD, 40 tracks, 18 spt, 256 bytes/sector, MFM + [Description("Atari 5.25\" double density floppy")] ATARI_525_DD = 242, /// 3,5", SS, DD, 80 tracks, 10 spt, 512 bytes/sector, MFM + [Description("Atari 3.5\" single sided (10 spt) floppy")] ATARI_35_SS_DD = 243, /// 3,5", DS, DD, 80 tracks, 10 spt, 512 bytes/sector, MFM + [Description("Atari 3.5\" double sided (10 spt) floppy")] ATARI_35_DS_DD = 244, /// 3,5", SS, DD, 80 tracks, 11 spt, 512 bytes/sector, MFM + [Description("Atari 3.5\" single sided (11 spt) floppy")] ATARI_35_SS_DD_11 = 245, /// 3,5", DS, DD, 80 tracks, 11 spt, 512 bytes/sector, MFM + [Description("Atari 3.5\" double sided (11 spt) floppy")] ATARI_35_DS_DD_11 = 246, #endregion Atari standard floppy formats, types 240 to 249 @@ -496,16 +647,22 @@ public enum MediaType : uint #region Commodore standard floppy formats, types 250 to 259 /// 3,5", DS, DD, 80 tracks, 10 spt, 512 bytes/sector, MFM (1581) + [Description("Commodore 3.5\" double density floppy")] CBM_35_DD = 250, /// 3,5", DS, DD, 80 tracks, 11 spt, 512 bytes/sector, MFM (Amiga) + [Description("Amiga 3.5\" double density floppy")] CBM_AMIGA_35_DD = 251, /// 3,5", DS, HD, 80 tracks, 22 spt, 512 bytes/sector, MFM (Amiga) + [Description("Amiga 3.5\" high density floppy")] CBM_AMIGA_35_HD = 252, /// 5,25", SS, DD, 35 tracks, GCR + [Description("Commodore 1540 floppy")] CBM_1540 = 253, /// 5,25", SS, DD, 40 tracks, GCR + [Description("Commodore 1540 extended floppy")] CBM_1540_Ext = 254, /// 5,25", DS, DD, 35 tracks, GCR + [Description("Commodore 1571 floppy")] CBM_1571 = 255, #endregion Commodore standard floppy formats, types 250 to 259 @@ -513,28 +670,38 @@ public enum MediaType : uint #region NEC/SHARP standard floppy formats, types 260 to 269 /// 8", DS, SD, 77 tracks, 26 spt, 128 bytes/sector, FM + [Description("NEC 8\" floppy (128 bps)")] NEC_8_SD = 260, /// 8", DS, DD, 77 tracks, 26 spt, 256 bytes/sector, MFM + [Description("NEC 8\" floppy (256 bps)")] NEC_8_DD = 261, /// 5.25", SS, SD, 80 tracks, 16 spt, 256 bytes/sector, FM + [Description("NEC 5.25\" single sided floppy")] NEC_525_SS = 262, /// 5.25", DS, SD, 80 tracks, 16 spt, 256 bytes/sector, MFM + [Description("NEC 5.25\" double sided floppy")] NEC_525_DS = 263, /// 5,25", DS, HD, 77 tracks, 8 spt, 1024 bytes/sector, MFM + [Description("NEC 5.25\" high density floppy")] NEC_525_HD = 264, /// 3,5", DS, HD, 77 tracks, 8 spt, 1024 bytes/sector, MFM, aka mode 3 + [Description("NEC 3.5\" floppy")] NEC_35_HD_8 = 265, /// 3,5", DS, HD, 80 tracks, 15 spt, 512 bytes/sector, MFM + [Description("NEC 3.5\" floppy (80 tracks)")] NEC_35_HD_15 = 266, /// 3,5", DS, TD, 240 tracks, 38 spt, 512 bytes/sector, MFM + [Description("NEC 3.5\" triple density floppy")] NEC_35_TD = 267, /// 5,25", DS, HD, 77 tracks, 8 spt, 1024 bytes/sector, MFM SHARP_525 = NEC_525_HD, /// 3,5", DS, HD, 80 tracks, 9 spt, 1024 bytes/sector, MFM + [Description("Sharp 5.25\" floppy")] SHARP_525_9 = 268, /// 3,5", DS, HD, 77 tracks, 8 spt, 1024 bytes/sector, MFM SHARP_35 = NEC_35_HD_8, /// 3,5", DS, HD, 80 tracks, 9 spt, 1024 bytes/sector, MFM + [Description("Sharp 3.5\" floppy")] SHARP_35_9 = 269, #endregion NEC/SHARP standard floppy formats, types 260 to 269 @@ -601,12 +768,16 @@ public enum MediaType : uint #region Non-standard PC formats (FDFORMAT, 2M, etc), types 290 to 308 /// 5,25", DS, DD, 82 tracks, 10 spt, 512 bytes/sector, MFM + [Description("FDFORMAT 5.25\" double density floppy")] FDFORMAT_525_DD = 290, /// 5,25", DS, HD, 82 tracks, 17 spt, 512 bytes/sector, MFM + [Description("FDFORMAT 5.25\" high density floppy")] FDFORMAT_525_HD = 291, /// 3,5", DS, DD, 82 tracks, 10 spt, 512 bytes/sector, MFM + [Description("FDFORMAT 3.5\" double density floppy")] FDFORMAT_35_DD = 292, /// 3,5", DS, HD, 82 tracks, 21 spt, 512 bytes/sector, MFM + [Description("FDFORMAT 3.5\" high density floppy")] FDFORMAT_35_HD = 293, #endregion Non-standard PC formats (FDFORMAT, 2M, etc), types 290 to 308 @@ -614,33 +785,50 @@ public enum MediaType : uint #region Apricot ACT standard floppy formats, type 309 /// 3.5", DS, DD, 70 tracks, 9 spt, 512 bytes/sector, MFM + [Description("Apricot ACT 3.5\" floppy")] Apricot_35 = 309, #endregion Apricot ACT standard floppy formats, type 309 #region OnStream ADR, types 310 to 319 + [Description("ADR-2120")] ADR2120 = 310, - ADR260 = 311, - ADR30 = 312, - ADR50 = 313, + [Description("ADR-260")] + ADR260 = 311, + [Description("ADR-30")] + ADR30 = 312, + [Description("ADR-50")] + ADR50 = 313, #endregion OnStream ADR, types 310 to 319 #region Advanced Intelligent Tape, types 320 to 339 - AIT1 = 320, + [Description("AIT")] + AIT1 = 320, + [Description("AIT Turbo")] AIT1Turbo = 321, - AIT2 = 322, + [Description("AIT-2")] + AIT2 = 322, + [Description("AIT-2 Turbo")] AIT2Turbo = 323, - AIT3 = 324, - AIT3Ex = 325, + [Description("AIT-3")] + AIT3 = 324, + [Description("AIT-3 Ex")] + AIT3Ex = 325, + [Description("AIT-3 Turbo")] AIT3Turbo = 326, - AIT4 = 327, - AIT5 = 328, + [Description("AIT-4")] + AIT4 = 327, + [Description("AIT-5")] + AIT5 = 328, + [Description("AIT-E Turbo")] AITETurbo = 329, - SAIT1 = 330, - SAIT2 = 331, + [Description("Super AIT")] + SAIT1 = 330, + [Description("Super AIT-2")] + SAIT2 = 331, #endregion Advanced Intelligent Tape, types 320 to 339 @@ -648,34 +836,54 @@ public enum MediaType : uint /// Obsolete type for 8"x11" Bernoulli Box disk [Obsolete] + [Description("Bernoulli Box")] Bernoulli = 340, /// Obsolete type for 5⅓" Bernoulli Box II disks [Obsolete] + [Description("Bernoulli Box II")] Bernoulli2 = 341, - Ditto = 342, - DittoMax = 343, - Jaz = 344, - Jaz2 = 345, + [Description("Ditto")] + Ditto = 342, + [Description("Ditto MAX")] + DittoMax = 343, + [Description("Jaz")] + Jaz = 344, + [Description("Jaz 2")] + Jaz2 = 345, + [Description("PocketZip / Clik!")] PocketZip = 346, - REV120 = 347, - REV35 = 348, - REV70 = 349, - ZIP100 = 350, - ZIP250 = 351, - ZIP750 = 352, + [Description("REV (120Gb)")] + REV120 = 347, + [Description("REV (35Gb)")] + REV35 = 348, + [Description("REV (70Gb)")] + REV70 = 349, + [Description("ZIP (100Mb)")] + ZIP100 = 350, + [Description("ZIP (250Mb)")] + ZIP250 = 351, + [Description("ZIP (750Mb)")] + ZIP750 = 352, /// 5⅓" Bernoulli Box II disk with 35Mb capacity + [Description("Bernoulli Box II (35Mb)")] Bernoulli35 = 353, /// 5⅓" Bernoulli Box II disk with 44Mb capacity + [Description("Bernoulli Box II (44Mb)")] Bernoulli44 = 354, /// 5⅓" Bernoulli Box II disk with 65Mb capacity + [Description("Bernoulli Box II (65Mb)")] Bernoulli65 = 355, /// 5⅓" Bernoulli Box II disk with 90Mb capacity + [Description("Bernoulli Box II (90Mb)")] Bernoulli90 = 356, /// 5⅓" Bernoulli Box II disk with 105Mb capacity + [Description("Bernoulli Box II (105Mb)")] Bernoulli105 = 357, /// 5⅓" Bernoulli Box II disk with 150Mb capacity + [Description("Bernoulli Box II (150Mb)")] Bernoulli150 = 358, /// 5⅓" Bernoulli Box II disk with 230Mb capacity + [Description("Bernoulli Box II (230Mb)")] Bernoulli230 = 359, #endregion Iomega, types 340 to 359 @@ -686,47 +894,70 @@ public enum MediaType : uint Data8 = 361, MiniDV = 362, /// D/CAS-25: Digital data on Compact Cassette form factor, special magnetic media, 9-track + [Description("D/CAS-25")] Dcas25 = 363, /// D/CAS-85: Digital data on Compact Cassette form factor, special magnetic media, 17-track + [Description("D/CAS-85")] Dcas85 = 364, /// D/CAS-103: Digital data on Compact Cassette form factor, special magnetic media, 21-track + [Description("D/CAS-103")] Dcas103 = 365, #endregion Audio media, types 360 to 369 #region CompactFlash Association, types 370 to 379 - CFast = 370, - CompactFlash = 371, + CFast = 370, + [Description("CompactFlash")] + CompactFlash = 371, + [Description("CompactFlash Type 2")] CompactFlashType2 = 372, #endregion CompactFlash Association, types 370 to 379 #region Digital Audio Tape / Digital Data Storage, types 380 to 389 + [Description("Digital Audio Tape")] DigitalAudioTape = 380, - DAT160 = 381, - DAT320 = 382, - DAT72 = 383, - DDS1 = 384, - DDS2 = 385, - DDS3 = 386, - DDS4 = 387, + [Description("DAT-160")] + DAT160 = 381, + [Description("DAT-320")] + DAT320 = 382, + [Description("DAT-72")] + DAT72 = 383, + [Description("DDS")] + DDS1 = 384, + [Description("DDS-2")] + DDS2 = 385, + [Description("DDS-3")] + DDS3 = 386, + [Description("DDS-4")] + DDS4 = 387, #endregion Digital Audio Tape / Digital Data Storage, types 380 to 389 #region DEC, types 390 to 399 - CompactTapeI = 390, + [Description("CompactTapeI")] + CompactTapeI = 390, + [Description("CompactTapeII")] CompactTapeII = 391, - DECtapeII = 392, - DLTtapeIII = 393, - DLTtapeIIIxt = 394, - DLTtapeIV = 395, - DLTtapeS4 = 396, - SDLT1 = 397, - SDLT2 = 398, - VStapeI = 399, + [Description("DECtapeII")] + DECtapeII = 392, + [Description("DLTtapeIII")] + DLTtapeIII = 393, + [Description("DLTtapeIIIxt")] + DLTtapeIIIxt = 394, + [Description("DLTtapeIV")] + DLTtapeIV = 395, + [Description("DLTtapeS4")] + DLTtapeS4 = 396, + [Description("Super DLT")] + SDLT1 = 397, + [Description("Super DLT 2")] + SDLT2 = 398, + [Description("VStapeI")] + VStapeI = 399, #endregion DEC, types 390 to 399 @@ -809,20 +1040,33 @@ public enum MediaType : uint GameBoyAdvanceGamePak = 451, GameBoyGamePak = 452, /// Nintendo GameCube Optical Disc + [Description("Nintendo GameCube Optical Disc")] GOD = 453, - N64DD = 454, - N64GamePak = 455, - NESGamePak = 456, + [Description("Nintendo 64 DD")] + N64DD = 454, + [Description("Nintendo 64 Game Pak")] + N64GamePak = 455, + [Description("NES Game Pak")] + NESGamePak = 456, + [Description("Nintendo 3DS Game Card")] Nintendo3DSGameCard = 457, - NintendoDiskCard = 458, - NintendoDSGameCard = 459, + [Description("Nintendo Disk Card")] + NintendoDiskCard = 458, + [Description("Nintendo DS Game Card")] + NintendoDSGameCard = 459, + [Description("Nintendo DSi Game Card")] NintendoDSiGameCard = 460, - SNESGamePak = 461, - SNESGamePakUS = 462, + [Description("SNES Game Pak")] + SNESGamePak = 461, + [Description("SNES Game Pak (US)")] + SNESGamePakUS = 462, /// Nintendo Wii Optical Disc + [Description("Nintendo Wii Optical Disc")] WOD = 463, /// Nintendo Wii U Optical Disc + [Description("Nintendo Wii U Optical Disc")] WUOD = 464, + [Description("Switch Game Card")] SwitchGameCard = 465, #endregion Nintendo, types 450 to 469 @@ -839,45 +1083,70 @@ public enum MediaType : uint #region LTO Ultrium, types 480 to 509 - LTO = 480, - LTO2 = 481, - LTO3 = 482, + [Description("LTO")] + LTO = 480, + [Description("LTO-2")] + LTO2 = 481, + [Description("LTO-3")] + LTO3 = 482, + [Description("LTO-3 (WORM)")] LTO3WORM = 483, - LTO4 = 484, + [Description("LTO-4")] + LTO4 = 484, + [Description("LTO-4 (WORM)")] LTO4WORM = 485, - LTO5 = 486, + [Description("LTO-5")] + LTO5 = 486, + [Description("LTO-5 (WORM)")] LTO5WORM = 487, - LTO6 = 488, + [Description("LTO-6")] + LTO6 = 488, + [Description("LTO-6 (WORM)")] LTO6WORM = 489, - LTO7 = 490, + [Description("LTO-7")] + LTO7 = 490, + [Description("LTO-7 (WORM)")] LTO7WORM = 491, #endregion LTO Ultrium, types 480 to 509 #region MemoryStick, types 510 to 519 - MemoryStick = 510, - MemoryStickDuo = 511, - MemoryStickMicro = 512, - MemoryStickPro = 513, + [Description("MemoryStick")] + MemoryStick = 510, + [Description("MemoryStick Duo")] + MemoryStickDuo = 511, + [Description("MemoryStick Micro")] + MemoryStickMicro = 512, + [Description("MemoryStick Pro")] + MemoryStickPro = 513, + [Description("MemoryStick Pro Duo")] MemoryStickProDuo = 514, #endregion MemoryStick, types 510 to 519 #region SecureDigital, types 520 to 529 - microSD = 520, - miniSD = 521, + [Description("microSD")] + microSD = 520, + [Description("miniSD")] + miniSD = 521, + [Description("SecureDigital")] SecureDigital = 522, #endregion SecureDigital, types 520 to 529 #region MultiMediaCard, types 530 to 539 - MMC = 530, - MMCmicro = 531, - RSMMC = 532, - MMCplus = 533, + [Description("MultiMediaCard")] + MMC = 530, + [Description("MMCmicro")] + MMCmicro = 531, + [Description("RS-MMC")] + RSMMC = 532, + [Description("MMC+")] + MMCplus = 533, + [Description("MMCmobile")] MMCmobile = 534, #endregion MultiMediaCard, types 530 to 539 @@ -911,19 +1180,32 @@ public enum MediaType : uint #region QIC, types 570 to 589 - QIC11 = 570, - QIC120 = 571, + [Description("QIC-11")] + QIC11 = 570, + [Description("QIC-120")] + QIC120 = 571, + [Description("QIC-1350")] QIC1350 = 572, - QIC150 = 573, - QIC24 = 574, + [Description("QIC-150")] + QIC150 = 573, + [Description("QIC-24")] + QIC24 = 574, + [Description("QIC-3010")] QIC3010 = 575, + [Description("QIC-3020")] QIC3020 = 576, + [Description("QIC-3080")] QIC3080 = 577, + [Description("QIC-3095")] QIC3095 = 578, - QIC320 = 579, - QIC40 = 580, - QIC525 = 581, - QIC80 = 582, + [Description("QIC-320")] + QIC320 = 579, + [Description("QIC-40")] + QIC40 = 580, + [Description("QIC-525")] + QIC525 = 581, + [Description("QIC-80")] + QIC80 = 582, #endregion QIC, types 570 to 589 @@ -1073,11 +1355,16 @@ public enum MediaType : uint #region Apple specific media, types 690 to 699 - AppleProfile = 690, - AppleWidget = 691, - AppleHD20 = 692, + [Description("Apple Profile")] + AppleProfile = 690, + [Description("Apple Widget")] + AppleWidget = 691, + [Description("Apple HD20")] + AppleHD20 = 692, + [Description("Priam Data Tower")] PriamDataTower = 693, - Pippin = 694, + [Description("Bandai Pippin game")] + Pippin = 694, #endregion Apple specific media, types 690 to 699 @@ -1223,8 +1510,10 @@ public enum MediaType : uint #region Imation, types 730 to 739 - LS120 = 730, - LS240 = 731, + [Description("LS-120")] + LS120 = 730, + [Description("LS-240")] + LS240 = 731, FD32MB = 732, RDX = 733, /// Imation 320Gb RDX @@ -1234,27 +1523,36 @@ public enum MediaType : uint #region VideoNow, types 740 to 749 - VideoNow = 740, + [Description("VideoNow")] + VideoNow = 740, + [Description("VideoNow Color")] VideoNowColor = 741, - VideoNowXp = 742, + [Description("VideoNow XP")] + VideoNowXp = 742, #endregion #region Iomega, types 750 to 759 /// 8"x11" Bernoulli Box disk with 10Mb capacity + [Description("Bernoulli Box (10Mb)")] Bernoulli10 = 750, /// 8"x11" Bernoulli Box disk with 20Mb capacity + [Description("Bernoulli Box (20Mb)")] Bernoulli20 = 751, /// 5⅓" Bernoulli Box II disk with 20Mb capacity + [Description("Bernoulli Box II (20Mb)")] BernoulliBox2_20 = 752, #endregion Iomega, types 750 to 759 #region Kodak, types 760 to 769 - KodakVerbatim3 = 760, - KodakVerbatim6 = 761, + [Description("Kodak/Verbatim (3Mb)")] + KodakVerbatim3 = 760, + [Description("Kodak/Verbatim (6Mb)")] + KodakVerbatim6 = 761, + [Description("Kodak/Verbatim (12Mb)")] KodakVerbatim12 = 762, #endregion Kodak, types 760 to 769 @@ -1262,38 +1560,55 @@ public enum MediaType : uint #region Sony and Panasonic Blu-ray derived, types 770 to 799 /// Professional Disc for video, single layer, rewritable, 23Gb + [Description("Professional Disc for video")] ProfessionalDisc = 770, /// Professional Disc for video, dual layer, rewritable, 50Gb + [Description("Professional Disc for video")] ProfessionalDiscDual = 771, /// Professional Disc for video, triple layer, rewritable, 100Gb + [Description("Professional Disc for video")] ProfessionalDiscTriple = 772, /// Professional Disc for video, quad layer, write once, 128Gb + [Description("Professional Disc for video")] ProfessionalDiscQuad = 773, /// Professional Disc for DATA, single layer, rewritable, 23Gb + [Description("Professional Disc for DATA")] PDD = 774, /// Professional Disc for DATA, single layer, write once, 23Gb + [Description("Professional Disc for DATA")] PDD_WORM = 775, /// Archival Disc, 1st gen., 300Gb + [Description("Archival Disc")] ArchivalDisc = 776, /// Archival Disc, 2nd gen., 500Gb + [Description("Archival Disc")] ArchivalDisc2 = 777, /// Archival Disc, 3rd gen., 1Tb + [Description("Archival Disc")] ArchivalDisc3 = 778, /// Optical Disc archive, 1st gen., write once, 300Gb + [Description("Optical Disc archive")] ODC300R = 779, /// Optical Disc archive, 1st gen., rewritable, 300Gb + [Description("Optical Disc archive")] ODC300RE = 780, /// Optical Disc archive, 2nd gen., write once, 600Gb + [Description("Optical Disc archive")] ODC600R = 781, /// Optical Disc archive, 2nd gen., rewritable, 600Gb + [Description("Optical Disc archive")] ODC600RE = 782, /// Optical Disc archive, 3rd gen., rewritable, 1200Gb + [Description("Optical Disc archive")] ODC1200RE = 783, /// Optical Disc archive, 3rd gen., write once, 1500Gb + [Description("Optical Disc archive")] ODC1500R = 784, /// Optical Disc archive, 4th gen., write once, 3300Gb + [Description("Optical Disc archive")] ODC3300R = 785, /// Optical Disc archive, 5th gen., write once, 5500Gb + [Description("Optical Disc archive")] ODC5500R = 786, #endregion Sony and Panasonic Blu-ray derived, types 770 to 799 @@ -1318,12 +1633,16 @@ public enum MediaType : uint /// 5.25", SS, DD, 35 tracks, 16 spt, 256 bytes/sector, MFM, 48 tpi, ???rpm MetaFloppy_Mod_I = 820, /// HyperFlex (12Mb), 5.25", DS, 301 tracks, 78 spt, 256 bytes/sector, MFM, 333 tpi, 600rpm + [Description("HyperFlex (12Mb)")] HF12 = 823, /// HyperFlex (24Mb), 5.25", DS, 506 tracks, 78 spt, 256 bytes/sector, MFM, 666 tpi, 720rpm + [Description("HyperFlex (24Mb)")] HF24 = 824, #endregion - AtariLynxCard = 821, + [Description("Atari Lynx card")] + AtariLynxCard = 821, + [Description("Atari Jaguar cartridge")] AtariJaguarCartridge = 822 } \ No newline at end of file diff --git a/Aaru.Core/Devices/Dumping/CompactDisc/Dump.cs b/Aaru.Core/Devices/Dumping/CompactDisc/Dump.cs index 2198fa308..ce461f3c7 100644 --- a/Aaru.Core/Devices/Dumping/CompactDisc/Dump.cs +++ b/Aaru.Core/Devices/Dumping/CompactDisc/Dump.cs @@ -949,7 +949,7 @@ sealed partial class Dump UpdateStatus?.Invoke(string.Format(Localization.Core.Device_can_read_0_blocks_at_a_time, _maximumReadable)); UpdateStatus?.Invoke(string.Format(Localization.Core.Device_reports_0_bytes_per_logical_block, blockSize)); UpdateStatus?.Invoke(string.Format(Localization.Core.SCSI_device_type_0, _dev.ScsiType)); - UpdateStatus?.Invoke(string.Format(Localization.Core.Media_identified_as_0, dskType)); + UpdateStatus?.Invoke(string.Format(Localization.Core.Media_identified_as_0, dskType.Humanize())); ret = outputOptical.Create(_outputPath, dskType, @@ -1079,8 +1079,9 @@ 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) @@ -1495,8 +1496,9 @@ sealed partial class Dump supportsLongSectors); foreach(Tuple 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) { diff --git a/Aaru.Core/Devices/Dumping/LinearMemory/Retrode.cs b/Aaru.Core/Devices/Dumping/LinearMemory/Retrode.cs index 32d741f89..5989b9408 100644 --- a/Aaru.Core/Devices/Dumping/LinearMemory/Retrode.cs +++ b/Aaru.Core/Devices/Dumping/LinearMemory/Retrode.cs @@ -236,7 +236,7 @@ public partial class Dump romSize, ByteSize.FromBytes(romSize).ToString("0.000"))); - UpdateStatus?.Invoke(string.Format(Localization.Core.Media_identified_as_0, mediaType)); + UpdateStatus?.Invoke(string.Format(Localization.Core.Media_identified_as_0, mediaType.Humanize())); ErrorNumber ret = outputBai.Create(_outputPath, mediaType, _formatOptions, romSize); diff --git a/Aaru.Core/Devices/Dumping/MiniDisc.cs b/Aaru.Core/Devices/Dumping/MiniDisc.cs index 000cdf408..90f4704ec 100644 --- a/Aaru.Core/Devices/Dumping/MiniDisc.cs +++ b/Aaru.Core/Devices/Dumping/MiniDisc.cs @@ -154,7 +154,7 @@ partial class Dump UpdateStatus?.Invoke(string.Format(Localization.Core.SCSI_device_type_0, _dev.ScsiType)); UpdateStatus?.Invoke(string.Format(Localization.Core.SCSI_medium_type_0, scsiMediumType)); - UpdateStatus?.Invoke(string.Format(Localization.Core.Media_identified_as_0, dskType)); + UpdateStatus?.Invoke(string.Format(Localization.Core.Media_identified_as_0, dskType.Humanize())); sense = _dev.MiniDiscGetType(out cmdBuf, out _, _dev.Timeout, out _); diff --git a/Aaru.Core/Devices/Dumping/PlayStationPortable/UMD.cs b/Aaru.Core/Devices/Dumping/PlayStationPortable/UMD.cs index 50f19f671..9ab051480 100644 --- a/Aaru.Core/Devices/Dumping/PlayStationPortable/UMD.cs +++ b/Aaru.Core/Devices/Dumping/PlayStationPortable/UMD.cs @@ -143,7 +143,7 @@ public partial class Dump UpdateStatus?.Invoke(string.Format(Localization.Core.Device_reports_0_bytes_per_logical_block, blockSize)); UpdateStatus?.Invoke(string.Format(Localization.Core.Device_reports_0_bytes_per_physical_block, blockSize)); UpdateStatus?.Invoke(string.Format(Localization.Core.SCSI_device_type_0, _dev.ScsiType)); - UpdateStatus?.Invoke(string.Format(Localization.Core.Media_identified_as_0, dskType)); + UpdateStatus?.Invoke(string.Format(Localization.Core.Media_identified_as_0, dskType.Humanize())); UpdateStatus?.Invoke(string.Format(Localization.Core.Media_part_number_is_0, mediaPartNumber)); bool ret; diff --git a/Aaru.Core/Devices/Dumping/SSC.cs b/Aaru.Core/Devices/Dumping/SSC.cs index a8435a9a9..1ae275ac1 100644 --- a/Aaru.Core/Devices/Dumping/SSC.cs +++ b/Aaru.Core/Devices/Dumping/SSC.cs @@ -285,9 +285,8 @@ partial class Dump Modes.DecodedMode? decMode = null; if(!sense && !_dev.Error) - { - if(Modes.DecodeMode10(cmdBuf, _dev.ScsiType).HasValue) decMode = Modes.DecodeMode10(cmdBuf, _dev.ScsiType); - } + if(Modes.DecodeMode10(cmdBuf, _dev.ScsiType).HasValue) + decMode = Modes.DecodeMode10(cmdBuf, _dev.ScsiType); UpdateStatus?.Invoke(Localization.Core.Requesting_MODE_SENSE_6); @@ -315,9 +314,8 @@ partial class Dump if(sense || _dev.Error) sense = _dev.ModeSense(out cmdBuf, out senseBuf, 5, out duration); if(!sense && !_dev.Error) - { - if(Modes.DecodeMode6(cmdBuf, _dev.ScsiType).HasValue) decMode = Modes.DecodeMode6(cmdBuf, _dev.ScsiType); - } + if(Modes.DecodeMode6(cmdBuf, _dev.ScsiType).HasValue) + decMode = Modes.DecodeMode6(cmdBuf, _dev.ScsiType); // TODO: Check partitions page if(decMode.HasValue) @@ -358,7 +356,7 @@ partial class Dump UpdateStatus?.Invoke(string.Format(Localization.Core.SCSI_device_type_0, _dev.ScsiType)); UpdateStatus?.Invoke(string.Format(Localization.Core.SCSI_medium_type_0, scsiMediumTypeTape)); UpdateStatus?.Invoke(string.Format(Localization.Core.SCSI_density_type_0, scsiDensityCodeTape)); - UpdateStatus?.Invoke(string.Format(Localization.Core.Media_identified_as_0, dskType)); + UpdateStatus?.Invoke(string.Format(Localization.Core.Media_identified_as_0, dskType.Humanize())); bool endOfMedia = false; diff --git a/Aaru.Core/Devices/Dumping/Sbc/Dump.cs b/Aaru.Core/Devices/Dumping/Sbc/Dump.cs index 9c71c696a..f3218ec6e 100644 --- a/Aaru.Core/Devices/Dumping/Sbc/Dump.cs +++ b/Aaru.Core/Devices/Dumping/Sbc/Dump.cs @@ -290,7 +290,7 @@ partial class Dump UpdateStatus?.Invoke(string.Format(Localization.Core.SCSI_medium_type_0, scsiMediumType)); UpdateStatus?.Invoke(string.Format(Localization.Core.SCSI_density_type_0, scsiDensityCode)); UpdateStatus?.Invoke(string.Format(Localization.Core.SCSI_floppy_mode_page_present_0, containsFloppyPage)); - UpdateStatus?.Invoke(string.Format(Localization.Core.Media_identified_as_0, dskType)); + UpdateStatus?.Invoke(string.Format(Localization.Core.Media_identified_as_0, dskType.Humanize())); uint longBlockSize = scsiReader.LongBlockSize; diff --git a/Aaru.Core/ImageInfo.cs b/Aaru.Core/ImageInfo.cs index 875a76e0f..ee479d7ad 100644 --- a/Aaru.Core/ImageInfo.cs +++ b/Aaru.Core/ImageInfo.cs @@ -941,7 +941,7 @@ public static class ImageInfo foreach(Track track in opticalImage.Tracks) { table.AddRow($"[teal]{track.Sequence}[/]", - $"[orange3]{track.Type}[/]", + $"[orange3]{track.Type.Humanize()}[/]", $"[aqua]{track.BytesPerSector}[/]", $"[aqua]{track.RawBytesPerSector}[/]", $"[fuchsia]{track.SubchannelType}[/]", @@ -951,7 +951,7 @@ public static class ImageInfo // Write all the track information to AaruLogging.Information in a single line AaruLogging - .Information($"Track {track.Sequence}: type {track.Type}, bytes per sector {track.BytesPerSector}, raw bytes per sector {track.RawBytesPerSector}, subchannel type {track.SubchannelType}, pregap {track.Pregap}, start sector {track.StartSector}, end sector {track.EndSector}"); + .Information($"Track {track.Sequence}: type {track.Type.Humanize()}, bytes per sector {track.BytesPerSector}, raw bytes per sector {track.RawBytesPerSector}, subchannel type {track.SubchannelType}, pregap {track.Pregap}, start sector {track.StartSector}, end sector {track.EndSector}"); } AnsiConsole.Write(table); diff --git a/Aaru.Images/Aaru.Images.csproj b/Aaru.Images/Aaru.Images.csproj index 50d59d23d..47c905582 100644 --- a/Aaru.Images/Aaru.Images.csproj +++ b/Aaru.Images/Aaru.Images.csproj @@ -35,6 +35,7 @@ + diff --git a/Aaru.Images/AaruFormat/Read.cs b/Aaru.Images/AaruFormat/Read.cs index 2574806fe..1688ee0fb 100644 --- a/Aaru.Images/AaruFormat/Read.cs +++ b/Aaru.Images/AaruFormat/Read.cs @@ -50,6 +50,7 @@ using Aaru.Compression; using Aaru.Decoders.CD; using Aaru.Helpers; using Aaru.Logging; +using Humanizer; using Schemas; using Marshal = Aaru.Helpers.Marshal; using Partition = Aaru.CommonTypes.Partition; @@ -81,8 +82,7 @@ public sealed partial class AaruFormat if(_header.imageMajorVersion > AARUFMT_VERSION) { - AaruLogging.Error(string.Format(Localization.Image_version_0_not_recognized, - _header.imageMajorVersion)); + AaruLogging.Error(string.Format(Localization.Image_version_0_not_recognized, _header.imageMajorVersion)); return ErrorNumber.NotSupported; } @@ -115,9 +115,9 @@ public sealed partial class AaruFormat IndexHeader2 idxHeader2 = Marshal.SpanToStructureLittleEndian(_structureBytes); AaruLogging.Debug(MODULE_NAME, - Localization.Index_at_0_contains_1_entries, - _header.indexOffset, - idxHeader2.entries); + Localization.Index_at_0_contains_1_entries, + _header.indexOffset, + idxHeader2.entries); AaruLogging.Debug(MODULE_NAME, Localization.Memory_snapshot_0_bytes, GC.GetTotalMemory(false)); @@ -131,10 +131,10 @@ public sealed partial class AaruFormat IndexEntry entry = Marshal.SpanToStructureLittleEndian(_structureBytes); AaruLogging.Debug(MODULE_NAME, - Localization.Block_type_0_with_data_type_1_is_indexed_to_be_at_2, - entry.blockType, - entry.dataType, - entry.offset); + Localization.Block_type_0_with_data_type_1_is_indexed_to_be_at_2, + entry.blockType, + entry.dataType, + entry.offset); _index.Add(entry); } @@ -142,9 +142,9 @@ public sealed partial class AaruFormat else { AaruLogging.Debug(MODULE_NAME, - Localization.Index_at_0_contains_1_entries, - _header.indexOffset, - idxHeader.entries); + Localization.Index_at_0_contains_1_entries, + _header.indexOffset, + idxHeader.entries); AaruLogging.Debug(MODULE_NAME, Localization.Memory_snapshot_0_bytes, GC.GetTotalMemory(false)); @@ -158,10 +158,10 @@ public sealed partial class AaruFormat IndexEntry entry = Marshal.SpanToStructureLittleEndian(_structureBytes); AaruLogging.Debug(MODULE_NAME, - Localization.Block_type_0_with_data_type_1_is_indexed_to_be_at_2, - entry.blockType, - entry.dataType, - entry.offset); + Localization.Block_type_0_with_data_type_1_is_indexed_to_be_at_2, + entry.blockType, + entry.dataType, + entry.offset); _index.Add(entry); } @@ -204,8 +204,8 @@ public sealed partial class AaruFormat if(blockHeader.identifier != entry.blockType) { AaruLogging.Debug(MODULE_NAME, - Localization.Incorrect_identifier_for_data_block_at_position_0, - entry.offset); + Localization.Incorrect_identifier_for_data_block_at_position_0, + entry.offset); break; } @@ -213,11 +213,11 @@ public sealed partial class AaruFormat if(blockHeader.type != entry.dataType) { AaruLogging.Debug(MODULE_NAME, - Localization - .Expected_block_with_data_type_0_at_position_1_but_found_data_type_2, - entry.dataType, - entry.offset, - blockHeader.type); + Localization + .Expected_block_with_data_type_0_at_position_1_but_found_data_type_2, + entry.dataType, + entry.offset, + blockHeader.type); break; } @@ -225,13 +225,11 @@ public sealed partial class AaruFormat byte[] data; AaruLogging.Debug(MODULE_NAME, - Localization.Found_data_block_type_0_at_position_1, - entry.dataType, - entry.offset); + Localization.Found_data_block_type_0_at_position_1, + entry.dataType, + entry.offset); - AaruLogging.Debug(MODULE_NAME, - Localization.Memory_snapshot_0_bytes, - GC.GetTotalMemory(false)); + AaruLogging.Debug(MODULE_NAME, Localization.Memory_snapshot_0_bytes, GC.GetTotalMemory(false)); // Decompress media tag if(blockHeader.compression is CompressionType.Lzma @@ -241,10 +239,10 @@ public sealed partial class AaruFormat entry.dataType != DataType.CdSectorSubchannel) { AaruLogging.Debug(MODULE_NAME, - Localization - .Invalid_compression_type_0_for_block_with_data_type_1_continuing, - blockHeader.compression, - entry.dataType); + Localization + .Invalid_compression_type_0_for_block_with_data_type_1_continuing, + blockHeader.compression, + entry.dataType); break; } @@ -261,10 +259,9 @@ public sealed partial class AaruFormat if(decompressedLength != blockHeader.length) { AaruLogging.Debug(MODULE_NAME, - Localization - .Error_decompressing_block_should_be_0_bytes_but_got_1_bytes, - blockHeader.length, - decompressedLength); + Localization.Error_decompressing_block_should_be_0_bytes_but_got_1_bytes, + blockHeader.length, + decompressedLength); return ErrorNumber.InOutError; } @@ -275,27 +272,23 @@ public sealed partial class AaruFormat decompressStopwatch.Stop(); AaruLogging.Debug(MODULE_NAME, - Localization.Took_0_seconds_to_decompress_block, - decompressStopwatch.Elapsed.TotalSeconds); + Localization.Took_0_seconds_to_decompress_block, + decompressStopwatch.Elapsed.TotalSeconds); - AaruLogging.Debug(MODULE_NAME, - Localization.Memory_snapshot_0_bytes, - GC.GetTotalMemory(false)); + AaruLogging.Debug(MODULE_NAME, Localization.Memory_snapshot_0_bytes, GC.GetTotalMemory(false)); } else if(blockHeader.compression == CompressionType.None) { data = new byte[blockHeader.length]; _imageStream.EnsureRead(data, 0, (int)blockHeader.length); - AaruLogging.Debug(MODULE_NAME, - Localization.Memory_snapshot_0_bytes, - GC.GetTotalMemory(false)); + AaruLogging.Debug(MODULE_NAME, Localization.Memory_snapshot_0_bytes, GC.GetTotalMemory(false)); } else { AaruLogging.Debug(MODULE_NAME, - Localization.Found_unknown_compression_type_0_continuing, - (ushort)blockHeader.compression); + Localization.Found_unknown_compression_type_0_continuing, + (ushort)blockHeader.compression); break; } @@ -306,10 +299,9 @@ public sealed partial class AaruFormat if(BitConverter.ToUInt64(blockCrc, 0) != blockHeader.crc64 && blockHeader.crc64 != 0) { AaruLogging.Debug(MODULE_NAME, - Localization - .Incorrect_CRC_found_0_X16_found_expected_1_X16_continuing, - BitConverter.ToUInt64(blockCrc, 0), - blockHeader.crc64); + Localization.Incorrect_CRC_found_0_X16_found_expected_1_X16_continuing, + BitConverter.ToUInt64(blockCrc, 0), + blockHeader.crc64); break; } @@ -334,8 +326,8 @@ public sealed partial class AaruFormat _imageInfo.ReadableSectorTags.Add(SectorTagType.CdSectorHeader); AaruLogging.Debug(MODULE_NAME, - Localization.Memory_snapshot_0_bytes, - GC.GetTotalMemory(false)); + Localization.Memory_snapshot_0_bytes, + GC.GetTotalMemory(false)); break; case DataType.CdSectorSuffix: @@ -364,8 +356,8 @@ public sealed partial class AaruFormat _imageInfo.ReadableSectorTags.Add(SectorTagType.CdSectorEdc); AaruLogging.Debug(MODULE_NAME, - Localization.Memory_snapshot_0_bytes, - GC.GetTotalMemory(false)); + Localization.Memory_snapshot_0_bytes, + GC.GetTotalMemory(false)); break; case DataType.CdSectorSubchannel: @@ -375,8 +367,8 @@ public sealed partial class AaruFormat _imageInfo.ReadableSectorTags.Add(SectorTagType.CdSectorSubchannel); AaruLogging.Debug(MODULE_NAME, - Localization.Memory_snapshot_0_bytes, - GC.GetTotalMemory(false)); + Localization.Memory_snapshot_0_bytes, + GC.GetTotalMemory(false)); break; case DataType.AppleProfileTag: @@ -388,16 +380,16 @@ public sealed partial class AaruFormat _imageInfo.ReadableSectorTags.Add(SectorTagType.AppleSectorTag); AaruLogging.Debug(MODULE_NAME, - Localization.Memory_snapshot_0_bytes, - GC.GetTotalMemory(false)); + Localization.Memory_snapshot_0_bytes, + GC.GetTotalMemory(false)); break; case DataType.CompactDiscMode2Subheader: _mode2Subheaders = data; AaruLogging.Debug(MODULE_NAME, - Localization.Memory_snapshot_0_bytes, - GC.GetTotalMemory(false)); + Localization.Memory_snapshot_0_bytes, + GC.GetTotalMemory(false)); break; case DataType.DvdSectorCprMai: @@ -410,8 +402,8 @@ public sealed partial class AaruFormat _imageInfo.ReadableSectorTags.Add(SectorTagType.DvdSectorTitleKey); AaruLogging.Debug(MODULE_NAME, - Localization.Memory_snapshot_0_bytes, - GC.GetTotalMemory(false)); + Localization.Memory_snapshot_0_bytes, + GC.GetTotalMemory(false)); break; case DataType.DvdSectorId: @@ -424,8 +416,8 @@ public sealed partial class AaruFormat _imageInfo.ReadableSectorTags.Add(SectorTagType.DvdSectorNumber); AaruLogging.Debug(MODULE_NAME, - Localization.Memory_snapshot_0_bytes, - GC.GetTotalMemory(false)); + Localization.Memory_snapshot_0_bytes, + GC.GetTotalMemory(false)); break; case DataType.DvdSectorIed: @@ -435,8 +427,8 @@ public sealed partial class AaruFormat _imageInfo.ReadableSectorTags.Add(SectorTagType.DvdSectorIed); AaruLogging.Debug(MODULE_NAME, - Localization.Memory_snapshot_0_bytes, - GC.GetTotalMemory(false)); + Localization.Memory_snapshot_0_bytes, + GC.GetTotalMemory(false)); break; case DataType.DvdSectorEdc: @@ -446,8 +438,8 @@ public sealed partial class AaruFormat _imageInfo.ReadableSectorTags.Add(SectorTagType.DvdSectorEdc); AaruLogging.Debug(MODULE_NAME, - Localization.Memory_snapshot_0_bytes, - GC.GetTotalMemory(false)); + Localization.Memory_snapshot_0_bytes, + GC.GetTotalMemory(false)); break; case DataType.DvdSectorTitleKeyDecrypted: @@ -457,8 +449,8 @@ public sealed partial class AaruFormat _imageInfo.ReadableSectorTags.Add(SectorTagType.DvdTitleKeyDecrypted); AaruLogging.Debug(MODULE_NAME, - Localization.Memory_snapshot_0_bytes, - GC.GetTotalMemory(false)); + Localization.Memory_snapshot_0_bytes, + GC.GetTotalMemory(false)); break; default: @@ -467,9 +459,8 @@ public sealed partial class AaruFormat if(_mediaTags.ContainsKey(mediaTagType)) { AaruLogging.Debug(MODULE_NAME, - Localization - .Media_tag_type_0_duplicated_removing_previous_entry, - mediaTagType); + Localization.Media_tag_type_0_duplicated_removing_previous_entry, + mediaTagType); _mediaTags.Remove(mediaTagType); } @@ -477,8 +468,8 @@ public sealed partial class AaruFormat _mediaTags.Add(mediaTagType, data); AaruLogging.Debug(MODULE_NAME, - Localization.Memory_snapshot_0_bytes, - GC.GetTotalMemory(false)); + Localization.Memory_snapshot_0_bytes, + GC.GetTotalMemory(false)); break; } @@ -499,8 +490,8 @@ public sealed partial class AaruFormat _shift = ddtHeader.shift; AaruLogging.Debug(MODULE_NAME, - Localization.Memory_snapshot_0_bytes, - GC.GetTotalMemory(false)); + Localization.Memory_snapshot_0_bytes, + GC.GetTotalMemory(false)); // Check for DDT compression switch(ddtHeader.compression) @@ -521,10 +512,10 @@ public sealed partial class AaruFormat if(decompressedLength != ddtHeader.length) { AaruLogging.Debug(MODULE_NAME, - Localization - .Error_decompressing_DDT_should_be_0_bytes_but_got_1_bytes, - ddtHeader.length, - decompressedLength); + Localization + .Error_decompressing_DDT_should_be_0_bytes_but_got_1_bytes, + ddtHeader.length, + decompressedLength); return ErrorNumber.InOutError; } @@ -534,12 +525,12 @@ public sealed partial class AaruFormat _inMemoryDdt = true; AaruLogging.Debug(MODULE_NAME, - Localization.Took_0_seconds_to_decompress_DDT, - ddtStopwatch.Elapsed.TotalSeconds); + Localization.Took_0_seconds_to_decompress_DDT, + ddtStopwatch.Elapsed.TotalSeconds); AaruLogging.Debug(MODULE_NAME, - Localization.Memory_snapshot_0_bytes, - GC.GetTotalMemory(false)); + Localization.Memory_snapshot_0_bytes, + GC.GetTotalMemory(false)); break; case CompressionType.None: @@ -547,14 +538,14 @@ public sealed partial class AaruFormat _outMemoryDdtPosition = (long)entry.offset; AaruLogging.Debug(MODULE_NAME, - Localization.Memory_snapshot_0_bytes, - GC.GetTotalMemory(false)); + Localization.Memory_snapshot_0_bytes, + GC.GetTotalMemory(false)); break; default: AaruLogging.Error(string.Format(Localization - .Found_unsupported_compression_algorithm_0, - (ushort)ddtHeader.compression)); + .Found_unsupported_compression_algorithm_0, + (ushort)ddtHeader.compression)); return ErrorNumber.NotSupported; } @@ -568,8 +559,8 @@ public sealed partial class AaruFormat byte[] decompressedDdt = new byte[ddtHeader.length]; AaruLogging.Debug(MODULE_NAME, - Localization.Memory_snapshot_0_bytes, - GC.GetTotalMemory(false)); + Localization.Memory_snapshot_0_bytes, + GC.GetTotalMemory(false)); // Check for DDT compression switch(ddtHeader.compression) @@ -591,35 +582,35 @@ public sealed partial class AaruFormat if(decompressedLength != ddtHeader.length) { AaruLogging.Debug(MODULE_NAME, - Localization - .Error_decompressing_DDT_should_be_0_bytes_but_got_1_bytes, - ddtHeader.length, - decompressedLength); + Localization + .Error_decompressing_DDT_should_be_0_bytes_but_got_1_bytes, + ddtHeader.length, + decompressedLength); return ErrorNumber.InOutError; } AaruLogging.Debug(MODULE_NAME, - Localization.Took_0_seconds_to_decompress_DDT, - ddtStopwatch.Elapsed.TotalSeconds); + Localization.Took_0_seconds_to_decompress_DDT, + ddtStopwatch.Elapsed.TotalSeconds); AaruLogging.Debug(MODULE_NAME, - Localization.Memory_snapshot_0_bytes, - GC.GetTotalMemory(false)); + Localization.Memory_snapshot_0_bytes, + GC.GetTotalMemory(false)); break; case CompressionType.None: _imageStream.EnsureRead(decompressedDdt, 0, decompressedDdt.Length); AaruLogging.Debug(MODULE_NAME, - Localization.Memory_snapshot_0_bytes, - GC.GetTotalMemory(false)); + Localization.Memory_snapshot_0_bytes, + GC.GetTotalMemory(false)); break; default: AaruLogging.Error(string.Format(Localization - .Found_unsupported_compression_algorithm_0, - (ushort)ddtHeader.compression)); + .Found_unsupported_compression_algorithm_0, + (ushort)ddtHeader.compression)); return ErrorNumber.NotSupported; } @@ -641,8 +632,8 @@ public sealed partial class AaruFormat } AaruLogging.Debug(MODULE_NAME, - Localization.Memory_snapshot_0_bytes, - GC.GetTotalMemory(false)); + Localization.Memory_snapshot_0_bytes, + GC.GetTotalMemory(false)); break; } @@ -659,18 +650,16 @@ public sealed partial class AaruFormat if(_geometryBlock.identifier == BlockType.GeometryBlock) { AaruLogging.Debug(MODULE_NAME, - Localization.Geometry_set_to_0_cylinders_1_heads_2_sectors_per_track, - _geometryBlock.cylinders, - _geometryBlock.heads, - _geometryBlock.sectorsPerTrack); + Localization.Geometry_set_to_0_cylinders_1_heads_2_sectors_per_track, + _geometryBlock.cylinders, + _geometryBlock.heads, + _geometryBlock.sectorsPerTrack); _imageInfo.Cylinders = _geometryBlock.cylinders; _imageInfo.Heads = _geometryBlock.heads; _imageInfo.SectorsPerTrack = _geometryBlock.sectorsPerTrack; - AaruLogging.Debug(MODULE_NAME, - Localization.Memory_snapshot_0_bytes, - GC.GetTotalMemory(false)); + AaruLogging.Debug(MODULE_NAME, Localization.Memory_snapshot_0_bytes, GC.GetTotalMemory(false)); } break; @@ -685,15 +674,13 @@ public sealed partial class AaruFormat if(metadataBlock.identifier != entry.blockType) { AaruLogging.Debug(MODULE_NAME, - Localization.Incorrect_identifier_for_data_block_at_position_0, - entry.offset); + Localization.Incorrect_identifier_for_data_block_at_position_0, + entry.offset); break; } - AaruLogging.Debug(MODULE_NAME, - Localization.Found_metadata_block_at_position_0, - entry.offset); + AaruLogging.Debug(MODULE_NAME, Localization.Found_metadata_block_at_position_0, entry.offset); byte[] metadata = new byte[metadataBlock.blockSize]; _imageStream.Position = (long)entry.offset; @@ -705,9 +692,9 @@ public sealed partial class AaruFormat _imageInfo.LastMediaSequence = metadataBlock.lastMediaSequence; AaruLogging.Debug(MODULE_NAME, - Localization.Setting_media_sequence_as_0_of_1, - _imageInfo.MediaSequence, - _imageInfo.LastMediaSequence); + Localization.Setting_media_sequence_as_0_of_1, + _imageInfo.MediaSequence, + _imageInfo.LastMediaSequence); } if(metadataBlock.creatorLength > 0 && @@ -738,9 +725,7 @@ public sealed partial class AaruFormat (int)metadataBlock.mediaTitleOffset, (int)(metadataBlock.mediaTitleLength - 2)); - AaruLogging.Debug(MODULE_NAME, - Localization.Setting_media_title_0, - _imageInfo.MediaTitle); + AaruLogging.Debug(MODULE_NAME, Localization.Setting_media_title_0, _imageInfo.MediaTitle); } if(metadataBlock.mediaManufacturerOffset > 0 && @@ -752,8 +737,8 @@ public sealed partial class AaruFormat (int)(metadataBlock.mediaManufacturerLength - 2)); AaruLogging.Debug(MODULE_NAME, - Localization.Setting_media_manufacturer_0, - _imageInfo.MediaManufacturer); + Localization.Setting_media_manufacturer_0, + _imageInfo.MediaManufacturer); } if(metadataBlock.mediaModelOffset > 0 && @@ -764,9 +749,7 @@ public sealed partial class AaruFormat (int)metadataBlock.mediaModelOffset, (int)(metadataBlock.mediaModelLength - 2)); - AaruLogging.Debug(MODULE_NAME, - Localization.Setting_media_model_0, - _imageInfo.MediaModel); + AaruLogging.Debug(MODULE_NAME, Localization.Setting_media_model_0, _imageInfo.MediaModel); } if(metadataBlock.mediaSerialNumberOffset > 0 && @@ -778,8 +761,8 @@ public sealed partial class AaruFormat (int)(metadataBlock.mediaSerialNumberLength - 2)); AaruLogging.Debug(MODULE_NAME, - Localization.Setting_media_serial_number_0, - _imageInfo.MediaSerialNumber); + Localization.Setting_media_serial_number_0, + _imageInfo.MediaSerialNumber); } if(metadataBlock.mediaBarcodeOffset > 0 && @@ -790,9 +773,7 @@ public sealed partial class AaruFormat (int)metadataBlock.mediaBarcodeOffset, (int)(metadataBlock.mediaBarcodeLength - 2)); - AaruLogging.Debug(MODULE_NAME, - Localization.Setting_media_barcode_0, - _imageInfo.MediaBarcode); + AaruLogging.Debug(MODULE_NAME, Localization.Setting_media_barcode_0, _imageInfo.MediaBarcode); } if(metadataBlock.mediaPartNumberOffset > 0 && @@ -804,8 +785,8 @@ public sealed partial class AaruFormat (int)(metadataBlock.mediaPartNumberLength - 2)); AaruLogging.Debug(MODULE_NAME, - Localization.Setting_media_part_number_0, - _imageInfo.MediaPartNumber); + Localization.Setting_media_part_number_0, + _imageInfo.MediaPartNumber); } if(metadataBlock.driveManufacturerOffset > 0 && @@ -817,8 +798,8 @@ public sealed partial class AaruFormat (int)(metadataBlock.driveManufacturerLength - 2)); AaruLogging.Debug(MODULE_NAME, - Localization.Setting_drive_manufacturer_0, - _imageInfo.DriveManufacturer); + Localization.Setting_drive_manufacturer_0, + _imageInfo.DriveManufacturer); } if(metadataBlock.driveModelOffset > 0 && @@ -829,9 +810,7 @@ public sealed partial class AaruFormat (int)metadataBlock.driveModelOffset, (int)(metadataBlock.driveModelLength - 2)); - AaruLogging.Debug(MODULE_NAME, - Localization.Setting_drive_model_0, - _imageInfo.DriveModel); + AaruLogging.Debug(MODULE_NAME, Localization.Setting_drive_model_0, _imageInfo.DriveModel); } if(metadataBlock.driveSerialNumberOffset > 0 && @@ -843,8 +822,8 @@ public sealed partial class AaruFormat (int)(metadataBlock.driveSerialNumberLength - 2)); AaruLogging.Debug(MODULE_NAME, - Localization.Setting_drive_serial_number_0, - _imageInfo.DriveSerialNumber); + Localization.Setting_drive_serial_number_0, + _imageInfo.DriveSerialNumber); } if(metadataBlock.driveFirmwareRevisionOffset > 0 && @@ -857,13 +836,11 @@ public sealed partial class AaruFormat (int)(metadataBlock.driveFirmwareRevisionLength - 2)); AaruLogging.Debug(MODULE_NAME, - Localization.Setting_drive_firmware_revision_0, - _imageInfo.DriveFirmwareRevision); + Localization.Setting_drive_firmware_revision_0, + _imageInfo.DriveFirmwareRevision); } - AaruLogging.Debug(MODULE_NAME, - Localization.Memory_snapshot_0_bytes, - GC.GetTotalMemory(false)); + AaruLogging.Debug(MODULE_NAME, Localization.Memory_snapshot_0_bytes, GC.GetTotalMemory(false)); break; @@ -876,8 +853,8 @@ public sealed partial class AaruFormat if(tracksHeader.identifier != BlockType.TracksBlock) { AaruLogging.Debug(MODULE_NAME, - Localization.Incorrect_identifier_for_tracks_block_at_position_0, - entry.offset); + Localization.Incorrect_identifier_for_tracks_block_at_position_0, + entry.offset); break; } @@ -889,10 +866,9 @@ public sealed partial class AaruFormat if(BitConverter.ToUInt64(trksCrc, 0) != tracksHeader.crc64) { AaruLogging.Debug(MODULE_NAME, - Localization - .Incorrect_CRC_found_0_X16_found_expected_1_X16_continuing, - BitConverter.ToUInt64(trksCrc, 0), - tracksHeader.crc64); + Localization.Incorrect_CRC_found_0_X16_found_expected_1_X16_continuing, + BitConverter.ToUInt64(trksCrc, 0), + tracksHeader.crc64); break; } @@ -904,9 +880,9 @@ public sealed partial class AaruFormat _trackIsrcs = new Dictionary(); AaruLogging.Debug(MODULE_NAME, - Localization.Found_0_tracks_at_position_1, - tracksHeader.entries, - entry.offset); + Localization.Found_0_tracks_at_position_1, + tracksHeader.entries, + entry.offset); for(ushort i = 0; i < tracksHeader.entries; i++) { @@ -945,9 +921,7 @@ public sealed partial class AaruFormat _imageInfo.HasPartitions = true; _imageInfo.HasSessions = true; - AaruLogging.Debug(MODULE_NAME, - Localization.Memory_snapshot_0_bytes, - GC.GetTotalMemory(false)); + AaruLogging.Debug(MODULE_NAME, Localization.Memory_snapshot_0_bytes, GC.GetTotalMemory(false)); break; @@ -962,12 +936,10 @@ public sealed partial class AaruFormat if(cicmBlock.identifier != BlockType.CicmBlock) break; AaruLogging.Debug(MODULE_NAME, - Localization.Found_CICM_XML_metadata_block_at_position_0, - entry.offset); + Localization.Found_CICM_XML_metadata_block_at_position_0, + entry.offset); - AaruLogging.Debug(MODULE_NAME, - Localization.Memory_snapshot_0_bytes, - GC.GetTotalMemory(false)); + AaruLogging.Debug(MODULE_NAME, Localization.Memory_snapshot_0_bytes, GC.GetTotalMemory(false)); byte[] cicmBytes = new byte[cicmBlock.length]; _imageStream.EnsureRead(cicmBytes, 0, cicmBytes.Length); @@ -991,8 +963,8 @@ public sealed partial class AaruFormat catch(XmlException ex) { AaruLogging.Debug(MODULE_NAME, - Localization.Exception_0_processing_CICM_XML_metadata_block, - ex.Message); + Localization.Exception_0_processing_CICM_XML_metadata_block, + ex.Message); AaruLogging.Exception(ex, Localization.Exception_0_processing_CICM_XML_metadata_block, @@ -1001,9 +973,7 @@ public sealed partial class AaruFormat AaruMetadata = null; } - AaruLogging.Debug(MODULE_NAME, - Localization.Memory_snapshot_0_bytes, - GC.GetTotalMemory(false)); + AaruLogging.Debug(MODULE_NAME, Localization.Memory_snapshot_0_bytes, GC.GetTotalMemory(false)); break; @@ -1017,13 +987,9 @@ public sealed partial class AaruFormat if(aaruMetadataBlock.identifier != BlockType.AaruMetadataJsonBlock) break; - AaruLogging.Debug(MODULE_NAME, - Localization.Found_Aaru_Metadata_block_at_position_0, - entry.offset); + AaruLogging.Debug(MODULE_NAME, Localization.Found_Aaru_Metadata_block_at_position_0, entry.offset); - AaruLogging.Debug(MODULE_NAME, - Localization.Memory_snapshot_0_bytes, - GC.GetTotalMemory(false)); + AaruLogging.Debug(MODULE_NAME, Localization.Memory_snapshot_0_bytes, GC.GetTotalMemory(false)); byte[] jsonBytes = new byte[aaruMetadataBlock.length]; _imageStream.EnsureRead(jsonBytes, 0, jsonBytes.Length); @@ -1037,19 +1003,15 @@ public sealed partial class AaruFormat catch(JsonException ex) { AaruLogging.Debug(MODULE_NAME, - Localization.Exception_0_processing_Aaru_Metadata_block, - ex.Message); + Localization.Exception_0_processing_Aaru_Metadata_block, + ex.Message); - AaruLogging.Exception(ex, - Localization.Exception_0_processing_Aaru_Metadata_block, - ex.Message); + AaruLogging.Exception(ex, Localization.Exception_0_processing_Aaru_Metadata_block, ex.Message); AaruMetadata = null; } - AaruLogging.Debug(MODULE_NAME, - Localization.Memory_snapshot_0_bytes, - GC.GetTotalMemory(false)); + AaruLogging.Debug(MODULE_NAME, Localization.Memory_snapshot_0_bytes, GC.GetTotalMemory(false)); break; @@ -1063,13 +1025,9 @@ public sealed partial class AaruFormat if(dumpBlock.identifier != BlockType.DumpHardwareBlock) break; - AaruLogging.Debug(MODULE_NAME, - Localization.Found_dump_hardware_block_at_position_0, - entry.offset); + AaruLogging.Debug(MODULE_NAME, Localization.Found_dump_hardware_block_at_position_0, entry.offset); - AaruLogging.Debug(MODULE_NAME, - Localization.Memory_snapshot_0_bytes, - GC.GetTotalMemory(false)); + AaruLogging.Debug(MODULE_NAME, Localization.Memory_snapshot_0_bytes, GC.GetTotalMemory(false)); _structureBytes = new byte[dumpBlock.length]; _imageStream.EnsureRead(_structureBytes, 0, _structureBytes.Length); @@ -1078,10 +1036,9 @@ public sealed partial class AaruFormat if(BitConverter.ToUInt64(dumpCrc, 0) != dumpBlock.crc64) { AaruLogging.Debug(MODULE_NAME, - Localization - .Incorrect_CRC_found_0_X16_found_expected_1_X16_continuing, - BitConverter.ToUInt64(dumpCrc, 0), - dumpBlock.crc64); + Localization.Incorrect_CRC_found_0_X16_found_expected_1_X16_continuing, + BitConverter.ToUInt64(dumpCrc, 0), + dumpBlock.crc64); break; } @@ -1190,9 +1147,7 @@ public sealed partial class AaruFormat if(DumpHardware.Count == 0) DumpHardware = null; - AaruLogging.Debug(MODULE_NAME, - Localization.Memory_snapshot_0_bytes, - GC.GetTotalMemory(false)); + AaruLogging.Debug(MODULE_NAME, Localization.Memory_snapshot_0_bytes, GC.GetTotalMemory(false)); break; @@ -1206,9 +1161,7 @@ public sealed partial class AaruFormat if(partitionHeader.identifier != BlockType.TapePartitionBlock) break; - AaruLogging.Debug(MODULE_NAME, - Localization.Found_tape_partition_block_at_position_0, - entry.offset); + AaruLogging.Debug(MODULE_NAME, Localization.Found_tape_partition_block_at_position_0, entry.offset); byte[] tapePartitionBytes = new byte[partitionHeader.length]; _imageStream.EnsureRead(tapePartitionBytes, 0, tapePartitionBytes.Length); @@ -1241,9 +1194,7 @@ public sealed partial class AaruFormat if(fileHeader.identifier != BlockType.TapeFileBlock) break; - AaruLogging.Debug(MODULE_NAME, - Localization.Found_tape_file_block_at_position_0, - entry.offset); + AaruLogging.Debug(MODULE_NAME, Localization.Found_tape_file_block_at_position_0, entry.offset); byte[] tapeFileBytes = new byte[fileHeader.length]; _imageStream.EnsureRead(tapeFileBytes, 0, tapeFileBytes.Length); @@ -1276,9 +1227,9 @@ public sealed partial class AaruFormat if(indexesHeader.identifier != BlockType.CompactDiscIndexesBlock) { AaruLogging.Debug(MODULE_NAME, - Localization - .Incorrect_identifier_for_compact_disc_indexes_block_at_position_0, - entry.offset); + Localization + .Incorrect_identifier_for_compact_disc_indexes_block_at_position_0, + entry.offset); break; } @@ -1290,10 +1241,9 @@ public sealed partial class AaruFormat if(BitConverter.ToUInt64(idsxCrc, 0) != indexesHeader.crc64) { AaruLogging.Debug(MODULE_NAME, - Localization - .Incorrect_CRC_found_0_X16_found_expected_1_X16_continuing, - BitConverter.ToUInt64(idsxCrc, 0), - indexesHeader.crc64); + Localization.Incorrect_CRC_found_0_X16_found_expected_1_X16_continuing, + BitConverter.ToUInt64(idsxCrc, 0), + indexesHeader.crc64); break; } @@ -1303,9 +1253,9 @@ public sealed partial class AaruFormat compactDiscIndexes = []; AaruLogging.Debug(MODULE_NAME, - Localization.Found_0_compact_disc_indexes_at_position_1, - indexesHeader.entries, - entry.offset); + Localization.Found_0_compact_disc_indexes_at_position_1, + indexesHeader.entries, + entry.offset); for(ushort i = 0; i < indexesHeader.entries; i++) { @@ -1317,9 +1267,7 @@ public sealed partial class AaruFormat CompactDiscIndexEntry>(_structureBytes)); } - AaruLogging.Debug(MODULE_NAME, - Localization.Memory_snapshot_0_bytes, - GC.GetTotalMemory(false)); + AaruLogging.Debug(MODULE_NAME, Localization.Memory_snapshot_0_bytes, GC.GetTotalMemory(false)); break; } @@ -1471,7 +1419,7 @@ public sealed partial class AaruFormat if(sessionPregapFixed) { AaruLogging.Error(Localization - .This_image_has_a_corrupted_track_list_a_best_effort_has_been_tried_but_may_require_manual_editing_or_redump); + .This_image_has_a_corrupted_track_list_a_best_effort_has_been_tried_but_may_require_manual_editing_or_redump); } } @@ -1558,7 +1506,7 @@ public sealed partial class AaruFormat Partitions.Add(new Partition { Sequence = track.Sequence, - Type = track.Type.ToString(), + Type = track.Type.Humanize(), Name = string.Format(Localization.Track_0, track.Sequence), Offset = currentTrackOffset, Start = (ulong)track.Indexes[1], @@ -1751,9 +1699,9 @@ public sealed partial class AaruFormat if(decompressedLength != blockHeader.length) { AaruLogging.Debug(MODULE_NAME, - Localization.Error_decompressing_block_should_be_0_bytes_but_got_1_bytes, - blockHeader.length, - decompressedLength); + Localization.Error_decompressing_block_should_be_0_bytes_but_got_1_bytes, + blockHeader.length, + decompressedLength); return ErrorNumber.InOutError; } @@ -1770,9 +1718,9 @@ public sealed partial class AaruFormat if(decompressedLength != blockHeader.length) { AaruLogging.Debug(MODULE_NAME, - Localization.Error_decompressing_block_should_be_0_bytes_but_got_1_bytes, - blockHeader.length, - decompressedLength); + Localization.Error_decompressing_block_should_be_0_bytes_but_got_1_bytes, + blockHeader.length, + decompressedLength); return ErrorNumber.InOutError; } diff --git a/Aaru.Images/AaruFormat/Write.cs b/Aaru.Images/AaruFormat/Write.cs index cefeac0e5..6df524100 100644 --- a/Aaru.Images/AaruFormat/Write.cs +++ b/Aaru.Images/AaruFormat/Write.cs @@ -52,6 +52,7 @@ using Aaru.Decoders; using Aaru.Decoders.CD; using Aaru.Helpers; using Aaru.Logging; +using Humanizer; using Schemas; using Marshal = Aaru.Helpers.Marshal; using Partition = Aaru.CommonTypes.Partition; @@ -222,9 +223,9 @@ public sealed partial class AaruFormat } AaruLogging.Debug(MODULE_NAME, - Localization.Got_a_shift_of_0_for_1_sectors_per_block, - _shift, - oldSectorsPerBlock); + Localization.Got_a_shift_of_0_for_1_sectors_per_block, + _shift, + oldSectorsPerBlock); _imageInfo = new ImageInfo { @@ -333,9 +334,9 @@ public sealed partial class AaruFormat } AaruLogging.Debug(MODULE_NAME, - Localization.Index_at_0_contains_1_entries, - _header.indexOffset, - idxHeader.entries); + Localization.Index_at_0_contains_1_entries, + _header.indexOffset, + idxHeader.entries); for(ushort i = 0; i < idxHeader.entries; i++) { @@ -344,10 +345,10 @@ public sealed partial class AaruFormat IndexEntry entry = Marshal.SpanToStructureLittleEndian(_structureBytes); AaruLogging.Debug(MODULE_NAME, - Localization.Block_type_0_with_data_type_1_is_indexed_to_be_at_2, - entry.blockType, - entry.dataType, - entry.offset); + Localization.Block_type_0_with_data_type_1_is_indexed_to_be_at_2, + entry.blockType, + entry.dataType, + entry.offset); _index.Add(entry); } @@ -380,8 +381,8 @@ public sealed partial class AaruFormat if(blockHeader.identifier != entry.blockType) { AaruLogging.Debug(MODULE_NAME, - Localization.Incorrect_identifier_for_data_block_at_position_0, - entry.offset); + Localization.Incorrect_identifier_for_data_block_at_position_0, + entry.offset); break; } @@ -389,11 +390,11 @@ public sealed partial class AaruFormat if(blockHeader.type != entry.dataType) { AaruLogging.Debug(MODULE_NAME, - Localization - .Expected_block_with_data_type_0_at_position_1_but_found_data_type_2, - entry.dataType, - entry.offset, - blockHeader.type); + Localization + .Expected_block_with_data_type_0_at_position_1_but_found_data_type_2, + entry.dataType, + entry.offset, + blockHeader.type); break; } @@ -401,13 +402,11 @@ public sealed partial class AaruFormat byte[] data; AaruLogging.Debug(MODULE_NAME, - Localization.Found_data_block_type_0_at_position_1, - entry.dataType, - entry.offset); + Localization.Found_data_block_type_0_at_position_1, + entry.dataType, + entry.offset); - AaruLogging.Debug(MODULE_NAME, - Localization.Memory_snapshot_0_bytes, - GC.GetTotalMemory(false)); + AaruLogging.Debug(MODULE_NAME, Localization.Memory_snapshot_0_bytes, GC.GetTotalMemory(false)); // Decompress media tag if(blockHeader.compression is CompressionType.Lzma @@ -417,10 +416,10 @@ public sealed partial class AaruFormat entry.dataType != DataType.CdSectorSubchannel) { AaruLogging.Debug(MODULE_NAME, - Localization - .Invalid_compression_type_0_for_block_with_data_type_1_continuing, - blockHeader.compression, - entry.dataType); + Localization + .Invalid_compression_type_0_for_block_with_data_type_1_continuing, + blockHeader.compression, + entry.dataType); break; } @@ -451,12 +450,12 @@ public sealed partial class AaruFormat decompressStopwatch.Stop(); AaruLogging.Debug(MODULE_NAME, - Localization.Took_0_seconds_to_decompress_block, - decompressStopwatch.Elapsed.TotalSeconds); + Localization.Took_0_seconds_to_decompress_block, + decompressStopwatch.Elapsed.TotalSeconds); AaruLogging.Debug(MODULE_NAME, - Localization.Memory_snapshot_0_bytes, - GC.GetTotalMemory(false)); + Localization.Memory_snapshot_0_bytes, + GC.GetTotalMemory(false)); } else if(blockHeader.compression == CompressionType.None) { @@ -464,14 +463,14 @@ public sealed partial class AaruFormat _imageStream.EnsureRead(data, 0, (int)blockHeader.length); AaruLogging.Debug(MODULE_NAME, - Localization.Memory_snapshot_0_bytes, - GC.GetTotalMemory(false)); + Localization.Memory_snapshot_0_bytes, + GC.GetTotalMemory(false)); } else { AaruLogging.Debug(MODULE_NAME, - Localization.Found_unknown_compression_type_0_continuing, - (ushort)blockHeader.compression); + Localization.Found_unknown_compression_type_0_continuing, + (ushort)blockHeader.compression); break; } @@ -482,10 +481,9 @@ public sealed partial class AaruFormat if(BitConverter.ToUInt64(blockCrc, 0) != blockHeader.crc64 && blockHeader.crc64 != 0) { AaruLogging.Debug(MODULE_NAME, - Localization - .Incorrect_CRC_found_0_X16_found_expected_1_X16_continuing, - BitConverter.ToUInt64(blockCrc, 0), - blockHeader.crc64); + Localization.Incorrect_CRC_found_0_X16_found_expected_1_X16_continuing, + BitConverter.ToUInt64(blockCrc, 0), + blockHeader.crc64); break; } @@ -510,8 +508,8 @@ public sealed partial class AaruFormat _imageInfo.ReadableSectorTags.Add(SectorTagType.CdSectorHeader); AaruLogging.Debug(MODULE_NAME, - Localization.Memory_snapshot_0_bytes, - GC.GetTotalMemory(false)); + Localization.Memory_snapshot_0_bytes, + GC.GetTotalMemory(false)); break; case DataType.CdSectorSuffix: @@ -540,8 +538,8 @@ public sealed partial class AaruFormat _imageInfo.ReadableSectorTags.Add(SectorTagType.CdSectorEdc); AaruLogging.Debug(MODULE_NAME, - Localization.Memory_snapshot_0_bytes, - GC.GetTotalMemory(false)); + Localization.Memory_snapshot_0_bytes, + GC.GetTotalMemory(false)); break; case DataType.CdSectorSubchannel: @@ -551,8 +549,8 @@ public sealed partial class AaruFormat _imageInfo.ReadableSectorTags.Add(SectorTagType.CdSectorSubchannel); AaruLogging.Debug(MODULE_NAME, - Localization.Memory_snapshot_0_bytes, - GC.GetTotalMemory(false)); + Localization.Memory_snapshot_0_bytes, + GC.GetTotalMemory(false)); break; case DataType.AppleProfileTag: @@ -564,16 +562,16 @@ public sealed partial class AaruFormat _imageInfo.ReadableSectorTags.Add(SectorTagType.AppleSectorTag); AaruLogging.Debug(MODULE_NAME, - Localization.Memory_snapshot_0_bytes, - GC.GetTotalMemory(false)); + Localization.Memory_snapshot_0_bytes, + GC.GetTotalMemory(false)); break; case DataType.CompactDiscMode2Subheader: _mode2Subheaders = data; AaruLogging.Debug(MODULE_NAME, - Localization.Memory_snapshot_0_bytes, - GC.GetTotalMemory(false)); + Localization.Memory_snapshot_0_bytes, + GC.GetTotalMemory(false)); break; case DataType.DvdSectorCprMai: @@ -586,8 +584,8 @@ public sealed partial class AaruFormat _imageInfo.ReadableSectorTags.Add(SectorTagType.DvdSectorTitleKey); AaruLogging.Debug(MODULE_NAME, - Localization.Memory_snapshot_0_bytes, - GC.GetTotalMemory(false)); + Localization.Memory_snapshot_0_bytes, + GC.GetTotalMemory(false)); break; case DataType.DvdSectorTitleKeyDecrypted: @@ -597,8 +595,8 @@ public sealed partial class AaruFormat _imageInfo.ReadableSectorTags.Add(SectorTagType.DvdTitleKeyDecrypted); AaruLogging.Debug(MODULE_NAME, - Localization.Memory_snapshot_0_bytes, - GC.GetTotalMemory(false)); + Localization.Memory_snapshot_0_bytes, + GC.GetTotalMemory(false)); break; case DataType.DvdSectorId: @@ -611,8 +609,8 @@ public sealed partial class AaruFormat _imageInfo.ReadableSectorTags.Add(SectorTagType.DvdSectorNumber); AaruLogging.Debug("Aaru Format plugin", - Localization.Memory_snapshot_0_bytes, - GC.GetTotalMemory(false)); + Localization.Memory_snapshot_0_bytes, + GC.GetTotalMemory(false)); break; case DataType.DvdSectorIed: @@ -622,8 +620,8 @@ public sealed partial class AaruFormat _imageInfo.ReadableSectorTags.Add(SectorTagType.DvdSectorIed); AaruLogging.Debug("Aaru Format plugin", - Localization.Memory_snapshot_0_bytes, - GC.GetTotalMemory(false)); + Localization.Memory_snapshot_0_bytes, + GC.GetTotalMemory(false)); break; case DataType.DvdSectorEdc: @@ -633,8 +631,8 @@ public sealed partial class AaruFormat _imageInfo.ReadableSectorTags.Add(SectorTagType.DvdSectorEdc); AaruLogging.Debug("Aaru Format plugin", - Localization.Memory_snapshot_0_bytes, - GC.GetTotalMemory(false)); + Localization.Memory_snapshot_0_bytes, + GC.GetTotalMemory(false)); break; default: @@ -643,9 +641,8 @@ public sealed partial class AaruFormat if(_mediaTags.ContainsKey(mediaTagType)) { AaruLogging.Debug(MODULE_NAME, - Localization - .Media_tag_type_0_duplicated_removing_previous_entry, - mediaTagType); + Localization.Media_tag_type_0_duplicated_removing_previous_entry, + mediaTagType); _mediaTags.Remove(mediaTagType); } @@ -653,8 +650,8 @@ public sealed partial class AaruFormat _mediaTags.Add(mediaTagType, data); AaruLogging.Debug(MODULE_NAME, - Localization.Memory_snapshot_0_bytes, - GC.GetTotalMemory(false)); + Localization.Memory_snapshot_0_bytes, + GC.GetTotalMemory(false)); break; } @@ -718,8 +715,8 @@ public sealed partial class AaruFormat _inMemoryDdt = true; AaruLogging.Debug(MODULE_NAME, - Localization.Took_0_seconds_to_decompress_DDT, - ddtStopwatch.Elapsed.TotalSeconds); + Localization.Took_0_seconds_to_decompress_DDT, + ddtStopwatch.Elapsed.TotalSeconds); break; case CompressionType.None: @@ -799,8 +796,8 @@ public sealed partial class AaruFormat ddtStopwatch.Stop(); AaruLogging.Debug(MODULE_NAME, - Localization.Took_0_seconds_to_decompress_DDT, - ddtStopwatch.Elapsed.TotalSeconds); + Localization.Took_0_seconds_to_decompress_DDT, + ddtStopwatch.Elapsed.TotalSeconds); break; case CompressionType.None: @@ -840,19 +837,18 @@ public sealed partial class AaruFormat if(_geometryBlock.identifier == BlockType.GeometryBlock) { AaruLogging.Debug(MODULE_NAME, - Localization - .Geometry_set_to_0_cylinders_1_heads_2_sectors_per_track, - _geometryBlock.cylinders, - _geometryBlock.heads, - _geometryBlock.sectorsPerTrack); + Localization.Geometry_set_to_0_cylinders_1_heads_2_sectors_per_track, + _geometryBlock.cylinders, + _geometryBlock.heads, + _geometryBlock.sectorsPerTrack); _imageInfo.Cylinders = _geometryBlock.cylinders; _imageInfo.Heads = _geometryBlock.heads; _imageInfo.SectorsPerTrack = _geometryBlock.sectorsPerTrack; AaruLogging.Debug(MODULE_NAME, - Localization.Memory_snapshot_0_bytes, - GC.GetTotalMemory(false)); + Localization.Memory_snapshot_0_bytes, + GC.GetTotalMemory(false)); } break; @@ -868,15 +864,13 @@ public sealed partial class AaruFormat if(metadataBlock.identifier != entry.blockType) { AaruLogging.Debug(MODULE_NAME, - Localization.Incorrect_identifier_for_data_block_at_position_0, - entry.offset); + Localization.Incorrect_identifier_for_data_block_at_position_0, + entry.offset); break; } - AaruLogging.Debug(MODULE_NAME, - Localization.Found_metadata_block_at_position_0, - entry.offset); + AaruLogging.Debug(MODULE_NAME, Localization.Found_metadata_block_at_position_0, entry.offset); byte[] metadata = new byte[metadataBlock.blockSize]; _imageStream.Position = (long)entry.offset; @@ -888,9 +882,9 @@ public sealed partial class AaruFormat _imageInfo.LastMediaSequence = metadataBlock.lastMediaSequence; AaruLogging.Debug(MODULE_NAME, - Localization.Setting_media_sequence_as_0_of_1, - _imageInfo.MediaSequence, - _imageInfo.LastMediaSequence); + Localization.Setting_media_sequence_as_0_of_1, + _imageInfo.MediaSequence, + _imageInfo.LastMediaSequence); } if(metadataBlock.creatorLength > 0 && @@ -912,9 +906,7 @@ public sealed partial class AaruFormat (int)metadataBlock.commentsOffset, (int)(metadataBlock.commentsLength - 2)); - AaruLogging.Debug(MODULE_NAME, - Localization.Setting_comments_0, - _imageInfo.Comments); + AaruLogging.Debug(MODULE_NAME, Localization.Setting_comments_0, _imageInfo.Comments); } if(metadataBlock.mediaTitleOffset > 0 && @@ -925,9 +917,7 @@ public sealed partial class AaruFormat (int)metadataBlock.mediaTitleOffset, (int)(metadataBlock.mediaTitleLength - 2)); - AaruLogging.Debug(MODULE_NAME, - Localization.Setting_media_title_0, - _imageInfo.MediaTitle); + AaruLogging.Debug(MODULE_NAME, Localization.Setting_media_title_0, _imageInfo.MediaTitle); } if(metadataBlock.mediaManufacturerOffset > 0 && @@ -940,8 +930,8 @@ public sealed partial class AaruFormat (int)(metadataBlock.mediaManufacturerLength - 2)); AaruLogging.Debug(MODULE_NAME, - Localization.Setting_media_manufacturer_0, - _imageInfo.MediaManufacturer); + Localization.Setting_media_manufacturer_0, + _imageInfo.MediaManufacturer); } if(metadataBlock.mediaModelOffset > 0 && @@ -952,9 +942,7 @@ public sealed partial class AaruFormat (int)metadataBlock.mediaModelOffset, (int)(metadataBlock.mediaModelLength - 2)); - AaruLogging.Debug(MODULE_NAME, - Localization.Setting_media_model_0, - _imageInfo.MediaModel); + AaruLogging.Debug(MODULE_NAME, Localization.Setting_media_model_0, _imageInfo.MediaModel); } if(metadataBlock.mediaSerialNumberOffset > 0 && @@ -967,8 +955,8 @@ public sealed partial class AaruFormat (int)(metadataBlock.mediaSerialNumberLength - 2)); AaruLogging.Debug(MODULE_NAME, - Localization.Setting_media_serial_number_0, - _imageInfo.MediaSerialNumber); + Localization.Setting_media_serial_number_0, + _imageInfo.MediaSerialNumber); } if(metadataBlock.mediaBarcodeOffset > 0 && @@ -980,8 +968,8 @@ public sealed partial class AaruFormat (int)(metadataBlock.mediaBarcodeLength - 2)); AaruLogging.Debug(MODULE_NAME, - Localization.Setting_media_barcode_0, - _imageInfo.MediaBarcode); + Localization.Setting_media_barcode_0, + _imageInfo.MediaBarcode); } if(metadataBlock.mediaPartNumberOffset > 0 && @@ -993,8 +981,8 @@ public sealed partial class AaruFormat (int)(metadataBlock.mediaPartNumberLength - 2)); AaruLogging.Debug(MODULE_NAME, - Localization.Setting_media_part_number_0, - _imageInfo.MediaPartNumber); + Localization.Setting_media_part_number_0, + _imageInfo.MediaPartNumber); } if(metadataBlock.driveManufacturerOffset > 0 && @@ -1007,8 +995,8 @@ public sealed partial class AaruFormat (int)(metadataBlock.driveManufacturerLength - 2)); AaruLogging.Debug(MODULE_NAME, - Localization.Setting_drive_manufacturer_0, - _imageInfo.DriveManufacturer); + Localization.Setting_drive_manufacturer_0, + _imageInfo.DriveManufacturer); } if(metadataBlock.driveModelOffset > 0 && @@ -1019,9 +1007,7 @@ public sealed partial class AaruFormat (int)metadataBlock.driveModelOffset, (int)(metadataBlock.driveModelLength - 2)); - AaruLogging.Debug(MODULE_NAME, - Localization.Setting_drive_model_0, - _imageInfo.DriveModel); + AaruLogging.Debug(MODULE_NAME, Localization.Setting_drive_model_0, _imageInfo.DriveModel); } if(metadataBlock.driveSerialNumberOffset > 0 && @@ -1034,8 +1020,8 @@ public sealed partial class AaruFormat (int)(metadataBlock.driveSerialNumberLength - 2)); AaruLogging.Debug(MODULE_NAME, - Localization.Setting_drive_serial_number_0, - _imageInfo.DriveSerialNumber); + Localization.Setting_drive_serial_number_0, + _imageInfo.DriveSerialNumber); } if(metadataBlock.driveFirmwareRevisionOffset > 0 && @@ -1048,13 +1034,11 @@ public sealed partial class AaruFormat (int)(metadataBlock.driveFirmwareRevisionLength - 2)); AaruLogging.Debug(MODULE_NAME, - Localization.Setting_drive_firmware_revision_0, - _imageInfo.DriveFirmwareRevision); + Localization.Setting_drive_firmware_revision_0, + _imageInfo.DriveFirmwareRevision); } - AaruLogging.Debug(MODULE_NAME, - Localization.Memory_snapshot_0_bytes, - GC.GetTotalMemory(false)); + AaruLogging.Debug(MODULE_NAME, Localization.Memory_snapshot_0_bytes, GC.GetTotalMemory(false)); break; @@ -1068,8 +1052,8 @@ public sealed partial class AaruFormat if(tracksHeader.identifier != BlockType.TracksBlock) { AaruLogging.Debug(MODULE_NAME, - Localization.Incorrect_identifier_for_tracks_block_at_position_0, - entry.offset); + Localization.Incorrect_identifier_for_tracks_block_at_position_0, + entry.offset); break; } @@ -1081,10 +1065,9 @@ public sealed partial class AaruFormat if(BitConverter.ToUInt64(trksCrc, 0) != tracksHeader.crc64) { AaruLogging.Debug(MODULE_NAME, - Localization - .Incorrect_CRC_found_0_X16_found_expected_1_X16_continuing, - BitConverter.ToUInt64(trksCrc, 0), - tracksHeader.crc64); + Localization.Incorrect_CRC_found_0_X16_found_expected_1_X16_continuing, + BitConverter.ToUInt64(trksCrc, 0), + tracksHeader.crc64); break; } @@ -1096,9 +1079,9 @@ public sealed partial class AaruFormat _trackIsrcs = new Dictionary(); AaruLogging.Debug(MODULE_NAME, - Localization.Found_0_tracks_at_position_1, - tracksHeader.entries, - entry.offset); + Localization.Found_0_tracks_at_position_1, + tracksHeader.entries, + entry.offset); for(ushort i = 0; i < tracksHeader.entries; i++) { @@ -1136,9 +1119,7 @@ public sealed partial class AaruFormat _imageInfo.HasPartitions = true; _imageInfo.HasSessions = true; - AaruLogging.Debug(MODULE_NAME, - Localization.Memory_snapshot_0_bytes, - GC.GetTotalMemory(false)); + AaruLogging.Debug(MODULE_NAME, Localization.Memory_snapshot_0_bytes, GC.GetTotalMemory(false)); break; @@ -1153,8 +1134,8 @@ public sealed partial class AaruFormat if(cicmBlock.identifier != BlockType.CicmBlock) break; AaruLogging.Debug(MODULE_NAME, - Localization.Found_CICM_XML_metadata_block_at_position_0, - entry.offset); + Localization.Found_CICM_XML_metadata_block_at_position_0, + entry.offset); byte[] cicmBytes = new byte[cicmBlock.length]; _imageStream.EnsureRead(cicmBytes, 0, cicmBytes.Length); @@ -1178,8 +1159,8 @@ public sealed partial class AaruFormat catch(XmlException ex) { AaruLogging.Debug(MODULE_NAME, - Localization.Exception_0_processing_CICM_XML_metadata_block, - ex.Message); + Localization.Exception_0_processing_CICM_XML_metadata_block, + ex.Message); AaruLogging.Exception(ex, Localization.Exception_0_processing_CICM_XML_metadata_block, @@ -1201,12 +1182,10 @@ public sealed partial class AaruFormat if(aaruMetadataBlock.identifier != BlockType.AaruMetadataJsonBlock) break; AaruLogging.Debug(MODULE_NAME, - Localization.Found_Aaru_Metadata_block_at_position_0, - entry.offset); + Localization.Found_Aaru_Metadata_block_at_position_0, + entry.offset); - AaruLogging.Debug(MODULE_NAME, - Localization.Memory_snapshot_0_bytes, - GC.GetTotalMemory(false)); + AaruLogging.Debug(MODULE_NAME, Localization.Memory_snapshot_0_bytes, GC.GetTotalMemory(false)); byte[] jsonBytes = new byte[aaruMetadataBlock.length]; _imageStream.EnsureRead(jsonBytes, 0, jsonBytes.Length); @@ -1221,15 +1200,13 @@ public sealed partial class AaruFormat catch(JsonException ex) { AaruLogging.Debug(MODULE_NAME, - Localization.Exception_0_processing_Aaru_Metadata_block, - ex.Message); + Localization.Exception_0_processing_Aaru_Metadata_block, + ex.Message); AaruMetadata = null; } - AaruLogging.Debug(MODULE_NAME, - Localization.Memory_snapshot_0_bytes, - GC.GetTotalMemory(false)); + AaruLogging.Debug(MODULE_NAME, Localization.Memory_snapshot_0_bytes, GC.GetTotalMemory(false)); break; @@ -1244,8 +1221,8 @@ public sealed partial class AaruFormat if(dumpBlock.identifier != BlockType.DumpHardwareBlock) break; AaruLogging.Debug(MODULE_NAME, - Localization.Found_dump_hardware_block_at_position_0, - entry.offset); + Localization.Found_dump_hardware_block_at_position_0, + entry.offset); _structureBytes = new byte[dumpBlock.length]; _imageStream.EnsureRead(_structureBytes, 0, _structureBytes.Length); @@ -1254,10 +1231,9 @@ public sealed partial class AaruFormat if(BitConverter.ToUInt64(dumpCrc, 0) != dumpBlock.crc64) { AaruLogging.Debug(MODULE_NAME, - Localization - .Incorrect_CRC_found_0_X16_found_expected_1_X16_continuing, - BitConverter.ToUInt64(dumpCrc, 0), - dumpBlock.crc64); + Localization.Incorrect_CRC_found_0_X16_found_expected_1_X16_continuing, + BitConverter.ToUInt64(dumpCrc, 0), + dumpBlock.crc64); break; } @@ -1379,8 +1355,8 @@ public sealed partial class AaruFormat if(partitionHeader.identifier != BlockType.TapePartitionBlock) break; AaruLogging.Debug(MODULE_NAME, - Localization.Found_tape_partition_block_at_position_0, - entry.offset); + Localization.Found_tape_partition_block_at_position_0, + entry.offset); byte[] tapePartitionBytes = new byte[partitionHeader.length]; _imageStream.EnsureRead(tapePartitionBytes, 0, tapePartitionBytes.Length); @@ -1414,9 +1390,7 @@ public sealed partial class AaruFormat if(fileHeader.identifier != BlockType.TapeFileBlock) break; - AaruLogging.Debug(MODULE_NAME, - Localization.Found_tape_file_block_at_position_0, - entry.offset); + AaruLogging.Debug(MODULE_NAME, Localization.Found_tape_file_block_at_position_0, entry.offset); byte[] tapeFileBytes = new byte[fileHeader.length]; _imageStream.EnsureRead(tapeFileBytes, 0, tapeFileBytes.Length); @@ -1449,9 +1423,9 @@ public sealed partial class AaruFormat if(indexesHeader.identifier != BlockType.CompactDiscIndexesBlock) { AaruLogging.Debug(MODULE_NAME, - Localization - .Incorrect_identifier_for_compact_disc_indexes_block_at_position_0, - entry.offset); + Localization + .Incorrect_identifier_for_compact_disc_indexes_block_at_position_0, + entry.offset); break; } @@ -1463,10 +1437,9 @@ public sealed partial class AaruFormat if(BitConverter.ToUInt64(idsxCrc, 0) != indexesHeader.crc64) { AaruLogging.Debug(MODULE_NAME, - Localization - .Incorrect_CRC_found_0_X16_found_expected_1_X16_continuing, - BitConverter.ToUInt64(idsxCrc, 0), - indexesHeader.crc64); + Localization.Incorrect_CRC_found_0_X16_found_expected_1_X16_continuing, + BitConverter.ToUInt64(idsxCrc, 0), + indexesHeader.crc64); break; } @@ -1476,9 +1449,9 @@ public sealed partial class AaruFormat compactDiscIndexes = []; AaruLogging.Debug(MODULE_NAME, - Localization.Found_0_compact_disc_indexes_at_position_1, - indexesHeader.entries, - entry.offset); + Localization.Found_0_compact_disc_indexes_at_position_1, + indexesHeader.entries, + entry.offset); for(ushort i = 0; i < indexesHeader.entries; i++) { @@ -1490,9 +1463,7 @@ public sealed partial class AaruFormat CompactDiscIndexEntry>(_structureBytes)); } - AaruLogging.Debug(MODULE_NAME, - Localization.Memory_snapshot_0_bytes, - GC.GetTotalMemory(false)); + AaruLogging.Debug(MODULE_NAME, Localization.Memory_snapshot_0_bytes, GC.GetTotalMemory(false)); break; } @@ -1669,7 +1640,7 @@ public sealed partial class AaruFormat Partitions.Add(new Partition { Sequence = track.Sequence, - Type = track.Type.ToString(), + Type = track.Type.Humanize(), Name = string.Format(Localization.Track_0, track.Sequence), Offset = currentTrackOffset, Start = (ulong)track.Indexes[1], @@ -1928,9 +1899,8 @@ public sealed partial class AaruFormat // Fill FLAC block if(remaining != 0) - { - for(int r = 0; r < remaining * 4; r++) _writingBuffer[_writingBufferPosition + r] = 0; - } + for(int r = 0; r < remaining * 4; r++) + _writingBuffer[_writingBufferPosition + r] = 0; compressedLength = FLAC.EncodeBuffer(_writingBuffer, _compressedBuffer, @@ -2722,9 +2692,8 @@ public sealed partial class AaruFormat // Fill FLAC block if(remaining != 0) - { - for(int r = 0; r < remaining * 4; r++) _writingBuffer[_writingBufferPosition + r] = 0; - } + for(int r = 0; r < remaining * 4; r++) + _writingBuffer[_writingBufferPosition + r] = 0; compressedLength = FLAC.EncodeBuffer(_writingBuffer, _compressedBuffer, @@ -2811,10 +2780,10 @@ public sealed partial class AaruFormat if(_deduplicate) { AaruLogging.Debug(MODULE_NAME, - Localization.Of_0_sectors_written_1_are_unique_2, - _writtenSectors, - _deduplicationTable.Count, - (double)_deduplicationTable.Count / _writtenSectors); + Localization.Of_0_sectors_written_1_are_unique_2, + _writtenSectors, + _deduplicationTable.Count, + (double)_deduplicationTable.Count / _writtenSectors); } IndexEntry idxEntry; @@ -2842,9 +2811,9 @@ public sealed partial class AaruFormat }; AaruLogging.Debug(MODULE_NAME, - Localization.Writing_tag_type_0_to_position_1, - mediaTag.Key, - idxEntry.offset); + Localization.Writing_tag_type_0_to_position_1, + mediaTag.Key, + idxEntry.offset); Crc64Context.Data(mediaTag.Value, out byte[] tagCrc); @@ -3061,9 +3030,7 @@ public sealed partial class AaruFormat offset = (ulong)_imageStream.Position }; - AaruLogging.Debug(MODULE_NAME, - Localization.Writing_dump_hardware_block_to_position_0, - idxEntry.offset); + AaruLogging.Debug(MODULE_NAME, Localization.Writing_dump_hardware_block_to_position_0, idxEntry.offset); Crc64Context.Data(dumpMs.ToArray(), out byte[] dumpCrc); @@ -3105,9 +3072,7 @@ public sealed partial class AaruFormat offset = (ulong)_imageStream.Position }; - AaruLogging.Debug(MODULE_NAME, - Localization.Writing_Aaru_Metadata_block_to_position_0, - idxEntry.offset); + AaruLogging.Debug(MODULE_NAME, Localization.Writing_Aaru_Metadata_block_to_position_0, idxEntry.offset); var jsonBlock = new AaruMetadataJsonBlock { @@ -3216,9 +3181,7 @@ public sealed partial class AaruFormat offset = (ulong)_imageStream.Position }; - AaruLogging.Debug(MODULE_NAME, - Localization.Writing_checksum_block_to_position_0, - idxEntry.offset); + AaruLogging.Debug(MODULE_NAME, Localization.Writing_checksum_block_to_position_0, idxEntry.offset); _structureBytes = new byte[Marshal.SizeOf()]; MemoryMarshal.Write(_structureBytes, in chkHeader); @@ -3249,9 +3212,7 @@ public sealed partial class AaruFormat offset = (ulong)_imageStream.Position }; - AaruLogging.Debug(MODULE_NAME, - Localization.Writing_tape_partitions_to_position_0, - idxEntry.offset); + AaruLogging.Debug(MODULE_NAME, Localization.Writing_tape_partitions_to_position_0, idxEntry.offset); var tapePartitionEntries = new TapePartitionEntry[TapePartitions.Count]; @@ -3434,8 +3395,8 @@ public sealed partial class AaruFormat }; AaruLogging.Debug(MODULE_NAME, - Localization.Writing_CD_sector_prefix_block_to_position_0, - idxEntry.offset); + Localization.Writing_CD_sector_prefix_block_to_position_0, + idxEntry.offset); Crc64Context.Data(_sectorPrefix, out byte[] blockCrc); @@ -3507,8 +3468,8 @@ public sealed partial class AaruFormat compressStopwatch.Stop(); AaruLogging.Debug(MODULE_NAME, - Localization.Took_0_seconds_to_compress_prefix, - compressStopwatch.Elapsed.TotalSeconds); + Localization.Took_0_seconds_to_compress_prefix, + compressStopwatch.Elapsed.TotalSeconds); } _structureBytes = new byte[Marshal.SizeOf()]; @@ -3533,8 +3494,8 @@ public sealed partial class AaruFormat }; AaruLogging.Debug(MODULE_NAME, - Localization.Writing_CD_sector_suffix_block_to_position_0, - idxEntry.offset); + Localization.Writing_CD_sector_suffix_block_to_position_0, + idxEntry.offset); Crc64Context.Data(_sectorSuffix, out blockCrc); @@ -3604,8 +3565,8 @@ public sealed partial class AaruFormat compressStopwatch.Stop(); AaruLogging.Debug(MODULE_NAME, - Localization.Took_0_seconds_to_compress_suffix, - compressStopwatch.Elapsed.TotalSeconds); + Localization.Took_0_seconds_to_compress_suffix, + compressStopwatch.Elapsed.TotalSeconds); } _structureBytes = new byte[Marshal.SizeOf()]; @@ -3693,34 +3654,34 @@ public sealed partial class AaruFormat } AaruLogging.Debug(MODULE_NAME, - Localization - ._0_1_prefixes_are_correct_2_3_prefixes_have_not_been_dumped_4_5_prefixes_have_been_written_to_image, - correctPrefixes, - correctPrefixes / _imageInfo.Sectors, - notDumpedPrefixes, - notDumpedPrefixes / _imageInfo.Sectors, - writtenPrefixes, - writtenPrefixes / _imageInfo.Sectors); + Localization + ._0_1_prefixes_are_correct_2_3_prefixes_have_not_been_dumped_4_5_prefixes_have_been_written_to_image, + correctPrefixes, + correctPrefixes / _imageInfo.Sectors, + notDumpedPrefixes, + notDumpedPrefixes / _imageInfo.Sectors, + writtenPrefixes, + writtenPrefixes / _imageInfo.Sectors); AaruLogging.Debug(MODULE_NAME, - Localization - ._0_1_suffixes_are_correct_2_3_suffixes_have_not_been_dumped_4_5_suffixes_have_been_written_to_image, - correctSuffixes, - correctSuffixes / _imageInfo.Sectors, - notDumpedSuffixes, - notDumpedSuffixes / _imageInfo.Sectors, - writtenSuffixes, - writtenSuffixes / _imageInfo.Sectors); + Localization + ._0_1_suffixes_are_correct_2_3_suffixes_have_not_been_dumped_4_5_suffixes_have_been_written_to_image, + correctSuffixes, + correctSuffixes / _imageInfo.Sectors, + notDumpedSuffixes, + notDumpedSuffixes / _imageInfo.Sectors, + writtenSuffixes, + writtenSuffixes / _imageInfo.Sectors); AaruLogging.Debug(MODULE_NAME, - Localization - ._0_1_MODE_2_Form_1_are_correct_2_3_MODE_2_Form_2_are_correct_4_5_MODE_2_Form_2_have_empty_CRC, - correctMode2Form1, - correctMode2Form1 / _imageInfo.Sectors, - correctMode2Form2, - correctMode2Form2 / _imageInfo.Sectors, - emptyMode2Form1, - emptyMode2Form1 / _imageInfo.Sectors); + Localization + ._0_1_MODE_2_Form_1_are_correct_2_3_MODE_2_Form_2_are_correct_4_5_MODE_2_Form_2_have_empty_CRC, + correctMode2Form1, + correctMode2Form1 / _imageInfo.Sectors, + correctMode2Form2, + correctMode2Form2 / _imageInfo.Sectors, + emptyMode2Form1, + emptyMode2Form1 / _imageInfo.Sectors); #endif idxEntry = new IndexEntry @@ -3731,8 +3692,8 @@ public sealed partial class AaruFormat }; AaruLogging.Debug(MODULE_NAME, - Localization.Writing_CompactDisc_sector_prefix_DDT_to_position_0, - idxEntry.offset); + Localization.Writing_CompactDisc_sector_prefix_DDT_to_position_0, + idxEntry.offset); var ddtHeader = new DdtHeader { @@ -3815,8 +3776,8 @@ public sealed partial class AaruFormat }; AaruLogging.Debug(MODULE_NAME, - Localization.Writing_CompactDisc_sector_suffix_DDT_to_position_0, - idxEntry.offset); + Localization.Writing_CompactDisc_sector_suffix_DDT_to_position_0, + idxEntry.offset); ddtHeader = new DdtHeader { @@ -3896,8 +3857,8 @@ public sealed partial class AaruFormat }; AaruLogging.Debug(MODULE_NAME, - Localization.Writing_CD_sector_corrected_prefix_block_to_position_0, - idxEntry.offset); + Localization.Writing_CD_sector_corrected_prefix_block_to_position_0, + idxEntry.offset); Crc64Context.Data(_sectorPrefixMs.GetBuffer(), (uint)_sectorPrefixMs.Length, out byte[] blockCrc); @@ -3968,8 +3929,8 @@ public sealed partial class AaruFormat compressStopwatch.Stop(); AaruLogging.Debug(MODULE_NAME, - Localization.Took_0_seconds_to_compress_prefix, - compressStopwatch.Elapsed.TotalSeconds); + Localization.Took_0_seconds_to_compress_prefix, + compressStopwatch.Elapsed.TotalSeconds); } _structureBytes = new byte[Marshal.SizeOf()]; @@ -3998,8 +3959,8 @@ public sealed partial class AaruFormat }; AaruLogging.Debug(MODULE_NAME, - Localization.Writing_CD_sector_corrected_suffix_block_to_position_0, - idxEntry.offset); + Localization.Writing_CD_sector_corrected_suffix_block_to_position_0, + idxEntry.offset); Crc64Context.Data(_sectorSuffixMs.GetBuffer(), (uint)_sectorSuffixMs.Length, out blockCrc); @@ -4070,8 +4031,8 @@ public sealed partial class AaruFormat compressStopwatch.Stop(); AaruLogging.Debug(MODULE_NAME, - Localization.Took_0_seconds_to_compress_suffix, - compressStopwatch.Elapsed.TotalSeconds); + Localization.Took_0_seconds_to_compress_suffix, + compressStopwatch.Elapsed.TotalSeconds); } _structureBytes = new byte[Marshal.SizeOf()]; @@ -4103,8 +4064,8 @@ public sealed partial class AaruFormat }; AaruLogging.Debug(MODULE_NAME, - Localization.Writing_CD_MODE2_subheaders_block_to_position_0, - idxEntry.offset); + Localization.Writing_CD_MODE2_subheaders_block_to_position_0, + idxEntry.offset); Crc64Context.Data(_mode2Subheaders, out byte[] blockCrc); @@ -4176,8 +4137,8 @@ public sealed partial class AaruFormat compressStopwatch.Stop(); AaruLogging.Debug(MODULE_NAME, - Localization.Took_0_seconds_to_compress_MODE2_subheaders, - compressStopwatch.Elapsed.TotalSeconds); + Localization.Took_0_seconds_to_compress_MODE2_subheaders, + compressStopwatch.Elapsed.TotalSeconds); } _structureBytes = new byte[Marshal.SizeOf()]; @@ -4209,8 +4170,8 @@ public sealed partial class AaruFormat }; AaruLogging.Debug(MODULE_NAME, - Localization.Writing_CD_subchannel_block_to_position_0, - idxEntry.offset); + Localization.Writing_CD_subchannel_block_to_position_0, + idxEntry.offset); Crc64Context.Data(_sectorSubchannel, out byte[] blockCrc); @@ -4286,8 +4247,8 @@ public sealed partial class AaruFormat compressStopwatch.Stop(); AaruLogging.Debug(MODULE_NAME, - Localization.Took_0_seconds_to_compress_subchannel, - compressStopwatch.Elapsed.TotalSeconds); + Localization.Took_0_seconds_to_compress_subchannel, + compressStopwatch.Elapsed.TotalSeconds); } _structureBytes = new byte[Marshal.SizeOf()]; @@ -4319,8 +4280,8 @@ public sealed partial class AaruFormat }; AaruLogging.Debug(MODULE_NAME, - Localization.Writing_DVD_CPR_MAI_block_to_position_0, - idxEntry.offset); + Localization.Writing_DVD_CPR_MAI_block_to_position_0, + idxEntry.offset); Crc64Context.Data(_sectorCprMai, out byte[] blockCrc); @@ -4392,8 +4353,8 @@ public sealed partial class AaruFormat compressStopwatch.Stop(); AaruLogging.Debug(MODULE_NAME, - Localization.Took_0_seconds_to_compress_CPR_MAI, - compressStopwatch.Elapsed.TotalSeconds); + Localization.Took_0_seconds_to_compress_CPR_MAI, + compressStopwatch.Elapsed.TotalSeconds); } _structureBytes = new byte[Marshal.SizeOf()]; @@ -4421,9 +4382,7 @@ public sealed partial class AaruFormat offset = (ulong)_imageStream.Position }; - AaruLogging.Debug(MODULE_NAME, - Localization.Writing_DVD_ID_block_to_position_0, - idxEntry.offset); + AaruLogging.Debug(MODULE_NAME, Localization.Writing_DVD_ID_block_to_position_0, idxEntry.offset); Crc64Context.Data(_sectorId, out byte[] blockCrc); @@ -4494,8 +4453,8 @@ public sealed partial class AaruFormat compressStopwatch.Stop(); AaruLogging.Debug(MODULE_NAME, - Localization.Took_0_seconds_to_compress_ID, - compressStopwatch.Elapsed.TotalSeconds); + Localization.Took_0_seconds_to_compress_ID, + compressStopwatch.Elapsed.TotalSeconds); } _structureBytes = new byte[Marshal.SizeOf()]; @@ -4522,9 +4481,7 @@ public sealed partial class AaruFormat offset = (ulong)_imageStream.Position }; - AaruLogging.Debug(MODULE_NAME, - Localization.Writing_DVD_IED_block_to_position_0, - idxEntry.offset); + AaruLogging.Debug(MODULE_NAME, Localization.Writing_DVD_IED_block_to_position_0, idxEntry.offset); Crc64Context.Data(_sectorIed, out byte[] blockCrc); @@ -4595,8 +4552,8 @@ public sealed partial class AaruFormat compressStopwatch.Stop(); AaruLogging.Debug(MODULE_NAME, - Localization.Took_0_seconds_to_compress_IED, - compressStopwatch.Elapsed.TotalSeconds); + Localization.Took_0_seconds_to_compress_IED, + compressStopwatch.Elapsed.TotalSeconds); } _structureBytes = new byte[Marshal.SizeOf()]; @@ -4623,9 +4580,7 @@ public sealed partial class AaruFormat offset = (ulong)_imageStream.Position }; - AaruLogging.Debug(MODULE_NAME, - Localization.Writing_DVD_EDC_block_to_position_0, - idxEntry.offset); + AaruLogging.Debug(MODULE_NAME, Localization.Writing_DVD_EDC_block_to_position_0, idxEntry.offset); Crc64Context.Data(_sectorEdc, out byte[] blockCrc); @@ -4696,8 +4651,8 @@ public sealed partial class AaruFormat compressStopwatch.Stop(); AaruLogging.Debug(MODULE_NAME, - Localization.Took_0_seconds_to_compress_EDC, - compressStopwatch.Elapsed.TotalSeconds); + Localization.Took_0_seconds_to_compress_EDC, + compressStopwatch.Elapsed.TotalSeconds); } _structureBytes = new byte[Marshal.SizeOf()]; @@ -4725,8 +4680,8 @@ public sealed partial class AaruFormat }; AaruLogging.Debug(MODULE_NAME, - Localization.Writing_decrypted_DVD_title_key_block_to_position_0, - idxEntry.offset); + Localization.Writing_decrypted_DVD_title_key_block_to_position_0, + idxEntry.offset); Crc64Context.Data(_sectorDecryptedTitleKey, out byte[] blockCrc); @@ -4798,8 +4753,8 @@ public sealed partial class AaruFormat compressStopwatch.Stop(); AaruLogging.Debug(MODULE_NAME, - Localization.Took_0_seconds_to_compress_decrypted_DVD_title_keys, - compressStopwatch.Elapsed.TotalSeconds); + Localization.Took_0_seconds_to_compress_decrypted_DVD_title_keys, + compressStopwatch.Elapsed.TotalSeconds); } _structureBytes = new byte[Marshal.SizeOf()]; @@ -4897,9 +4852,7 @@ public sealed partial class AaruFormat crc64 = BitConverter.ToUInt64(trksCrc, 0) }; - AaruLogging.Debug(MODULE_NAME, - Localization.Writing_tracks_to_position_0, - _imageStream.Position); + AaruLogging.Debug(MODULE_NAME, Localization.Writing_tracks_to_position_0, _imageStream.Position); _index.RemoveAll(t => t is { blockType: BlockType.TracksBlock, dataType: DataType.NoData }); @@ -4950,8 +4903,8 @@ public sealed partial class AaruFormat }; AaruLogging.Debug(MODULE_NAME, - Localization.Writing_compact_disc_indexes_to_position_0, - _imageStream.Position); + Localization.Writing_compact_disc_indexes_to_position_0, + _imageStream.Position); _index.RemoveAll(t => t is { @@ -5000,8 +4953,8 @@ public sealed partial class AaruFormat }; AaruLogging.Debug(MODULE_NAME, - Localization.Writing_apple_sector_tag_block_to_position_0, - idxEntry.offset); + Localization.Writing_apple_sector_tag_block_to_position_0, + idxEntry.offset); Crc64Context.Data(_sectorSubchannel, out byte[] blockCrc); diff --git a/Aaru.Images/Alcohol120/Read.cs b/Aaru.Images/Alcohol120/Read.cs index a7608f698..3bfc20886 100644 --- a/Aaru.Images/Alcohol120/Read.cs +++ b/Aaru.Images/Alcohol120/Read.cs @@ -152,114 +152,114 @@ public sealed partial class Alcohol120 } AaruLogging.Debug(MODULE_NAME, - "session[{2}].track[{1}].mode = {0}", - track.mode, - track.point, - session.sessionSequence); + "session[{2}].track[{1}].mode = {0}", + track.mode, + track.point, + session.sessionSequence); AaruLogging.Debug(MODULE_NAME, - "session[{2}].track[{1}].subMode = {0}", - track.subMode, - track.point, - session.sessionSequence); + "session[{2}].track[{1}].subMode = {0}", + track.subMode, + track.point, + session.sessionSequence); AaruLogging.Debug(MODULE_NAME, - "session[{2}].track[{1}].adrCtl = {0}", - track.adrCtl, - track.point, - session.sessionSequence); + "session[{2}].track[{1}].adrCtl = {0}", + track.adrCtl, + track.point, + session.sessionSequence); AaruLogging.Debug(MODULE_NAME, - "session[{2}].track[{1}].tno = {0}", - track.tno, - track.point, - session.sessionSequence); + "session[{2}].track[{1}].tno = {0}", + track.tno, + track.point, + session.sessionSequence); AaruLogging.Debug(MODULE_NAME, - "session[{2}].track[{1}].point = {0:X2}", - track.point, - track.point, - session.sessionSequence); + "session[{2}].track[{1}].point = {0:X2}", + track.point, + track.point, + session.sessionSequence); AaruLogging.Debug(MODULE_NAME, - "session[{2}].track[{1}].min = {0}", - track.min, - track.point, - session.sessionSequence); + "session[{2}].track[{1}].min = {0}", + track.min, + track.point, + session.sessionSequence); AaruLogging.Debug(MODULE_NAME, - "session[{2}].track[{1}].sec = {0}", - track.sec, - track.point, - session.sessionSequence); + "session[{2}].track[{1}].sec = {0}", + track.sec, + track.point, + session.sessionSequence); AaruLogging.Debug(MODULE_NAME, - "session[{2}].track[{1}].frame = {0}", - track.frame, - track.point, - session.sessionSequence); + "session[{2}].track[{1}].frame = {0}", + track.frame, + track.point, + session.sessionSequence); AaruLogging.Debug(MODULE_NAME, - "session[{2}].track[{1}].zero = {0}", - track.zero, - track.point, - session.sessionSequence); + "session[{2}].track[{1}].zero = {0}", + track.zero, + track.point, + session.sessionSequence); AaruLogging.Debug(MODULE_NAME, - "session[{2}].track[{1}].pmin = {0}", - track.pmin, - track.point, - session.sessionSequence); + "session[{2}].track[{1}].pmin = {0}", + track.pmin, + track.point, + session.sessionSequence); AaruLogging.Debug(MODULE_NAME, - "session[{2}].track[{1}].psec = {0}", - track.psec, - track.point, - session.sessionSequence); + "session[{2}].track[{1}].psec = {0}", + track.psec, + track.point, + session.sessionSequence); AaruLogging.Debug(MODULE_NAME, - "session[{2}].track[{1}].pframe = {0}", - track.pframe, - track.point, - session.sessionSequence); + "session[{2}].track[{1}].pframe = {0}", + track.pframe, + track.point, + session.sessionSequence); AaruLogging.Debug(MODULE_NAME, - "session[{2}].track[{1}].extraOffset = {0}", - track.extraOffset, - track.point, - session.sessionSequence); + "session[{2}].track[{1}].extraOffset = {0}", + track.extraOffset, + track.point, + session.sessionSequence); AaruLogging.Debug(MODULE_NAME, - "session[{2}].track[{1}].sectorSize = {0}", - track.sectorSize, - track.point, - session.sessionSequence); + "session[{2}].track[{1}].sectorSize = {0}", + track.sectorSize, + track.point, + session.sessionSequence); //for(int j = 0; j < track.unknown.Length; j++) // AaruLogging.DebugWriteLine(MODULE_NAME, "session[{2}].track[{1}].unknown[{2}] = {0}", track.unknown[j], i, j, session.sessionSequence); AaruLogging.Debug(MODULE_NAME, - "session[{2}].track[{1}].startLba = {0}", - track.startLba, - track.point, - session.sessionSequence); + "session[{2}].track[{1}].startLba = {0}", + track.startLba, + track.point, + session.sessionSequence); AaruLogging.Debug(MODULE_NAME, - "session[{2}].track[{1}].startOffset = {0}", - track.startOffset, - track.point, - session.sessionSequence); + "session[{2}].track[{1}].startOffset = {0}", + track.startOffset, + track.point, + session.sessionSequence); AaruLogging.Debug(MODULE_NAME, - "session[{2}].track[{1}].files = {0}", - track.files, - track.point, - session.sessionSequence); + "session[{2}].track[{1}].files = {0}", + track.files, + track.point, + session.sessionSequence); AaruLogging.Debug(MODULE_NAME, - "session[{2}].track[{1}].footerOffset = {0}", - track.footerOffset, - track.point, - session.sessionSequence); + "session[{2}].track[{1}].footerOffset = {0}", + track.footerOffset, + track.point, + session.sessionSequence); //for(int j = 0; j < track.unknown2.Length; j++) // AaruLogging.DebugWriteLine(MODULE_NAME, "session[{2}].track[{1}].unknown2[{2}] = {0}", track.unknown2[j], i, j, session.sessionSequence); @@ -269,7 +269,7 @@ public sealed partial class Alcohol120 if(track is { point: 1, startLba: > 0 }) { AaruLogging.Error(Localization - .The_disc_this_image_represents_contained_a_hidden_track_in_the_first_pregap_that_this_image_format_cannot_store_This_dump_is_therefore_incorrect); + .The_disc_this_image_represents_contained_a_hidden_track_in_the_first_pregap_that_this_image_format_cannot_store_This_dump_is_therefore_incorrect); track1Index1 = track.startLba; track.startLba = 0; diff --git a/Aaru.Images/BlindWrite4/Read.cs b/Aaru.Images/BlindWrite4/Read.cs index 8518b8b98..acb37adc7 100644 --- a/Aaru.Images/BlindWrite4/Read.cs +++ b/Aaru.Images/BlindWrite4/Read.cs @@ -43,6 +43,7 @@ using Aaru.CommonTypes.Structs; using Aaru.Decoders.CD; using Aaru.Helpers; using Aaru.Logging; +using Humanizer; using Session = Aaru.CommonTypes.Structs.Session; namespace Aaru.Images; @@ -689,7 +690,7 @@ public sealed partial class BlindWrite4 }; partition.Offset = partition.Start * 2352; - partition.Type = track.Type.ToString(); + partition.Type = track.Type.Humanize(); Partitions.Add(partition); Tracks.Add(track); @@ -744,9 +745,8 @@ public sealed partial class BlindWrite4 // As long as subchannel is written for any track, it is present for all tracks if(Tracks.Any(t => t.SubchannelType == TrackSubchannelType.Packed)) - { - foreach(Track track in Tracks) track.SubchannelType = TrackSubchannelType.Packed; - } + foreach(Track track in Tracks) + track.SubchannelType = TrackSubchannelType.Packed; _imageInfo.MediaType = MediaType.CD; diff --git a/Aaru.Images/BlindWrite5/Read.cs b/Aaru.Images/BlindWrite5/Read.cs index 1aaa66290..a4af6213c 100644 --- a/Aaru.Images/BlindWrite5/Read.cs +++ b/Aaru.Images/BlindWrite5/Read.cs @@ -49,6 +49,7 @@ using Aaru.Filters; using Aaru.Helpers; using Aaru.Helpers.IO; using Aaru.Logging; +using Humanizer; using Sentry; using DMI = Aaru.Decoders.Xbox.DMI; using Sector = Aaru.Decoders.CD.Sector; @@ -1136,7 +1137,7 @@ public sealed partial class BlindWrite5 partition.Sequence = track.Sequence; partition.Offset = offsetBytes; partition.Start = track.StartSector; - partition.Type = track.Type.ToString(); + partition.Type = track.Type.Humanize(); offsetBytes += partition.Size; diff --git a/Aaru.Images/CDRWin/Properties.cs b/Aaru.Images/CDRWin/Properties.cs index b88524994..e27827f5d 100644 --- a/Aaru.Images/CDRWin/Properties.cs +++ b/Aaru.Images/CDRWin/Properties.cs @@ -90,7 +90,7 @@ public sealed partial class CdrWin ulong previousStartSector = 0; const ulong gdRomSession2Offset = 45000; - var previousTrackFile = ""; + string previousTrackFile = ""; foreach(CdrWinTrack cdrTrack in _discImage.Tracks) { diff --git a/Aaru.Images/CloneCD/Read.cs b/Aaru.Images/CloneCD/Read.cs index d6dfda2ac..1b3a45315 100644 --- a/Aaru.Images/CloneCD/Read.cs +++ b/Aaru.Images/CloneCD/Read.cs @@ -42,6 +42,7 @@ using Aaru.CommonTypes.Structs; using Aaru.Decoders.CD; using Aaru.Helpers; using Aaru.Logging; +using Humanizer; using Session = Aaru.CommonTypes.Structs.Session; namespace Aaru.Images; @@ -130,8 +131,7 @@ public sealed partial class CloneCd { if(inDisk || inSession || inEntry || inTrack || inCdText) { - AaruLogging.Error(string.Format(Localization.Found_CloneCD_out_of_order_in_line_0, - lineNumber)); + AaruLogging.Error(string.Format(Localization.Found_CloneCD_out_of_order_in_line_0, lineNumber)); return ErrorNumber.InvalidArgument; } @@ -179,8 +179,8 @@ public sealed partial class CloneCd if(_imageInfo.Version != "2" && _imageInfo.Version != "3") { AaruLogging.Error(Localization - .CloneCD_plugin_Warning_Unknown_CCD_image_version_0_may_not_work, - _imageInfo.Version); + .CloneCD_plugin_Warning_Unknown_CCD_image_version_0_may_not_work, + _imageInfo.Version); } } else if(inDisk) @@ -193,31 +193,25 @@ public sealed partial class CloneCd if(discEntMatch.Success) { - AaruLogging.Debug(MODULE_NAME, - Localization.Found_TocEntries_at_line_0, - lineNumber); + AaruLogging.Debug(MODULE_NAME, Localization.Found_TocEntries_at_line_0, lineNumber); } else if(discSessMatch.Success) AaruLogging.Debug(MODULE_NAME, Localization.Found_Sessions_at_line_0, lineNumber); else if(discScrMatch.Success) { AaruLogging.Debug(MODULE_NAME, - Localization.Found_DataTracksScrambled_at_line_0, - lineNumber); + Localization.Found_DataTracksScrambled_at_line_0, + lineNumber); _scrambled |= discScrMatch.Groups["value"].Value == "1"; } else if(cdtLenMatch.Success) { - AaruLogging.Debug(MODULE_NAME, - Localization.Found_CDTextLength_at_line_0, - lineNumber); + AaruLogging.Debug(MODULE_NAME, Localization.Found_CDTextLength_at_line_0, lineNumber); } else if(discCatMatch.Success) { - AaruLogging.Debug(MODULE_NAME, - Localization.Found_Catalog_at_line_0_smallcase, - lineNumber); + AaruLogging.Debug(MODULE_NAME, Localization.Found_Catalog_at_line_0_smallcase, lineNumber); _catalog = discCatMatch.Groups["value"].Value; } @@ -231,15 +225,11 @@ public sealed partial class CloneCd if(cdtEntsMatch.Success) { - AaruLogging.Debug(MODULE_NAME, - Localization.Found_CD_Text_Entries_at_line_0, - lineNumber); + AaruLogging.Debug(MODULE_NAME, Localization.Found_CD_Text_Entries_at_line_0, lineNumber); } else if(cdtEntMatch.Success) { - AaruLogging.Debug(MODULE_NAME, - Localization.Found_CD_Text_Entry_at_line_0, - lineNumber); + AaruLogging.Debug(MODULE_NAME, Localization.Found_CD_Text_Entry_at_line_0, lineNumber); string[] bytes = cdtEntMatch.Groups["value"] .Value.Split(new[] @@ -260,15 +250,11 @@ public sealed partial class CloneCd if(sessPregMatch.Success) { - AaruLogging.Debug(MODULE_NAME, - Localization.Found_PreGapMode_at_line_0, - lineNumber); + AaruLogging.Debug(MODULE_NAME, Localization.Found_PreGapMode_at_line_0, lineNumber); } else if(sessSubcMatch.Success) { - AaruLogging.Debug(MODULE_NAME, - Localization.Found_PreGapSubC_at_line_0, - lineNumber); + AaruLogging.Debug(MODULE_NAME, Localization.Found_PreGapSubC_at_line_0, lineNumber); } } else if(inEntry) @@ -567,8 +553,8 @@ public sealed partial class CloneCd if(_imageInfo.MediaManufacturer != "") { AaruLogging.Debug(MODULE_NAME, - Localization.Disc_manufactured_by_0, - _imageInfo.MediaManufacturer); + Localization.Disc_manufactured_by_0, + _imageInfo.MediaManufacturer); } } @@ -580,7 +566,7 @@ public sealed partial class CloneCd { uint id = (uint)((descriptor.Min << 16) + (descriptor.Sec << 8) + descriptor.Frame); AaruLogging.Debug(MODULE_NAME, Localization.Disc_ID_0_X6, id & 0x00FFFFFF); - _imageInfo.MediaSerialNumber = $"{id & 0x00FFFFFF:X6}"; + _imageInfo.MediaSerialNumber = $"{id & 0x00FFFFFF:X6}"; break; } @@ -836,7 +822,7 @@ public sealed partial class CloneCd Sequence = track.Sequence, Offset = track.FileOffset, Start = (ulong)track.Indexes[1], - Type = track.Type.ToString() + Type = track.Type.Humanize() }; Partitions.Add(partition); diff --git a/Aaru.Images/DiscJuggler/Read.cs b/Aaru.Images/DiscJuggler/Read.cs index ed8045c1e..ce3455c7b 100644 --- a/Aaru.Images/DiscJuggler/Read.cs +++ b/Aaru.Images/DiscJuggler/Read.cs @@ -42,6 +42,7 @@ using Aaru.CommonTypes.Structs; using Aaru.Decoders.CD; using Aaru.Helpers; using Aaru.Logging; +using Humanizer; using Session = Aaru.CommonTypes.Structs.Session; namespace Aaru.Images; @@ -242,10 +243,10 @@ public sealed partial class DiscJuggler track.Sequence = BitConverter.ToUInt32(descriptor, position) + lastSessionTrack + 1; AaruLogging.Debug(MODULE_NAME, - "\ttrack = {1} + {2} + 1 = {0}", - track.Sequence, - BitConverter.ToUInt32(descriptor, position), - lastSessionTrack); + "\ttrack = {1} + {2} + 1 = {0}", + track.Sequence, + BitConverter.ToUInt32(descriptor, position), + lastSessionTrack); // There's always an index 0 in the image track.Pregap = (ulong)track.Indexes[0]; @@ -406,9 +407,8 @@ public sealed partial class DiscJuggler break; case 1: - AaruLogging.Error(string.Format(Localization - .Invalid_read_mode_0_for_this_track, - readMode)); + AaruLogging.Error(string.Format(Localization.Invalid_read_mode_0_for_this_track, + readMode)); return ErrorNumber.InvalidArgument; case 2: @@ -514,9 +514,8 @@ public sealed partial class DiscJuggler switch(readMode) { case 0: - AaruLogging.Error(string.Format(Localization - .Invalid_read_mode_0_for_this_track, - readMode)); + AaruLogging.Error(string.Format(Localization.Invalid_read_mode_0_for_this_track, + readMode)); return ErrorNumber.InvalidArgument; case 1: @@ -609,7 +608,7 @@ public sealed partial class DiscJuggler Sequence = track.Sequence, Offset = track.FileOffset, Start = track.StartSector, - Type = track.Type.ToString() + Type = track.Type.Humanize() }; if(track.Sequence > 1 && track.Pregap > 0) diff --git a/Aaru.Images/GDI/Read.cs b/Aaru.Images/GDI/Read.cs index 241c1683d..6da13be71 100644 --- a/Aaru.Images/GDI/Read.cs +++ b/Aaru.Images/GDI/Read.cs @@ -103,15 +103,14 @@ public sealed partial class Gdi } AaruLogging.Debug(MODULE_NAME, - Localization - .Found_track_0_starts_at_1_flags_2_type_3_file_4_offset_5_at_line_6, - trackMatch.Groups["track"].Value, - trackMatch.Groups["start"].Value, - trackMatch.Groups["flags"].Value, - trackMatch.Groups["type"].Value, - trackMatch.Groups["filename"].Value, - trackMatch.Groups["offset"].Value, - lineNumber); + Localization.Found_track_0_starts_at_1_flags_2_type_3_file_4_offset_5_at_line_6, + trackMatch.Groups["track"].Value, + trackMatch.Groups["start"].Value, + trackMatch.Groups["flags"].Value, + trackMatch.Groups["type"].Value, + trackMatch.Groups["filename"].Value, + trackMatch.Groups["offset"].Value, + lineNumber); var currentTrack = new GdiTrack @@ -216,50 +215,36 @@ public sealed partial class Gdi AaruLogging.Debug(MODULE_NAME, Localization.Session_information); - AaruLogging.Debug(MODULE_NAME, - "\t" + Localization.Disc_contains_0_sessions, - _discImage.Sessions.Count); + AaruLogging.Debug(MODULE_NAME, "\t" + Localization.Disc_contains_0_sessions, _discImage.Sessions.Count); for(int i = 0; i < _discImage.Sessions.Count; i++) { AaruLogging.Debug(MODULE_NAME, "\t" + Localization.Session_0_information, i + 1); AaruLogging.Debug(MODULE_NAME, - "\t\t" + Localization.Starting_track_0, - _discImage.Sessions[i].StartTrack); + "\t\t" + Localization.Starting_track_0, + _discImage.Sessions[i].StartTrack); AaruLogging.Debug(MODULE_NAME, - "\t\t" + Localization.Starting_sector_0, - _discImage.Sessions[i].StartSector); + "\t\t" + Localization.Starting_sector_0, + _discImage.Sessions[i].StartSector); - AaruLogging.Debug(MODULE_NAME, - "\t\t" + Localization.Ending_track_0, - _discImage.Sessions[i].EndTrack); + AaruLogging.Debug(MODULE_NAME, "\t\t" + Localization.Ending_track_0, _discImage.Sessions[i].EndTrack); - AaruLogging.Debug(MODULE_NAME, - "\t\t" + Localization.Ending_sector_0, - _discImage.Sessions[i].EndSector); + AaruLogging.Debug(MODULE_NAME, "\t\t" + Localization.Ending_sector_0, _discImage.Sessions[i].EndSector); } AaruLogging.Debug(MODULE_NAME, Localization.Track_information); - AaruLogging.Debug(MODULE_NAME, - "\t" + Localization.Disc_contains_0_tracks, - _discImage.Tracks.Count); + AaruLogging.Debug(MODULE_NAME, "\t" + Localization.Disc_contains_0_tracks, _discImage.Tracks.Count); for(int i = 0; i < _discImage.Tracks.Count; i++) { - AaruLogging.Debug(MODULE_NAME, - "\t" + Localization.Track_0_information, - _discImage.Tracks[i].Sequence); + AaruLogging.Debug(MODULE_NAME, "\t" + Localization.Track_0_information, _discImage.Tracks[i].Sequence); - AaruLogging.Debug(MODULE_NAME, - "\t\t" + Localization._0_bytes_per_sector, - _discImage.Tracks[i].Bps); + AaruLogging.Debug(MODULE_NAME, "\t\t" + Localization._0_bytes_per_sector, _discImage.Tracks[i].Bps); - AaruLogging.Debug(MODULE_NAME, - "\t\t" + Localization.Pregap_0_sectors, - _discImage.Tracks[i].Pregap); + AaruLogging.Debug(MODULE_NAME, "\t\t" + Localization.Pregap_0_sectors, _discImage.Tracks[i].Pregap); if((_discImage.Tracks[i].Flags & 0x8) == 0x8) AaruLogging.Debug(MODULE_NAME, "\t\t" + Localization.Track_is_flagged_as_quadraphonic); @@ -274,11 +259,10 @@ public sealed partial class Gdi AaruLogging.Debug(MODULE_NAME, "\t\t" + Localization.Track_has_pre_emphasis_applied); AaruLogging.Debug(MODULE_NAME, - "\t\t" + - Localization.Track_resides_in_file_0_type_defined_as_1_starting_at_byte_2, - _discImage.Tracks[i].TrackFilter, - _discImage.Tracks[i].TrackType, - _discImage.Tracks[i].Offset); + "\t\t" + Localization.Track_resides_in_file_0_type_defined_as_1_starting_at_byte_2, + _discImage.Tracks[i].TrackFilter, + _discImage.Tracks[i].TrackType, + _discImage.Tracks[i].Offset); } AaruLogging.Debug(MODULE_NAME, Localization.Building_offset_map); diff --git a/Aaru/Commands/Device/Info.cs b/Aaru/Commands/Device/Info.cs index 0a9e2c321..07a77eae6 100644 --- a/Aaru/Commands/Device/Info.cs +++ b/Aaru/Commands/Device/Info.cs @@ -357,7 +357,7 @@ sealed class DeviceInfoCommand : Command AaruLogging.WriteLine(removable ? Localization.Core.Media_identified_as_0 : Localization.Core.Device_identified_as_0, - mediaType); + mediaType.Humanize()); Statistics.AddMedia(mediaType, true); } diff --git a/Aaru/Commands/Media/Info.cs b/Aaru/Commands/Media/Info.cs index 6276960db..89dd89bca 100644 --- a/Aaru/Commands/Media/Info.cs +++ b/Aaru/Commands/Media/Info.cs @@ -51,6 +51,7 @@ using Aaru.Decoders.SCSI.SSC; using Aaru.Decoders.Xbox; using Aaru.Localization; using Aaru.Logging; +using Humanizer; using Humanizer.Bytes; using Spectre.Console; using Spectre.Console.Cli; @@ -796,7 +797,7 @@ sealed class MediaInfoCommand : Command AaruLogging.WriteLine(""); } - AaruLogging.WriteLine(Localization.Core.Media_identified_as_0, scsiInfo.MediaType); + AaruLogging.WriteLine(Localization.Core.Media_identified_as_0, scsiInfo.MediaType.Humanize()); Statistics.AddMedia(scsiInfo.MediaType, true); if(scsiInfo.Toc != null || scsiInfo.RawToc != null) @@ -851,7 +852,7 @@ sealed class MediaInfoCommand : Command track.StartSector, track.EndSector, track.Pregap, - track.Type); + track.Type.Humanize()); } AaruLogging.WriteLine();