AeN64Driver.h
5.51 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
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
#ifndef _AE_U64Dev_h
#define _AE_U64Dev_h
#include <Vk/VkMenu.h>
#include "n64.h"
#include "GioMgr.h"
#include "AeAsset.h"
#include "AePlayer.h"
#include "AeErr.h"
class VkCallbackObject;
class List;
class AeN64Config;
enum
{
kN64InitErr = -3000,
kN64LowMemErr = -3001,
kN64LowSampleMemErr = -3002,
kN64BookMemErr = -3003,
kN64BadBookN = -3004
};
#define DEF_BANK_PER_BANKFILE 16
#define DEF_INST_PER_BANK 128
#define DEF_SND_PER_INST 64
#define DEF_BOOK_SIZE 128
typedef struct
{
int dataType;
u8 * memStart;
int memSize;
AeAsset * refAsset;
int maxArray;
} U64Block;
typedef struct
{
u8 *romStart;
int size;
} smplBlock;
class AeN64Driver : public AePlayer
{
public:
static AeErr NewN64Driver (char *, AeN64Driver *&);
AeN64Driver (char * configFileName = NULL);
virtual ~AeN64Driver (void);
// client messages
virtual void SetAssetBase (AeAssetBase *);
void CloseBank (void);
virtual void CreateAsset (AeAsset *, Boolean);
virtual void UpdateAsset (AeAsset *, Boolean);
virtual void DeleteAsset (AeAsset *, Boolean);
virtual void OnlineAsset (AeAsset *, Boolean);
virtual void UpdateResume (void);
// player messages
virtual void AuditionStart (AeAsset *);
virtual void AuditionStop (void);
virtual void BuildMenu (AeAssetWindow *);
AeErr ResetDevice (void);
AeErr ReconfigureAudio (void);
void PoseConfigure (void);
AeN64Config * GetConfig (void) { return fConfig; }
void ResetMidi (void);
AeErr SendMidiBlock (CommPckt *cp);
virtual void ReportError (AeErr);
protected:
AeErr loadBank (void);
AeErr loadControl (void);
AeErr loadWave (void);
void unloadBank (void);
AeErr startBank (void);
Boolean checkBank (void);
Boolean isBankOnline (void);
Boolean isBankLoadable (void);
Boolean isInstLoadable (AeInstAsset *);
Boolean isSoundLoadable (AeSoundAsset *);
Boolean checkFx (void);
Boolean isFxOnline (AeAsset *);
Boolean isFxSxnOnline (AeFxSxnAsset *);
Boolean isFxLoadable (AeFxAsset *);
void fxCreateBuiltIn (void);
void fxParseParamList (AeFxAsset *, int * params);
void fxBuildParamList (AeFxAsset *, int ** pParams, int * nParams);
int * fxSxnParseParamList (AeFxSxnAsset *, int * params);
int * fxSxnBuildParamList (AeFxSxnAsset *, int * params);
int msec2alignedsamples (int);
void createBankAsset (AeAsset *, Boolean);
void createFxAsset (AeAsset *, Boolean);
void updateBankAsset (AeAsset *, Boolean);
void updateFxAsset (AeAsset *, Boolean);
void deleteBankAsset (AeAsset *, Boolean);
void deleteFxAsset (AeAsset *, Boolean);
void onlineBankAsset (AeAsset *, Boolean);
void onlineFxAsset (AeAsset *, Boolean);
AeErr allocBankMem (AeAsset *);
void deallocBankMem (AeAsset *);
void reallocBankMem (void);
AeErr allocWaveMem (AeWaveAsset *);
void deallocWaveMem (AeWaveAsset *);
void reallocWaveMem (void);
Boolean canGetAuditionParams (AeAsset *,
char * pPatch,
char * pKey,
char * pChannel);
void getInstPatch (AeInstAsset *, char *);
void updateAsset (AeAsset *);
void updateBankFile (AeBankFileAsset *);
void updateBank (AeBankAsset *);
void updateInst (AeInstAsset *);
void updateSound (AeSoundAsset *);
void updateEnv (AeEnvAsset *);
void updateKeymap (AeKeymapAsset *);
void updateWave (AeWaveAsset *);
void updateLoop (AeLoopAsset *);
void updateBook (AeADPCMBookAsset *);
void updateFx (AeFxAsset *);
void updateFxSxn (AeFxSxnAsset *);
void assembleAssetList (GList<AeAsset *> *, u8 *);
void assembleAssetRefs (AeAsset *, u8 *);
void assembleAsset (AeAsset *, u8 *);
void assembleBankFile (AeBankFileAsset *, ALBankFile *);
void assembleBank (AeBankAsset *, ALBank *);
void assembleInst (AeInstAsset *, ALInstrument *);
void assembleSound (AeSoundAsset *, ALSound *);
void assembleKeymap (AeKeymapAsset *, ALKeyMap *);
void assembleEnv (AeEnvAsset *, ALEnvelope *);
void assembleWave (AeWaveAsset *, ALWaveTable *);
void assembleLoop (AeLoopAsset *, ALADPCMloop *);
void assembleBook (AeADPCMBookAsset *, ALADPCMBook *);
static void configureCallback (Widget, XtPointer, XtPointer);
static void saveConfigCallback (Widget, XtPointer, XtPointer);
static void loadConfigCallback (Widget, XtPointer, XtPointer);
static void clearProfileCallback (Widget, XtPointer, XtPointer);
static void resetSystemCallback (Widget, XtPointer, XtPointer);
VkSubMenu * fPlayerMenu;
VkMenuItem * fConfigureButton;
VkMenuItem * fSaveConfigButton;
VkMenuItem * fLoadConfigButton;
VkMenuItem * fClearProfileButton;
VkMenuItem * fResetSystemButton;
List * usedBlocks;
List * freeBlocks;
List * usedSmpl;
List * freeSmpl;
u8 * fBmemStart;
u8 * fBmemEnd;
u8 * fBmemCur;
u8 * fSmemStart;
u8 * fSmemEnd;
u8 * fSmemCur;
GioMgr * fGioMgr;
AeN64Config * fConfig;
AeBankAsset * fBank; // currently loaded bank
Boolean fBankOnlineHW; // true if bank loaded onto hardware
Boolean fNeedsConfigure; // True if audio needs reconfigure
public:
// utility routines
static int aetype2n64type (TAssetType);
static TAssetType n64type2aetype (int);
};
#endif