* DiscImageChef.Decoders/CD/TOC.cs:

* DiscImageChef.Decoders/CD/PMA.cs:
	* DiscImageChef.Decoders/CD/ATIP.cs:
	* DiscImageChef.Decoders/CD/Session.cs:
	* DiscImageChef.Decoders/CD/FullTOC.cs:
	* DiscImageChef.Decoders/CD/CDTextOnLeadIn.cs:
	  Rename fields, methods and structs to more adequate names.

	* DiscImageChef/Commands/Decode.cs:
	  Rename CD decoders fields, methods and structs to more
	  adequate names.
This commit is contained in:
2015-10-19 02:46:04 +01:00
parent 4457479471
commit 45303f8a8d
9 changed files with 63 additions and 47 deletions

View File

@@ -222,7 +222,7 @@ namespace DiscImageChef.Decoders.CD
public byte Reserved10;
}
public static CDATIP? DecodeCDATIP(byte[] CDATIPResponse)
public static CDATIP? Decode(byte[] CDATIPResponse)
{
if (CDATIPResponse == null)
return null;
@@ -282,7 +282,7 @@ namespace DiscImageChef.Decoders.CD
return decoded;
}
public static string PrettifyCDATIP(CDATIP? CDATIPResponse)
public static string Prettify(CDATIP? CDATIPResponse)
{
if (CDATIPResponse == null)
return null;
@@ -371,10 +371,10 @@ namespace DiscImageChef.Decoders.CD
return sb.ToString();
}
public static string PrettifyCDATIP(byte[] CDATIPResponse)
public static string Prettify(byte[] CDATIPResponse)
{
CDATIP? decoded = DecodeCDATIP(CDATIPResponse);
return PrettifyCDATIP(decoded);
CDATIP? decoded = Decode(CDATIPResponse);
return Prettify(decoded);
}
}
}

View File

@@ -126,7 +126,7 @@ namespace DiscImageChef.Decoders.CD
BlockSizeInformation = 0x8F
}
public struct CDTextLeadIn
public struct CDText
{
/// <summary>
/// Total size of returned CD-Text information minus this field
@@ -190,12 +190,12 @@ namespace DiscImageChef.Decoders.CD
public UInt16 CRC;
}
public static CDTextLeadIn? DecodeCDTextLeadIn(byte[] CDTextResponse)
public static CDText? Decode(byte[] CDTextResponse)
{
if (CDTextResponse == null)
return null;
CDTextLeadIn decoded = new CDTextLeadIn();
CDText decoded = new CDText();
BigEndianBitConverter.IsLittleEndian = BitConverter.IsLittleEndian;
@@ -226,12 +226,12 @@ namespace DiscImageChef.Decoders.CD
return decoded;
}
public static string PrettifyCDTextLeadIn(CDTextLeadIn? CDTextResponse)
public static string Prettify(CDText? CDTextResponse)
{
if (CDTextResponse == null)
return null;
CDTextLeadIn response = CDTextResponse.Value;
CDText response = CDTextResponse.Value;
StringBuilder sb = new StringBuilder();
@@ -383,10 +383,10 @@ namespace DiscImageChef.Decoders.CD
return sb.ToString();
}
public static string PrettifyCDTextLeadIn(byte[] CDTextResponse)
public static string Prettify(byte[] CDTextResponse)
{
CDTextLeadIn? decoded = DecodeCDTextLeadIn(CDTextResponse);
return PrettifyCDTextLeadIn(decoded);
CDText? decoded = Decode(CDTextResponse);
return Prettify(decoded);
}
}
}

View File

