-
Notifications
You must be signed in to change notification settings - Fork 0
/
midasdll.h
247 lines (191 loc) · 6.4 KB
/
midasdll.h
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
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
/* midasdll.h
*
* MIDAS DLL programming interface
*
* $Id: midasdll.h,v 1.4 1997/01/16 18:41:59 pekangas Exp $
*
* Copyright 1996,1997 Housemarque Inc.
*
* This file is part of the MIDAS Sound System, and may only be
* used, modified and distributed under the terms of the MIDAS
* Sound System license, LICENSE.TXT. By continuing to use,
* modify or distribute this file you indicate that you have
* read the license and understand and accept it fully.
*/
#ifndef __midasdll_h
#define __midasdll_h
/* This is a kluge, but necessary as Watcom C sucks: */
#ifdef EXPORT_IN_MIDASDLL_H
#ifdef __WC32__
#define _FUNC(x) x __export __stdcall
#else
#define _FUNC(x) __declspec(dllexport) x __stdcall
#endif
#else
#ifdef __LINUX__
#define _FUNC(x) x
#else
#ifdef __DOS__
#define _FUNC(x) x cdecl
#else
#define _FUNC(x) x __stdcall
#endif
#endif
#endif
/* We'll need to define DWORD, BOOL, TRUE and FALSE if someone hasn't
done that before. For now, we'll just assume that if no-one has defined
TRUE we need to define everything. There definitions are compatible with
windows.h. If something else in your system defines these differently,
things should still work OK as long as FALSE is 0, TRUE is nonzero and
DWORD is 32-bit. Take care that you don't compare BOOLs like "bool == TRUE"
in that case though, just use "bool".
THIS IS UGLY AND MAY NEED FIXING!
---------------------------------
*/
#ifndef TRUE
#define TRUE 1
#define FALSE 0
typedef int BOOL;
typedef unsigned long DWORD;
#endif /* ifndef TRUE */
enum MIDASoptions
{
MIDAS_OPTION_NONE = 0,
MIDAS_OPTION_MIXRATE,
MIDAS_OPTION_OUTPUTMODE,
MIDAS_OPTION_MIXBUFLEN,
MIDAS_OPTION_MIXBUFBLOCKS
};
enum MIDASmodes
{
MIDAS_MODE_NONE = 0,
MIDAS_MODE_MONO = 1,
MIDAS_MODE_STEREO = 2,
MIDAS_MODE_8BIT = 4,
MIDAS_MODE_16BIT = 8,
MIDAS_MODE_8BIT_MONO = MIDAS_MODE_8BIT | MIDAS_MODE_MONO,
MIDAS_MODE_8BIT_STEREO = MIDAS_MODE_8BIT | MIDAS_MODE_STEREO,
MIDAS_MODE_16BIT_MONO = MIDAS_MODE_16BIT | MIDAS_MODE_MONO,
MIDAS_MODE_16BIT_STEREO = MIDAS_MODE_16BIT | MIDAS_MODE_STEREO
};
enum MIDASsampleTypes
{
MIDAS_SAMPLE_NONE = 0,
MIDAS_SAMPLE_8BIT_MONO = 1,
MIDAS_SAMPLE_16BIT_MONO = 2,
MIDAS_SAMPLE_8BIT_STEREO = 3,
MIDAS_SAMPLE_16BIT_STEREO = 4
};
enum MIDASloop
{
MIDAS_LOOP_NO = 0,
MIDAS_LOOP_YES
};
enum MIDASpanning
{
MIDAS_PAN_LEFT = -64,
MIDAS_PAN_MIDDLE = 0,
MIDAS_PAN_RIGHT = 64,
MIDAS_PAN_SURROUND = 0x80
};
enum MIDASchannels
{
MIDAS_CHANNEL_AUTO = 0xFFFF
};
typedef struct
{
char songName[32];
unsigned songLength;
unsigned numPatterns;
unsigned numInstruments;
unsigned numChannels;
} MIDASmoduleInfo;
typedef struct
{
char instName[32];
} MIDASinstrumentInfo;
typedef struct
{
unsigned position;
unsigned pattern;
unsigned row;
int syncInfo;
} MIDASplayStatus;
typedef void* MIDASmodule;
typedef DWORD MIDASsample;
typedef DWORD MIDASsamplePlayHandle;
typedef void* MIDASstreamHandle;
#ifdef __cplusplus
extern "C" {
#endif
_FUNC(int) MIDASgetLastError(void);
_FUNC(char*) MIDASgetErrorMessage(int errorCode);
_FUNC(BOOL) MIDASstartup(void);
_FUNC(BOOL) MIDASinit(void);
_FUNC(BOOL) MIDASsetOption(int option, int value);
_FUNC(BOOL) MIDASclose(void);
_FUNC(BOOL) MIDASopenChannels(int numChannels);
_FUNC(BOOL) MIDAScloseChannels(void);
_FUNC(BOOL) MIDASstartBackgroundPlay(DWORD pollRate);
_FUNC(BOOL) MIDASstopBackgroundPlay(void);
_FUNC(BOOL) MIDASpoll(void);
_FUNC(char*) MIDASgetVersionString(void);
_FUNC(MIDASmodule) MIDASloadModule(char *fileName);
_FUNC(BOOL) MIDASplayModule(MIDASmodule module, int numEffectChannels); // ok
_FUNC(BOOL) MIDASstopModule(MIDASmodule module);
_FUNC(BOOL) MIDASfreeModule(MIDASmodule module);
_FUNC(BOOL) MIDASgetPlayStatus(MIDASplayStatus *status);
_FUNC(BOOL) MIDASsetPosition(int newPosition);
_FUNC(BOOL) MIDASsetMusicVolume(unsigned volume);
_FUNC(BOOL) MIDASgetModuleInfo(MIDASmodule module, MIDASmoduleInfo *info);
_FUNC(BOOL) MIDASgetInstrumentInfo(MIDASmodule module, int instNum,
MIDASinstrumentInfo *info);
_FUNC(MIDASsample) MIDASloadRawSample(char *fileName, int sampleType,
int loopSample);
_FUNC(BOOL) MIDASfreeSample(MIDASsample sample);
_FUNC(BOOL) MIDASsetAutoEffectChannels(unsigned firstChannel,
unsigned numChannels);
_FUNC(MIDASsamplePlayHandle) MIDASplaySample(MIDASsample sample,
unsigned channel, int priority, unsigned rate,
unsigned volume, int panning);
_FUNC(BOOL) MIDASstopSample(MIDASsamplePlayHandle sample);
_FUNC(BOOL) MIDASsetSampleRate(MIDASsamplePlayHandle sample,
unsigned rate);
_FUNC(BOOL) MIDASsetSampleVolume(MIDASsamplePlayHandle sample,
unsigned volume);
_FUNC(BOOL) MIDASsetSamplePanning(MIDASsamplePlayHandle sample,
int panning);
_FUNC(BOOL) MIDASsetSamplePriority(MIDASsamplePlayHandle sample,
int priority);
_FUNC(MIDASstreamHandle) MIDASplayStreamFile(unsigned channel, char *fileName,
unsigned sampleType, unsigned sampleRate,
unsigned bufferLength, int loopStream);
_FUNC(BOOL) MIDASstopStream(MIDASstreamHandle stream);
_FUNC(MIDASstreamHandle) MIDASplayStreamPolling(unsigned channel,
unsigned sampleType, unsigned sampleRate,
unsigned bufferLength);
_FUNC(unsigned) MIDASfeedStreamData(MIDASstreamHandle stream,
unsigned char *data, unsigned numBytes, BOOL feedAll);
_FUNC(BOOL) MIDASsetStreamRate(MIDASstreamHandle stream, unsigned rate);
_FUNC(BOOL) MIDASsetStreamVolume(MIDASstreamHandle stream,
unsigned volume);
_FUNC(BOOL) MIDASsetStreamPanning(MIDASstreamHandle stream, int panning);
#ifdef __cplusplus
}
#endif
#endif
/*
* $Log: midasdll.h,v $
* Revision 1.4 1997/01/16 18:41:59 pekangas
* Changed copyright messages to Housemarque
*
* Revision 1.3 1997/01/16 18:26:27 pekangas
* Added numerous new functions
*
* Revision 1.2 1996/09/28 08:12:40 jpaana
* Fixed for Linux
*
* Revision 1.1 1996/09/25 18:38:12 pekangas
* Initial revision
*
*/