shithub: cuefs

Download patch

ref: c402d678bf078f5aed978229c400a9f1362824b1
parent: ec39ae8f8b2184347768f308ea80b11cc4aabf1b
author: Tevo <estevan.cps@gmail.com>
date: Sat Feb 13 22:10:49 EST 2021

Handle PREGAP and POSTGAP  properly 

--- a/BUGS	Sat Feb 13 22:04:42 2021
+++ b/BUGS	Sat Feb 13 22:10:49 2021
@@ -13,3 +13,4 @@
 		REM GENRE "Progressive Rock"
 		REM DATE 2002
 	it probably wouldn't hurt to try parsing some of those; not a high priority at the moment
+• cuefs does not respect PREGAP and POSTGAP tags on cuesheets
--- a/cue.c	Sat Feb 13 22:04:42 2021
+++ b/cue.c	Sat Feb 13 22:10:49 2021
@@ -167,8 +167,24 @@
 setisrc(Cuesheet *c, char *isrc)
 {
 	if(c->curentry == nil)
-		parserfatal("flag outside of track");
+		parserfatal("isrc outside of track");
 	c->curentry->isrc = isrc;
+}
+
+void 
+setpregap(Cuesheet* c, Timestamp pre)
+{
+	if(c->curentry == nil)
+		parserfatal("pregap outside of track");
+	c->curentry->pregap = pre;
+}
+
+void 
+setpostgap(Cuesheet* c, Timestamp post)
+{
+	if(c->curentry == nil)
+		parserfatal("postgap outside of track");
+	c->curentry->postgap = post;
 }
 
 void
--- a/cue.y	Sat Feb 13 22:04:42 2021
+++ b/cue.y	Sat Feb 13 22:10:49 2021
@@ -42,6 +42,8 @@
 	| CATALOG MCN				{ setmcn(cursheet, $2); }
 	| FLAGS flags				{ setflags(cursheet, $2); }
 	| ISRC ISRCCODE			{ setisrc(cursheet, $2); }
+	| PREGAP timestamp			{ setpregap(cursheet, $2); }
+	| POSTGAP timestamp		{ setpostgap(cursheet, $2); }
 	;
 
 flags:						{ $$ = 0; }
--- a/cuefs.h	Sat Feb 13 22:04:42 2021
+++ b/cuefs.h	Sat Feb 13 22:10:49 2021
@@ -76,6 +76,7 @@
 	AFile *file;
 	int index, flags;
 	char *title, *performer, *isrc;
+	Timestamp pregap, postgap;
 	Entry *next;
 };
 
@@ -95,6 +96,8 @@
 Cuesheet* newsheet(void);
 void freesheet(Cuesheet*);
 
+void setpregap(Cuesheet*, Timestamp);
+void setpostgap(Cuesheet*, Timestamp);
 void setisrc(Cuesheet*, char*);
 void setflags(Cuesheet*, int);
 void setmcn(Cuesheet*, char*);