AeAssetFile.h
2.58 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
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
#ifndef _AE_FileMgr_h
#define _AE_FileMgr_h
#include <PR/libaudio.h>
#include <PR/audiotools.h>
#include "Hash.h"
enum
{
FILE_NOT_SUPPORTED = -2,
FILE_FAILURE = -1,
FILE_OK = 0,
NO_FILE = 1
};
class AeAsset;
class AeBankFileAsset;
class AeBankAsset;
class AeInstAsset;
class AeSoundAsset;
class AeEnvAsset;
class AeKeymapAsset;
class AeWaveAsset;
class AeLoopAsset;
class AeBookAsset;
class AeFile
{
public:
AeFile (const char *, const char *, const char *);
virtual ~AeFile (void);
const char * GetFileName (void) { return fFileName; }
const char * GetDirName (void) { return fDirName; }
protected:
int GetFileData (char * fname, char *& fData, int & fSize);
static void parseFileString (const char *, char *& dir,
char *& file, char *& suffix);
static TAssetType suffix2type (char *);
const char * fDirName;
const char * fFileName;
const char * fFileSuffix;
};
class AeN64ConfigFile : public AeFile
{
AeN64ConfigFile (const char *, const char *, const char *);
virtual ~AeN64ConfigFile (void);
int Read (AeN64Config *&);
};
class AeAssetFile : public AeFile
{
public:
AeAssetFile (const char *, const char *, const char *);
virtual ~AeAssetFile (void);
virtual int Read (AeAsset *&);
};
class AeBankFile : public AeAssetFile
{
public:
AeBankFile (const char *, const char *, const char *);
virtual ~AeBankFile (void);
virtual int Read (AeAsset *&);
private:
int _ParseAssets (AeAsset *&);
void _ParseBankFile (AeBankFileAsset *, int);
void _ParseBank (AeBankAsset *, int);
void _ParseInst (AeInstAsset *, int);
void _ParseSound (AeSoundAsset *, int);
void _ParseKeymap (AeKeymapAsset *, int);
void _ParseEnvlp (AeEnvAsset *, int);
void _ParseWavet (AeWaveAsset *, int);
void _ParseLoop (AeLoopAsset *, int);
void _ParseBook (AeADPCMBookAsset *, int);
ALSymFile * fSymData;
int fSymSize;
ALBankFile * fCtlData;
int fCtlSize;
u8 * fTblData;
int fTblSize;
HashTable * fHashTbl;
};
class AeWaveFile : public AeAssetFile
{
public:
AeWaveFile (const char *, const char *, const char *);
virtual ~AeWaveFile (void);
virtual int Read (AeAsset *&);
};
#endif