File: APEHeader.h

package info (click to toggle)
libjmac-java 1.74-8
  • links: PTS, VCS
  • area: main
  • in suites: bookworm, forky, sid, trixie
  • size: 1,780 kB
  • sloc: java: 9,279; cpp: 4,375; xml: 369; makefile: 31; sh: 12
file content (57 lines) | stat: -rw-r--r-- 2,245 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
#ifndef APE_HEADER_H
#define APE_HEADER_H

/*****************************************************************************************
APE header that all APE files have in common (old and new)
*****************************************************************************************/
struct APE_COMMON_HEADER
{
    char cID[4];                            // should equal 'MAC '
    uint16 nVersion;                        // version number * 1000 (3.81 = 3810)
};

/*****************************************************************************************
APE header structure for old APE files (3.97 and earlier)
*****************************************************************************************/
struct APE_HEADER_OLD 
{
    char cID[4];                            // should equal 'MAC '
    uint16 nVersion;                        // version number * 1000 (3.81 = 3810)
    uint16 nCompressionLevel;               // the compression level
    uint16 nFormatFlags;                    // any format flags (for future use)
    uint16 nChannels;                       // the number of channels (1 or 2)
    uint32 nSampleRate;                     // the sample rate (typically 44100)
    uint32 nHeaderBytes;                    // the bytes after the MAC header that compose the WAV header
    uint32 nTerminatingBytes;               // the bytes after that raw data (for extended info)
    uint32 nTotalFrames;                    // the number of frames in the file
    uint32 nFinalFrameBlocks;               // the number of samples in the final frame
};

struct APE_FILE_INFO;
class CIO;

/*****************************************************************************************
CAPEHeader - makes managing APE headers a little smoother (and the format change as of 3.98)
*****************************************************************************************/
class CAPEHeader
{

public:
    
    CAPEHeader(CIO * pIO);
    ~CAPEHeader();

    int Analyze(APE_FILE_INFO * pInfo);

protected:

    int AnalyzeCurrent(APE_FILE_INFO * pInfo);
    int AnalyzeOld(APE_FILE_INFO * pInfo);

    int FindDescriptor(BOOL bSeek);

    CIO * m_pIO;
};

#endif // #ifndef APE_HEADER_H