mirror of
https://github.com/aaru-dps/Aaru.git
synced 2025-12-16 19:24:25 +00:00
Simplify naming of AaruConsole methods.
This commit is contained in:
@@ -81,14 +81,14 @@ public sealed partial class DiscJuggler
|
||||
ushort mediumType;
|
||||
byte maxS = descriptor[0];
|
||||
|
||||
AaruConsole.DebugWriteLine(MODULE_NAME, "maxS = {0}", maxS);
|
||||
AaruConsole.Debug(MODULE_NAME, "maxS = {0}", maxS);
|
||||
uint lastSessionTrack = 0;
|
||||
ulong currentOffset = 0;
|
||||
|
||||
// Read sessions
|
||||
for(byte s = 0; s <= maxS; s++)
|
||||
{
|
||||
AaruConsole.DebugWriteLine(MODULE_NAME, "s = {0}", s);
|
||||
AaruConsole.Debug(MODULE_NAME, "s = {0}", s);
|
||||
|
||||
// Seems all sessions start with this data
|
||||
if(descriptor[position + 0] != 0x00 ||
|
||||
@@ -148,7 +148,7 @@ public sealed partial class DiscJuggler
|
||||
if(descriptor[position + 1] > 99) return ErrorNumber.InvalidArgument;
|
||||
|
||||
byte maxT = descriptor[position + 1];
|
||||
AaruConsole.DebugWriteLine(MODULE_NAME, "maxT = {0}", maxT);
|
||||
AaruConsole.Debug(MODULE_NAME, "maxT = {0}", maxT);
|
||||
|
||||
sessionSequence++;
|
||||
|
||||
@@ -165,7 +165,7 @@ public sealed partial class DiscJuggler
|
||||
// Read track
|
||||
for(byte t = 0; t < maxT; t++)
|
||||
{
|
||||
AaruConsole.DebugWriteLine(MODULE_NAME, "t = {0}", t);
|
||||
AaruConsole.Debug(MODULE_NAME, "t = {0}", t);
|
||||
var track = new Track();
|
||||
|
||||
// Skip unknown
|
||||
@@ -176,19 +176,19 @@ public sealed partial class DiscJuggler
|
||||
Array.Copy(descriptor, position, trackFilenameB, 0, trackFilenameB.Length);
|
||||
position += trackFilenameB.Length;
|
||||
track.File = Path.GetFileName(Encoding.Default.GetString(trackFilenameB));
|
||||
AaruConsole.DebugWriteLine(MODULE_NAME, "\tfilename = {0}", track.File);
|
||||
AaruConsole.Debug(MODULE_NAME, "\tfilename = {0}", track.File);
|
||||
|
||||
// Skip unknown
|
||||
position += 29;
|
||||
|
||||
mediumType = BitConverter.ToUInt16(descriptor, position);
|
||||
position += 2;
|
||||
AaruConsole.DebugWriteLine(MODULE_NAME, "\tmediumType = {0}", mediumType);
|
||||
AaruConsole.Debug(MODULE_NAME, "\tmediumType = {0}", mediumType);
|
||||
|
||||
// Read indices
|
||||
ushort maxI = BitConverter.ToUInt16(descriptor, position);
|
||||
position += 2;
|
||||
AaruConsole.DebugWriteLine(MODULE_NAME, "\tmaxI = {0}", maxI);
|
||||
AaruConsole.Debug(MODULE_NAME, "\tmaxI = {0}", maxI);
|
||||
|
||||
// This is not really the index position, but, the index length, go figure
|
||||
for(ushort i = 0; i < maxI; i++)
|
||||
@@ -196,13 +196,13 @@ public sealed partial class DiscJuggler
|
||||
int index = BitConverter.ToInt32(descriptor, position);
|
||||
track.Indexes.Add(i, index);
|
||||
position += 4;
|
||||
AaruConsole.DebugWriteLine(MODULE_NAME, "\tindex[{1}] = {0}", index, i);
|
||||
AaruConsole.Debug(MODULE_NAME, "\tindex[{1}] = {0}", index, i);
|
||||
}
|
||||
|
||||
// Read CD-Text
|
||||
uint maxC = BitConverter.ToUInt32(descriptor, position);
|
||||
position += 4;
|
||||
AaruConsole.DebugWriteLine(MODULE_NAME, "\tmaxC = {0}", maxC);
|
||||
AaruConsole.Debug(MODULE_NAME, "\tmaxC = {0}", maxC);
|
||||
|
||||
for(uint c = 0; c < maxC; c++)
|
||||
{
|
||||
@@ -210,7 +210,7 @@ public sealed partial class DiscJuggler
|
||||
{
|
||||
int bLen = descriptor[position];
|
||||
position++;
|
||||
AaruConsole.DebugWriteLine(MODULE_NAME, "\tc[{1}][{2}].Length = {0}", bLen, c, cb);
|
||||
AaruConsole.Debug(MODULE_NAME, "\tc[{1}][{2}].Length = {0}", bLen, c, cb);
|
||||
|
||||
if(bLen <= 0) continue;
|
||||
|
||||
@@ -223,13 +223,13 @@ public sealed partial class DiscJuggler
|
||||
|
||||
track.Description = Encoding.Default.GetString(textBlk, 0, bLen);
|
||||
|
||||
AaruConsole.DebugWriteLine(MODULE_NAME, "\t" + Localization.Track_title_0, track.Description);
|
||||
AaruConsole.Debug(MODULE_NAME, "\t" + Localization.Track_title_0, track.Description);
|
||||
}
|
||||
}
|
||||
|
||||
position += 2;
|
||||
uint trackMode = BitConverter.ToUInt32(descriptor, position);
|
||||
AaruConsole.DebugWriteLine(MODULE_NAME, "\ttrackMode = {0}", trackMode);
|
||||
AaruConsole.Debug(MODULE_NAME, "\ttrackMode = {0}", trackMode);
|
||||
position += 4;
|
||||
|
||||
// Skip unknown
|
||||
@@ -237,11 +237,11 @@ public sealed partial class DiscJuggler
|
||||
|
||||
session.Sequence = (ushort)(BitConverter.ToUInt32(descriptor, position) + 1);
|
||||
track.Session = session.Sequence;
|
||||
AaruConsole.DebugWriteLine(MODULE_NAME, "\tsession = {0}", session.Sequence);
|
||||
AaruConsole.Debug(MODULE_NAME, "\tsession = {0}", session.Sequence);
|
||||
position += 4;
|
||||
track.Sequence = BitConverter.ToUInt32(descriptor, position) + lastSessionTrack + 1;
|
||||
|
||||
AaruConsole.DebugWriteLine(MODULE_NAME,
|
||||
AaruConsole.Debug(MODULE_NAME,
|
||||
"\ttrack = {1} + {2} + 1 = {0}",
|
||||
track.Sequence,
|
||||
BitConverter.ToUInt32(descriptor, position),
|
||||
@@ -256,7 +256,7 @@ public sealed partial class DiscJuggler
|
||||
|
||||
position += 4;
|
||||
track.StartSector = BitConverter.ToUInt32(descriptor, position);
|
||||
AaruConsole.DebugWriteLine(MODULE_NAME, "\ttrackStart = {0}", track.StartSector);
|
||||
AaruConsole.Debug(MODULE_NAME, "\ttrackStart = {0}", track.StartSector);
|
||||
position += 4;
|
||||
uint trackLen = BitConverter.ToUInt32(descriptor, position);
|
||||
|
||||
@@ -279,7 +279,7 @@ public sealed partial class DiscJuggler
|
||||
}
|
||||
|
||||
track.EndSector = track.StartSector + trackLen - 1;
|
||||
AaruConsole.DebugWriteLine(MODULE_NAME, "\ttrackEnd = {0}", track.EndSector);
|
||||
AaruConsole.Debug(MODULE_NAME, "\ttrackEnd = {0}", track.EndSector);
|
||||
position += 4;
|
||||
|
||||
if(track.Sequence > session.EndTrack)
|
||||
@@ -298,10 +298,10 @@ public sealed partial class DiscJuggler
|
||||
position += 16;
|
||||
|
||||
uint readMode = BitConverter.ToUInt32(descriptor, position);
|
||||
AaruConsole.DebugWriteLine(MODULE_NAME, "\treadMode = {0}", readMode);
|
||||
AaruConsole.Debug(MODULE_NAME, "\treadMode = {0}", readMode);
|
||||
position += 4;
|
||||
uint trackCtl = BitConverter.ToUInt32(descriptor, position);
|
||||
AaruConsole.DebugWriteLine(MODULE_NAME, "\ttrackCtl = {0}", trackCtl);
|
||||
AaruConsole.Debug(MODULE_NAME, "\ttrackCtl = {0}", trackCtl);
|
||||
position += 4;
|
||||
|
||||
// Skip unknown
|
||||
@@ -309,28 +309,28 @@ public sealed partial class DiscJuggler
|
||||
|
||||
byte[] isrc = new byte[12];
|
||||
Array.Copy(descriptor, position, isrc, 0, 12);
|
||||
AaruConsole.DebugWriteLine(MODULE_NAME, "\tisrc = {0}", StringHandlers.CToString(isrc));
|
||||
AaruConsole.Debug(MODULE_NAME, "\tisrc = {0}", StringHandlers.CToString(isrc));
|
||||
position += 12;
|
||||
uint isrcValid = BitConverter.ToUInt32(descriptor, position);
|
||||
AaruConsole.DebugWriteLine(MODULE_NAME, "\tisrc_valid = {0}", isrcValid);
|
||||
AaruConsole.Debug(MODULE_NAME, "\tisrc_valid = {0}", isrcValid);
|
||||
position += 4;
|
||||
|
||||
// Skip unknown
|
||||
position += 87;
|
||||
|
||||
byte sessionType = descriptor[position];
|
||||
AaruConsole.DebugWriteLine(MODULE_NAME, "\tsessionType = {0}", sessionType);
|
||||
AaruConsole.Debug(MODULE_NAME, "\tsessionType = {0}", sessionType);
|
||||
position++;
|
||||
|
||||
// Skip unknown
|
||||
position += 5;
|
||||
|
||||
byte trackFollows = descriptor[position];
|
||||
AaruConsole.DebugWriteLine(MODULE_NAME, "\ttrackFollows = {0}", trackFollows);
|
||||
AaruConsole.Debug(MODULE_NAME, "\ttrackFollows = {0}", trackFollows);
|
||||
position += 2;
|
||||
|
||||
uint endAddress = BitConverter.ToUInt32(descriptor, position);
|
||||
AaruConsole.DebugWriteLine(MODULE_NAME, "\tendAddress = {0}", endAddress);
|
||||
AaruConsole.Debug(MODULE_NAME, "\tendAddress = {0}", endAddress);
|
||||
position += 4;
|
||||
|
||||
// As to skip the lead-in
|
||||
@@ -380,7 +380,7 @@ public sealed partial class DiscJuggler
|
||||
|
||||
break;
|
||||
default:
|
||||
AaruConsole.ErrorWriteLine(string.Format(Localization.Unknown_read_mode_0, readMode));
|
||||
AaruConsole.Error(string.Format(Localization.Unknown_read_mode_0, readMode));
|
||||
|
||||
return ErrorNumber.InvalidArgument;
|
||||
}
|
||||
@@ -406,7 +406,7 @@ public sealed partial class DiscJuggler
|
||||
|
||||
break;
|
||||
case 1:
|
||||
AaruConsole.ErrorWriteLine(string.Format(Localization
|
||||
AaruConsole.Error(string.Format(Localization
|
||||
.Invalid_read_mode_0_for_this_track,
|
||||
readMode));
|
||||
|
||||
@@ -497,7 +497,7 @@ public sealed partial class DiscJuggler
|
||||
|
||||
break;
|
||||
default:
|
||||
AaruConsole.ErrorWriteLine(string.Format(Localization.Unknown_read_mode_0, readMode));
|
||||
AaruConsole.Error(string.Format(Localization.Unknown_read_mode_0, readMode));
|
||||
|
||||
return ErrorNumber.InvalidArgument;
|
||||
}
|
||||
@@ -514,7 +514,7 @@ public sealed partial class DiscJuggler
|
||||
switch(readMode)
|
||||
{
|
||||
case 0:
|
||||
AaruConsole.ErrorWriteLine(string.Format(Localization
|
||||
AaruConsole.Error(string.Format(Localization
|
||||
.Invalid_read_mode_0_for_this_track,
|
||||
readMode));
|
||||
|
||||
@@ -578,14 +578,14 @@ public sealed partial class DiscJuggler
|
||||
|
||||
break;
|
||||
default:
|
||||
AaruConsole.ErrorWriteLine(string.Format(Localization.Unknown_read_mode_0, readMode));
|
||||
AaruConsole.Error(string.Format(Localization.Unknown_read_mode_0, readMode));
|
||||
|
||||
return ErrorNumber.InvalidArgument;
|
||||
}
|
||||
|
||||
break;
|
||||
default:
|
||||
AaruConsole.ErrorWriteLine(string.Format(Localization.Unknown_track_mode_0, trackMode));
|
||||
AaruConsole.Error(string.Format(Localization.Unknown_track_mode_0, trackMode));
|
||||
|
||||
return ErrorNumber.InvalidArgument;
|
||||
}
|
||||
@@ -633,56 +633,56 @@ public sealed partial class DiscJuggler
|
||||
|
||||
lastSessionTrack = session.EndTrack;
|
||||
Sessions.Add(session);
|
||||
AaruConsole.DebugWriteLine(MODULE_NAME, "session.StartTrack = {0}", session.StartTrack);
|
||||
AaruConsole.DebugWriteLine(MODULE_NAME, "session.StartSector = {0}", session.StartSector);
|
||||
AaruConsole.DebugWriteLine(MODULE_NAME, "session.EndTrack = {0}", session.EndTrack);
|
||||
AaruConsole.DebugWriteLine(MODULE_NAME, "session.EndSector = {0}", session.EndSector);
|
||||
AaruConsole.Debug(MODULE_NAME, "session.StartTrack = {0}", session.StartTrack);
|
||||
AaruConsole.Debug(MODULE_NAME, "session.StartSector = {0}", session.StartSector);
|
||||
AaruConsole.Debug(MODULE_NAME, "session.EndTrack = {0}", session.EndTrack);
|
||||
AaruConsole.Debug(MODULE_NAME, "session.EndSector = {0}", session.EndSector);
|
||||
|
||||
AaruConsole.DebugWriteLine(MODULE_NAME, "session.Sequence = {0}", session.Sequence);
|
||||
AaruConsole.Debug(MODULE_NAME, "session.Sequence = {0}", session.Sequence);
|
||||
}
|
||||
|
||||
// Skip unknown
|
||||
position += 16;
|
||||
|
||||
AaruConsole.DebugWriteLine(MODULE_NAME, Localization.Current_position_equals_0, position);
|
||||
AaruConsole.Debug(MODULE_NAME, Localization.Current_position_equals_0, position);
|
||||
byte[] filenameB = new byte[descriptor[position]];
|
||||
position++;
|
||||
Array.Copy(descriptor, position, filenameB, 0, filenameB.Length);
|
||||
position += filenameB.Length;
|
||||
string filename = Path.GetFileName(Encoding.Default.GetString(filenameB));
|
||||
AaruConsole.DebugWriteLine(MODULE_NAME, "filename = {0}", filename);
|
||||
AaruConsole.Debug(MODULE_NAME, "filename = {0}", filename);
|
||||
|
||||
// Skip unknown
|
||||
position += 29;
|
||||
|
||||
mediumType = BitConverter.ToUInt16(descriptor, position);
|
||||
position += 2;
|
||||
AaruConsole.DebugWriteLine(MODULE_NAME, "mediumType = {0}", mediumType);
|
||||
AaruConsole.Debug(MODULE_NAME, "mediumType = {0}", mediumType);
|
||||
|
||||
uint discSize = BitConverter.ToUInt32(descriptor, position);
|
||||
position += 4;
|
||||
AaruConsole.DebugWriteLine(MODULE_NAME, "discSize = {0}", discSize);
|
||||
AaruConsole.Debug(MODULE_NAME, "discSize = {0}", discSize);
|
||||
|
||||
byte[] volidB = new byte[descriptor[position]];
|
||||
position++;
|
||||
Array.Copy(descriptor, position, volidB, 0, volidB.Length);
|
||||
position += volidB.Length;
|
||||
string volid = Path.GetFileName(Encoding.Default.GetString(volidB));
|
||||
AaruConsole.DebugWriteLine(MODULE_NAME, "volid = {0}", volid);
|
||||
AaruConsole.Debug(MODULE_NAME, "volid = {0}", volid);
|
||||
|
||||
// Skip unknown
|
||||
position += 9;
|
||||
|
||||
byte[] mcn = new byte[13];
|
||||
Array.Copy(descriptor, position, mcn, 0, 13);
|
||||
AaruConsole.DebugWriteLine(MODULE_NAME, "mcn = {0}", StringHandlers.CToString(mcn));
|
||||
AaruConsole.Debug(MODULE_NAME, "mcn = {0}", StringHandlers.CToString(mcn));
|
||||
position += 13;
|
||||
uint mcnValid = BitConverter.ToUInt32(descriptor, position);
|
||||
AaruConsole.DebugWriteLine(MODULE_NAME, "mcn_valid = {0}", mcnValid);
|
||||
AaruConsole.Debug(MODULE_NAME, "mcn_valid = {0}", mcnValid);
|
||||
position += 4;
|
||||
|
||||
uint cdtextLen = BitConverter.ToUInt32(descriptor, position);
|
||||
AaruConsole.DebugWriteLine(MODULE_NAME, "cdtextLen = {0}", cdtextLen);
|
||||
AaruConsole.Debug(MODULE_NAME, "cdtextLen = {0}", cdtextLen);
|
||||
position += 4;
|
||||
|
||||
if(cdtextLen > 0)
|
||||
@@ -696,7 +696,7 @@ public sealed partial class DiscJuggler
|
||||
// Skip unknown
|
||||
position += 12;
|
||||
|
||||
AaruConsole.DebugWriteLine(MODULE_NAME, Localization.End_position_equals_0, position);
|
||||
AaruConsole.Debug(MODULE_NAME, Localization.End_position_equals_0, position);
|
||||
|
||||
_imageInfo.MediaType = DecodeCdiMediumType(mediumType);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user