Added %N for the cue-to-chapter-name conversion routine (track number padded with a zero).

This commit is contained in:
Moritz Bunkus 2003-11-15 18:19:26 +00:00
parent 89b68ad397
commit 52e0186fc3
2 changed files with 10 additions and 3 deletions

View File

@ -66,9 +66,12 @@ for this name can be set. The following meta characters are supported:
.br .br
\fB%p\fR is replaced by the current entry's \fIPERFORMER\fR string, \fB%p\fR is replaced by the current entry's \fIPERFORMER\fR string,
.br .br
\fB%t\fR is replaced by the current entry's \fITITLE\fR string and \fB%t\fR is replaced by the current entry's \fITITLE\fR string,
.br .br
\fB%n\fR is replaced by the current track number. \fB%n\fR is replaced by the current track number and
.br
\fB%N\fR is replaced by the current track number padded with a leading zero if
it is < 10.
.br .br
Everything else is copied as-is. Everything else is copied as-is.
.br .br

View File

@ -283,7 +283,11 @@ static void cue_entries_to_chapter_name(string &performer, string &title,
name += title; name += title;
else if (*next_char == 'n') else if (*next_char == 'n')
name += to_string(num); name += to_string(num);
else { else if (*next_char == 'N') {
if (num < 10)
name += '0';
name += to_string(num);
} else {
name += *this_char; name += *this_char;
this_char--; this_char--;
} }