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