From ff722b6a5287499f49553f68f4b576d2c00d2e39 Mon Sep 17 00:00:00 2001 From: Michael Bucari-Tovo Date: Wed, 16 Jun 2021 16:58:01 -0600 Subject: [PATCH] Added support for chapter titles and refactored. --- AaxDecrypter/UNTESTED/Cue.cs | 19 +++++++------------ LibationLauncher/LibationLauncher.csproj | 2 +- 2 files changed, 8 insertions(+), 13 deletions(-) diff --git a/AaxDecrypter/UNTESTED/Cue.cs b/AaxDecrypter/UNTESTED/Cue.cs index 5401dc25..86ec88c3 100644 --- a/AaxDecrypter/UNTESTED/Cue.cs +++ b/AaxDecrypter/UNTESTED/Cue.cs @@ -14,20 +14,15 @@ namespace AaxDecrypter stringBuilder.AppendLine(GetFileLine(filePath, "MP3")); - var beginningTimes = chapters.GetBeginningTimes().ToList(); - for (var i = 0; i < beginningTimes.Count; i++) + var trackCount = 0; + foreach (Chapter c in chapters.ChapterList) { - var chapter = i + 1; + trackCount++; + var startTime = TimeSpan.FromSeconds(c.StartTime); - var timeSpan = beginningTimes[i]; - var minutes = Math.Floor(timeSpan.TotalMinutes).ToString(); - var seconds = timeSpan.Seconds.ToString("D2"); - var milliseconds = (timeSpan.Milliseconds / 10).ToString("D2"); - var time = minutes + ":" + seconds + ":" + milliseconds; - - stringBuilder.AppendLine($"TRACK {chapter} AUDIO"); - stringBuilder.AppendLine($" TITLE \"Chapter {chapter:D2}\""); - stringBuilder.AppendLine($" INDEX 01 {time}"); + stringBuilder.AppendLine($"TRACK {trackCount} AUDIO"); + stringBuilder.AppendLine($" TITLE \"{c.Title}\""); + stringBuilder.AppendLine($" INDEX 01 {(int)startTime.TotalMinutes}:{startTime:ss\\:ff}"); } return stringBuilder.ToString(); diff --git a/LibationLauncher/LibationLauncher.csproj b/LibationLauncher/LibationLauncher.csproj index 5f3caf92..c5b085d2 100644 --- a/LibationLauncher/LibationLauncher.csproj +++ b/LibationLauncher/LibationLauncher.csproj @@ -13,7 +13,7 @@ win-x64 - 4.2.4.3 + 4.2.4.8