-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathfmod.h
761 lines (657 loc) · 32.8 KB
/
fmod.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
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
#pragma once
//==========================================================================================
// FMOD Main header file. Copyright (c), FireLight Multimedia 1999-2000.
//==========================================================================================
//===============================================================================================
//= DEFINITIONS
//===============================================================================================
//;;CG
//;;#define STDCALL __attribute__ ((stdcall))
#ifndef _stdcall //;;bielefeld
#define _stdcall STDCALL
#endif //;;bielefeld
#define F_API _stdcall
//;;CG #define F_API
#ifdef DLL_EXPORTS
#define DLL_API __declspec(dllexport)
#else
#ifdef LCCWIN32
#define DLL_API F_API
#else
#define DLL_API __declspec(dllimport)
#endif // LCCWIN32
#endif //DLL_EXPORTS
#define FMOD_VERSION 3.20f
//;;CG
#define DLL_API __declspec(dllimport)
// fmod defined types
typedef struct FSOUND_SAMPLE FSOUND_SAMPLE;
typedef struct FSOUND_STREAM FSOUND_STREAM;
typedef struct FSOUND_DSPUNIT FSOUND_DSPUNIT;
typedef struct FSOUND_MATERIAL FSOUND_MATERIAL;
typedef struct FSOUND_GEOMLIST FSOUND_GEOMLIST;
typedef struct FMUSIC_MODULE FMUSIC_MODULE;
// callback types
typedef void (*FSOUND_STREAMCALLBACK) (FSOUND_STREAM *stream, void *buff, int len, int param);
typedef void * (*FSOUND_DSPCALLBACK) (void *originalbuffer, void *newbuffer, int length, int param);
typedef void (*FMUSIC_CALLBACK) (FMUSIC_MODULE *mod, unsigned char param);
/*
[ENUM]
[
[DESCRIPTION]
On failure of commands in FMOD, use FSOUND_GetError to attain what happened.
[SEE_ALSO]
FSOUND_GetError
]
*/
enum FMOD_ERRORS
{
FMOD_ERR_NONE, // No errors
FMOD_ERR_BUSY, // Cannot call this command after FSOUND_Init. Call FSOUND_Close first.
FMOD_ERR_UNINITIALIZED, // This command failed because FSOUND_Init was not called
FMOD_ERR_INIT, // Error initializing output device.
FMOD_ERR_ALLOCATED, // Error initializing output device, but more specifically, the output device is already in use and cannot be reused.
FMOD_ERR_PLAY, // Playing the sound failed.
FMOD_ERR_OUTPUT_FORMAT, // Soundcard does not support the features needed for this soundsystem (16bit stereo output)
FMOD_ERR_COOPERATIVELEVEL, // Error setting cooperative level for hardware.
FMOD_ERR_CREATEBUFFER, // Error creating hardware sound buffer.
FMOD_ERR_FILE_NOTFOUND, // File not found
FMOD_ERR_FILE_FORMAT, // Unknown file format
FMOD_ERR_FILE_BAD, // Error loading file
FMOD_ERR_MEMORY, // Not enough memory
FMOD_ERR_VERSION, // The version number of this file format is not supported
FMOD_ERR_INVALID_MIXER, // Incorrect mixer selected
FMOD_ERR_INVALID_PARAM, // An invalid parameter was passed to this function
FMOD_ERR_NO_EAX, // Tried to use an EAX command on a non EAX enabled channel or output.
FMOD_ERR_NO_EAX2, // Tried to use an advanced EAX2 command on a non EAX2 enabled channel or output.
FMOD_ERR_CHANNEL_ALLOC, // Failed to allocate a new channel
FMOD_ERR_RECORD, // Recording is not supported on this machine
};
/*
[ENUM]
[
[DESCRIPTION]
These output types are used with FSOUND_SetOutput, to choose which output driver to use.
FSOUND_OUTPUT_A3D will cause FSOUND_Init to FAIL if you have not got a vortex
based A3D card. The suggestion for this is to immediately try and reinitialize FMOD with
FSOUND_OUTPUT_DSOUND, and if this fails, try initializing FMOD with FSOUND_OUTPUT_WAVEOUT.
FSOUND_OUTPUT_DSOUND will not support hardware 3d acceleration if the sound card driver
does not support DirectX 6 Voice Manager Extensions.
[SEE_ALSO]
FSOUND_SetOutput
FSOUND_GetOutput
]
*/
enum FSOUND_OUTPUTTYPES
{
FSOUND_OUTPUT_NOSOUND, // NoSound driver, all calls to this succeed but do nothing.
FSOUND_OUTPUT_WINMM, // Windows Multimedia driver.
FSOUND_OUTPUT_DSOUND, // DirectSound driver. You need this to get EAX or EAX2 support.
FSOUND_OUTPUT_A3D, // A3D driver. You need this to get geometry and EAX reverb support.
};
/*
[ENUM]
[
[DESCRIPTION]
These mixer types are used with FSOUND_SetMixer, to choose which mixer to use, or to act
upon for other reasons using FSOUND_GetMixer.
[SEE_ALSO]
FSOUND_SetMixer
FSOUND_GetMixer
]
*/
enum FSOUND_MIXERTYPES
{
FSOUND_MIXER_AUTODETECT, // Enables autodetection of the fastest mixer based on your cpu.
FSOUND_MIXER_BLENDMODE, // Enables the standard non mmx, blendmode mixer.
FSOUND_MIXER_MMXP5, // Enables the mmx, pentium optimized blendmode mixer.
FSOUND_MIXER_MMXP6, // Enables the mmx, ppro/p2/p3 optimized mixer.
FSOUND_MIXER_QUALITY_AUTODETECT,// Enables autodetection of the fastest quality mixer based on your cpu.
FSOUND_MIXER_QUALITY_FPU, // Enables the interpolating FPU mixer.
FSOUND_MIXER_QUALITY_MMXP5, // Enables the interpolating p5 MMX mixer.
FSOUND_MIXER_QUALITY_MMXP6, // Enables the interpolating ppro/p2/p3 MMX mixer.
FSOUND_MIXER_QUALITY_FPU_VOLUMERAMP,// Enables the interpolating 'de-clicking' FPU mixer.
};
/*
[ENUM]
[
[DESCRIPTION]
These definitions describe the type of song being played.
[SEE_ALSO]
FMUSIC_GetType
]
*/
enum FMUSIC_TYPES
{
FMUSIC_TYPE_NONE,
FMUSIC_TYPE_MOD, // Protracker / Fasttracker
FMUSIC_TYPE_S3M, // ScreamTracker 3
FMUSIC_TYPE_XM, // FastTracker 2
FMUSIC_TYPE_IT, // Impulse Tracker.
};
/*
[DEFINE_START]
[
[NAME]
FSOUND_DSP_PRIORITIES
[DESCRIPTION]
These default priorities are
[SEE_ALSO]
FSOUND_DSP_Create
FSOUND_DSP_SetPriority
]
*/
#define FSOUND_DSP_DEFAULTPRIORITY_CLEARUNIT 0 // DSP CLEAR unit - done first
#define FSOUND_DSP_DEFAULTPRIORITY_SFXUNIT 100 // DSP SFX unit - done second
#define FSOUND_DSP_DEFAULTPRIORITY_MUSICUNIT 200 // DSP MUSIC unit - done third
#define FSOUND_DSP_DEFAULTPRIORITY_USER 300 // User priority, use this as reference
#define FSOUND_DSP_DEFAULTPRIORITY_CLIPANDCOPYUNIT 1000 // DSP CLIP AND COPY unit - last
// [DEFINE_END]
/*
[DEFINE_START]
[
[NAME]
FSOUND_CAPS
[DESCRIPTION]
Driver description bitfields. Use FSOUND_Driver_GetCaps to determine if a driver enumerated
has the settings you are after. The enumerated driver depends on the output mode, see
FSOUND_OUTPUTTYPES
[SEE_ALSO]
FSOUND_GetDriverCaps
FSOUND_OUTPUTTYPES
]
*/
#define FSOUND_CAPS_HARDWARE 0x1 // This driver supports hardware accelerated 3d sound.
#define FSOUND_CAPS_EAX 0x2 // This driver supports EAX reverb
#define FSOUND_CAPS_GEOMETRY_OCCLUSIONS 0x4 // This driver supports (A3D) geometry occlusions
#define FSOUND_CAPS_GEOMETRY_REFLECTIONS 0x8 // This driver supports (A3D) geometry reflections
#define FSOUND_CAPS_EAX2 0x10 // This driver supports EAX2/A3D3 reverb
// [DEFINE_END]
/*
[DEFINE_START]
[
[NAME]
FSOUND_MODES
[DESCRIPTION]
Sample description bitfields, OR them together for loading and describing samples.
]
*/
#define FSOUND_LOOP_OFF 0x01 // For non looping samples.
#define FSOUND_LOOP_NORMAL 0x02 // For forward looping samples.
#define FSOUND_LOOP_BIDI 0x04 // For bidirectional looping samples. (no effect if in hardware).
#define FSOUND_8BITS 0x08 // For 8 bit samples.
#define FSOUND_16BITS 0x10 // For 16 bit samples.
#define FSOUND_MONO 0x20 // For mono samples.
#define FSOUND_STEREO 0x40 // For stereo samples.
#define FSOUND_UNSIGNED 0x80 // For source data containing unsigned samples.
#define FSOUND_SIGNED 0x100 // For source data containing signed data.
#define FSOUND_DELTA 0x200 // For source data stored as delta values.
#define FSOUND_IT214 0x400 // For source data stored using IT214 compression.
#define FSOUND_IT215 0x800 // For source data stored using IT215 compression.
#define FSOUND_HW3D 0x1000 // Attempts to make samples use 3d hardware acceleration. (if the card supports it)
#define FSOUND_2D 0x2000 // Ignores any 3d processing. overrides FSOUND_HW3D. Located in software.
#define FSOUND_STREAMABLE 0x4000 // For realtime streamable samples. If you dont supply this sound may come out corrupted.
// Default sample type. Loop off, 8bit mono, signed, not hardware accelerated.
// Some API functions ignore 8bits and mono, as it may be an mpeg or wav which has its format predetermined.
#define FSOUND_NORMAL (FSOUND_LOOP_OFF | FSOUND_8BITS | FSOUND_MONO)
// [DEFINE_END]
/*
[DEFINE_START]
[
[NAME]
FSOUND_CDPLAYMODES
[DESCRIPTION]
Playback method for a CD Audio track, using FSOUND_CD_Play
[SEE_ALSO]
FSOUND_CD_Play
]
*/
#define FSOUND_CD_PLAYCONTINUOUS 0 // Starts from the current track and plays to end of CD.
#define FSOUND_CD_PLAYONCE 1 // Plays the specified track then stops.
#define FSOUND_CD_PLAYLOOPED 2 // Plays the specified track looped, forever until stopped manually.
#define FSOUND_CD_PLAYRANDOM 3 // Plays tracks in random order
// [DEFINE_END]
/*
[DEFINE_START]
[
[NAME]
FSOUND_SAMPLEMODE
[DESCRIPTION]
Misccellaneous values for FMOD functions.
[SEE_ALSO]
FSOUND_PlaySound
FSOUND_PlaySoundAttrib
FSOUND_3D_PlaySound
FSOUND_Sample_Alloc
FSOUND_Sample_LoadWav
FSOUND_Sample_LoadMpeg
FSOUND_Sample_LoadRaw
FSOUND_Sample_LoadWavMemory
FSOUND_Sample_LoadMpegMemory
FSOUND_SetPan
]
*/
#define FSOUND_FREE -1 // value to play on any free channel, or to allocate a sample in a free sample slot.
#define FSOUND_UNMANAGED -2 // value to allocate a sample that is NOT managed by FSOUND or placed in a sample slot.
#define FSOUND_STEREOPAN -1 // value for FSOUND_SetPan so that stereo sounds are not played at half volume. See FSOUND_SetPan for more on this.
// [DEFINE_END]
/*
[ENUM]
[
[DESCRIPTION]
These are environment types defined for use with the FSOUND_Reverb API.
[SEE_ALSO]
FSOUND_Reverb_SetEnvironment
FSOUND_Reverb_SetEnvironmentAdvanced
]
*/
enum FSOUND_REVERB_ENVIRONMENTS
{
FSOUND_ENVIRONMENT_GENERIC,
FSOUND_ENVIRONMENT_PADDEDCELL,
FSOUND_ENVIRONMENT_ROOM,
FSOUND_ENVIRONMENT_BATHROOM,
FSOUND_ENVIRONMENT_LIVINGROOM,
FSOUND_ENVIRONMENT_STONEROOM,
FSOUND_ENVIRONMENT_AUDITORIUM,
FSOUND_ENVIRONMENT_CONCERTHALL,
FSOUND_ENVIRONMENT_CAVE,
FSOUND_ENVIRONMENT_ARENA,
FSOUND_ENVIRONMENT_HANGAR,
FSOUND_ENVIRONMENT_CARPETEDHALLWAY,
FSOUND_ENVIRONMENT_HALLWAY,
FSOUND_ENVIRONMENT_STONECORRIDOR,
FSOUND_ENVIRONMENT_ALLEY,
FSOUND_ENVIRONMENT_FOREST,
FSOUND_ENVIRONMENT_CITY,
FSOUND_ENVIRONMENT_MOUNTAINS,
FSOUND_ENVIRONMENT_QUARRY,
FSOUND_ENVIRONMENT_PLAIN,
FSOUND_ENVIRONMENT_PARKINGLOT,
FSOUND_ENVIRONMENT_SEWERPIPE,
FSOUND_ENVIRONMENT_UNDERWATER,
FSOUND_ENVIRONMENT_DRUGGED,
FSOUND_ENVIRONMENT_DIZZY,
FSOUND_ENVIRONMENT_PSYCHOTIC,
FSOUND_ENVIRONMENT_COUNT
};
/*
[DEFINE_START]
[
[NAME]
FSOUND_REVERBMIX_USEDISTANCE
[DESCRIPTION]
Used with FSOUND_Reverb_SetMix, this setting allows reverb to attenuate based on distance from the listener.
Instead of hard coding a value with FSOUND_Reverb_SetMix, this value can be used instead, for a more natural
reverb dropoff.
[SEE_ALSO]
FSOUND_Reverb_SetMix
]
*/
#define FSOUND_REVERBMIX_USEDISTANCE -1.0f // used with FSOUND_Reverb_SetMix to scale reverb by distance
// [DEFINE_END]
/*
[DEFINE_START]
[
[NAME]
FSOUND_REVERB_IGNOREPARAM
[DESCRIPTION]
Used with FSOUND_Reverb_SetEnvironment and FSOUND_Reverb_SetEnvironmentAdvanced, this can
be placed in the place of a specific parameter for the reverb setting. It allows you to
not set any parameters except the ones you are interested in .. and example would be this.
FSOUND_Reverb_SetEnvironment(FSOUND_REVERB_IGNOREPARAM,
FSOUND_REVERB_IGNOREPARAM,
FSOUND_REVERB_IGNOREPARAM,
0.0f);
This means env, vol and decay are left alone, but 'damp' is set to 0.
[SEE_ALSO]
FSOUND_Reverb_SetEnvironment
FSOUND_Reverb_SetEnvironmentAdvanced
]
*/
#define FSOUND_REVERB_IGNOREPARAM -9999999 // used with FSOUND_Reverb_SetEnvironmentAdvanced to ignore certain parameters by choice.
// [DEFINE_END]
/*
[DEFINE_START]
[
[NAME]
FSOUND_REVERB_PRESETS
[DESCRIPTION]
A set of predefined environment PARAMETERS, created by Creative Labs
These can be placed directly into the FSOUND_Reverb_SetEnvironment call
[SEE_ALSO]
FSOUND_Reverb_SetEnvironment
]
*/
#define FSOUND_PRESET_GENERIC FSOUND_ENVIRONMENT_GENERIC,0.5f, 1.493f, 0.5f
#define FSOUND_PRESET_PADDEDCELL FSOUND_ENVIRONMENT_PADDEDCELL,0.25f, 0.1f, 0.0f
#define FSOUND_PRESET_ROOM FSOUND_ENVIRONMENT_ROOM,0.417f, 0.4f, 0.666f
#define FSOUND_PRESET_BATHROOM FSOUND_ENVIRONMENT_BATHROOM,0.653f, 1.499f, 0.166f
#define FSOUND_PRESET_LIVINGROOM FSOUND_ENVIRONMENT_LIVINGROOM,0.208f, 0.478f, 0.0f
#define FSOUND_PRESET_STONEROOM FSOUND_ENVIRONMENT_STONEROOM,0.5f, 2.309f, 0.888f
#define FSOUND_PRESET_AUDITORIUM FSOUND_ENVIRONMENT_AUDITORIUM,0.403f, 4.279f, 0.5f
#define FSOUND_PRESET_CONCERTHALL FSOUND_ENVIRONMENT_CONCERTHALL,0.5f, 3.961f, 0.5f
#define FSOUND_PRESET_CAVE FSOUND_ENVIRONMENT_CAVE,0.5f, 2.886f, 1.304f
#define FSOUND_PRESET_ARENA FSOUND_ENVIRONMENT_ARENA,0.361f, 7.284f, 0.332f
#define FSOUND_PRESET_HANGAR FSOUND_ENVIRONMENT_HANGAR,0.5f, 10.0f, 0.3f
#define FSOUND_PRESET_CARPETEDHALLWAY FSOUND_ENVIRONMENT_CARPETEDHALLWAY,0.153f, 0.259f, 2.0f
#define FSOUND_PRESET_HALLWAY FSOUND_ENVIRONMENT_HALLWAY,0.361f, 1.493f, 0.0f
#define FSOUND_PRESET_STONECORRIDOR FSOUND_ENVIRONMENT_STONECORRIDOR,0.444f, 2.697f, 0.638f
#define FSOUND_PRESET_ALLEY FSOUND_ENVIRONMENT_ALLEY,0.25f, 1.752f, 0.776f
#define FSOUND_PRESET_FOREST FSOUND_ENVIRONMENT_FOREST,0.111f, 3.145f, 0.472f
#define FSOUND_PRESET_CITY FSOUND_ENVIRONMENT_CITY,0.111f, 2.767f, 0.224f
#define FSOUND_PRESET_MOUNTAINS FSOUND_ENVIRONMENT_MOUNTAINS,0.194f, 7.841f, 0.472f
#define FSOUND_PRESET_QUARRY FSOUND_ENVIRONMENT_QUARRY,1.0f, 1.499f, 0.5f
#define FSOUND_PRESET_PLAIN FSOUND_ENVIRONMENT_PLAIN,0.097f, 2.767f, 0.224f
#define FSOUND_PRESET_PARKINGLOT FSOUND_ENVIRONMENT_PARKINGLOT,0.208f, 1.652f, 1.5f
#define FSOUND_PRESET_SEWERPIPE FSOUND_ENVIRONMENT_SEWERPIPE,0.652f, 2.886f, 0.25f
#define FSOUND_PRESET_UNDERWATER FSOUND_ENVIRONMENT_UNDERWATER,1.0f, 1.499f, 0.0f
#define FSOUND_PRESET_DRUGGED FSOUND_ENVIRONMENT_DRUGGED,0.875f, 8.392f, 1.388f
#define FSOUND_PRESET_DIZZY FSOUND_ENVIRONMENT_DIZZY,0.139f, 17.234f, 0.666f
#define FSOUND_PRESET_PSYCHOTIC FSOUND_ENVIRONMENT_PSYCHOTIC,0.486f, 7.563f, 0.806f
// [DEFINE_END]
/*
[DEFINE_START]
[
[NAME]
FSOUND_GEOMETRY_MODES
[DESCRIPTION]
Geometry flags, used as the mode flag in FSOUND_Geometry_AddPolygon
[SEE_ALSO]
FSOUND_Geometry_AddPolygon
]
*/
#define FSOUND_GEOMETRY_NORMAL 0x0 // Default geometry type. Occluding polygon
#define FSOUND_GEOMETRY_REFLECTIVE 0x01 // This polygon is reflective
#define FSOUND_GEOMETRY_OPENING 0x02 // Overlays a transparency over the previous polygon. The 'openingfactor' value supplied is copied internally.
#define FSOUND_GEOMETRY_OPENING_REFERENCE 0x04 // Overlays a transparency over the previous polygon. The 'openingfactor' supplied is pointed to (for access when building a list)
// [DEFINE_END]
//===============================================================================================
//= FUNCTION PROTOTYPES
//===============================================================================================
#ifdef __cplusplus
extern "C" {
#endif
// ==================================
// Initialization / Global functions.
// ==================================
// Pre FSOUND_Init functions. These can't be called after FSOUND_Init is called (they will fail)
// They set up FMOD system functionality.
DLL_API signed char F_API _FSOUND_SetOutput(int outputtype);
DLL_API signed char F_API _FSOUND_SetDriver(int driver);
DLL_API signed char F_API FSOUND_SetMixer(int mixer);
DLL_API signed char F_API FSOUND_SetBufferSize(int len_ms);
DLL_API signed char F_API FSOUND_SetHWND(void *hwnd);
DLL_API signed char F_API FSOUND_SetMinHardwareChannels(int min);
DLL_API signed char F_API FSOUND_SetMaxHardwareChannels(int max);
// Main initialization / closedown functions
DLL_API signed char F_API _FSOUND_Init(int mixrate, int maxsoftwarechannels, int vcmmode);
DLL_API void F_API _FSOUND_Close();
// Runtime
DLL_API void F_API FSOUND_SetSFXMasterVolume(int volume);
DLL_API void F_API FSOUND_SetPanSeperation(float pansep);
// Error functions
DLL_API int F_API _FSOUND_GetError();
// ===================================
// Sample management / load functions.
// ===================================
// File functions
DLL_API FSOUND_SAMPLE * F_API FSOUND_Sample_LoadWav(int index, char *filename, unsigned int mode);
DLL_API FSOUND_SAMPLE * F_API FSOUND_Sample_LoadMpeg(int index, char *filename, unsigned int mode);
DLL_API FSOUND_SAMPLE * F_API FSOUND_Sample_LoadRaw(int index, char *filename, unsigned int mode);
DLL_API FSOUND_SAMPLE * F_API FSOUND_Sample_LoadWavMemory(int index, void *data, unsigned int mode, int length);
DLL_API FSOUND_SAMPLE * F_API FSOUND_Sample_LoadMpegMemory(int index, void *data, unsigned int mode, int length);
// Sample management functions
DLL_API FSOUND_SAMPLE * F_API FSOUND_Sample_Alloc(int index, int length, unsigned int mode, int deffreq, int defvol, int defpan, int defpri);
DLL_API void F_API FSOUND_Sample_Free(FSOUND_SAMPLE *sptr);
DLL_API signed char F_API FSOUND_Sample_Upload(FSOUND_SAMPLE *sptr, void *srcdata, unsigned int mode);
DLL_API signed char F_API FSOUND_Sample_Lock(FSOUND_SAMPLE *sptr, int offset, int length, void **ptr1, void **ptr2, unsigned int *len1, unsigned int *len2);
DLL_API signed char F_API FSOUND_Sample_Unlock(FSOUND_SAMPLE *sptr, void *ptr1, void *ptr2, unsigned int len1, unsigned int len2);
// Sample control functions
DLL_API signed char F_API FSOUND_Sample_SetLoopMode(FSOUND_SAMPLE *sptr, unsigned int loopmode);
DLL_API signed char F_API FSOUND_Sample_SetLoopPoints(FSOUND_SAMPLE *sptr, int loopstart, int loopend);
DLL_API signed char F_API FSOUND_Sample_SetDefaults(FSOUND_SAMPLE *sptr, int deffreq, int defvol, int defpan, int defpri);
DLL_API signed char F_API FSOUND_Sample_SetMinMaxDistance(FSOUND_SAMPLE *sptr, float min, float max);
// ============================
// Channel control functions.
// ============================
// Playing and stopping sounds.
DLL_API int F_API FSOUND_PlaySound(int channel, FSOUND_SAMPLE *sptr);
DLL_API int F_API FSOUND_PlaySoundAttrib(int channel, FSOUND_SAMPLE *sptr, int freq, int vol, int pan);
DLL_API int F_API FSOUND_3D_PlaySound(int channel, FSOUND_SAMPLE *sptr, float *pos, float *vel);
DLL_API signed char F_API FSOUND_StopSound(int channel);
DLL_API void F_API FSOUND_StopAllChannels();
// Functions to control playback of a channel.
DLL_API signed char F_API FSOUND_SetFrequency(int channel, int freq);
DLL_API signed char F_API FSOUND_SetVolume(int channel, int vol);
DLL_API signed char F_API FSOUND_SetVolumeAbsolute(int channel, int vol);
DLL_API signed char F_API FSOUND_SetPan(int channel, int pan);
DLL_API signed char F_API FSOUND_SetSurround(int channel, signed char surround);
DLL_API signed char F_API FSOUND_SetMute(int channel, signed char mute);
DLL_API signed char F_API FSOUND_SetPriority(int channel, int priority);
DLL_API signed char F_API FSOUND_SetReserved(int channel, signed char reserved);
DLL_API signed char F_API FSOUND_SetPaused(int channel, signed char paused);
DLL_API signed char F_API FSOUND_MixBuffers(void *destbuffer, void *srcbuffer, int len, int freq, int vol, int pan, unsigned int mode);
// ================================
// Information retrieval functions.
// ================================
// System information
DLL_API float F_API _FSOUND_GetVersion();
DLL_API int F_API FSOUND_GetOutput();
DLL_API int F_API FSOUND_GetDriver();
DLL_API int F_API FSOUND_GetMixer();
DLL_API int F_API _FSOUND_GetNumDrivers();
DLL_API signed char * F_API FSOUND_GetDriverName(int id);
DLL_API signed char F_API FSOUND_GetDriverCaps(int id, unsigned int *caps);
DLL_API int F_API FSOUND_GetOutputRate();
DLL_API int F_API FSOUND_GetMaxChannels();
DLL_API int F_API FSOUND_GetMaxSamples();
DLL_API int F_API FSOUND_GetSFXMasterVolume();
DLL_API int F_API FSOUND_GetNumHardwareChannels();
DLL_API int F_API FSOUND_GetChannelsPlaying();
DLL_API float F_API FSOUND_GetCPUUsage();
// Channel information
DLL_API signed char F_API FSOUND_IsPlaying(int channel);
DLL_API int F_API FSOUND_GetFrequency(int channel);
DLL_API int F_API FSOUND_GetVolume(int channel);
DLL_API int F_API FSOUND_GetPan(int channel);
DLL_API signed char F_API FSOUND_GetSurround(int channel);
DLL_API signed char F_API FSOUND_GetMute(int channel);
DLL_API int F_API FSOUND_GetPriority(int channel);
DLL_API signed char F_API FSOUND_GetReserved(int channel);
DLL_API signed char F_API FSOUND_GetPaused(int channel);
DLL_API unsigned int F_API FSOUND_GetCurrentPosition(int channel);
DLL_API FSOUND_SAMPLE * F_API FSOUND_GetCurrentSample(int channel);
DLL_API float F_API FSOUND_GetCurrentVU(int channel);
// Sample information
DLL_API FSOUND_SAMPLE * F_API FSOUND_Sample_Get(int sampno);
DLL_API unsigned int F_API FSOUND_Sample_GetLength(FSOUND_SAMPLE *sptr);
DLL_API signed char F_API FSOUND_Sample_GetLoopPoints(FSOUND_SAMPLE *sptr, int *loopstart, int *loopend);
DLL_API signed char F_API FSOUND_Sample_GetDefaults(FSOUND_SAMPLE *sptr, int *deffreq, int *defvol, int *defpan, int *defpri);
DLL_API unsigned int F_API FSOUND_Sample_GetMode(FSOUND_SAMPLE *sptr);
// ===================
// 3D sound functions.
// ===================
// see also FSOUND_3D_PlaySound (above)
// see also FSOUND_Sample_SetMinMaxDistance (above)
DLL_API void F_API FSOUND_3D_Update();
DLL_API signed char F_API FSOUND_3D_SetAttributes(int channel, float *pos, float *vel);
DLL_API signed char F_API FSOUND_3D_GetAttributes(int channel, float *pos, float *vel);
DLL_API void F_API FSOUND_3D_Listener_SetAttributes(float *pos, float *vel, float fx, float fy, float fz, float tx, float ty, float tz);
DLL_API void F_API FSOUND_3D_Listener_GetAttributes(float *pos, float *vel, float *fx, float *fy, float *fz, float *tx, float *ty, float *tz);
DLL_API void F_API FSOUND_3D_Listener_SetDopplerFactor(float scale);
DLL_API void F_API FSOUND_3D_Listener_SetDistanceFactor(float scale);
DLL_API void F_API FSOUND_3D_Listener_SetRolloffFactor(float scale);
// ===================
// Geometry functions.
// ===================
// scene/polygon functions
DLL_API signed char F_API FSOUND_Geometry_AddPolygon(float *p1, float *p2, float *p3, float *p4, float *normal, unsigned int mode, float *openingfactor);
DLL_API int F_API FSOUND_Geometry_AddList(FSOUND_GEOMLIST *geomlist);
// polygon list functions
DLL_API FSOUND_GEOMLIST* F_API FSOUND_Geometry_List_Create(signed char boundingvolume);
DLL_API signed char F_API FSOUND_Geometry_List_Free(FSOUND_GEOMLIST *geomlist);
DLL_API signed char F_API FSOUND_Geometry_List_Begin(FSOUND_GEOMLIST *geomlist);
DLL_API signed char F_API FSOUND_Geometry_List_End(FSOUND_GEOMLIST *geomlist);
DLL_API signed char F_API FSOUND_Geometry_List_Add(FSOUND_GEOMLIST *geomlist);
// material functions
DLL_API FSOUND_MATERIAL* F_API FSOUND_Geometry_Material_Create();
DLL_API signed char F_API FSOUND_Geometry_Material_Free(FSOUND_MATERIAL *material);
DLL_API signed char F_API FSOUND_Geometry_Material_SetAttributes(FSOUND_MATERIAL *material, float reflectancegain, float reflectancefreq, float transmittancegain, float transmittancefreq);
DLL_API signed char F_API FSOUND_Geometry_Material_GetAttributes(FSOUND_MATERIAL *material, float *reflectancegain, float *reflectancefreq, float *transmittancegain, float *transmittancefreq);
DLL_API signed char F_API FSOUND_Geometry_Material_Set(FSOUND_MATERIAL *material);
// occlusion (supported in software, eax, eax2, a3d3)
DLL_API signed char F_API FSOUND_Geometry_SetOcclusionFactor(float factor);
// ==============================================
// Reverb functions. (eax, eax2, a3d 3.0 reverb)
// ==============================================
// eax1, eax2, a3d 3.0 (use FSOUND_REVERB_PRESETS if you like), (eax2 support through emulation/parameter conversion)
DLL_API signed char F_API FSOUND_Reverb_SetEnvironment(int env, float vol, float decay, float damp);
// eax2, a3d 3.0 only, does not work on eax1
DLL_API signed char F_API FSOUND_Reverb_SetEnvironmentAdvanced(
int env,
int Room, // [-10000, 0] default: -10000 mB or use FSOUND_REVERB_IGNOREPARAM
int RoomHF, // [-10000, 0] default: 0 mB or use FSOUND_REVERB_IGNOREPARAM
float RoomRolloffFactor, // [0.0, 10.0] default: 0.0 or use FSOUND_REVERB_IGNOREPARAM
float DecayTime, // [0.1, 20.0] default: 1.0 s or use FSOUND_REVERB_IGNOREPARAM
float DecayHFRatio, // [0.1, 2.0] default: 0.5 or use FSOUND_REVERB_IGNOREPARAM
int Reflections, // [-10000, 1000] default: -10000 mB or use FSOUND_REVERB_IGNOREPARAM
float ReflectionsDelay, // [0.0, 0.3] default: 0.02 s or use FSOUND_REVERB_IGNOREPARAM
int Reverb, // [-10000, 2000] default: -10000 mB or use FSOUND_REVERB_IGNOREPARAM
float ReverbDelay, // [0.0, 0.1] default: 0.04 s or use FSOUND_REVERB_IGNOREPARAM
float EnvironmentSize, // [0.0, 100.0] default: 100.0 % or use FSOUND_REVERB_IGNOREPARAM
float EnvironmentDiffusion, // [0.0, 100.0] default: 100.0 % or use FSOUND_REVERB_IGNOREPARAM
float AirAbsorptionHF); // [20.0, 20000.0] default: 5000.0 Hz or use FSOUND_REVERB_IGNOREPARAM
DLL_API signed char F_API FSOUND_Reverb_SetMix(int channel, float mix);
// information functions
DLL_API signed char F_API FSOUND_Reverb_GetEnvironment(int *env, float *vol, float *decay, float *damp);
DLL_API signed char F_API FSOUND_Reverb_GetEnvironmentAdvanced(
int *env,
int *Room,
int *RoomHF,
float *RoomRolloffFactor,
float *DecayTime,
float *DecayHFRatio,
int *Reflections,
float *ReflectionsDelay,
int *Reverb,
float *ReverbDelay,
float *EnvironmentSize,
float *EnvironmentDiffusion,
float *AirAbsorptionHF);
DLL_API signed char F_API FSOUND_Reverb_GetlMix(int channel, float *mix);
// =========================
// File Streaming functions.
// =========================
DLL_API FSOUND_STREAM * F_API _FSOUND_Stream_Create(FSOUND_STREAMCALLBACK callback, int length, unsigned int mode, int samplerate, int userdata);
DLL_API FSOUND_STREAM * F_API _FSOUND_Stream_Open(char *filename, unsigned int mode, int samplerate);
DLL_API FSOUND_STREAM * F_API _FSOUND_Stream_OpenWav(char *filename, unsigned int mode);
DLL_API FSOUND_STREAM * F_API _FSOUND_Stream_OpenMpeg(char *filename, unsigned int mode);
DLL_API int F_API _FSOUND_Stream_Play(int channel, FSOUND_STREAM *stream);
DLL_API signed char F_API _FSOUND_Stream_Stop(FSOUND_STREAM *stream);
DLL_API signed char F_API _FSOUND_Stream_Close(FSOUND_STREAM *stream);
DLL_API signed char F_API FSOUND_Stream_SetPaused(FSOUND_STREAM *stream, signed char paused);
DLL_API signed char F_API FSOUND_Stream_GetPaused(FSOUND_STREAM *stream);
DLL_API signed char F_API FSOUND_Stream_SetPosition(FSOUND_STREAM *stream, int position);
DLL_API int F_API FSOUND_Stream_GetPosition(FSOUND_STREAM *stream);
/*;;;;*/DLL_API int F_API _FSOUND_Stream_GetTime(FSOUND_STREAM *stream);
DLL_API int F_API FSOUND_Stream_GetLength(FSOUND_STREAM *stream);
// ===================
// CD audio functions.
// ===================
DLL_API signed char F_API FSOUND_CD_Play(int track);
DLL_API void F_API FSOUND_CD_SetPlayMode(signed char mode);
DLL_API signed char F_API FSOUND_CD_Stop();
DLL_API signed char F_API FSOUND_CD_SetPaused(signed char paused);
DLL_API signed char F_API FSOUND_CD_GetPaused();
DLL_API int F_API FSOUND_CD_GetTrack();
DLL_API int F_API FSOUND_CD_GetNumTracks();
DLL_API signed char F_API FSOUND_CD_Eject();
// ==============
// DSP functions.
// ==============
// DSP Unit control and information functions.
DLL_API FSOUND_DSPUNIT *F_API FSOUND_DSP_Create(FSOUND_DSPCALLBACK callback, int priority, int param);
DLL_API void F_API FSOUND_DSP_Free(FSOUND_DSPUNIT *unit);
DLL_API void F_API FSOUND_DSP_SetPriority(FSOUND_DSPUNIT *unit, int priority);
DLL_API int F_API FSOUND_DSP_GetPriority(FSOUND_DSPUNIT *unit);
DLL_API void F_API FSOUND_DSP_SetActive(FSOUND_DSPUNIT *unit, signed char active);
DLL_API signed char F_API FSOUND_DSP_GetActive(FSOUND_DSPUNIT *unit);
// Functions to get hold of FSOUND 'system DSP unit' handles.
DLL_API FSOUND_DSPUNIT *F_API FSOUND_DSP_GetClearUnit();
DLL_API FSOUND_DSPUNIT *F_API FSOUND_DSP_GetSFXUnit();
DLL_API FSOUND_DSPUNIT *F_API FSOUND_DSP_GetMusicUnit();
DLL_API FSOUND_DSPUNIT *F_API FSOUND_DSP_GetClipAndCopyUnit();
// misc DSP functions
DLL_API void F_API FSOUND_DSP_ClearMixBuffer();
DLL_API int F_API FSOUND_DSP_GetBufferLength();
// =========================
// Recording functions
// =========================
// recording initialization
DLL_API signed char F_API FSOUND_Record_SetDriver(int outputtype);
// information functions.
DLL_API int F_API FSOUND_Record_GetNumDrivers();
DLL_API signed char * F_API FSOUND_Record_GetDriverName(int id);
DLL_API int F_API FSOUND_Record_GetDriver();
// recording functionality. Only one recording session will work at a time
DLL_API signed char F_API FSOUND_Record_StartSample(FSOUND_SAMPLE *sptr, signed char loop);// record to sample
DLL_API signed char F_API FSOUND_Record_Stop(); // stop recording
DLL_API int F_API FSOUND_Record_GetPosition(); // offset in sample, or wav file
// =========================
// File system override
// =========================
DLL_API void F_API FSOUND_File_SetCallbacks(unsigned int (*OpenCallback)(char *name),
void (*CloseCallback)(unsigned int handle),
int (*ReadCallback)(void *buffer, int size, unsigned int handle),
void (*SeekCallback)(unsigned int handle, int pos, signed char mode),
int (*TellCallback)(unsigned int handle));
// =============================================================================================
// FMUSIC API
// =============================================================================================
// Song management / playback functions.
// =====================================
DLL_API FMUSIC_MODULE * F_API FMUSIC_LoadSong(char *name);
DLL_API FMUSIC_MODULE * F_API FMUSIC_LoadSongMemory(void *data, int length);
DLL_API signed char F_API FMUSIC_FreeSong(FMUSIC_MODULE *mod);
DLL_API signed char F_API FMUSIC_PlaySong(FMUSIC_MODULE *mod);
DLL_API signed char F_API FMUSIC_StopSong(FMUSIC_MODULE *mod);
DLL_API void F_API FMUSIC_StopAllSongs();
DLL_API signed char F_API FMUSIC_SetZxxCallback(FMUSIC_MODULE *mod, FMUSIC_CALLBACK callback);
DLL_API signed char F_API FMUSIC_SetRowCallback(FMUSIC_MODULE *mod, FMUSIC_CALLBACK callback, int rowstep);
DLL_API signed char F_API FMUSIC_SetOrderCallback(FMUSIC_MODULE *mod, FMUSIC_CALLBACK callback, int orderstep);
DLL_API signed char F_API FMUSIC_OptimizeChannels(FMUSIC_MODULE *mod, int maxchannels, int minvolume);
// Runtime song functions.
// =======================
DLL_API signed char F_API FMUSIC_SetOrder(FMUSIC_MODULE *mod, int order);
DLL_API signed char F_API FMUSIC_SetPaused(FMUSIC_MODULE *mod, signed char pause);
DLL_API signed char F_API FMUSIC_SetMasterVolume(FMUSIC_MODULE *mod, int volume);
DLL_API signed char F_API FMUSIC_SetPanSeperation(FMUSIC_MODULE *mod, float pansep);
// Static song information functions.
// ==================================
DLL_API char * F_API FMUSIC_GetName(FMUSIC_MODULE *mod);
DLL_API signed char F_API FMUSIC_GetType(FMUSIC_MODULE *mod);
DLL_API signed char F_API FMUSIC_UsesLinearFrequencies(FMUSIC_MODULE *mod);
DLL_API int F_API FMUSIC_GetNumOrders(FMUSIC_MODULE *mod);
DLL_API int F_API FMUSIC_GetNumPatterns(FMUSIC_MODULE *mod);
DLL_API int F_API FMUSIC_GetNumInstruments(FMUSIC_MODULE *mod);
DLL_API int F_API FMUSIC_GetNumSamples(FMUSIC_MODULE *mod);
DLL_API int F_API FMUSIC_GetNumChannels(FMUSIC_MODULE *mod);
DLL_API FSOUND_SAMPLE * F_API FMUSIC_GetSample(FMUSIC_MODULE *mod, int sampno);
DLL_API int F_API FMUSIC_GetPatternLength(FMUSIC_MODULE *mod, int orderno);
// Runtime song information.
// =========================
DLL_API signed char F_API FMUSIC_IsFinished(FMUSIC_MODULE *mod);
DLL_API signed char F_API FMUSIC_IsPlaying(FMUSIC_MODULE *mod);
DLL_API int F_API FMUSIC_GetMasterVolume(FMUSIC_MODULE *mod);
DLL_API int F_API FMUSIC_GetGlobalVolume(FMUSIC_MODULE *mod);
DLL_API int F_API FMUSIC_GetOrder(FMUSIC_MODULE *mod);
DLL_API int F_API FMUSIC_GetPattern(FMUSIC_MODULE *mod);
DLL_API int F_API FMUSIC_GetSpeed(FMUSIC_MODULE *mod);
DLL_API int F_API FMUSIC_GetBPM(FMUSIC_MODULE *mod);
DLL_API int F_API FMUSIC_GetRow(FMUSIC_MODULE *mod);
DLL_API signed char F_API FMUSIC_GetPaused(FMUSIC_MODULE *mod);
DLL_API unsigned int F_API FMUSIC_GetTime(FMUSIC_MODULE *mod);
#ifdef __cplusplus
}
#endif