mirror of
https://github.com/SabreTools/MPF.git
synced 2026-07-02 17:24:48 +00:00
Fix writing of valid indexes for Aaru cuesheet
This commit is contained in:
@@ -2280,8 +2280,20 @@ namespace DICUI.Aaru
|
||||
// Loop through each index
|
||||
foreach (TrackIndexType trackIndex in track.Indexes)
|
||||
{
|
||||
// TODO: Convert Value to timecode
|
||||
cueTrack.Indices.Add(new CueIndex(trackIndex.index.ToString(), trackIndex.Value.ToString()));
|
||||
// Get timestamp from frame count
|
||||
int absoluteLength = Math.Abs(trackIndex.Value);
|
||||
int frames = absoluteLength % 75;
|
||||
int seconds = (absoluteLength / 75) % 60;
|
||||
int minutes = (absoluteLength / 75 / 60);
|
||||
string timeString = $"{minutes:D2}:{seconds:D2}:{frames:D2}";
|
||||
|
||||
// Pregap information
|
||||
if (trackIndex.Value < 0)
|
||||
cueTrack.PreGap = new PreGap(timeString);
|
||||
|
||||
// Individual indexes
|
||||
else
|
||||
cueTrack.Indices.Add(new CueIndex(trackIndex.index.ToString(), timeString));
|
||||
}
|
||||
}
|
||||
else
|
||||
|
||||
Reference in New Issue
Block a user