-
Notifications
You must be signed in to change notification settings - Fork 17
/
Copy pathid3.h
56 lines (47 loc) · 1.2 KB
/
id3.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
/*
* Author: Floris Creyf
* Date: May 2015
* ID3 contains meta data irrelevant to the decoder. The header contains an
* offset used to determine the location of the first MP3 header.
* | Header | Additional header (optional) | Meta Data | Footer (optional) |
*/
#ifndef ID3_H
#define ID3_H
#include <string>
#include <vector>
#include <stdio.h>
using std::string;
using std::vector;
class id3 {
private:
unsigned char *buffer;
bool valid;
unsigned int start;
string version;
unsigned int offset;
bool id3_flags[4];
unsigned int extended_header_size;
vector<string> id3_frames[2];
void set_version(unsigned char version, unsigned char revision);
bool set_flags(unsigned char flags);
void set_offset(int offset);
void set_extended_header_size(int size);
void set_fields(unsigned char *buffer);
public:
enum Flags {
FooterPresent = 0,
ExperimentalIndicator = 1,
ExtendedHeader = 2,
Unsynchronisation = 3
};
id3(unsigned char *buffer);
id3(const id3 &orig);
bool is_valid();
string get_id3_version();
const bool *get_id3_flags();
int get_id3_offset();
int get_id3_extended_header_size();
const vector<string> *get_id3_fields();
unsigned int get_id3_fields_length();
};
#endif /* ID3_H */