1 /*
2 BASS 2.4 C/C++ header file
3 Copyright (c) 1999-2021 Un4seen Developments Ltd.
4
5 See the BASS.CHM file for more detailed documentation
6 */
7
8 #ifndef BASS_H
9 #define BASS_H
10
11 #ifdef _WIN32
12 #ifdef WINAPI_FAMILY
13 #include <winapifamily.h>
14 #endif
15 #include <wtypes.h>
16 typedef unsigned __int64 QWORD;
17 #else
18 #include <stdint.h>
19 #define WINAPI
20 #define CALLBACK
21 typedef uint8_t BYTE;
22 typedef uint16_t WORD;
23 typedef uint32_t DWORD;
24 typedef uint64_t QWORD;
25 #ifdef __OBJC__
26 typedef int BOOL32;
27 #define BOOL BOOL32 // override objc's BOOL
28 #else
29 typedef int BOOL;
30 #endif
31 #ifndef TRUE
32 #define TRUE 1
33 #define FALSE 0
34 #endif
35 #define LOBYTE(a) (BYTE)(a)
36 #define HIBYTE(a) (BYTE)((a)>>8)
37 #define LOWORD(a) (WORD)(a)
38 #define HIWORD(a) (WORD)((a)>>16)
39 #define MAKEWORD(a,b) (WORD)(((a)&0xff)|((b)<<8))
40 #define MAKELONG(a,b) (DWORD)(((a)&0xffff)|((b)<<16))
41 #endif
42
43 #ifdef __cplusplus
44 extern "C" {
45 #endif
46
47 #define BASSVERSION 0x204 // API version
48 #define BASSVERSIONTEXT "2.4"
49
50 #ifndef BASSDEF
51 #define BASSDEF(f) WINAPI f
52 #else
53 #define NOBASSOVERLOADS
54 #endif
55
56 typedef DWORD HMUSIC; // MOD music handle
57 typedef DWORD HSAMPLE; // sample handle
58 typedef DWORD HCHANNEL; // sample playback handle
59 typedef DWORD HSTREAM; // sample stream handle
60 typedef DWORD HRECORD; // recording handle
61 typedef DWORD HSYNC; // synchronizer handle
62 typedef DWORD HDSP; // DSP handle
63 typedef DWORD HFX; // effect handle
64 typedef DWORD HPLUGIN; // plugin handle
65
66 // Error codes returned by BASS_ErrorGetCode
67 #define BASS_OK 0 // all is OK
68 #define BASS_ERROR_MEM 1 // memory error
69 #define BASS_ERROR_FILEOPEN 2 // can't open the file
70 #define BASS_ERROR_DRIVER 3 // can't find a free/valid driver
71 #define BASS_ERROR_BUFLOST 4 // the sample buffer was lost
72 #define BASS_ERROR_HANDLE 5 // invalid handle
73 #define BASS_ERROR_FORMAT 6 // unsupported sample format
74 #define BASS_ERROR_POSITION 7 // invalid position
75 #define BASS_ERROR_INIT 8 // BASS_Init has not been successfully called
76 #define BASS_ERROR_START 9 // BASS_Start has not been successfully called
77 #define BASS_ERROR_SSL 10 // SSL/HTTPS support isn't available
78 #define BASS_ERROR_REINIT 11 // device needs to be reinitialized
79 #define BASS_ERROR_ALREADY 14 // already initialized/paused/whatever
80 #define BASS_ERROR_NOTAUDIO 17 // file does not contain audio
81 #define BASS_ERROR_NOCHAN 18 // can't get a free channel
82 #define BASS_ERROR_ILLTYPE 19 // an illegal type was specified
83 #define BASS_ERROR_ILLPARAM 20 // an illegal parameter was specified
84 #define BASS_ERROR_NO3D 21 // no 3D support
85 #define BASS_ERROR_NOEAX 22 // no EAX support
86 #define BASS_ERROR_DEVICE 23 // illegal device number
87 #define BASS_ERROR_NOPLAY 24 // not playing
88 #define BASS_ERROR_FREQ 25 // illegal sample rate
89 #define BASS_ERROR_NOTFILE 27 // the stream is not a file stream
90 #define BASS_ERROR_NOHW 29 // no hardware voices available
91 #define BASS_ERROR_EMPTY 31 // the MOD music has no sequence data
92 #define BASS_ERROR_NONET 32 // no internet connection could be opened
93 #define BASS_ERROR_CREATE 33 // couldn't create the file
94 #define BASS_ERROR_NOFX 34 // effects are not available
95 #define BASS_ERROR_NOTAVAIL 37 // requested data/action is not available
96 #define BASS_ERROR_DECODE 38 // the channel is/isn't a "decoding channel"
97 #define BASS_ERROR_DX 39 // a sufficient DirectX version is not installed
98 #define BASS_ERROR_TIMEOUT 40 // connection timedout
99 #define BASS_ERROR_FILEFORM 41 // unsupported file format
100 #define BASS_ERROR_SPEAKER 42 // unavailable speaker
101 #define BASS_ERROR_VERSION 43 // invalid BASS version (used by add-ons)
102 #define BASS_ERROR_CODEC 44 // codec is not available/supported
103 #define BASS_ERROR_ENDED 45 // the channel/file has ended
104 #define BASS_ERROR_BUSY 46 // the device is busy
105 #define BASS_ERROR_UNSTREAMABLE 47 // unstreamable file
106 #define BASS_ERROR_PROTOCOL 48 // unsupported protocol
107 #define BASS_ERROR_UNKNOWN -1 // some other mystery problem
108
109 // BASS_SetConfig options
110 #define BASS_CONFIG_BUFFER 0
111 #define BASS_CONFIG_UPDATEPERIOD 1
112 #define BASS_CONFIG_GVOL_SAMPLE 4
113 #define BASS_CONFIG_GVOL_STREAM 5
114 #define BASS_CONFIG_GVOL_MUSIC 6
115 #define BASS_CONFIG_CURVE_VOL 7
116 #define BASS_CONFIG_CURVE_PAN 8
117 #define BASS_CONFIG_FLOATDSP 9
118 #define BASS_CONFIG_3DALGORITHM 10
119 #define BASS_CONFIG_NET_TIMEOUT 11
120 #define BASS_CONFIG_NET_BUFFER 12
121 #define BASS_CONFIG_PAUSE_NOPLAY 13
122 #define BASS_CONFIG_NET_PREBUF 15
123 #define BASS_CONFIG_NET_PASSIVE 18
124 #define BASS_CONFIG_REC_BUFFER 19
125 #define BASS_CONFIG_NET_PLAYLIST 21
126 #define BASS_CONFIG_MUSIC_VIRTUAL 22
127 #define BASS_CONFIG_VERIFY 23
128 #define BASS_CONFIG_UPDATETHREADS 24
129 #define BASS_CONFIG_DEV_BUFFER 27
130 #define BASS_CONFIG_REC_LOOPBACK 28
131 #define BASS_CONFIG_VISTA_TRUEPOS 30
132 #define BASS_CONFIG_IOS_SESSION 34
133 #define BASS_CONFIG_IOS_MIXAUDIO 34
134 #define BASS_CONFIG_DEV_DEFAULT 36
135 #define BASS_CONFIG_NET_READTIMEOUT 37
136 #define BASS_CONFIG_VISTA_SPEAKERS 38
137 #define BASS_CONFIG_IOS_SPEAKER 39
138 #define BASS_CONFIG_MF_DISABLE 40
139 #define BASS_CONFIG_HANDLES 41
140 #define BASS_CONFIG_UNICODE 42
141 #define BASS_CONFIG_SRC 43
142 #define BASS_CONFIG_SRC_SAMPLE 44
143 #define BASS_CONFIG_ASYNCFILE_BUFFER 45
144 #define BASS_CONFIG_OGG_PRESCAN 47
145 #define BASS_CONFIG_MF_VIDEO 48
146 #define BASS_CONFIG_AIRPLAY 49
147 #define BASS_CONFIG_DEV_NONSTOP 50
148 #define BASS_CONFIG_IOS_NOCATEGORY 51
149 #define BASS_CONFIG_VERIFY_NET 52
150 #define BASS_CONFIG_DEV_PERIOD 53
151 #define BASS_CONFIG_FLOAT 54
152 #define BASS_CONFIG_NET_SEEK 56
153 #define BASS_CONFIG_AM_DISABLE 58
154 #define BASS_CONFIG_NET_PLAYLIST_DEPTH 59
155 #define BASS_CONFIG_NET_PREBUF_WAIT 60
156 #define BASS_CONFIG_ANDROID_SESSIONID 62
157 #define BASS_CONFIG_WASAPI_PERSIST 65
158 #define BASS_CONFIG_REC_WASAPI 66
159 #define BASS_CONFIG_ANDROID_AAUDIO 67
160 #define BASS_CONFIG_SAMPLE_ONEHANDLE 69
161 #define BASS_CONFIG_DEV_TIMEOUT 70
162 #define BASS_CONFIG_NET_META 71
163 #define BASS_CONFIG_NET_RESTRATE 72
164
165 // BASS_SetConfigPtr options
166 #define BASS_CONFIG_NET_AGENT 16
167 #define BASS_CONFIG_NET_PROXY 17
168 #define BASS_CONFIG_IOS_NOTIFY 46
169 #define BASS_CONFIG_LIBSSL 64
170
171 #define BASS_CONFIG_THREAD 0x40000000 // flag: thread-specific setting
172
173 // BASS_CONFIG_IOS_SESSION flags
174 #define BASS_IOS_SESSION_MIX 1
175 #define BASS_IOS_SESSION_DUCK 2
176 #define BASS_IOS_SESSION_AMBIENT 4
177 #define BASS_IOS_SESSION_SPEAKER 8
178 #define BASS_IOS_SESSION_DISABLE 16
179
180 // BASS_Init flags
181 #define BASS_DEVICE_8BITS 1 // unused
182 #define BASS_DEVICE_MONO 2 // mono
183 #define BASS_DEVICE_3D 4 // unused
184 #define BASS_DEVICE_16BITS 8 // limit output to 16-bit
185 #define BASS_DEVICE_REINIT 128 // reinitialize
186 #define BASS_DEVICE_LATENCY 0x100 // unused
187 #define BASS_DEVICE_CPSPEAKERS 0x400 // unused
188 #define BASS_DEVICE_SPEAKERS 0x800 // force enabling of speaker assignment
189 #define BASS_DEVICE_NOSPEAKER 0x1000 // ignore speaker arrangement
190 #define BASS_DEVICE_DMIX 0x2000 // use ALSA "dmix" plugin
191 #define BASS_DEVICE_FREQ 0x4000 // set device sample rate
192 #define BASS_DEVICE_STEREO 0x8000 // limit output to stereo
193 #define BASS_DEVICE_HOG 0x10000 // hog/exclusive mode
194 #define BASS_DEVICE_AUDIOTRACK 0x20000 // use AudioTrack output
195 #define BASS_DEVICE_DSOUND 0x40000 // use DirectSound output
196 #define BASS_DEVICE_SOFTWARE 0x80000 // disable hardware/fastpath output
197
198 // DirectSound interfaces (for use with BASS_GetDSoundObject)
199 #define BASS_OBJECT_DS 1 // IDirectSound
200 #define BASS_OBJECT_DS3DL 2 // IDirectSound3DListener
201
202 // Device info structure
203 typedef struct {
204 #if defined(_WIN32_WCE) || (defined(WINAPI_FAMILY) && WINAPI_FAMILY != WINAPI_FAMILY_DESKTOP_APP)
205 const wchar_t *name; // description
206 const wchar_t *driver; // driver
207 #else
208 const char *name; // description
209 const char *driver; // driver
210 #endif
211 DWORD flags;
212 } BASS_DEVICEINFO;
213
214 // BASS_DEVICEINFO flags
215 #define BASS_DEVICE_ENABLED 1
216 #define BASS_DEVICE_DEFAULT 2
217 #define BASS_DEVICE_INIT 4
218 #define BASS_DEVICE_LOOPBACK 8
219 #define BASS_DEVICE_DEFAULTCOM 128
220
221 #define BASS_DEVICE_TYPE_MASK 0xff000000
222 #define BASS_DEVICE_TYPE_NETWORK 0x01000000
223 #define BASS_DEVICE_TYPE_SPEAKERS 0x02000000
224 #define BASS_DEVICE_TYPE_LINE 0x03000000
225 #define BASS_DEVICE_TYPE_HEADPHONES 0x04000000
226 #define BASS_DEVICE_TYPE_MICROPHONE 0x05000000
227 #define BASS_DEVICE_TYPE_HEADSET 0x06000000
228 #define BASS_DEVICE_TYPE_HANDSET 0x07000000
229 #define BASS_DEVICE_TYPE_DIGITAL 0x08000000
230 #define BASS_DEVICE_TYPE_SPDIF 0x09000000
231 #define BASS_DEVICE_TYPE_HDMI 0x0a000000
232 #define BASS_DEVICE_TYPE_DISPLAYPORT 0x40000000
233
234 // BASS_GetDeviceInfo flags
235 #define BASS_DEVICES_AIRPLAY 0x1000000
236
237 typedef struct {
238 DWORD flags; // device capabilities (DSCAPS_xxx flags)
239 DWORD hwsize; // unused
240 DWORD hwfree; // unused
241 DWORD freesam; // unused
242 DWORD free3d; // unused
243 DWORD minrate; // unused
244 DWORD maxrate; // unused
245 BOOL eax; // unused
246 DWORD minbuf; // recommended minimum buffer length in ms
247 DWORD dsver; // DirectSound version
248 DWORD latency; // average delay (in ms) before start of playback
249 DWORD initflags; // BASS_Init "flags" parameter
250 DWORD speakers; // number of speakers available
251 DWORD freq; // current output rate
252 } BASS_INFO;
253
254 // BASS_INFO flags (from DSOUND.H)
255 #define DSCAPS_EMULDRIVER 0x00000020 // device does not have hardware DirectSound support
256 #define DSCAPS_CERTIFIED 0x00000040 // device driver has been certified by Microsoft
257
258 #define DSCAPS_HARDWARE 0x80000000 // hardware mixed
259
260 // Recording device info structure
261 typedef struct {
262 DWORD flags; // device capabilities (DSCCAPS_xxx flags)
263 DWORD formats; // supported standard formats (WAVE_FORMAT_xxx flags)
264 DWORD inputs; // number of inputs
265 BOOL singlein; // TRUE = only 1 input can be set at a time
266 DWORD freq; // current input rate
267 } BASS_RECORDINFO;
268
269 // BASS_RECORDINFO flags (from DSOUND.H)
270 #define DSCCAPS_EMULDRIVER DSCAPS_EMULDRIVER // device does not have hardware DirectSound recording support
271 #define DSCCAPS_CERTIFIED DSCAPS_CERTIFIED // device driver has been certified by Microsoft
272
273 // defines for formats field of BASS_RECORDINFO (from MMSYSTEM.H)
274 #ifndef WAVE_FORMAT_1M08
275 #define WAVE_FORMAT_1M08 0x00000001 /* 11.025 kHz, Mono, 8-bit */
276 #define WAVE_FORMAT_1S08 0x00000002 /* 11.025 kHz, Stereo, 8-bit */
277 #define WAVE_FORMAT_1M16 0x00000004 /* 11.025 kHz, Mono, 16-bit */
278 #define WAVE_FORMAT_1S16 0x00000008 /* 11.025 kHz, Stereo, 16-bit */
279 #define WAVE_FORMAT_2M08 0x00000010 /* 22.05 kHz, Mono, 8-bit */
280 #define WAVE_FORMAT_2S08 0x00000020 /* 22.05 kHz, Stereo, 8-bit */
281 #define WAVE_FORMAT_2M16 0x00000040 /* 22.05 kHz, Mono, 16-bit */
282 #define WAVE_FORMAT_2S16 0x00000080 /* 22.05 kHz, Stereo, 16-bit */
283 #define WAVE_FORMAT_4M08 0x00000100 /* 44.1 kHz, Mono, 8-bit */
284 #define WAVE_FORMAT_4S08 0x00000200 /* 44.1 kHz, Stereo, 8-bit */
285 #define WAVE_FORMAT_4M16 0x00000400 /* 44.1 kHz, Mono, 16-bit */
286 #define WAVE_FORMAT_4S16 0x00000800 /* 44.1 kHz, Stereo, 16-bit */
287 #endif
288
289 // Sample info structure
290 typedef struct {
291 DWORD freq; // default playback rate
292 float volume; // default volume (0-1)
293 float pan; // default pan (-1=left, 0=middle, 1=right)
294 DWORD flags; // BASS_SAMPLE_xxx flags
295 DWORD length; // length (in bytes)
296 DWORD max; // maximum simultaneous playbacks
297 DWORD origres; // original resolution
298 DWORD chans; // number of channels
299 DWORD mingap; // minimum gap (ms) between creating channels
300 DWORD mode3d; // BASS_3DMODE_xxx mode
301 float mindist; // minimum distance
302 float maxdist; // maximum distance
303 DWORD iangle; // angle of inside projection cone
304 DWORD oangle; // angle of outside projection cone
305 float outvol; // delta-volume outside the projection cone
306 DWORD vam; // unused
307 DWORD priority; // unused
308 } BASS_SAMPLE;
309
310 #define BASS_SAMPLE_8BITS 1 // 8 bit
311 #define BASS_SAMPLE_FLOAT 256 // 32 bit floating-point
312 #define BASS_SAMPLE_MONO 2 // mono
313 #define BASS_SAMPLE_LOOP 4 // looped
314 #define BASS_SAMPLE_3D 8 // 3D functionality
315 #define BASS_SAMPLE_SOFTWARE 16 // unused
316 #define BASS_SAMPLE_MUTEMAX 32 // mute at max distance (3D only)
317 #define BASS_SAMPLE_VAM 64 // unused
318 #define BASS_SAMPLE_FX 128 // unused
319 #define BASS_SAMPLE_OVER_VOL 0x10000 // override lowest volume
320 #define BASS_SAMPLE_OVER_POS 0x20000 // override longest playing
321 #define BASS_SAMPLE_OVER_DIST 0x30000 // override furthest from listener (3D only)
322
323 #define BASS_STREAM_PRESCAN 0x20000 // scan file for accurate seeking and length
324 #define BASS_STREAM_AUTOFREE 0x40000 // automatically free the stream when it stops/ends
325 #define BASS_STREAM_RESTRATE 0x80000 // restrict the download rate of internet file stream
326 #define BASS_STREAM_BLOCK 0x100000 // download internet file stream in small blocks
327 #define BASS_STREAM_DECODE 0x200000 // don't play the stream, only decode
328 #define BASS_STREAM_STATUS 0x800000 // give server status info (HTTP/ICY tags) in DOWNLOADPROC
329
330 #define BASS_MP3_IGNOREDELAY 0x200 // ignore LAME/Xing/VBRI/iTunes delay & padding info
331 #define BASS_MP3_SETPOS BASS_STREAM_PRESCAN
332
333 #define BASS_MUSIC_FLOAT BASS_SAMPLE_FLOAT
334 #define BASS_MUSIC_MONO BASS_SAMPLE_MONO
335 #define BASS_MUSIC_LOOP BASS_SAMPLE_LOOP
336 #define BASS_MUSIC_3D BASS_SAMPLE_3D
337 #define BASS_MUSIC_FX BASS_SAMPLE_FX
338 #define BASS_MUSIC_AUTOFREE BASS_STREAM_AUTOFREE
339 #define BASS_MUSIC_DECODE BASS_STREAM_DECODE
340 #define BASS_MUSIC_PRESCAN BASS_STREAM_PRESCAN // calculate playback length
341 #define BASS_MUSIC_CALCLEN BASS_MUSIC_PRESCAN
342 #define BASS_MUSIC_RAMP 0x200 // normal ramping
343 #define BASS_MUSIC_RAMPS 0x400 // sensitive ramping
344 #define BASS_MUSIC_SURROUND 0x800 // surround sound
345 #define BASS_MUSIC_SURROUND2 0x1000 // surround sound (mode 2)
346 #define BASS_MUSIC_FT2PAN 0x2000 // apply FastTracker 2 panning to XM files
347 #define BASS_MUSIC_FT2MOD 0x2000 // play .MOD as FastTracker 2 does
348 #define BASS_MUSIC_PT1MOD 0x4000 // play .MOD as ProTracker 1 does
349 #define BASS_MUSIC_NONINTER 0x10000 // non-interpolated sample mixing
350 #define BASS_MUSIC_SINCINTER 0x800000 // sinc interpolated sample mixing
351 #define BASS_MUSIC_POSRESET 0x8000 // stop all notes when moving position
352 #define BASS_MUSIC_POSRESETEX 0x400000 // stop all notes and reset bmp/etc when moving position
353 #define BASS_MUSIC_STOPBACK 0x80000 // stop the music on a backwards jump effect
354 #define BASS_MUSIC_NOSAMPLE 0x100000 // don't load the samples
355
356 // Speaker assignment flags
357 #define BASS_SPEAKER_FRONT 0x1000000 // front speakers
358 #define BASS_SPEAKER_REAR 0x2000000 // rear/side speakers
359 #define BASS_SPEAKER_CENLFE 0x3000000 // center & LFE speakers (5.1)
360 #define BASS_SPEAKER_REAR2 0x4000000 // rear center speakers (7.1)
361 #define BASS_SPEAKER_N(n) ((n)<<24) // n'th pair of speakers (max 15)
362 #define BASS_SPEAKER_LEFT 0x10000000 // modifier: left
363 #define BASS_SPEAKER_RIGHT 0x20000000 // modifier: right
364 #define BASS_SPEAKER_FRONTLEFT BASS_SPEAKER_FRONT|BASS_SPEAKER_LEFT
365 #define BASS_SPEAKER_FRONTRIGHT BASS_SPEAKER_FRONT|BASS_SPEAKER_RIGHT
366 #define BASS_SPEAKER_REARLEFT BASS_SPEAKER_REAR|BASS_SPEAKER_LEFT
367 #define BASS_SPEAKER_REARRIGHT BASS_SPEAKER_REAR|BASS_SPEAKER_RIGHT
368 #define BASS_SPEAKER_CENTER BASS_SPEAKER_CENLFE|BASS_SPEAKER_LEFT
369 #define BASS_SPEAKER_LFE BASS_SPEAKER_CENLFE|BASS_SPEAKER_RIGHT
370 #define BASS_SPEAKER_REAR2LEFT BASS_SPEAKER_REAR2|BASS_SPEAKER_LEFT
371 #define BASS_SPEAKER_REAR2RIGHT BASS_SPEAKER_REAR2|BASS_SPEAKER_RIGHT
372
373 #define BASS_ASYNCFILE 0x40000000 // read file asynchronously
374 #define BASS_UNICODE 0x80000000 // UTF-16
375
376 #define BASS_RECORD_PAUSE 0x8000 // start recording paused
377 #define BASS_RECORD_ECHOCANCEL 0x2000
378 #define BASS_RECORD_AGC 0x4000
379
380 // DX7 voice allocation & management flags
381 #define BASS_VAM_HARDWARE 1
382 #define BASS_VAM_SOFTWARE 2
383 #define BASS_VAM_TERM_TIME 4
384 #define BASS_VAM_TERM_DIST 8
385 #define BASS_VAM_TERM_PRIO 16
386
387 // Channel info structure
388 typedef struct {
389 DWORD freq; // default playback rate
390 DWORD chans; // channels
391 DWORD flags;
392 DWORD ctype; // type of channel
393 DWORD origres; // original resolution
394 HPLUGIN plugin;
395 HSAMPLE sample;
396 const char *filename;
397 } BASS_CHANNELINFO;
398
399 #define BASS_ORIGRES_FLOAT 0x10000
400
401 // BASS_CHANNELINFO types
402 #define BASS_CTYPE_SAMPLE 1
403 #define BASS_CTYPE_RECORD 2
404 #define BASS_CTYPE_STREAM 0x10000
405 #define BASS_CTYPE_STREAM_VORBIS 0x10002
406 #define BASS_CTYPE_STREAM_OGG 0x10002
407 #define BASS_CTYPE_STREAM_MP1 0x10003
408 #define BASS_CTYPE_STREAM_MP2 0x10004
409 #define BASS_CTYPE_STREAM_MP3 0x10005
410 #define BASS_CTYPE_STREAM_AIFF 0x10006
411 #define BASS_CTYPE_STREAM_CA 0x10007
412 #define BASS_CTYPE_STREAM_MF 0x10008
413 #define BASS_CTYPE_STREAM_AM 0x10009
414 #define BASS_CTYPE_STREAM_SAMPLE 0x1000a
415 #define BASS_CTYPE_STREAM_DUMMY 0x18000
416 #define BASS_CTYPE_STREAM_DEVICE 0x18001
417 #define BASS_CTYPE_STREAM_WAV 0x40000 // WAVE flag (LOWORD=codec)
418 #define BASS_CTYPE_STREAM_WAV_PCM 0x50001
419 #define BASS_CTYPE_STREAM_WAV_FLOAT 0x50003
420 #define BASS_CTYPE_MUSIC_MOD 0x20000
421 #define BASS_CTYPE_MUSIC_MTM 0x20001
422 #define BASS_CTYPE_MUSIC_S3M 0x20002
423 #define BASS_CTYPE_MUSIC_XM 0x20003
424 #define BASS_CTYPE_MUSIC_IT 0x20004
425 #define BASS_CTYPE_MUSIC_MO3 0x00100 // MO3 flag
426
427 typedef struct {
428 DWORD ctype; // channel type
429 #if defined(_WIN32_WCE) || (defined(WINAPI_FAMILY) && WINAPI_FAMILY != WINAPI_FAMILY_DESKTOP_APP)
430 const wchar_t *name; // format description
431 const wchar_t *exts; // file extension filter (*.ext1;*.ext2;etc...)
432 #else
433 const char *name; // format description
434 const char *exts; // file extension filter (*.ext1;*.ext2;etc...)
435 #endif
436 } BASS_PLUGINFORM;
437
438 typedef struct {
439 DWORD version; // version (same form as BASS_GetVersion)
440 DWORD formatc; // number of formats
441 const BASS_PLUGINFORM *formats; // the array of formats
442 } BASS_PLUGININFO;
443
444 // 3D vector (for 3D positions/velocities/orientations)
445 typedef struct BASS_3DVECTOR {
446 #ifdef __cplusplus
BASS_3DVECTORBASS_3DVECTOR447 BASS_3DVECTOR() {};
BASS_3DVECTORBASS_3DVECTOR448 BASS_3DVECTOR(float _x, float _y, float _z) : x(_x), y(_y), z(_z) {};
449 #endif
450 float x{}; // +=right, -=left
451 float y{}; // +=up, -=down
452 float z{}; // +=front, -=behind
453 } BASS_3DVECTOR;
454
455 // 3D channel modes
456 #define BASS_3DMODE_NORMAL 0 // normal 3D processing
457 #define BASS_3DMODE_RELATIVE 1 // position is relative to the listener
458 #define BASS_3DMODE_OFF 2 // no 3D processing
459
460 // software 3D mixing algorithms (used with BASS_CONFIG_3DALGORITHM)
461 #define BASS_3DALG_DEFAULT 0
462 #define BASS_3DALG_OFF 1
463 #define BASS_3DALG_FULL 2
464 #define BASS_3DALG_LIGHT 3
465
466 // BASS_SampleGetChannel flags
467 #define BASS_SAMCHAN_NEW 1 // get a new playback channel
468 #define BASS_SAMCHAN_STREAM 2 // create a stream
469
470 typedef DWORD (CALLBACK STREAMPROC)(HSTREAM handle, void *buffer, DWORD length, void *user);
471 /* User stream callback function.
472 handle : The stream that needs writing
473 buffer : Buffer to write the samples in
474 length : Number of bytes to write
475 user : The 'user' parameter value given when calling BASS_StreamCreate
476 RETURN : Number of bytes written. Set the BASS_STREAMPROC_END flag to end the stream. */
477
478 #define BASS_STREAMPROC_END 0x80000000 // end of user stream flag
479
480 // Special STREAMPROCs
481 #define STREAMPROC_DUMMY (STREAMPROC*)0 // "dummy" stream
482 #define STREAMPROC_PUSH (STREAMPROC*)-1 // push stream
483 #define STREAMPROC_DEVICE (STREAMPROC*)-2 // device mix stream
484 #define STREAMPROC_DEVICE_3D (STREAMPROC*)-3 // device 3D mix stream
485
486 // BASS_StreamCreateFileUser file systems
487 #define STREAMFILE_NOBUFFER 0
488 #define STREAMFILE_BUFFER 1
489 #define STREAMFILE_BUFFERPUSH 2
490
491 // User file stream callback functions
492 typedef void (CALLBACK FILECLOSEPROC)(void *user);
493 typedef QWORD (CALLBACK FILELENPROC)(void *user);
494 typedef DWORD (CALLBACK FILEREADPROC)(void *buffer, DWORD length, void *user);
495 typedef BOOL (CALLBACK FILESEEKPROC)(QWORD offset, void *user);
496
497 typedef struct {
498 FILECLOSEPROC *close;
499 FILELENPROC *length;
500 FILEREADPROC *read;
501 FILESEEKPROC *seek;
502 } BASS_FILEPROCS;
503
504 // BASS_StreamPutFileData options
505 #define BASS_FILEDATA_END 0 // end & close the file
506
507 // BASS_StreamGetFilePosition modes
508 #define BASS_FILEPOS_CURRENT 0
509 #define BASS_FILEPOS_DECODE BASS_FILEPOS_CURRENT
510 #define BASS_FILEPOS_DOWNLOAD 1
511 #define BASS_FILEPOS_END 2
512 #define BASS_FILEPOS_START 3
513 #define BASS_FILEPOS_CONNECTED 4
514 #define BASS_FILEPOS_BUFFER 5
515 #define BASS_FILEPOS_SOCKET 6
516 #define BASS_FILEPOS_ASYNCBUF 7
517 #define BASS_FILEPOS_SIZE 8
518 #define BASS_FILEPOS_BUFFERING 9
519 #define BASS_FILEPOS_AVAILABLE 10
520
521 typedef void (CALLBACK DOWNLOADPROC)(const void *buffer, DWORD length, void *user);
522 /* Internet stream download callback function.
523 buffer : Buffer containing the downloaded data... NULL=end of download
524 length : Number of bytes in the buffer
525 user : The 'user' parameter value given when calling BASS_StreamCreateURL */
526
527 // BASS_ChannelSetSync types
528 #define BASS_SYNC_POS 0
529 #define BASS_SYNC_END 2
530 #define BASS_SYNC_META 4
531 #define BASS_SYNC_SLIDE 5
532 #define BASS_SYNC_STALL 6
533 #define BASS_SYNC_DOWNLOAD 7
534 #define BASS_SYNC_FREE 8
535 #define BASS_SYNC_SETPOS 11
536 #define BASS_SYNC_MUSICPOS 10
537 #define BASS_SYNC_MUSICINST 1
538 #define BASS_SYNC_MUSICFX 3
539 #define BASS_SYNC_OGG_CHANGE 12
540 #define BASS_SYNC_DEV_FAIL 14
541 #define BASS_SYNC_DEV_FORMAT 15
542 #define BASS_SYNC_THREAD 0x20000000 // flag: call sync in other thread
543 #define BASS_SYNC_MIXTIME 0x40000000 // flag: sync at mixtime, else at playtime
544 #define BASS_SYNC_ONETIME 0x80000000 // flag: sync only once, else continuously
545
546 typedef void (CALLBACK SYNCPROC)(HSYNC handle, DWORD channel, DWORD data, void *user);
547 /* Sync callback function.
548 handle : The sync that has occured
549 channel: Channel that the sync occured in
550 data : Additional data associated with the sync's occurance
551 user : The 'user' parameter given when calling BASS_ChannelSetSync */
552
553 typedef void (CALLBACK DSPPROC)(HDSP handle, DWORD channel, void *buffer, DWORD length, void *user);
554 /* DSP callback function.
555 handle : The DSP handle
556 channel: Channel that the DSP is being applied to
557 buffer : Buffer to apply the DSP to
558 length : Number of bytes in the buffer
559 user : The 'user' parameter given when calling BASS_ChannelSetDSP */
560
561 typedef BOOL (CALLBACK RECORDPROC)(HRECORD handle, const void *buffer, DWORD length, void *user);
562 /* Recording callback function.
563 handle : The recording handle
564 buffer : Buffer containing the recorded sample data
565 length : Number of bytes
566 user : The 'user' parameter value given when calling BASS_RecordStart
567 RETURN : TRUE = continue recording, FALSE = stop */
568
569 // BASS_ChannelIsActive return values
570 #define BASS_ACTIVE_STOPPED 0
571 #define BASS_ACTIVE_PLAYING 1
572 #define BASS_ACTIVE_STALLED 2
573 #define BASS_ACTIVE_PAUSED 3
574 #define BASS_ACTIVE_PAUSED_DEVICE 4
575
576 // Channel attributes
577 #define BASS_ATTRIB_FREQ 1
578 #define BASS_ATTRIB_VOL 2
579 #define BASS_ATTRIB_PAN 3
580 #define BASS_ATTRIB_EAXMIX 4
581 #define BASS_ATTRIB_NOBUFFER 5
582 #define BASS_ATTRIB_VBR 6
583 #define BASS_ATTRIB_CPU 7
584 #define BASS_ATTRIB_SRC 8
585 #define BASS_ATTRIB_NET_RESUME 9
586 #define BASS_ATTRIB_SCANINFO 10
587 #define BASS_ATTRIB_NORAMP 11
588 #define BASS_ATTRIB_BITRATE 12
589 #define BASS_ATTRIB_BUFFER 13
590 #define BASS_ATTRIB_GRANULE 14
591 #define BASS_ATTRIB_USER 15
592 #define BASS_ATTRIB_TAIL 16
593 #define BASS_ATTRIB_PUSH_LIMIT 17
594 #define BASS_ATTRIB_MUSIC_AMPLIFY 0x100
595 #define BASS_ATTRIB_MUSIC_PANSEP 0x101
596 #define BASS_ATTRIB_MUSIC_PSCALER 0x102
597 #define BASS_ATTRIB_MUSIC_BPM 0x103
598 #define BASS_ATTRIB_MUSIC_SPEED 0x104
599 #define BASS_ATTRIB_MUSIC_VOL_GLOBAL 0x105
600 #define BASS_ATTRIB_MUSIC_ACTIVE 0x106
601 #define BASS_ATTRIB_MUSIC_VOL_CHAN 0x200 // + channel #
602 #define BASS_ATTRIB_MUSIC_VOL_INST 0x300 // + instrument #
603
604 // BASS_ChannelSlideAttribute flags
605 #define BASS_SLIDE_LOG 0x1000000
606
607 // BASS_ChannelGetData flags
608 #define BASS_DATA_AVAILABLE 0 // query how much data is buffered
609 #define BASS_DATA_NOREMOVE 0x10000000 // flag: don't remove data from recording buffer
610 #define BASS_DATA_FIXED 0x20000000 // flag: return 8.24 fixed-point data
611 #define BASS_DATA_FLOAT 0x40000000 // flag: return floating-point sample data
612 #define BASS_DATA_FFT256 0x80000000 // 256 sample FFT
613 #define BASS_DATA_FFT512 0x80000001 // 512 FFT
614 #define BASS_DATA_FFT1024 0x80000002 // 1024 FFT
615 #define BASS_DATA_FFT2048 0x80000003 // 2048 FFT
616 #define BASS_DATA_FFT4096 0x80000004 // 4096 FFT
617 #define BASS_DATA_FFT8192 0x80000005 // 8192 FFT
618 #define BASS_DATA_FFT16384 0x80000006 // 16384 FFT
619 #define BASS_DATA_FFT32768 0x80000007 // 32768 FFT
620 #define BASS_DATA_FFT_INDIVIDUAL 0x10 // FFT flag: FFT for each channel, else all combined
621 #define BASS_DATA_FFT_NOWINDOW 0x20 // FFT flag: no Hanning window
622 #define BASS_DATA_FFT_REMOVEDC 0x40 // FFT flag: pre-remove DC bias
623 #define BASS_DATA_FFT_COMPLEX 0x80 // FFT flag: return complex data
624 #define BASS_DATA_FFT_NYQUIST 0x100 // FFT flag: return extra Nyquist value
625
626 // BASS_ChannelGetLevelEx flags
627 #define BASS_LEVEL_MONO 1 // get mono level
628 #define BASS_LEVEL_STEREO 2 // get stereo level
629 #define BASS_LEVEL_RMS 4 // get RMS levels
630 #define BASS_LEVEL_VOLPAN 8 // apply VOL/PAN attributes to the levels
631 #define BASS_LEVEL_NOREMOVE 16 // don't remove data from recording buffer
632
633 // BASS_ChannelGetTags types : what's returned
634 #define BASS_TAG_ID3 0 // ID3v1 tags : TAG_ID3 structure
635 #define BASS_TAG_ID3V2 1 // ID3v2 tags : variable length block
636 #define BASS_TAG_OGG 2 // OGG comments : series of null-terminated UTF-8 strings
637 #define BASS_TAG_HTTP 3 // HTTP headers : series of null-terminated ASCII strings
638 #define BASS_TAG_ICY 4 // ICY headers : series of null-terminated ANSI strings
639 #define BASS_TAG_META 5 // ICY metadata : ANSI string
640 #define BASS_TAG_APE 6 // APE tags : series of null-terminated UTF-8 strings
641 #define BASS_TAG_MP4 7 // MP4/iTunes metadata : series of null-terminated UTF-8 strings
642 #define BASS_TAG_WMA 8 // WMA tags : series of null-terminated UTF-8 strings
643 #define BASS_TAG_VENDOR 9 // OGG encoder : UTF-8 string
644 #define BASS_TAG_LYRICS3 10 // Lyric3v2 tag : ASCII string
645 #define BASS_TAG_CA_CODEC 11 // CoreAudio codec info : TAG_CA_CODEC structure
646 #define BASS_TAG_MF 13 // Media Foundation tags : series of null-terminated UTF-8 strings
647 #define BASS_TAG_WAVEFORMAT 14 // WAVE format : WAVEFORMATEEX structure
648 #define BASS_TAG_AM_NAME 16 // Android Media codec name : ASCII string
649 #define BASS_TAG_ID3V2_2 17 // ID3v2 tags (2nd block) : variable length block
650 #define BASS_TAG_AM_MIME 18 // Android Media MIME type : ASCII string
651 #define BASS_TAG_LOCATION 19 // redirected URL : ASCII string
652 #define BASS_TAG_RIFF_INFO 0x100 // RIFF "INFO" tags : series of null-terminated ANSI strings
653 #define BASS_TAG_RIFF_BEXT 0x101 // RIFF/BWF "bext" tags : TAG_BEXT structure
654 #define BASS_TAG_RIFF_CART 0x102 // RIFF/BWF "cart" tags : TAG_CART structure
655 #define BASS_TAG_RIFF_DISP 0x103 // RIFF "DISP" text tag : ANSI string
656 #define BASS_TAG_RIFF_CUE 0x104 // RIFF "cue " chunk : TAG_CUE structure
657 #define BASS_TAG_RIFF_SMPL 0x105 // RIFF "smpl" chunk : TAG_SMPL structure
658 #define BASS_TAG_APE_BINARY 0x1000 // + index #, binary APE tag : TAG_APE_BINARY structure
659 #define BASS_TAG_MUSIC_NAME 0x10000 // MOD music name : ANSI string
660 #define BASS_TAG_MUSIC_MESSAGE 0x10001 // MOD message : ANSI string
661 #define BASS_TAG_MUSIC_ORDERS 0x10002 // MOD order list : BYTE array of pattern numbers
662 #define BASS_TAG_MUSIC_AUTH 0x10003 // MOD author : UTF-8 string
663 #define BASS_TAG_MUSIC_INST 0x10100 // + instrument #, MOD instrument name : ANSI string
664 #define BASS_TAG_MUSIC_CHAN 0x10200 // + channel #, MOD channel name : ANSI string
665 #define BASS_TAG_MUSIC_SAMPLE 0x10300 // + sample #, MOD sample name : ANSI string
666
667 // ID3v1 tag structure
668 typedef struct {
669 char id[3];
670 char title[30];
671 char artist[30];
672 char album[30];
673 char year[4];
674 char comment[30];
675 BYTE genre;
676 } TAG_ID3;
677
678 // Binary APE tag structure
679 typedef struct {
680 const char *key;
681 const void *data;
682 DWORD length;
683 } TAG_APE_BINARY;
684
685 // BWF "bext" tag structure
686 #ifdef _MSC_VER
687 #pragma warning(push)
688 #pragma warning(disable:4200)
689 #endif
690 #pragma pack(push,1)
691 typedef struct {
692 char Description[256]; // description
693 char Originator[32]; // name of the originator
694 char OriginatorReference[32]; // reference of the originator
695 char OriginationDate[10]; // date of creation (yyyy-mm-dd)
696 char OriginationTime[8]; // time of creation (hh-mm-ss)
697 QWORD TimeReference; // first sample count since midnight (little-endian)
698 WORD Version; // BWF version (little-endian)
699 BYTE UMID[64]; // SMPTE UMID
700 BYTE Reserved[190];
701 #if defined(__GNUC__) && __GNUC__<3
702 char CodingHistory[0]; // history
703 #elif 1 // change to 0 if compiler fails the following line
704 char CodingHistory[]; // history
705 #else
706 char CodingHistory[1]; // history
707 #endif
708 } TAG_BEXT;
709 #pragma pack(pop)
710
711 // BWF "cart" tag structures
712 typedef struct
713 {
714 DWORD dwUsage; // FOURCC timer usage ID
715 DWORD dwValue; // timer value in samples from head
716 } TAG_CART_TIMER;
717
718 typedef struct
719 {
720 char Version[4]; // version of the data structure
721 char Title[64]; // title of cart audio sequence
722 char Artist[64]; // artist or creator name
723 char CutID[64]; // cut number identification
724 char ClientID[64]; // client identification
725 char Category[64]; // category ID, PSA, NEWS, etc
726 char Classification[64]; // classification or auxiliary key
727 char OutCue[64]; // out cue text
728 char StartDate[10]; // yyyy-mm-dd
729 char StartTime[8]; // hh:mm:ss
730 char EndDate[10]; // yyyy-mm-dd
731 char EndTime[8]; // hh:mm:ss
732 char ProducerAppID[64]; // name of vendor or application
733 char ProducerAppVersion[64]; // version of producer application
734 char UserDef[64]; // user defined text
735 DWORD dwLevelReference; // sample value for 0 dB reference
736 TAG_CART_TIMER PostTimer[8]; // 8 time markers after head
737 char Reserved[276];
738 char URL[1024]; // uniform resource locator
739 #if defined(__GNUC__) && __GNUC__<3
740 char TagText[0]; // free form text for scripts or tags
741 #elif 1 // change to 0 if compiler fails the following line
742 char TagText[]; // free form text for scripts or tags
743 #else
744 char TagText[1]; // free form text for scripts or tags
745 #endif
746 } TAG_CART;
747
748 // RIFF "cue " tag structures
749 typedef struct
750 {
751 DWORD dwName;
752 DWORD dwPosition;
753 DWORD fccChunk;
754 DWORD dwChunkStart;
755 DWORD dwBlockStart;
756 DWORD dwSampleOffset;
757 } TAG_CUE_POINT;
758
759 typedef struct
760 {
761 DWORD dwCuePoints;
762 #if defined(__GNUC__) && __GNUC__<3
763 TAG_CUE_POINT CuePoints[0];
764 #elif 1 // change to 0 if compiler fails the following line
765 TAG_CUE_POINT CuePoints[];
766 #else
767 TAG_CUE_POINT CuePoints[1];
768 #endif
769 } TAG_CUE;
770
771 // RIFF "smpl" tag structures
772 typedef struct
773 {
774 DWORD dwIdentifier;
775 DWORD dwType;
776 DWORD dwStart;
777 DWORD dwEnd;
778 DWORD dwFraction;
779 DWORD dwPlayCount;
780 } TAG_SMPL_LOOP;
781
782 typedef struct
783 {
784 DWORD dwManufacturer;
785 DWORD dwProduct;
786 DWORD dwSamplePeriod;
787 DWORD dwMIDIUnityNote;
788 DWORD dwMIDIPitchFraction;
789 DWORD dwSMPTEFormat;
790 DWORD dwSMPTEOffset;
791 DWORD cSampleLoops;
792 DWORD cbSamplerData;
793 #if defined(__GNUC__) && __GNUC__<3
794 TAG_SMPL_LOOP SampleLoops[0];
795 #elif 1 // change to 0 if compiler fails the following line
796 TAG_SMPL_LOOP SampleLoops[];
797 #else
798 TAG_SMPL_LOOP SampleLoops[1];
799 #endif
800 } TAG_SMPL;
801 #ifdef _MSC_VER
802 #pragma warning(pop)
803 #endif
804
805 // CoreAudio codec info structure
806 typedef struct {
807 DWORD ftype; // file format
808 DWORD atype; // audio format
809 const char *name; // description
810 } TAG_CA_CODEC;
811
812 #ifndef _WAVEFORMATEX_
813 #define _WAVEFORMATEX_
814 #pragma pack(push,1)
815 typedef struct tWAVEFORMATEX
816 {
817 WORD wFormatTag;
818 WORD nChannels;
819 DWORD nSamplesPerSec;
820 DWORD nAvgBytesPerSec;
821 WORD nBlockAlign;
822 WORD wBitsPerSample;
823 WORD cbSize;
824 } WAVEFORMATEX, *PWAVEFORMATEX, *LPWAVEFORMATEX;
825 typedef const WAVEFORMATEX *LPCWAVEFORMATEX;
826 #pragma pack(pop)
827 #endif
828
829 // BASS_ChannelGetLength/GetPosition/SetPosition modes
830 #define BASS_POS_BYTE 0 // byte position
831 #define BASS_POS_MUSIC_ORDER 1 // order.row position, MAKELONG(order,row)
832 #define BASS_POS_OGG 3 // OGG bitstream number
833 #define BASS_POS_END 0x10 // trimmed end position
834 #define BASS_POS_LOOP 0x11 // loop start positiom
835 #define BASS_POS_FLUSH 0x1000000 // flag: flush decoder/FX buffers
836 #define BASS_POS_RESET 0x2000000 // flag: reset user file buffers
837 #define BASS_POS_RELATIVE 0x4000000 // flag: seek relative to the current position
838 #define BASS_POS_INEXACT 0x8000000 // flag: allow seeking to inexact position
839 #define BASS_POS_DECODE 0x10000000 // flag: get the decoding (not playing) position
840 #define BASS_POS_DECODETO 0x20000000 // flag: decode to the position instead of seeking
841 #define BASS_POS_SCAN 0x40000000 // flag: scan to the position
842
843 // BASS_ChannelSetDevice/GetDevice option
844 #define BASS_NODEVICE 0x20000
845
846 // BASS_RecordSetInput flags
847 #define BASS_INPUT_OFF 0x10000
848 #define BASS_INPUT_ON 0x20000
849
850 #define BASS_INPUT_TYPE_MASK 0xff000000
851 #define BASS_INPUT_TYPE_UNDEF 0x00000000
852 #define BASS_INPUT_TYPE_DIGITAL 0x01000000
853 #define BASS_INPUT_TYPE_LINE 0x02000000
854 #define BASS_INPUT_TYPE_MIC 0x03000000
855 #define BASS_INPUT_TYPE_SYNTH 0x04000000
856 #define BASS_INPUT_TYPE_CD 0x05000000
857 #define BASS_INPUT_TYPE_PHONE 0x06000000
858 #define BASS_INPUT_TYPE_SPEAKER 0x07000000
859 #define BASS_INPUT_TYPE_WAVE 0x08000000
860 #define BASS_INPUT_TYPE_AUX 0x09000000
861 #define BASS_INPUT_TYPE_ANALOG 0x0a000000
862
863 // BASS_ChannelSetFX effect types
864 #define BASS_FX_DX8_CHORUS 0
865 #define BASS_FX_DX8_COMPRESSOR 1
866 #define BASS_FX_DX8_DISTORTION 2
867 #define BASS_FX_DX8_ECHO 3
868 #define BASS_FX_DX8_FLANGER 4
869 #define BASS_FX_DX8_GARGLE 5
870 #define BASS_FX_DX8_I3DL2REVERB 6
871 #define BASS_FX_DX8_PARAMEQ 7
872 #define BASS_FX_DX8_REVERB 8
873 #define BASS_FX_VOLUME 9
874
875 typedef struct {
876 float fWetDryMix;
877 float fDepth;
878 float fFeedback;
879 float fFrequency;
880 DWORD lWaveform; // 0=triangle, 1=sine
881 float fDelay;
882 DWORD lPhase; // BASS_DX8_PHASE_xxx
883 } BASS_DX8_CHORUS;
884
885 typedef struct {
886 float fGain;
887 float fAttack;
888 float fRelease;
889 float fThreshold;
890 float fRatio;
891 float fPredelay;
892 } BASS_DX8_COMPRESSOR;
893
894 typedef struct {
895 float fGain;
896 float fEdge;
897 float fPostEQCenterFrequency;
898 float fPostEQBandwidth;
899 float fPreLowpassCutoff;
900 } BASS_DX8_DISTORTION;
901
902 typedef struct {
903 float fWetDryMix;
904 float fFeedback;
905 float fLeftDelay;
906 float fRightDelay;
907 BOOL lPanDelay;
908 } BASS_DX8_ECHO;
909
910 typedef struct {
911 float fWetDryMix;
912 float fDepth;
913 float fFeedback;
914 float fFrequency;
915 DWORD lWaveform; // 0=triangle, 1=sine
916 float fDelay;
917 DWORD lPhase; // BASS_DX8_PHASE_xxx
918 } BASS_DX8_FLANGER;
919
920 typedef struct {
921 DWORD dwRateHz; // Rate of modulation in hz
922 DWORD dwWaveShape; // 0=triangle, 1=square
923 } BASS_DX8_GARGLE;
924
925 typedef struct {
926 int lRoom; // [-10000, 0] default: -1000 mB
927 int lRoomHF; // [-10000, 0] default: 0 mB
928 float flRoomRolloffFactor; // [0.0, 10.0] default: 0.0
929 float flDecayTime; // [0.1, 20.0] default: 1.49s
930 float flDecayHFRatio; // [0.1, 2.0] default: 0.83
931 int lReflections; // [-10000, 1000] default: -2602 mB
932 float flReflectionsDelay; // [0.0, 0.3] default: 0.007 s
933 int lReverb; // [-10000, 2000] default: 200 mB
934 float flReverbDelay; // [0.0, 0.1] default: 0.011 s
935 float flDiffusion; // [0.0, 100.0] default: 100.0 %
936 float flDensity; // [0.0, 100.0] default: 100.0 %
937 float flHFReference; // [20.0, 20000.0] default: 5000.0 Hz
938 } BASS_DX8_I3DL2REVERB;
939
940 typedef struct {
941 float fCenter;
942 float fBandwidth;
943 float fGain;
944 } BASS_DX8_PARAMEQ;
945
946 typedef struct {
947 float fInGain; // [-96.0,0.0] default: 0.0 dB
948 float fReverbMix; // [-96.0,0.0] default: 0.0 db
949 float fReverbTime; // [0.001,3000.0] default: 1000.0 ms
950 float fHighFreqRTRatio; // [0.001,0.999] default: 0.001
951 } BASS_DX8_REVERB;
952
953 #define BASS_DX8_PHASE_NEG_180 0
954 #define BASS_DX8_PHASE_NEG_90 1
955 #define BASS_DX8_PHASE_ZERO 2
956 #define BASS_DX8_PHASE_90 3
957 #define BASS_DX8_PHASE_180 4
958
959 typedef struct {
960 float fTarget;
961 float fCurrent;
962 float fTime;
963 DWORD lCurve;
964 } BASS_FX_VOLUME_PARAM;
965
966 typedef void (CALLBACK IOSNOTIFYPROC)(DWORD status);
967 /* iOS notification callback function.
968 status : The notification (BASS_IOSNOTIFY_xxx) */
969
970 #define BASS_IOSNOTIFY_INTERRUPT 1 // interruption started
971 #define BASS_IOSNOTIFY_INTERRUPT_END 2 // interruption ended
972
973 BOOL BASSDEF(BASS_SetConfig)(DWORD option, DWORD value);
974 DWORD BASSDEF(BASS_GetConfig)(DWORD option);
975 BOOL BASSDEF(BASS_SetConfigPtr)(DWORD option, const void *value);
976 const void *BASSDEF(BASS_GetConfigPtr)(DWORD option);
977 DWORD BASSDEF(BASS_GetVersion)(void);
978 int BASSDEF(BASS_ErrorGetCode)(void);
979
980 BOOL BASSDEF(BASS_GetDeviceInfo)(DWORD device, BASS_DEVICEINFO *info);
981 #if defined(_WIN32) && !defined(_WIN32_WCE) && !(defined(WINAPI_FAMILY) && WINAPI_FAMILY != WINAPI_FAMILY_DESKTOP_APP)
982 BOOL BASSDEF(BASS_Init)(int device, DWORD freq, DWORD flags, HWND win, const void *dsguid);
983 #else
984 BOOL BASSDEF(BASS_Init)(int device, DWORD freq, DWORD flags, void *win, const void *dsguid);
985 #endif
986 BOOL BASSDEF(BASS_Free)(void);
987 BOOL BASSDEF(BASS_SetDevice)(DWORD device);
988 DWORD BASSDEF(BASS_GetDevice)(void);
989 BOOL BASSDEF(BASS_GetInfo)(BASS_INFO *info);
990 BOOL BASSDEF(BASS_Start)(void);
991 BOOL BASSDEF(BASS_Stop)(void);
992 BOOL BASSDEF(BASS_Pause)(void);
993 DWORD BASSDEF(BASS_IsStarted)(void);
994 BOOL BASSDEF(BASS_Update)(DWORD length);
995 float BASSDEF(BASS_GetCPU)(void);
996 BOOL BASSDEF(BASS_SetVolume)(float volume);
997 float BASSDEF(BASS_GetVolume)(void);
998 #if defined(_WIN32) && !defined(_WIN32_WCE) && !(defined(WINAPI_FAMILY) && WINAPI_FAMILY != WINAPI_FAMILY_DESKTOP_APP)
999 void *BASSDEF(BASS_GetDSoundObject)(DWORD object);
1000 #endif
1001
1002 BOOL BASSDEF(BASS_Set3DFactors)(float distf, float rollf, float doppf);
1003 BOOL BASSDEF(BASS_Get3DFactors)(float *distf, float *rollf, float *doppf);
1004 BOOL BASSDEF(BASS_Set3DPosition)(const BASS_3DVECTOR *pos, const BASS_3DVECTOR *vel, const BASS_3DVECTOR *front, const BASS_3DVECTOR *top);
1005 BOOL BASSDEF(BASS_Get3DPosition)(BASS_3DVECTOR *pos, BASS_3DVECTOR *vel, BASS_3DVECTOR *front, BASS_3DVECTOR *top);
1006 void BASSDEF(BASS_Apply3D)(void);
1007
1008 HPLUGIN BASSDEF(BASS_PluginLoad)(const char *file, DWORD flags);
1009 BOOL BASSDEF(BASS_PluginFree)(HPLUGIN handle);
1010 BOOL BASSDEF(BASS_PluginEnable)(HPLUGIN handle, BOOL enable);
1011 const BASS_PLUGININFO *BASSDEF(BASS_PluginGetInfo)(HPLUGIN handle);
1012
1013 HSAMPLE BASSDEF(BASS_SampleLoad)(BOOL mem, const void *file, QWORD offset, DWORD length, DWORD max, DWORD flags);
1014 HSAMPLE BASSDEF(BASS_SampleCreate)(DWORD length, DWORD freq, DWORD chans, DWORD max, DWORD flags);
1015 BOOL BASSDEF(BASS_SampleFree)(HSAMPLE handle);
1016 BOOL BASSDEF(BASS_SampleSetData)(HSAMPLE handle, const void *buffer);
1017 BOOL BASSDEF(BASS_SampleGetData)(HSAMPLE handle, void *buffer);
1018 BOOL BASSDEF(BASS_SampleGetInfo)(HSAMPLE handle, BASS_SAMPLE *info);
1019 BOOL BASSDEF(BASS_SampleSetInfo)(HSAMPLE handle, const BASS_SAMPLE *info);
1020 DWORD BASSDEF(BASS_SampleGetChannel)(HSAMPLE handle, DWORD flags);
1021 DWORD BASSDEF(BASS_SampleGetChannels)(HSAMPLE handle, HCHANNEL *channels);
1022 BOOL BASSDEF(BASS_SampleStop)(HSAMPLE handle);
1023
1024 HSTREAM BASSDEF(BASS_StreamCreate)(DWORD freq, DWORD chans, DWORD flags, STREAMPROC *proc, void *user);
1025 HSTREAM BASSDEF(BASS_StreamCreateFile)(BOOL mem, const void *file, QWORD offset, QWORD length, DWORD flags);
1026 HSTREAM BASSDEF(BASS_StreamCreateURL)(const char *url, DWORD offset, DWORD flags, DOWNLOADPROC *proc, void *user);
1027 HSTREAM BASSDEF(BASS_StreamCreateFileUser)(DWORD system, DWORD flags, const BASS_FILEPROCS *proc, void *user);
1028 BOOL BASSDEF(BASS_StreamFree)(HSTREAM handle);
1029 QWORD BASSDEF(BASS_StreamGetFilePosition)(HSTREAM handle, DWORD mode);
1030 DWORD BASSDEF(BASS_StreamPutData)(HSTREAM handle, const void *buffer, DWORD length);
1031 DWORD BASSDEF(BASS_StreamPutFileData)(HSTREAM handle, const void *buffer, DWORD length);
1032
1033 HMUSIC BASSDEF(BASS_MusicLoad)(BOOL mem, const void *file, QWORD offset, DWORD length, DWORD flags, DWORD freq);
1034 BOOL BASSDEF(BASS_MusicFree)(HMUSIC handle);
1035
1036 BOOL BASSDEF(BASS_RecordGetDeviceInfo)(DWORD device, BASS_DEVICEINFO *info);
1037 BOOL BASSDEF(BASS_RecordInit)(int device);
1038 BOOL BASSDEF(BASS_RecordFree)(void);
1039 BOOL BASSDEF(BASS_RecordSetDevice)(DWORD device);
1040 DWORD BASSDEF(BASS_RecordGetDevice)(void);
1041 BOOL BASSDEF(BASS_RecordGetInfo)(BASS_RECORDINFO *info);
1042 const char *BASSDEF(BASS_RecordGetInputName)(int input);
1043 BOOL BASSDEF(BASS_RecordSetInput)(int input, DWORD flags, float volume);
1044 DWORD BASSDEF(BASS_RecordGetInput)(int input, float *volume);
1045 HRECORD BASSDEF(BASS_RecordStart)(DWORD freq, DWORD chans, DWORD flags, RECORDPROC *proc, void *user);
1046
1047 double BASSDEF(BASS_ChannelBytes2Seconds)(DWORD handle, QWORD pos);
1048 QWORD BASSDEF(BASS_ChannelSeconds2Bytes)(DWORD handle, double pos);
1049 DWORD BASSDEF(BASS_ChannelGetDevice)(DWORD handle);
1050 BOOL BASSDEF(BASS_ChannelSetDevice)(DWORD handle, DWORD device);
1051 DWORD BASSDEF(BASS_ChannelIsActive)(DWORD handle);
1052 BOOL BASSDEF(BASS_ChannelGetInfo)(DWORD handle, BASS_CHANNELINFO *info);
1053 const char *BASSDEF(BASS_ChannelGetTags)(DWORD handle, DWORD tags);
1054 DWORD BASSDEF(BASS_ChannelFlags)(DWORD handle, DWORD flags, DWORD mask);
1055 BOOL BASSDEF(BASS_ChannelLock)(DWORD handle, BOOL lock);
1056 BOOL BASSDEF(BASS_ChannelFree)(DWORD handle);
1057 BOOL BASSDEF(BASS_ChannelPlay)(DWORD handle, BOOL restart);
1058 BOOL BASSDEF(BASS_ChannelStop)(DWORD handle);
1059 BOOL BASSDEF(BASS_ChannelPause)(DWORD handle);
1060 BOOL BASSDEF(BASS_ChannelUpdate)(DWORD handle, DWORD length);
1061 BOOL BASSDEF(BASS_ChannelSetAttribute)(DWORD handle, DWORD attrib, float value);
1062 BOOL BASSDEF(BASS_ChannelGetAttribute)(DWORD handle, DWORD attrib, float *value);
1063 BOOL BASSDEF(BASS_ChannelSlideAttribute)(DWORD handle, DWORD attrib, float value, DWORD time);
1064 BOOL BASSDEF(BASS_ChannelIsSliding)(DWORD handle, DWORD attrib);
1065 BOOL BASSDEF(BASS_ChannelSetAttributeEx)(DWORD handle, DWORD attrib, void *value, DWORD size);
1066 DWORD BASSDEF(BASS_ChannelGetAttributeEx)(DWORD handle, DWORD attrib, void *value, DWORD size);
1067 BOOL BASSDEF(BASS_ChannelSet3DAttributes)(DWORD handle, int mode, float min, float max, int iangle, int oangle, float outvol);
1068 BOOL BASSDEF(BASS_ChannelGet3DAttributes)(DWORD handle, DWORD *mode, float *min, float *max, DWORD *iangle, DWORD *oangle, float *outvol);
1069 BOOL BASSDEF(BASS_ChannelSet3DPosition)(DWORD handle, const BASS_3DVECTOR *pos, const BASS_3DVECTOR *orient, const BASS_3DVECTOR *vel);
1070 BOOL BASSDEF(BASS_ChannelGet3DPosition)(DWORD handle, BASS_3DVECTOR *pos, BASS_3DVECTOR *orient, BASS_3DVECTOR *vel);
1071 QWORD BASSDEF(BASS_ChannelGetLength)(DWORD handle, DWORD mode);
1072 BOOL BASSDEF(BASS_ChannelSetPosition)(DWORD handle, QWORD pos, DWORD mode);
1073 QWORD BASSDEF(BASS_ChannelGetPosition)(DWORD handle, DWORD mode);
1074 DWORD BASSDEF(BASS_ChannelGetLevel)(DWORD handle);
1075 BOOL BASSDEF(BASS_ChannelGetLevelEx)(DWORD handle, float *levels, float length, DWORD flags);
1076 DWORD BASSDEF(BASS_ChannelGetData)(DWORD handle, void *buffer, DWORD length);
1077 HSYNC BASSDEF(BASS_ChannelSetSync)(DWORD handle, DWORD type, QWORD param, SYNCPROC *proc, void *user);
1078 BOOL BASSDEF(BASS_ChannelRemoveSync)(DWORD handle, HSYNC sync);
1079 BOOL BASSDEF(BASS_ChannelSetLink)(DWORD handle, DWORD chan);
1080 BOOL BASSDEF(BASS_ChannelRemoveLink)(DWORD handle, DWORD chan);
1081 HDSP BASSDEF(BASS_ChannelSetDSP)(DWORD handle, DSPPROC *proc, void *user, int priority);
1082 BOOL BASSDEF(BASS_ChannelRemoveDSP)(DWORD handle, HDSP dsp);
1083 HFX BASSDEF(BASS_ChannelSetFX)(DWORD handle, DWORD type, int priority);
1084 BOOL BASSDEF(BASS_ChannelRemoveFX)(DWORD handle, HFX fx);
1085
1086 BOOL BASSDEF(BASS_FXSetParameters)(HFX handle, const void *params);
1087 BOOL BASSDEF(BASS_FXGetParameters)(HFX handle, void *params);
1088 BOOL BASSDEF(BASS_FXSetPriority)(HFX handle, int priority);
1089 BOOL BASSDEF(BASS_FXReset)(DWORD handle);
1090
1091 #ifdef __cplusplus
1092 }
1093
1094 #if defined(_WIN32) && !defined(NOBASSOVERLOADS)
BASS_PluginLoad(const WCHAR * file,DWORD flags)1095 static inline HPLUGIN BASS_PluginLoad(const WCHAR *file, DWORD flags)
1096 {
1097 return BASS_PluginLoad((const char*)file, flags | BASS_UNICODE);
1098 }
1099
BASS_MusicLoad(BOOL mem,const WCHAR * file,QWORD offset,DWORD length,DWORD flags,DWORD freq)1100 static inline HMUSIC BASS_MusicLoad(BOOL mem, const WCHAR *file, QWORD offset, DWORD length, DWORD flags, DWORD freq)
1101 {
1102 return BASS_MusicLoad(mem, (const void*)file, offset, length, flags | BASS_UNICODE, freq);
1103 }
1104
BASS_SampleLoad(BOOL mem,const WCHAR * file,QWORD offset,DWORD length,DWORD max,DWORD flags)1105 static inline HSAMPLE BASS_SampleLoad(BOOL mem, const WCHAR *file, QWORD offset, DWORD length, DWORD max, DWORD flags)
1106 {
1107 return BASS_SampleLoad(mem, (const void*)file, offset, length, max, flags | BASS_UNICODE);
1108 }
1109
BASS_StreamCreateFile(BOOL mem,const WCHAR * file,QWORD offset,QWORD length,DWORD flags)1110 static inline HSTREAM BASS_StreamCreateFile(BOOL mem, const WCHAR *file, QWORD offset, QWORD length, DWORD flags)
1111 {
1112 return BASS_StreamCreateFile(mem, (const void*)file, offset, length, flags | BASS_UNICODE);
1113 }
1114
BASS_StreamCreateURL(const WCHAR * url,DWORD offset,DWORD flags,DOWNLOADPROC * proc,void * user)1115 static inline HSTREAM BASS_StreamCreateURL(const WCHAR *url, DWORD offset, DWORD flags, DOWNLOADPROC *proc, void *user)
1116 {
1117 return BASS_StreamCreateURL((const char*)url, offset, flags | BASS_UNICODE, proc, user);
1118 }
1119
BASS_SetConfigPtr(DWORD option,const WCHAR * value)1120 static inline BOOL BASS_SetConfigPtr(DWORD option, const WCHAR *value)
1121 {
1122 return BASS_SetConfigPtr(option | BASS_UNICODE, (const void*)value);
1123 }
1124 #endif
1125 #endif
1126
1127 #ifdef __OBJC__
1128 #undef BOOL
1129 #endif
1130
1131 #endif
1132