File: apetag.h

package info (click to toggle)
mp3gain 1.4.6-1
  • links: PTS
  • area: main
  • in suites: sarge
  • size: 532 kB
  • ctags: 735
  • sloc: ansic: 7,583; makefile: 75
file content (78 lines) | stat: -rw-r--r-- 2,055 bytes parent folder | download | duplicates (5)
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
72
73
74
75
76
77
78
#ifndef APETAG_H
#define APETAG_H

#include <stdio.h>

struct MP3GainTagInfo {
    int haveTrackGain;
    int haveTrackPeak;
    int haveAlbumGain;
    int haveAlbumPeak;
    int haveUndo;
    int haveMinMaxGain;
	int haveAlbumMinMaxGain;
    double trackGain;
    double trackPeak;
    double albumGain;
    double albumPeak;
    int undoLeft;
    int undoRight;
    int undoWrap;
    /* undoLeft and undoRight will be the same 95% of the time.
       mp3gain DOES have a command-line switch to adjust the gain on just
       one channel, though.
       The "undoWrap" field indicates whether or not "wrapping" was turned on
       when the mp3 was adjusted
     */
    unsigned char minGain;
    unsigned char maxGain;
	unsigned char albumMinGain;
	unsigned char albumMaxGain;
    /* minGain and maxGain are the current minimum and maximum values of
       the "global gain" fields in the frames of the mp3 file
     */
	int dirty; /* flag if data changes after loaded from file */
  int recalc; /* Used to signal if recalculation is required */
};

struct APEFieldStruct {
	unsigned long vsize;
	unsigned long isize;
	unsigned long flags;
	char *name;
	char *value;
};

struct APETagFooterStruct {
    char   ID       [8];
    char   Version  [4];
    char   Length   [4];
    char   TagCount [4];
    char   Flags    [4];
    char   Reserved [8];
};

struct APETagStruct {
	unsigned long originalTagSize;
	int haveHeader;
	struct APETagFooterStruct header;
	struct APETagFooterStruct footer;
	unsigned char *otherFields; /* i.e. other than MP3Gain */
    unsigned long otherFieldsSize;
};

struct FileTagsStruct {
	long tagOffset;
	struct APETagStruct *apeTag;
    unsigned char *lyrics3tag;
	unsigned long lyrics3TagSize;
    unsigned char *id31tag;
};
	
int ReadMP3GainAPETag (char *filename, struct MP3GainTagInfo *info, struct FileTagsStruct *fileTags);

int WriteMP3GainAPETag (char *filename, struct MP3GainTagInfo *info, struct FileTagsStruct *fileTags, int saveTimeStamp);

int RemoveMP3GainAPETag (char *filename, int saveTimeStamp);

#endif