@@ -75,10 +75,10 @@ namespace DiscImageChef.Decoders.CD
/// <summary>
/// Track descriptors
/// </summary>
public CDFullTOCInfoTrackDataDescriptor[] TrackDescriptors;
public TrackDataDescriptor[] TrackDescriptors;
}
public struct CDFullTOCInfoTrackDataDescriptor
public struct TrackDataDescriptor
{
/// <summary>
/// Byte 0
@@ -141,7 +141,7 @@ namespace DiscImageChef.Decoders.CD
public byte PFRAME;
}
public static CDFullTOC? DecodeCDFullTOC(byte[] CDFullTOCResponse)
public static CDFullTOC? Decode(byte[] CDFullTOCResponse)
{
if (CDFullTOCResponse == null)
return null;
@@ -153,7 +153,7 @@ namespace DiscImageChef.Decoders.CD
decoded.DataLength = BigEndianBitConverter.ToUInt16(CDFullTOCResponse, 0);
decoded.FirstCompleteSession = CDFullTOCResponse[2];
decoded.LastCompleteSession = CDFullTOCResponse[3];
decoded.TrackDescriptors = new CDFullTOCInfoTrackDataDescriptor[(decoded.DataLength - 2) / 11];
decoded.TrackDescriptors = new TrackDataDescriptor[(decoded.DataLength - 2) / 11];
if (decoded.DataLength + 2 != CDFullTOCResponse.Length)
{
@@ -182,7 +182,7 @@ namespace DiscImageChef.Decoders.CD
return decoded;
}
public static string PrettifyCDFullTOC(CDFullTOC? CDFullTOCResponse)
public static string Prettify(CDFullTOC? CDFullTOCResponse)
{
if (CDFullTOCResponse == null)
return null;
@@ -193,7 +193,7 @@ namespace DiscImageChef.Decoders.CD
sb.AppendFormat("First complete session number: {0}", response.FirstCompleteSession).AppendLine();
sb.AppendFormat("Last complete session number: {0}", response.LastCompleteSession).AppendLine();
foreach (CDFullTOCInfoTrackDataDescriptor descriptor in response.TrackDescriptors)
foreach (TrackDataDescriptor descriptor in response.TrackDescriptors)
{
if ((descriptor.CONTROL != 4 && descriptor.CONTROL != 6) ||
(descriptor.ADR != 1 && descriptor.ADR != 5) ||
@@ -364,10 +364,10 @@ namespace DiscImageChef.Decoders.CD
return sb.ToString();
}
public static string PrettifyCDFullTOC(byte[] CDFullTOCResponse)
public static string Prettify(byte[] CDFullTOCResponse)
{
CDFullTOC? decoded = DecodeCDFullTOC(CDFullTOCResponse);
return PrettifyCDFullTOC(decoded);
CDFullTOC? decoded = Decode(CDFullTOCResponse);
return Prettify(decoded);
}
}
}

View File

@@ -137,7 +137,7 @@ namespace DiscImageChef.Decoders.CD
public byte PFRAME;
}
public static CDPMA? DecodeCDPMA(byte[] CDPMAResponse)
public static CDPMA? Decode(byte[] CDPMAResponse)
{
if (CDPMAResponse == null)
return null;
@@ -177,7 +177,7 @@ namespace DiscImageChef.Decoders.CD
return decoded;
}
public static string PrettifyCDPMA(CDPMA? CDPMAResponse)
public static string Prettify(CDPMA? CDPMAResponse)
{
if (CDPMAResponse == null)
return null;
@@ -217,10 +217,10 @@ namespace DiscImageChef.Decoders.CD
return sb.ToString();
}
public static string PrettifyCDPMA(byte[] CDPMAResponse)
public static string Prettify(byte[] CDPMAResponse)
{
CDPMA? decoded = DecodeCDPMA(CDPMAResponse);
return PrettifyCDPMA(decoded);
CDPMA? decoded = Decode(CDPMAResponse);
return Prettify(decoded);
}
}
}

View File

@@ -75,10 +75,10 @@ namespace DiscImageChef.Decoders.CD
/// <summary>
/// Track descriptors
/// </summary>
public CDSessionInfoTrackDataDescriptor[] TrackDescriptors;
public TrackDataDescriptor[] TrackDescriptors;
}
public struct CDSessionInfoTrackDataDescriptor
public struct TrackDataDescriptor
{
/// <summary>
/// Byte 0
@@ -112,7 +112,7 @@ namespace DiscImageChef.Decoders.CD
public UInt32 TrackStartAddress;
}
public static CDSessionInfo? DecodeCDSessionInfo(byte[] CDSessionInfoResponse)
public static CDSessionInfo? Decode(byte[] CDSessionInfoResponse)
{
if (CDSessionInfoResponse == null)
return null;
@@ -124,7 +124,7 @@ namespace DiscImageChef.Decoders.CD
decoded.DataLength = BigEndianBitConverter.ToUInt16(CDSessionInfoResponse, 0);
decoded.FirstCompleteSession = CDSessionInfoResponse[2];
decoded.LastCompleteSession = CDSessionInfoResponse[3];
decoded.TrackDescriptors = new CDSessionInfoTrackDataDescriptor[(decoded.DataLength - 2) / 8];
decoded.TrackDescriptors = new TrackDataDescriptor[(decoded.DataLength - 2) / 8];
if (decoded.DataLength + 2 != CDSessionInfoResponse.Length)
{
@@ -145,7 +145,7 @@ namespace DiscImageChef.Decoders.CD
return decoded;
}
public static string PrettifyCDSessionInfo(CDSessionInfo? CDSessionInfoResponse)
public static string Prettify(CDSessionInfo? CDSessionInfoResponse)
{
if (CDSessionInfoResponse == null)
return null;
@@ -156,7 +156,7 @@ namespace DiscImageChef.Decoders.CD
sb.AppendFormat("First complete session number: {0}", response.FirstCompleteSession).AppendLine();
sb.AppendFormat("Last complete session number: {0}", response.LastCompleteSession).AppendLine();
foreach (CDSessionInfoTrackDataDescriptor descriptor in response.TrackDescriptors)
foreach (TrackDataDescriptor descriptor in response.TrackDescriptors)
{
sb.AppendFormat("First track number in last complete session: {0}", descriptor.TrackNumber);
sb.AppendFormat("Track starts at LBA {0}, or MSF {1:X2}:{2:X2}:{3:X2}", descriptor.TrackStartAddress,
@@ -225,10 +225,10 @@ namespace DiscImageChef.Decoders.CD
return sb.ToString();
}
public static string PrettifyCDSessionInfo(byte[] CDSessionInfoResponse)
public static string Prettify(byte[] CDSessionInfoResponse)
{
CDSessionInfo? decoded = DecodeCDSessionInfo(CDSessionInfoResponse);
return PrettifyCDSessionInfo(decoded);
CDSessionInfo? decoded = Decode(CDSessionInfoResponse);
return Prettify(decoded);
}
}
}

View File

@@ -112,7 +112,7 @@ namespace DiscImageChef.Decoders.CD
public UInt32 TrackStartAddress;
}
public static CDTOC? DecodeCDTOC(byte[] CDTOCResponse)
public static CDTOC? Decode(byte[] CDTOCResponse)
{
if (CDTOCResponse == null)
return null;
@@ -145,7 +145,7 @@ namespace DiscImageChef.Decoders.CD
return decoded;
}
public static string PrettifyCDTOC(CDTOC? CDTOCResponse)
public static string Prettify(CDTOC? CDTOCResponse)
{
if (CDTOCResponse == null)
return null;
@@ -225,10 +225,10 @@ namespace DiscImageChef.Decoders.CD
return sb.ToString();
}
public static string PrettifyCDTOC(byte[] CDTOCResponse)
public static string Prettify(byte[] CDTOCResponse)
{
CDTOC? decoded = DecodeCDTOC(CDTOCResponse);
return PrettifyCDTOC(decoded);
CDTOC? decoded = Decode(CDTOCResponse);
return Prettify(decoded);
}
}
}

