* 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 bd0d0c0806
commit bf38b4cc3d
7 changed files with 51 additions and 41 deletions

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);
}
}
}