-
Notifications
You must be signed in to change notification settings - Fork 39
/
cue_parser.h
59 lines (49 loc) · 1.08 KB
/
cue_parser.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
#ifndef __CUE_PARSER_H__
#define __CUE_PARSER_H__
#ifndef CUE_PARSER_TEST
#include "idxfile.h"
#include "FatFs/ff.h"
#endif
#define SECTOR_AUDIO 0
#define SECTOR_DATA_MODE1 1
#define SECTOR_DATA_MODE2 2
#define CUE_RES_OK 0
#define CUE_RES_NOTFOUND 1
#define CUE_RES_INVALID 2
#define CUE_RES_UNS 3
#define CUE_RES_BINERR 4
typedef struct
{
int offset;
int start;
int end;
int type;
int sector_size;
} cd_track_t;
typedef struct
{
int valid;
int end;
int last;
cd_track_t tracks[100];
#ifndef CUE_PARSER_TEST
IDXFile *file; // the .bin file
#endif
} toc_t;
typedef struct
{
unsigned char m;
unsigned char s;
unsigned char f;
} msf_t;
extern toc_t toc;
extern const char *cue_error_msg[];
#ifdef CUE_PARSER_TEST
char cue_parse(const char *filename);
#else
char cue_parse(const char *filename, IDXFile *image);
#endif
void LBA2MSF(int lba, msf_t* msf);
int MSF2LBA(unsigned char m, unsigned char s, unsigned char f);
int cue_gettrackbylba(int lba);
#endif // __CUE_PARSER_H__