public static void WriteAccurateRipLog(CUESheet sheet, TextWriter writer) { writer.WriteLine("[CUETools log; Date: {0}; Version: {1}]", DateTime.Now, CUESheet.CUEToolsVersion); if (sheet.PreGapLength != 0) writer.WriteLine("Pregap length {0}.", sheet.PreGapLengthMSF); if (!sheet.TOC[1].IsAudio) writer.WriteLine("Playstation type data track length {0}.", sheet.TOC[sheet.TOC.FirstAudio].StartMSF); if (!sheet.TOC[sheet.TOC.TrackCount].IsAudio) writer.WriteLine("CD-Extra data track length {0}.", sheet.TOC[sheet.TOC.TrackCount].Length == 0 && sheet.MinDataTrackLength.HasValue ? CDImageLayout.TimeToString(sheet.MinDataTrackLength.Value) + " - " + CDImageLayout.TimeToString(sheet.MinDataTrackLength.Value + 74) : sheet.TOC[sheet.TOC.TrackCount].LengthMSF); if (sheet.CDDBDiscIdTag != null && AccurateRipVerify.CalculateCDDBId(sheet.TOC).ToUpper() != sheet.CDDBDiscIdTag.ToUpper() && !sheet.MinDataTrackLength.HasValue) writer.WriteLine("CDDBId mismatch: {0} vs {1}", sheet.CDDBDiscIdTag.ToUpper(), AccurateRipVerify.CalculateCDDBId(sheet.TOC).ToUpper()); if (sheet.AccurateRipId != null && AccurateRipVerify.CalculateAccurateRipId(sheet.TOC) != sheet.AccurateRipId) writer.WriteLine("Using preserved id, actual id is {0}.", AccurateRipVerify.CalculateAccurateRipId(sheet.TOC)); if (sheet.Truncated4608) writer.WriteLine("Truncated 4608 extra samples in some input files."); if (sheet.PaddedToFrame) writer.WriteLine("Padded some input files to a frame boundary."); if (!sheet.Processed) { if (sheet.IsUsingCUEToolsDB) sheet.GenerateCTDBLog(writer); writer.WriteLine("[AccurateRip ID: {0}] {1}.", sheet.AccurateRipId ?? AccurateRipVerify.CalculateAccurateRipId(sheet.TOC), sheet.ArVerify.ARStatus ?? "found"); return; } if (sheet.HDCDDecoder != null && string.Format("{0:s}", sheet.HDCDDecoder) != "") writer.WriteLine("HDCD: {0:f}", sheet.HDCDDecoder); if (0 != sheet.WriteOffset) writer.WriteLine("Offset applied: {0}", sheet.WriteOffset); if (sheet.IsUsingCUEToolsDBFix)// && _CUEToolsDB.SelectedEntry != null) writer.WriteLine("CUETools DB: corrected {0} errors.", sheet.CTDB.SelectedEntry.repair.CorrectableErrors); else if (sheet.IsUsingCUEToolsDB) sheet.GenerateCTDBLog(writer); sheet.ArVerify.GenerateFullLog(writer, sheet.Config.arLogVerbose, sheet.AccurateRipId ?? AccurateRipVerify.CalculateAccurateRipId(sheet.TOC)); }
public static string GetRipperLog(CUESheet sheet) { StringWriter logWriter = new StringWriter(CultureInfo.InvariantCulture); logWriter.WriteLine("{0}", sheet.CDRipper.RipperVersion); logWriter.WriteLine("Extraction logfile from : {0}", DateTime.Now); logWriter.WriteLine("Used drive : {0}", sheet.CDRipper.ARName); logWriter.WriteLine("Read offset correction : {0}", sheet.CDRipper.DriveOffset); logWriter.WriteLine("Read command : {0}", sheet.CDRipper.CurrentReadCommand); logWriter.WriteLine("Secure mode : {0}", sheet.CDRipper.CorrectionQuality); logWriter.WriteLine("Disk length : {0}", CDImageLayout.TimeToString(sheet.TOC.AudioLength)); logWriter.WriteLine("AccurateRip : {0}", sheet.ArVerify.ARStatus == null ? "ok" : sheet.ArVerify.ARStatus); if (sheet.HDCDDecoder != null && string.Format("{0:s}", sheet.HDCDDecoder) != "") logWriter.WriteLine("HDCD : {0:f}", sheet.HDCDDecoder); logWriter.WriteLine(); logWriter.WriteLine("TOC of the extracted CD"); logWriter.WriteLine(); logWriter.Write(GetTOCContents(sheet)); logWriter.WriteLine(); logWriter.WriteLine(" Track | Pregap | Indexes"); logWriter.WriteLine(" ---------------------------------------------------------"); for (int track = 1; track <= sheet.TOC.TrackCount; track++) logWriter.WriteLine("{0,9} | {1,8} | {2,2}", sheet.TOC[track].Number, CDImageLayout.TimeToString(sheet.TOC[track].Pregap + (track == 1 ? 150U : 0U)), sheet.TOC[track].LastIndex); logWriter.WriteLine(); logWriter.WriteLine("Destination files"); foreach (string path in sheet.DestPaths) logWriter.WriteLine(" {0}", path); bool wereErrors = sheet.PrintErrors(logWriter, sheet.TOC[sheet.TOC.FirstAudio][0].Start, sheet.TOC.AudioLength); if (wereErrors) { logWriter.WriteLine(); if (wereErrors) logWriter.WriteLine("There were errors"); else logWriter.WriteLine("No errors occurred"); } if (sheet.IsUsingCUEToolsDB) { logWriter.WriteLine(); sheet.GenerateCTDBLog(logWriter); } if (sheet.IsUsingAccurateRip) { logWriter.WriteLine(); logWriter.WriteLine("AccurateRip summary"); logWriter.WriteLine(); sheet.ArVerify.GenerateFullLog(logWriter, true, AccurateRipVerify.CalculateAccurateRipId(sheet.TOC)); } logWriter.WriteLine(); logWriter.WriteLine("End of status report"); logWriter.Close(); return logWriter.ToString(); }