AeWaveFile.h
2.15 KB
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
79
80
81
82
83
84
85
86
87
#ifndef __AeWaveFile__
#define __AeWaveFile__
#include <stdio.h>
#include <dmedia/audiofile.h>
#include "aiffc.h"
#include "AeFile.h"
enum
{
kAeFileTooManyLoops = -2000,
kAeFileBadLoopVersion = -2001,
kAeFileBadBookVersion = -2002,
kAeFileBadMarker = -2003
};
class AeWaveAsset;
class AeRaw16WaveAsset;
class AeADPCMWaveAsset;
class AeLoopAsset;
class AeADPCMLoopAsset;
class AeADPCMBookAsset;
class AeKeymapAsset;
class AeWaveFile : public AeAssetFile
{
public:
AeWaveFile (char *);
virtual ~AeWaveFile (void);
virtual AeErr ReadList (GList<AeAsset *> *&);
virtual AeErr Read (AeAsset *&);
AeErr ReadSampleData (char *& buffer, long & nbytes);
AeWaveAsset * GetWave (void) { return fWave; }
AeKeymapAsset * GetKeymap (void) { return fKeymap; }
virtual void ReportError (AeErr);
private:
AeErr afRead (void);
AeErr aeRead (void);
AeErr afReadSampleData (char *& buffer, long & nbytes);
AeErr aeReadSampleData (char *& buffer, long & nbytes);
// routines using the Audio File library
AeErr newWaveAsset (AFfilehandle);
AeErr newKeymapAsset (void);
void afReadWaveParams (AFfilehandle, AeWaveAsset *);
void afReadInstParams (AFfilehandle);
void afReadRaw16Params (AFfilehandle, AeRaw16WaveAsset *);
void afReadADPCMParams (AFfilehandle, AeADPCMWaveAsset *);
void afReadLoop (AFfilehandle, AeLoopAsset *);
void afReadADPCMLoop (void *, AeADPCMLoopAsset *);
void afReadADPCMBook (void *, AeADPCMBookAsset *);
void * afReadPString (void *, char *&);
long afReadLong (void * data);
short afReadShort (void * data);
// routines using custom parser
void aeReadInstParams (FILE *);
void aeReadLoop (AeLoopAsset * asset, Marker *, short nmarkers);
void aeReadADPCMLoop (FILE *, AeADPCMLoopAsset *);
void aeReadADPCMBook (FILE *, AeADPCMBookAsset *);
void aeReadMarkers (FILE *, Marker **, short *);
char * aeReadPString (FILE *);
int findMarkerSample (long *, MarkerID, Marker *, int);
AeWaveAsset * fWave;
AeKeymapAsset * fKeymap;
Loop fLoop;
};
#endif