View File

@@ -1,3 +1,13 @@
2015-10-19 Natalia Portillo <claunia@claunia.com>
* CD/TOC.cs:
* CD/PMA.cs:
* CD/ATIP.cs:
* CD/Session.cs:
* CD/FullTOC.cs:
* CD/CDTextOnLeadIn.cs:
Rename fields, methods and structs to more adequate names.
2015-10-19 Natalia Portillo <claunia@claunia.com>
* CD/CD.cs:

View File

@@ -1,3 +1,9 @@
2015-10-19 Natalia Portillo <claunia@claunia.com>
* Commands/Decode.cs:
Rename CD decoders fields, methods and structs to more
adequate names.
2015-10-19 Natalia Portillo <claunia@claunia.com>
* Commands/Decode.cs:

View File

@@ -124,7 +124,7 @@ namespace DiscImageChef.Commands
{
DicConsole.WriteLine("CD ATIP:");
DicConsole.WriteLine("================================================================================");
DicConsole.WriteLine(Decoders.CD.ATIP.PrettifyCDATIP(atip));
DicConsole.WriteLine(Decoders.CD.ATIP.Prettify(atip));
DicConsole.WriteLine("================================================================================");
}
break;
@@ -138,7 +138,7 @@ namespace DiscImageChef.Commands
{
DicConsole.WriteLine("CD full TOC:");
DicConsole.WriteLine("================================================================================");
DicConsole.WriteLine(Decoders.CD.FullTOC.PrettifyCDFullTOC(fulltoc));
DicConsole.WriteLine(Decoders.CD.FullTOC.Prettify(fulltoc));
DicConsole.WriteLine("================================================================================");
}
break;
@@ -152,7 +152,7 @@ namespace DiscImageChef.Commands
{
DicConsole.WriteLine("CD PMA:");
DicConsole.WriteLine("================================================================================");
DicConsole.WriteLine(Decoders.CD.PMA.PrettifyCDPMA(pma));
DicConsole.WriteLine(Decoders.CD.PMA.Prettify(pma));
DicConsole.WriteLine("================================================================================");
}
break;
@@ -166,7 +166,7 @@ namespace DiscImageChef.Commands
{
DicConsole.WriteLine("CD session information:");
DicConsole.WriteLine("================================================================================");
DicConsole.WriteLine(Decoders.CD.Session.PrettifyCDSessionInfo(sessioninfo));
DicConsole.WriteLine(Decoders.CD.Session.Prettify(sessioninfo));
DicConsole.WriteLine("================================================================================");
}
break;
@@ -180,7 +180,7 @@ namespace DiscImageChef.Commands
{
DicConsole.WriteLine("CD-TEXT:");
DicConsole.WriteLine("================================================================================");
DicConsole.WriteLine(Decoders.CD.CDTextOnLeadIn.PrettifyCDTextLeadIn(cdtext));
DicConsole.WriteLine(Decoders.CD.CDTextOnLeadIn.Prettify(cdtext));
DicConsole.WriteLine("================================================================================");
}
break;
@@ -194,7 +194,7 @@ namespace DiscImageChef.Commands
{
DicConsole.WriteLine("CD TOC:");
DicConsole.WriteLine("================================================================================");
DicConsole.WriteLine(Decoders.CD.TOC.PrettifyCDTOC(toc));
DicConsole.WriteLine(Decoders.CD.TOC.Prettify(toc));
DicConsole.WriteLine("================================================================================");
}
break;