-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathcuefs.h
121 lines (96 loc) · 2.13 KB
/
cuefs.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
extern char *fname;
extern int infd, outfd;
/* lex/yacc */
int yylex(void);
int yyparse(void);
void yyerror(char*);
/* misc.c */
void* erealloc(void*, ulong);
void* emallocz(ulong, int);
void* emalloc(ulong);
char* esmprint(char*, ...);
char* setstr(char*, char**, char*);
char* strreplace(char*, char, char);
#pragma varargk argpos parserwarn 1
#pragma varargk argpos parserfatal 1
#pragma varargk argpos debug 1
void parserwarn(char*, ...);
void parserfatal(char*, ...);
void debug(char*, ...);
void trace(char*, ...);
extern int verbosity;
/*****/
enum
{
WAVE, MP3, AIFF, BINARY /* PCM LE */, MOTOROLA /* PCM BE */,
/**/
AAC, FLAC, OGG, OPUS, UNKNOWN
};
enum
{
FLAG_DCP = (1<<0),
FLAG_4CH = (1<<1),
FLAG_PRE = (1<<2),
FLAG_SCMS = (1<<3),
};
typedef struct Timestamp Timestamp;
typedef struct AFile AFile;
typedef struct Start Start;
typedef struct Entry Entry;
typedef struct Cuesheet Cuesheet;
struct Timestamp
{
u64int frames;
};
struct AFile
{
int type, actual;
AFile *next;
char *name;
};
struct Start
{
Timestamp;
u8int index;
Start *next;
};
struct Entry
{
Cuesheet *sheet;
Start *starts;
AFile *file;
int index, flags;
char *title, *performer, *songwriter, *isrc;
Timestamp pregap, postgap;
Entry *next;
};
struct Cuesheet
{
char *title, *performer, *songwriter, *mcn;
AFile *files, *curfile;
Entry *entries, *curentry;
};
extern Cuesheet *cursheet;
Timestamp parsetime(int, int, int);
double t2sec(Timestamp);
double of2sec(uint, uint, uint, vlong);
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*);
void setperformer(Cuesheet*, char*);
void setsongwriter(Cuesheet*, char*);
void settitle(Cuesheet*, char*);
void addfile(Cuesheet*, char*, int);
void addnewtrack(Cuesheet*, int);
void settimestamp(Cuesheet*, int, Timestamp);
char* formatext(int);
char* fileext(AFile*);
int actualformat(AFile*);
int prefoutfmt(int);
static char *Estub = "not yet";
static char *Eunsupported = "unsupported format";
void cuefsinit(Cuesheet*, char*, int, int);