forked from z52c/MusicDownloader
-
Notifications
You must be signed in to change notification settings - Fork 0
/
id3tag.h
71 lines (60 loc) · 1.38 KB
/
id3tag.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
#ifndef ID3TAG_H
#define ID3TAG_H
#include <QObject>
#include <QFile>
#include <QTextStream>
#include <QDataStream>
typedef struct ID3HEADER{
char identifier[3];
char version[2];
char flags;
char size[4];
}id3Header;
typedef struct FRAMEHEADER{
char frameID[4];
char size[4];
char flags[2];
}frameHeader;
class ID3tag : public QObject
{
Q_OBJECT
private:
id3Header tagHeaderOld;
QString mp3FileName;
QString mp3FileNameTmp;
id3Header tagHeader;
frameHeader titleHeader;
frameHeader artistHeader;
frameHeader albumHeader;
frameHeader picHeader;
int titleSize;
int artistSize;
int albumSize;
int picSize;
QString title;
QString artist;
QString album;
QByteArray image;
QByteArray mp3File;
char mimeInfo[14];
QFile *fileN; //新的的文件
QFile *fileS; //原来的文件
QFile *fileImage;
QDataStream *dStreamS;
QDataStream *dStream;
// QTextStream *tStream;
public:
explicit ID3tag(QObject *parent = nullptr);
ID3tag(QString fileName);
~ID3tag();
void setTitle(QString t);
void setArtist(QString a);
void setAlbum(QString a);
void setPic(QString imageFileName);
void doJob();
signals:
processState(QString );
finished();
public slots:
};
#endif // ID3TAG_H