Skip to content
Merged
Show file tree
Hide file tree
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions cue_parser.y
Original file line number Diff line number Diff line change
Expand Up @@ -123,6 +123,8 @@ Cd *cue_parse_string(const char*);
%type <ival> rem_item
%token <ival> DATE
%token <ival> COMMENT
%token <ival> DISCNUMBER
%token <ival> TOTALDISCS
%token <ival> XXX_GENRE /* parsed in REM but stored in CD-TEXT */
%token <ival> REPLAYGAIN_ALBUM_GAIN
%token <ival> REPLAYGAIN_ALBUM_PEAK
Expand Down Expand Up @@ -313,6 +315,8 @@ rem
rem_item
: DATE
| COMMENT
| DISCNUMBER
| TOTALDISCS
| REPLAYGAIN_ALBUM_GAIN
| REPLAYGAIN_ALBUM_PEAK
| REPLAYGAIN_TRACK_GAIN
Expand Down
2 changes: 2 additions & 0 deletions cue_scanner.l
Original file line number Diff line number Diff line change
Expand Up @@ -103,6 +103,8 @@ REM { BEGIN(REM); /* exclusive rules for special exceptions */ }

<REM>DATE { BEGIN(NAME); yylval.ival = REM_DATE; return DATE; }
<REM>COMMENT { BEGIN(NAME); yylval.ival = REM_COMMENT; return COMMENT; }
<REM>DISCNUMBER { BEGIN(NAME); yylval.ival = REM_DISCNUMBER; return DISCNUMBER; }
<REM>TOTALDISCS { BEGIN(NAME); yylval.ival = REM_TOTALDISCS; return TOTALDISCS; }
<REM>GENRE { BEGIN(NAME); yylval.ival = PTI_GENRE; return XXX_GENRE; }
<REM>REPLAYGAIN_ALBUM_GAIN { BEGIN(RPG); yylval.ival = REM_REPLAYGAIN_ALBUM_GAIN;
return REPLAYGAIN_ALBUM_GAIN; }
Expand Down
2 changes: 2 additions & 0 deletions libcue.h
Original file line number Diff line number Diff line change
Expand Up @@ -99,6 +99,8 @@ enum Pti {
enum RemType {
REM_DATE, /* date of cd/track */
REM_COMMENT,
REM_DISCNUMBER,
REM_TOTALDISCS,
REM_REPLAYGAIN_ALBUM_GAIN,
REM_REPLAYGAIN_ALBUM_PEAK,
REM_REPLAYGAIN_TRACK_GAIN,
Expand Down
2 changes: 2 additions & 0 deletions rem.c
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,8 @@ rem_new( void)
Rem rem[] = {
{REM_DATE, NULL},
{REM_COMMENT, NULL},
{REM_DISCNUMBER, NULL},
{REM_TOTALDISCS, NULL},
{REM_REPLAYGAIN_ALBUM_GAIN, NULL},
{REM_REPLAYGAIN_ALBUM_PEAK, NULL},
{REM_REPLAYGAIN_TRACK_GAIN, NULL},
Expand Down
10 changes: 10 additions & 0 deletions t/standard_cue.c
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,8 @@ int tests_run;
static char cue[] = "REM GENRE Alternative\n"
"REM DATE 1991\n"
"REM DISCID 860B640B\n"
"REM DISCNUMBER 1\n"
"REM TOTALDISCS 2\n"
"REM COMMENT \"ExactAudioCopy v0.95b4\"\n"
"PERFORMER \"My Bloody Valentine\"\n"
"TITLE \"Loveless\"\n"
Expand Down Expand Up @@ -54,6 +56,14 @@ static char* cue_test()
mu_assert ("error getting CD date", val != NULL);
mu_assert ("error validating CD date", strcmp (val, "1991") == 0);

val = rem_get (REM_DISCNUMBER, rem);
mu_assert ("error getting CD disc number", val != NULL);
mu_assert ("error validating CD disc number", strcmp (val, "1") == 0);

val = rem_get (REM_TOTALDISCS, rem);
mu_assert ("error getting CD total discs", val != NULL);
mu_assert ("error validating CD total discs", strcmp (val, "2") == 0);

val = rem_get (REM_COMMENT, rem);
mu_assert ("error getting CD comment", val != NULL);
mu_assert ("error validating CD comment", strcmp (val, "ExactAudioCopy v0.95b4") == 0);
Expand Down
Loading