290
|
1 /*
|
|
2 * id3tag.h
|
|
3 *
|
|
4 * Description: ID3 functions prototypes
|
|
5 *
|
|
6 */
|
|
7
|
|
8 #pragma pack(1)
|
|
9
|
|
10 #define MAX_LINE 4096
|
442
|
11 #define MAX_YEAR 5
|
|
12 #define MAX_TRACK 3
|
|
13 #define MAX_GENRE 256
|
290
|
14 //#define ID3_VERSION 3
|
|
15
|
|
16 /* ID3 common headers set */
|
|
17
|
|
18 #define TIT2 1
|
|
19 #define TPE1 2
|
|
20 #define TALB 3
|
|
21 #define TRCK 4
|
|
22 #define TYER 5
|
|
23 #define TCON 6
|
|
24 #define COMM 7
|
|
25
|
|
26 /* ID3 tag checked flags */
|
|
27
|
|
28 #define ID3_UNSYNCHRONISATION_FLAG 0x80
|
|
29 #define ID3_EXTENDEDHEADER_FLAG 0x40
|
|
30 #define ID3_EXPERIMENTALTAG_FLAG 0x20
|
|
31 #define ID3_FOOTERPRESENT_FLAG 0x10
|
|
32
|
|
33 /* ID3 frame checked flags */
|
|
34
|
|
35 #define FRAME_COMPRESSION_FLAG 0x0008
|
|
36 #define FRAME_ENCRYPTION_FLAG 0x0004
|
|
37 #define FRAME_UNSYNCHRONISATION_FLAG 0x0002
|
|
38
|
|
39 /* ID3 field text encoding */
|
|
40
|
|
41 #define FIELD_TEXT_ISO_8859_1 0x00
|
|
42 #define FIELD_TEXT_UTF_16 0x01
|
|
43 #define FIELD_TEXT_UTF_16BE 0x02
|
|
44 #define FIELD_TEXT_UTF_8 0x03
|
|
45
|
|
46 #define GENRES 148
|
|
47
|
|
48 typedef struct {
|
|
49 unsigned char id[3];
|
|
50 unsigned char title[30];
|
|
51 unsigned char artist[30];
|
|
52 unsigned char album[30];
|
|
53 unsigned char year[4];
|
|
54 unsigned char comment[28];
|
|
55 unsigned char zero;
|
|
56 unsigned char track;
|
|
57 unsigned char genre;
|
|
58 } id3v1_tag;
|
|
59
|
|
60 typedef struct {
|
|
61 unsigned char id[3];
|
|
62 unsigned short version;
|
|
63 unsigned char flags;
|
|
64 unsigned char size[4];
|
|
65 } id3v2_tag;
|
|
66
|
|
67 typedef struct {
|
|
68 unsigned char id[4];
|
|
69 unsigned char size[4];
|
|
70 unsigned short flags;
|
|
71 } id3v2_frame;
|
|
72
|
|
73 typedef struct {
|
|
74 unsigned char name[31];
|
|
75 unsigned char title[31];
|
|
76 unsigned char artist[31];
|
|
77 unsigned char album[31];
|
|
78 unsigned char comment[31];
|
|
79 unsigned char year[5];
|
|
80 unsigned char track;
|
|
81 unsigned char genre;
|
|
82 unsigned char id3has;
|
|
83 } id3v1_data;
|
|
84
|
|
85 typedef struct {
|
|
86 unsigned char name[MAX_LINE];
|
|
87 unsigned char title[MAX_LINE];
|
|
88 unsigned char artist[MAX_LINE];
|
|
89 unsigned char album[MAX_LINE];
|
|
90 unsigned char comment[MAX_LINE];
|
442
|
91 unsigned char year[MAX_YEAR];
|
|
92 unsigned char track[MAX_TRACK];
|
|
93 unsigned char genre[MAX_GENRE];
|
290
|
94 unsigned char id3has;
|
|
95 unsigned long size;
|
|
96 } id3v2_data;
|
|
97
|
|
98
|