aboutsummaryrefslogtreecommitdiffstats
path: root/al/eax/api.h
blob: 038fdf75912e656a0a1924ce83cef310c5e4c2df (plain)
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
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
1001
1002
1003
1004
1005
1006
1007
1008
1009
1010
1011
1012
1013
1014
1015
1016
1017
1018
1019
1020
1021
1022
1023
1024
1025
1026
1027
1028
1029
1030
1031
1032
1033
1034
1035
1036
1037
1038
1039
1040
1041
1042
1043
1044
1045
1046
1047
1048
1049
1050
1051
1052
1053
1054
1055
1056
1057
1058
1059
1060
1061
1062
1063
1064
1065
1066
1067
1068
1069
1070
1071
1072
1073
1074
1075
1076
1077
1078
1079
1080
1081
1082
1083
1084
1085
1086
1087
1088
1089
1090
1091
1092
1093
1094
1095
1096
1097
1098
1099
1100
1101
1102
1103
1104
1105
1106
1107
1108
1109
1110
1111
1112
1113
1114
1115
1116
1117
1118
1119
1120
1121
1122
1123
1124
1125
1126
1127
1128
1129
1130
1131
1132
1133
1134
1135
1136
1137
1138
1139
1140
1141
1142
1143
1144
1145
1146
1147
1148
1149
1150
1151
1152
1153
1154
1155
1156
1157
1158
1159
1160
1161
1162
1163
1164
1165
1166
1167
1168
1169
1170
1171
1172
1173
1174
1175
1176
1177
1178
1179
1180
1181
1182
1183
1184
1185
1186
1187
1188
1189
1190
1191
1192
1193
1194
1195
1196
1197
1198
1199
1200
1201
1202
1203
1204
1205
1206
1207
1208
1209
1210
1211
1212
1213
1214
1215
1216
1217
1218
1219
1220
1221
1222
1223
1224
1225
1226
1227
1228
1229
1230
1231
1232
1233
1234
1235
1236
1237
1238
1239
1240
1241
1242
1243
1244
1245
1246
1247
1248
1249
1250
1251
1252
1253
1254
1255
1256
1257
1258
1259
1260
1261
1262
1263
1264
1265
1266
1267
1268
1269
1270
1271
1272
1273
1274
1275
1276
1277
1278
1279
1280
1281
1282
1283
1284
1285
1286
1287
1288
1289
1290
1291
1292
1293
1294
1295
1296
1297
1298
1299
1300
1301
1302
1303
1304
1305
1306
1307
1308
1309
1310
1311
1312
1313
1314
1315
1316
1317
1318
1319
1320
1321
1322
1323
1324
1325
1326
1327
1328
1329
1330
1331
1332
1333
1334
1335
1336
1337
1338
1339
1340
1341
1342
1343
1344
1345
1346
1347
1348
1349
1350
1351
1352
1353
1354
1355
1356
1357
1358
1359
1360
1361
1362
1363
1364
1365
1366
1367
1368
1369
1370
1371
1372
1373
1374
1375
1376
1377
1378
1379
1380
1381
1382
1383
1384
1385
1386
1387
1388
1389
1390
1391
1392
1393
1394
1395
1396
1397
1398
1399
1400
1401
1402
1403
1404
1405
1406
1407
1408
1409
1410
1411
1412
1413
1414
1415
1416
1417
1418
1419
1420
1421
1422
1423
1424
1425
1426
1427
1428
1429
1430
1431
1432
1433
1434
1435
1436
1437
1438
1439
1440
1441
1442
1443
1444
1445
1446
1447
1448
1449
1450
1451
1452
1453
1454
1455
1456
1457
1458
1459
1460
1461
1462
1463
1464
1465
1466
1467
1468
1469
1470
1471
1472
1473
1474
1475
1476
1477
1478
1479
1480
1481
1482
1483
1484
1485
1486
1487
1488
1489
1490
1491
1492
1493
1494
1495
1496
1497
1498
1499
1500
1501
1502
1503
1504
1505
1506
1507
#ifndef EAX_API_INCLUDED
#define EAX_API_INCLUDED


//
// EAX API.
//
// Based on headers `eax[2-5].h` included in Doom 3 source code:
// https://github.com/id-Software/DOOM-3/tree/master/neo/openal/include
//


#include <array>
#include <cfloat>
#include <cstdint>
#include <cstring>
#ifdef _WIN32
#include <guiddef.h>
#endif

#include "AL/al.h"


#ifndef _WIN32
using GUID = struct _GUID {
    std::uint32_t Data1;
    std::uint16_t Data2;
    std::uint16_t Data3;
    std::array<std::uint8_t,8> Data4;
};

inline bool operator==(const GUID& lhs, const GUID& rhs) noexcept
{ return std::memcmp(&lhs, &rhs, sizeof(GUID)) == 0; }

inline bool operator!=(const GUID& lhs, const GUID& rhs) noexcept
{ return !(lhs == rhs); }
#endif // _WIN32

#define DECL_EQOP(T) \
friend bool operator==(const T &lhs, const T &rhs) noexcept { return std::memcmp(&lhs, &rhs, sizeof(T)) == 0;  } \
friend bool operator!=(const T &lhs, const T &rhs) noexcept { return !(lhs == rhs);  }

extern const GUID DSPROPSETID_EAX_ReverbProperties;

enum DSPROPERTY_EAX_REVERBPROPERTY : unsigned int {
    DSPROPERTY_EAX_ALL,
    DSPROPERTY_EAX_ENVIRONMENT,
    DSPROPERTY_EAX_VOLUME,
    DSPROPERTY_EAX_DECAYTIME,
    DSPROPERTY_EAX_DAMPING,
}; // DSPROPERTY_EAX_REVERBPROPERTY

struct EAX_REVERBPROPERTIES {
    unsigned long environment;
    float fVolume;
    float fDecayTime_sec;
    float fDamping;
}; // EAX_REVERBPROPERTIES


extern const GUID DSPROPSETID_EAXBUFFER_ReverbProperties;

enum DSPROPERTY_EAXBUFFER_REVERBPROPERTY : unsigned int {
    DSPROPERTY_EAXBUFFER_ALL,
    DSPROPERTY_EAXBUFFER_REVERBMIX,
}; // DSPROPERTY_EAXBUFFER_REVERBPROPERTY

struct EAXBUFFER_REVERBPROPERTIES {
    float fMix;
};

constexpr auto EAX_BUFFER_MINREVERBMIX = 0.0F;
constexpr auto EAX_BUFFER_MAXREVERBMIX = 1.0F;
constexpr auto EAX_REVERBMIX_USEDISTANCE = -1.0F;


extern const GUID DSPROPSETID_EAX20_ListenerProperties;

enum DSPROPERTY_EAX20_LISTENERPROPERTY : unsigned int {
    DSPROPERTY_EAX20LISTENER_NONE,
    DSPROPERTY_EAX20LISTENER_ALLPARAMETERS,
    DSPROPERTY_EAX20LISTENER_ROOM,
    DSPROPERTY_EAX20LISTENER_ROOMHF,
    DSPROPERTY_EAX20LISTENER_ROOMROLLOFFFACTOR,
    DSPROPERTY_EAX20LISTENER_DECAYTIME,
    DSPROPERTY_EAX20LISTENER_DECAYHFRATIO,
    DSPROPERTY_EAX20LISTENER_REFLECTIONS,
    DSPROPERTY_EAX20LISTENER_REFLECTIONSDELAY,
    DSPROPERTY_EAX20LISTENER_REVERB,
    DSPROPERTY_EAX20LISTENER_REVERBDELAY,
    DSPROPERTY_EAX20LISTENER_ENVIRONMENT,
    DSPROPERTY_EAX20LISTENER_ENVIRONMENTSIZE,
    DSPROPERTY_EAX20LISTENER_ENVIRONMENTDIFFUSION,
    DSPROPERTY_EAX20LISTENER_AIRABSORPTIONHF,
    DSPROPERTY_EAX20LISTENER_FLAGS
}; // DSPROPERTY_EAX20_LISTENERPROPERTY

struct EAX20LISTENERPROPERTIES {
    long lRoom; // room effect level at low frequencies
    long lRoomHF; // room effect high-frequency level re. low frequency level
    float flRoomRolloffFactor; // like DS3D flRolloffFactor but for room effect
    float flDecayTime; // reverberation decay time at low frequencies
    float flDecayHFRatio; // high-frequency to low-frequency decay time ratio
    long lReflections; // early reflections level relative to room effect
    float flReflectionsDelay; // initial reflection delay time
    long lReverb; // late reverberation level relative to room effect
    float flReverbDelay; // late reverberation delay time relative to initial reflection
    unsigned long dwEnvironment; // sets all listener properties
    float flEnvironmentSize; // environment size in meters
    float flEnvironmentDiffusion; // environment diffusion
    float flAirAbsorptionHF; // change in level per meter at 5 kHz
    unsigned long dwFlags; // modifies the behavior of properties
}; // EAX20LISTENERPROPERTIES

enum : unsigned long {
    EAX2_ENVIRONMENT_GENERIC,
    EAX2_ENVIRONMENT_PADDEDCELL,
    EAX2_ENVIRONMENT_ROOM,
    EAX2_ENVIRONMENT_BATHROOM,
    EAX2_ENVIRONMENT_LIVINGROOM,
    EAX2_ENVIRONMENT_STONEROOM,
    EAX2_ENVIRONMENT_AUDITORIUM,
    EAX2_ENVIRONMENT_CONCERTHALL,
    EAX2_ENVIRONMENT_CAVE,
    EAX2_ENVIRONMENT_ARENA,
    EAX2_ENVIRONMENT_HANGAR,
    EAX2_ENVIRONMENT_CARPETEDHALLWAY,
    EAX2_ENVIRONMENT_HALLWAY,
    EAX2_ENVIRONMENT_STONECORRIDOR,
    EAX2_ENVIRONMENT_ALLEY,
    EAX2_ENVIRONMENT_FOREST,
    EAX2_ENVIRONMENT_CITY,
    EAX2_ENVIRONMENT_MOUNTAINS,
    EAX2_ENVIRONMENT_QUARRY,
    EAX2_ENVIRONMENT_PLAIN,
    EAX2_ENVIRONMENT_PARKINGLOT,
    EAX2_ENVIRONMENT_SEWERPIPE,
    EAX2_ENVIRONMENT_UNDERWATER,
    EAX2_ENVIRONMENT_DRUGGED,
    EAX2_ENVIRONMENT_DIZZY,
    EAX2_ENVIRONMENT_PSYCHOTIC,

    EAX2_ENVIRONMENT_COUNT,
};

constexpr auto EAX2LISTENERFLAGS_DECAYTIMESCALE = 0x00000001UL;
constexpr auto EAX2LISTENERFLAGS_REFLECTIONSSCALE = 0x00000002UL;
constexpr auto EAX2LISTENERFLAGS_REFLECTIONSDELAYSCALE = 0x00000004UL;
constexpr auto EAX2LISTENERFLAGS_REVERBSCALE = 0x00000008UL;
constexpr auto EAX2LISTENERFLAGS_REVERBDELAYSCALE = 0x00000010UL;
constexpr auto EAX2LISTENERFLAGS_DECAYHFLIMIT = 0x00000020UL;
constexpr auto EAX2LISTENERFLAGS_RESERVED = 0xFFFFFFC0UL;

constexpr auto EAX2LISTENER_MINROOM = -10'000L;
constexpr auto EAX2LISTENER_MAXROOM = 0L;
constexpr auto EAX2LISTENER_DEFAULTROOM = -1'000L;

constexpr auto EAX2LISTENER_MINROOMHF = -10'000L;
constexpr auto EAX2LISTENER_MAXROOMHF = 0L;
constexpr auto EAX2LISTENER_DEFAULTROOMHF = -100L;

constexpr auto EAX2LISTENER_MINROOMROLLOFFFACTOR = 0.0F;
constexpr auto EAX2LISTENER_MAXROOMROLLOFFFACTOR = 10.0F;
constexpr auto EAX2LISTENER_DEFAULTROOMROLLOFFFACTOR = 0.0F;

constexpr auto EAX2LISTENER_MINDECAYTIME = 0.1F;
constexpr auto EAX2LISTENER_MAXDECAYTIME = 20.0F;
constexpr auto EAX2LISTENER_DEFAULTDECAYTIME = 1.49F;

constexpr auto EAX2LISTENER_MINDECAYHFRATIO = 0.1F;
constexpr auto EAX2LISTENER_MAXDECAYHFRATIO = 2.0F;
constexpr auto EAX2LISTENER_DEFAULTDECAYHFRATIO = 0.83F;

constexpr auto EAX2LISTENER_MINREFLECTIONS = -10'000L;
constexpr auto EAX2LISTENER_MAXREFLECTIONS = 1'000L;
constexpr auto EAX2LISTENER_DEFAULTREFLECTIONS = -2'602L;

constexpr auto EAX2LISTENER_MINREFLECTIONSDELAY = 0.0F;
constexpr auto EAX2LISTENER_MAXREFLECTIONSDELAY = 0.3F;
constexpr auto EAX2LISTENER_DEFAULTREFLECTIONSDELAY = 0.007F;

constexpr auto EAX2LISTENER_MINREVERB = -10'000L;
constexpr auto EAX2LISTENER_MAXREVERB = 2'000L;
constexpr auto EAX2LISTENER_DEFAULTREVERB = 200L;

constexpr auto EAX2LISTENER_MINREVERBDELAY = 0.0F;
constexpr auto EAX2LISTENER_MAXREVERBDELAY = 0.1F;
constexpr auto EAX2LISTENER_DEFAULTREVERBDELAY = 0.011F;

constexpr auto EAX2LISTENER_MINENVIRONMENT = 0UL;
constexpr auto EAX2LISTENER_MAXENVIRONMENT = EAX2_ENVIRONMENT_COUNT - 1;
constexpr auto EAX2LISTENER_DEFAULTENVIRONMENT = EAX2_ENVIRONMENT_GENERIC;

constexpr auto EAX2LISTENER_MINENVIRONMENTSIZE = 1.0F;
constexpr auto EAX2LISTENER_MAXENVIRONMENTSIZE = 100.0F;
constexpr auto EAX2LISTENER_DEFAULTENVIRONMENTSIZE = 7.5F;

constexpr auto EAX2LISTENER_MINENVIRONMENTDIFFUSION = 0.0F;
constexpr auto EAX2LISTENER_MAXENVIRONMENTDIFFUSION = 1.0F;
constexpr auto EAX2LISTENER_DEFAULTENVIRONMENTDIFFUSION = 1.0F;

constexpr auto EAX2LISTENER_MINAIRABSORPTIONHF = -100.0F;
constexpr auto EAX2LISTENER_MAXAIRABSORPTIONHF = 0.0F;
constexpr auto EAX2LISTENER_DEFAULTAIRABSORPTIONHF = -5.0F;

constexpr auto EAX2LISTENER_DEFAULTFLAGS =
    EAX2LISTENERFLAGS_DECAYTIMESCALE |
    EAX2LISTENERFLAGS_REFLECTIONSSCALE |
    EAX2LISTENERFLAGS_REFLECTIONSDELAYSCALE |
    EAX2LISTENERFLAGS_REVERBSCALE |
    EAX2LISTENERFLAGS_REVERBDELAYSCALE |
    EAX2LISTENERFLAGS_DECAYHFLIMIT;


extern const GUID DSPROPSETID_EAX20_BufferProperties;

enum DSPROPERTY_EAX20_BUFFERPROPERTY : unsigned int {
    DSPROPERTY_EAX20BUFFER_NONE,
    DSPROPERTY_EAX20BUFFER_ALLPARAMETERS,
    DSPROPERTY_EAX20BUFFER_DIRECT,
    DSPROPERTY_EAX20BUFFER_DIRECTHF,
    DSPROPERTY_EAX20BUFFER_ROOM,
    DSPROPERTY_EAX20BUFFER_ROOMHF,
    DSPROPERTY_EAX20BUFFER_ROOMROLLOFFFACTOR,
    DSPROPERTY_EAX20BUFFER_OBSTRUCTION,
    DSPROPERTY_EAX20BUFFER_OBSTRUCTIONLFRATIO,
    DSPROPERTY_EAX20BUFFER_OCCLUSION,
    DSPROPERTY_EAX20BUFFER_OCCLUSIONLFRATIO,
    DSPROPERTY_EAX20BUFFER_OCCLUSIONROOMRATIO,
    DSPROPERTY_EAX20BUFFER_OUTSIDEVOLUMEHF,
    DSPROPERTY_EAX20BUFFER_AIRABSORPTIONFACTOR,
    DSPROPERTY_EAX20BUFFER_FLAGS
}; // DSPROPERTY_EAX20_BUFFERPROPERTY

struct EAX20BUFFERPROPERTIES {
    long lDirect; // direct path level
    long lDirectHF; // direct path level at high frequencies
    long lRoom; // room effect level
    long lRoomHF; // room effect level at high frequencies
    float flRoomRolloffFactor; // like DS3D flRolloffFactor but for room effect
    long lObstruction; // main obstruction control (attenuation at high frequencies) 
    float flObstructionLFRatio; // obstruction low-frequency level re. main control
    long lOcclusion; // main occlusion control (attenuation at high frequencies)
    float flOcclusionLFRatio; // occlusion low-frequency level re. main control
    float flOcclusionRoomRatio; // occlusion room effect level re. main control
    long lOutsideVolumeHF; // outside sound cone level at high frequencies
    float flAirAbsorptionFactor; // multiplies DSPROPERTY_EAXLISTENER_AIRABSORPTIONHF
    unsigned long dwFlags; // modifies the behavior of properties
}; // EAX20BUFFERPROPERTIES

extern const GUID DSPROPSETID_EAX30_ListenerProperties;

extern const GUID DSPROPSETID_EAX30_BufferProperties;


constexpr auto EAX_MAX_FXSLOTS = 4;

constexpr auto EAX40_MAX_ACTIVE_FXSLOTS = 2;
constexpr auto EAX50_MAX_ACTIVE_FXSLOTS = 4;


constexpr auto EAX_OK = 0L;
constexpr auto EAXERR_INVALID_OPERATION = -1L;
constexpr auto EAXERR_INVALID_VALUE = -2L;
constexpr auto EAXERR_NO_EFFECT_LOADED = -3L;
constexpr auto EAXERR_UNKNOWN_EFFECT = -4L;
constexpr auto EAXERR_INCOMPATIBLE_SOURCE_TYPE = -5L;
constexpr auto EAXERR_INCOMPATIBLE_EAX_VERSION = -6L;


extern const GUID EAX_NULL_GUID;

extern const GUID EAX_PrimaryFXSlotID;


struct EAXVECTOR {
    float x;
    float y;
    float z;
}; // EAXVECTOR

inline bool operator==(const EAXVECTOR& lhs, const EAXVECTOR& rhs) noexcept
{ return std::memcmp(&lhs, &rhs, sizeof(EAXVECTOR)) == 0; }

inline bool operator!=(const EAXVECTOR& lhs, const EAXVECTOR& rhs) noexcept
{ return !(lhs == rhs); }


extern const GUID EAXPROPERTYID_EAX40_Context;

extern const GUID EAXPROPERTYID_EAX50_Context;

// EAX50
constexpr auto HEADPHONES = 0UL;
constexpr auto SPEAKERS_2 = 1UL;
constexpr auto SPEAKERS_4 = 2UL;
constexpr auto SPEAKERS_5 = 3UL; // 5.1 speakers
constexpr auto SPEAKERS_6 = 4UL; // 6.1 speakers
constexpr auto SPEAKERS_7 = 5UL; // 7.1 speakers

constexpr auto EAXCONTEXT_MINSPEAKERCONFIG = HEADPHONES;
constexpr auto EAXCONTEXT_MAXSPEAKERCONFIG = SPEAKERS_7;

// EAX50
constexpr auto EAX_40 = 5UL; // EAX 4.0
constexpr auto EAX_50 = 6UL; // EAX 5.0

constexpr auto EAXCONTEXT_MINEAXSESSION = EAX_40;
constexpr auto EAXCONTEXT_MAXEAXSESSION = EAX_50;
constexpr auto EAXCONTEXT_DEFAULTEAXSESSION = EAX_40;

constexpr auto EAXCONTEXT_MINMAXACTIVESENDS = 2UL;
constexpr auto EAXCONTEXT_MAXMAXACTIVESENDS = 4UL;
constexpr auto EAXCONTEXT_DEFAULTMAXACTIVESENDS = 2UL;

// EAX50
struct EAXSESSIONPROPERTIES {
    unsigned long ulEAXVersion;
    unsigned long ulMaxActiveSends;
}; // EAXSESSIONPROPERTIES

enum EAXCONTEXT_PROPERTY : unsigned int {
    EAXCONTEXT_NONE = 0,
    EAXCONTEXT_ALLPARAMETERS,
    EAXCONTEXT_PRIMARYFXSLOTID,
    EAXCONTEXT_DISTANCEFACTOR,
    EAXCONTEXT_AIRABSORPTIONHF,
    EAXCONTEXT_HFREFERENCE,
    EAXCONTEXT_LASTERROR,

    // EAX50
    EAXCONTEXT_SPEAKERCONFIG,
    EAXCONTEXT_EAXSESSION,
    EAXCONTEXT_MACROFXFACTOR,
}; // EAXCONTEXT_PROPERTY

struct EAX40CONTEXTPROPERTIES {
    GUID guidPrimaryFXSlotID;
    float flDistanceFactor;
    float flAirAbsorptionHF;
    float flHFReference;
}; // EAX40CONTEXTPROPERTIES

struct EAX50CONTEXTPROPERTIES : public EAX40CONTEXTPROPERTIES {
    float flMacroFXFactor;
}; // EAX50CONTEXTPROPERTIES


constexpr auto EAXCONTEXT_MINDISTANCEFACTOR = FLT_MIN;
constexpr auto EAXCONTEXT_MAXDISTANCEFACTOR = FLT_MAX;
constexpr auto EAXCONTEXT_DEFAULTDISTANCEFACTOR = 1.0F;

constexpr auto EAXCONTEXT_MINAIRABSORPTIONHF = -100.0F;
constexpr auto EAXCONTEXT_MAXAIRABSORPTIONHF = 0.0F;
constexpr auto EAXCONTEXT_DEFAULTAIRABSORPTIONHF = -5.0F;

constexpr auto EAXCONTEXT_MINHFREFERENCE = 1000.0F;
constexpr auto EAXCONTEXT_MAXHFREFERENCE = 20000.0F;
constexpr auto EAXCONTEXT_DEFAULTHFREFERENCE = 5000.0F;

constexpr auto EAXCONTEXT_MINMACROFXFACTOR = 0.0F;
constexpr auto EAXCONTEXT_MAXMACROFXFACTOR = 1.0F;
constexpr auto EAXCONTEXT_DEFAULTMACROFXFACTOR = 0.0F;


extern const GUID EAXPROPERTYID_EAX40_FXSlot0;
extern const GUID EAXPROPERTYID_EAX50_FXSlot0;
extern const GUID EAXPROPERTYID_EAX40_FXSlot1;
extern const GUID EAXPROPERTYID_EAX50_FXSlot1;
extern const GUID EAXPROPERTYID_EAX40_FXSlot2;
extern const GUID EAXPROPERTYID_EAX50_FXSlot2;
extern const GUID EAXPROPERTYID_EAX40_FXSlot3;
extern const GUID EAXPROPERTYID_EAX50_FXSlot3;

extern const GUID EAX40CONTEXT_DEFAULTPRIMARYFXSLOTID;
extern const GUID EAX50CONTEXT_DEFAULTPRIMARYFXSLOTID;

enum EAXFXSLOT_PROPERTY : unsigned int {
    EAXFXSLOT_PARAMETER = 0,

    EAXFXSLOT_NONE = 0x10000,
    EAXFXSLOT_ALLPARAMETERS,
    EAXFXSLOT_LOADEFFECT,
    EAXFXSLOT_VOLUME,
    EAXFXSLOT_LOCK,
    EAXFXSLOT_FLAGS,

    // EAX50
    EAXFXSLOT_OCCLUSION,
    EAXFXSLOT_OCCLUSIONLFRATIO,
}; // EAXFXSLOT_PROPERTY

constexpr auto EAXFXSLOTFLAGS_ENVIRONMENT = 0x00000001UL;
// EAX50
constexpr auto EAXFXSLOTFLAGS_UPMIX = 0x00000002UL;

constexpr auto EAX40FXSLOTFLAGS_RESERVED = 0xFFFFFFFEUL; // reserved future use
constexpr auto EAX50FXSLOTFLAGS_RESERVED = 0xFFFFFFFCUL; // reserved future use


constexpr auto EAXFXSLOT_MINVOLUME = -10'000L;
constexpr auto EAXFXSLOT_MAXVOLUME = 0L;
constexpr auto EAXFXSLOT_DEFAULTVOLUME = 0L;

constexpr auto EAXFXSLOT_MINLOCK = 0L;
constexpr auto EAXFXSLOT_MAXLOCK = 1L;

enum : long {
    EAXFXSLOT_UNLOCKED = 0,
    EAXFXSLOT_LOCKED = 1
};

constexpr auto EAXFXSLOT_MINOCCLUSION = -10'000L;
constexpr auto EAXFXSLOT_MAXOCCLUSION = 0L;
constexpr auto EAXFXSLOT_DEFAULTOCCLUSION = 0L;

constexpr auto EAXFXSLOT_MINOCCLUSIONLFRATIO = 0.0F;
constexpr auto EAXFXSLOT_MAXOCCLUSIONLFRATIO = 1.0F;
constexpr auto EAXFXSLOT_DEFAULTOCCLUSIONLFRATIO = 0.25F;

constexpr auto EAX40FXSLOT_DEFAULTFLAGS = EAXFXSLOTFLAGS_ENVIRONMENT;

constexpr auto EAX50FXSLOT_DEFAULTFLAGS =
    EAXFXSLOTFLAGS_ENVIRONMENT |
    EAXFXSLOTFLAGS_UPMIX; // ignored for reverb;

struct EAX40FXSLOTPROPERTIES {
    GUID guidLoadEffect;
    long lVolume;
    long lLock;
    unsigned long ulFlags;
}; // EAX40FXSLOTPROPERTIES

struct EAX50FXSLOTPROPERTIES : public EAX40FXSLOTPROPERTIES {
    long lOcclusion;
    float flOcclusionLFRatio;
}; // EAX50FXSLOTPROPERTIES

extern const GUID EAXPROPERTYID_EAX40_Source;
extern const GUID EAXPROPERTYID_EAX50_Source;

// Source object properties
enum EAXSOURCE_PROPERTY : unsigned int {
    // EAX30
    EAXSOURCE_NONE,
    EAXSOURCE_ALLPARAMETERS,
    EAXSOURCE_OBSTRUCTIONPARAMETERS,
    EAXSOURCE_OCCLUSIONPARAMETERS,
    EAXSOURCE_EXCLUSIONPARAMETERS,
    EAXSOURCE_DIRECT,
    EAXSOURCE_DIRECTHF,
    EAXSOURCE_ROOM,
    EAXSOURCE_ROOMHF,
    EAXSOURCE_OBSTRUCTION,
    EAXSOURCE_OBSTRUCTIONLFRATIO,
    EAXSOURCE_OCCLUSION,
    EAXSOURCE_OCCLUSIONLFRATIO,
    EAXSOURCE_OCCLUSIONROOMRATIO,
    EAXSOURCE_OCCLUSIONDIRECTRATIO,
    EAXSOURCE_EXCLUSION,
    EAXSOURCE_EXCLUSIONLFRATIO,
    EAXSOURCE_OUTSIDEVOLUMEHF,
    EAXSOURCE_DOPPLERFACTOR,
    EAXSOURCE_ROLLOFFFACTOR,
    EAXSOURCE_ROOMROLLOFFFACTOR,
    EAXSOURCE_AIRABSORPTIONFACTOR,
    EAXSOURCE_FLAGS,

    // EAX40
    EAXSOURCE_SENDPARAMETERS,
    EAXSOURCE_ALLSENDPARAMETERS,
    EAXSOURCE_OCCLUSIONSENDPARAMETERS,
    EAXSOURCE_EXCLUSIONSENDPARAMETERS,
    EAXSOURCE_ACTIVEFXSLOTID,

    // EAX50
    EAXSOURCE_MACROFXFACTOR,
    EAXSOURCE_SPEAKERLEVELS,
    EAXSOURCE_ALL2DPARAMETERS,
}; // EAXSOURCE_PROPERTY


constexpr auto EAXSOURCEFLAGS_DIRECTHFAUTO = 0x00000001UL; // relates to EAXSOURCE_DIRECTHF
constexpr auto EAXSOURCEFLAGS_ROOMAUTO = 0x00000002UL; // relates to EAXSOURCE_ROOM
constexpr auto EAXSOURCEFLAGS_ROOMHFAUTO = 0x00000004UL; // relates to EAXSOURCE_ROOMHF
// EAX50
constexpr auto EAXSOURCEFLAGS_3DELEVATIONFILTER = 0x00000008UL;
constexpr auto EAXSOURCEFLAGS_UPMIX = 0x00000010UL;
constexpr auto EAXSOURCEFLAGS_APPLYSPEAKERLEVELS = 0x00000020UL;

constexpr auto EAX20SOURCEFLAGS_RESERVED = 0xFFFFFFF8UL; // reserved future use
constexpr auto EAX50SOURCEFLAGS_RESERVED = 0xFFFFFFC0UL; // reserved future use


constexpr auto EAXSOURCE_MINSEND = -10'000L;
constexpr auto EAXSOURCE_MAXSEND = 0L;
constexpr auto EAXSOURCE_DEFAULTSEND = 0L;

constexpr auto EAXSOURCE_MINSENDHF = -10'000L;
constexpr auto EAXSOURCE_MAXSENDHF = 0L;
constexpr auto EAXSOURCE_DEFAULTSENDHF = 0L;

constexpr auto EAXSOURCE_MINDIRECT = -10'000L;
constexpr auto EAXSOURCE_MAXDIRECT = 1'000L;
constexpr auto EAXSOURCE_DEFAULTDIRECT = 0L;

constexpr auto EAXSOURCE_MINDIRECTHF = -10'000L;
constexpr auto EAXSOURCE_MAXDIRECTHF = 0L;
constexpr auto EAXSOURCE_DEFAULTDIRECTHF = 0L;

constexpr auto EAXSOURCE_MINROOM = -10'000L;
constexpr auto EAXSOURCE_MAXROOM = 1'000L;
constexpr auto EAXSOURCE_DEFAULTROOM = 0L;

constexpr auto EAXSOURCE_MINROOMHF = -10'000L;
constexpr auto EAXSOURCE_MAXROOMHF = 0L;
constexpr auto EAXSOURCE_DEFAULTROOMHF = 0L;

constexpr auto EAXSOURCE_MINOBSTRUCTION = -10'000L;
constexpr auto EAXSOURCE_MAXOBSTRUCTION = 0L;
constexpr auto EAXSOURCE_DEFAULTOBSTRUCTION = 0L;

constexpr auto EAXSOURCE_MINOBSTRUCTIONLFRATIO = 0.0F;
constexpr auto EAXSOURCE_MAXOBSTRUCTIONLFRATIO = 1.0F;
constexpr auto EAXSOURCE_DEFAULTOBSTRUCTIONLFRATIO = 0.0F;

constexpr auto EAXSOURCE_MINOCCLUSION = -10'000L;
constexpr auto EAXSOURCE_MAXOCCLUSION = 0L;
constexpr auto EAXSOURCE_DEFAULTOCCLUSION = 0L;

constexpr auto EAXSOURCE_MINOCCLUSIONLFRATIO = 0.0F;
constexpr auto EAXSOURCE_MAXOCCLUSIONLFRATIO = 1.0F;
constexpr auto EAXSOURCE_DEFAULTOCCLUSIONLFRATIO = 0.25F;

constexpr auto EAXSOURCE_MINOCCLUSIONROOMRATIO = 0.0F;
constexpr auto EAXSOURCE_MAXOCCLUSIONROOMRATIO = 10.0F;
constexpr auto EAXSOURCE_DEFAULTOCCLUSIONROOMRATIO = 1.5F;

constexpr auto EAXSOURCE_MINOCCLUSIONDIRECTRATIO = 0.0F;
constexpr auto EAXSOURCE_MAXOCCLUSIONDIRECTRATIO = 10.0F;
constexpr auto EAXSOURCE_DEFAULTOCCLUSIONDIRECTRATIO = 1.0F;

constexpr auto EAXSOURCE_MINEXCLUSION = -10'000L;
constexpr auto EAXSOURCE_MAXEXCLUSION = 0L;
constexpr auto EAXSOURCE_DEFAULTEXCLUSION = 0L;

constexpr auto EAXSOURCE_MINEXCLUSIONLFRATIO = 0.0F;
constexpr auto EAXSOURCE_MAXEXCLUSIONLFRATIO = 1.0F;
constexpr auto EAXSOURCE_DEFAULTEXCLUSIONLFRATIO = 1.0F;

constexpr auto EAXSOURCE_MINOUTSIDEVOLUMEHF = -10'000L;
constexpr auto EAXSOURCE_MAXOUTSIDEVOLUMEHF = 0L;
constexpr auto EAXSOURCE_DEFAULTOUTSIDEVOLUMEHF = 0L;

constexpr auto EAXSOURCE_MINDOPPLERFACTOR = 0.0F;
constexpr auto EAXSOURCE_MAXDOPPLERFACTOR = 10.0F;
constexpr auto EAXSOURCE_DEFAULTDOPPLERFACTOR = 1.0F;

constexpr auto EAXSOURCE_MINROLLOFFFACTOR = 0.0F;
constexpr auto EAXSOURCE_MAXROLLOFFFACTOR = 10.0F;
constexpr auto EAXSOURCE_DEFAULTROLLOFFFACTOR = 0.0F;

constexpr auto EAXSOURCE_MINROOMROLLOFFFACTOR = 0.0F;
constexpr auto EAXSOURCE_MAXROOMROLLOFFFACTOR = 10.0F;
constexpr auto EAXSOURCE_DEFAULTROOMROLLOFFFACTOR = 0.0F;

constexpr auto EAXSOURCE_MINAIRABSORPTIONFACTOR = 0.0F;
constexpr auto EAXSOURCE_MAXAIRABSORPTIONFACTOR = 10.0F;
constexpr auto EAXSOURCE_DEFAULTAIRABSORPTIONFACTOR = 0.0F;

// EAX50

constexpr auto EAXSOURCE_MINMACROFXFACTOR = 0.0F;
constexpr auto EAXSOURCE_MAXMACROFXFACTOR = 1.0F;
constexpr auto EAXSOURCE_DEFAULTMACROFXFACTOR = 1.0F;

constexpr auto EAXSOURCE_MINSPEAKERLEVEL = -10'000L;
constexpr auto EAXSOURCE_MAXSPEAKERLEVEL = 0L;
constexpr auto EAXSOURCE_DEFAULTSPEAKERLEVEL = -10'000L;

constexpr auto EAXSOURCE_DEFAULTFLAGS =
    EAXSOURCEFLAGS_DIRECTHFAUTO |
    EAXSOURCEFLAGS_ROOMAUTO |
    EAXSOURCEFLAGS_ROOMHFAUTO;

enum : long {
    EAXSPEAKER_FRONT_LEFT = 1,
    EAXSPEAKER_FRONT_CENTER = 2,
    EAXSPEAKER_FRONT_RIGHT = 3,
    EAXSPEAKER_SIDE_RIGHT = 4,
    EAXSPEAKER_REAR_RIGHT = 5,
    EAXSPEAKER_REAR_CENTER = 6,
    EAXSPEAKER_REAR_LEFT = 7,
    EAXSPEAKER_SIDE_LEFT = 8,
    EAXSPEAKER_LOW_FREQUENCY = 9
};

// EAXSOURCEFLAGS_DIRECTHFAUTO, EAXSOURCEFLAGS_ROOMAUTO and EAXSOURCEFLAGS_ROOMHFAUTO are ignored for 2D sources
// EAXSOURCEFLAGS_UPMIX is ignored for 3D sources
constexpr auto EAX50SOURCE_DEFAULTFLAGS =
    EAXSOURCEFLAGS_DIRECTHFAUTO |
    EAXSOURCEFLAGS_ROOMAUTO |
    EAXSOURCEFLAGS_ROOMHFAUTO |
    EAXSOURCEFLAGS_UPMIX;

struct EAX30SOURCEPROPERTIES {
    long lDirect; // direct path level (at low and mid frequencies)
    long lDirectHF; // relative direct path level at high frequencies
    long lRoom; // room effect level (at low and mid frequencies)
    long lRoomHF; // relative room effect level at high frequencies
    long lObstruction; // main obstruction control (attenuation at high frequencies) 
    float flObstructionLFRatio; // obstruction low-frequency level re. main control
    long lOcclusion; // main occlusion control (attenuation at high frequencies)
    float flOcclusionLFRatio; // occlusion low-frequency level re. main control
    float flOcclusionRoomRatio; // relative occlusion control for room effect
    float flOcclusionDirectRatio; // relative occlusion control for direct path
    long lExclusion; // main exclusion control (attenuation at high frequencies)
    float flExclusionLFRatio; // exclusion low-frequency level re. main control
    long lOutsideVolumeHF; // outside sound cone level at high frequencies
    float flDopplerFactor; // like DS3D flDopplerFactor but per source
    float flRolloffFactor; // like DS3D flRolloffFactor but per source
    float flRoomRolloffFactor; // like DS3D flRolloffFactor but for room effect
    float flAirAbsorptionFactor; // multiplies EAXREVERB_AIRABSORPTIONHF
    unsigned long ulFlags; // modifies the behavior of properties
}; // EAX30SOURCEPROPERTIES

struct EAX50SOURCEPROPERTIES : public EAX30SOURCEPROPERTIES {
    float flMacroFXFactor;
}; // EAX50SOURCEPROPERTIES

struct EAXSOURCEALLSENDPROPERTIES {
    GUID guidReceivingFXSlotID;
    long lSend; // send level (at low and mid frequencies)
    long lSendHF; // relative send level at high frequencies
    long lOcclusion;
    float flOcclusionLFRatio;
    float flOcclusionRoomRatio;
    float flOcclusionDirectRatio;
    long lExclusion;
    float flExclusionLFRatio;
}; // EAXSOURCEALLSENDPROPERTIES

struct EAXSOURCE2DPROPERTIES {
    long lDirect; // direct path level (at low and mid frequencies)
    long lDirectHF; // relative direct path level at high frequencies
    long lRoom; // room effect level (at low and mid frequencies)
    long lRoomHF; // relative room effect level at high frequencies
    unsigned long ulFlags; // modifies the behavior of properties
}; // EAXSOURCE2DPROPERTIES

struct EAXSPEAKERLEVELPROPERTIES {
    long lSpeakerID;
    long lLevel;
}; // EAXSPEAKERLEVELPROPERTIES

struct EAX40ACTIVEFXSLOTS {
    std::array<GUID,EAX40_MAX_ACTIVE_FXSLOTS> guidActiveFXSlots;
}; // EAX40ACTIVEFXSLOTS

struct EAX50ACTIVEFXSLOTS {
    std::array<GUID,EAX50_MAX_ACTIVE_FXSLOTS> guidActiveFXSlots;
}; // EAX50ACTIVEFXSLOTS

// Use this structure for EAXSOURCE_OBSTRUCTIONPARAMETERS property.
struct EAXOBSTRUCTIONPROPERTIES {
    long lObstruction;
    float flObstructionLFRatio;
}; // EAXOBSTRUCTIONPROPERTIES

// Use this structure for EAXSOURCE_OCCLUSIONPARAMETERS property.
struct EAXOCCLUSIONPROPERTIES {
    long lOcclusion;
    float flOcclusionLFRatio;
    float flOcclusionRoomRatio;
    float flOcclusionDirectRatio;
}; // EAXOCCLUSIONPROPERTIES

// Use this structure for EAXSOURCE_EXCLUSIONPARAMETERS property.
struct EAXEXCLUSIONPROPERTIES {
    long lExclusion;
    float flExclusionLFRatio;
}; // EAXEXCLUSIONPROPERTIES

// Use this structure for EAXSOURCE_SENDPARAMETERS properties.
struct EAXSOURCESENDPROPERTIES {
    GUID guidReceivingFXSlotID;
    long lSend;
    long lSendHF;
}; // EAXSOURCESENDPROPERTIES

// Use this structure for EAXSOURCE_OCCLUSIONSENDPARAMETERS 
struct EAXSOURCEOCCLUSIONSENDPROPERTIES {
    GUID guidReceivingFXSlotID;
    long lOcclusion;
    float flOcclusionLFRatio;
    float flOcclusionRoomRatio;
    float flOcclusionDirectRatio;
}; // EAXSOURCEOCCLUSIONSENDPROPERTIES

// Use this structure for EAXSOURCE_EXCLUSIONSENDPARAMETERS
struct EAXSOURCEEXCLUSIONSENDPROPERTIES {
    GUID guidReceivingFXSlotID;
    long lExclusion;
    float flExclusionLFRatio;
}; // EAXSOURCEEXCLUSIONSENDPROPERTIES

extern const EAX40ACTIVEFXSLOTS EAX40SOURCE_DEFAULTACTIVEFXSLOTID;

extern const EAX50ACTIVEFXSLOTS EAX50SOURCE_3DDEFAULTACTIVEFXSLOTID;

extern const EAX50ACTIVEFXSLOTS EAX50SOURCE_2DDEFAULTACTIVEFXSLOTID;


// EAX Reverb Effect

extern const GUID EAX_REVERB_EFFECT;

// Reverb effect properties
enum EAXREVERB_PROPERTY : unsigned int {
    EAXREVERB_NONE,
    EAXREVERB_ALLPARAMETERS,
    EAXREVERB_ENVIRONMENT,
    EAXREVERB_ENVIRONMENTSIZE,
    EAXREVERB_ENVIRONMENTDIFFUSION,
    EAXREVERB_ROOM,
    EAXREVERB_ROOMHF,
    EAXREVERB_ROOMLF,
    EAXREVERB_DECAYTIME,
    EAXREVERB_DECAYHFRATIO,
    EAXREVERB_DECAYLFRATIO,
    EAXREVERB_REFLECTIONS,
    EAXREVERB_REFLECTIONSDELAY,
    EAXREVERB_REFLECTIONSPAN,
    EAXREVERB_REVERB,
    EAXREVERB_REVERBDELAY,
    EAXREVERB_REVERBPAN,
    EAXREVERB_ECHOTIME,
    EAXREVERB_ECHODEPTH,
    EAXREVERB_MODULATIONTIME,
    EAXREVERB_MODULATIONDEPTH,
    EAXREVERB_AIRABSORPTIONHF,
    EAXREVERB_HFREFERENCE,
    EAXREVERB_LFREFERENCE,
    EAXREVERB_ROOMROLLOFFFACTOR,
    EAXREVERB_FLAGS,
}; // EAXREVERB_PROPERTY

// used by EAXREVERB_ENVIRONMENT
enum : unsigned long {
    EAX_ENVIRONMENT_GENERIC,
    EAX_ENVIRONMENT_PADDEDCELL,
    EAX_ENVIRONMENT_ROOM,
    EAX_ENVIRONMENT_BATHROOM,
    EAX_ENVIRONMENT_LIVINGROOM,
    EAX_ENVIRONMENT_STONEROOM,
    EAX_ENVIRONMENT_AUDITORIUM,
    EAX_ENVIRONMENT_CONCERTHALL,
    EAX_ENVIRONMENT_CAVE,
    EAX_ENVIRONMENT_ARENA,
    EAX_ENVIRONMENT_HANGAR,
    EAX_ENVIRONMENT_CARPETEDHALLWAY,
    EAX_ENVIRONMENT_HALLWAY,
    EAX_ENVIRONMENT_STONECORRIDOR,
    EAX_ENVIRONMENT_ALLEY,
    EAX_ENVIRONMENT_FOREST,
    EAX_ENVIRONMENT_CITY,
    EAX_ENVIRONMENT_MOUNTAINS,
    EAX_ENVIRONMENT_QUARRY,
    EAX_ENVIRONMENT_PLAIN,
    EAX_ENVIRONMENT_PARKINGLOT,
    EAX_ENVIRONMENT_SEWERPIPE,
    EAX_ENVIRONMENT_UNDERWATER,
    EAX_ENVIRONMENT_DRUGGED,
    EAX_ENVIRONMENT_DIZZY,
    EAX_ENVIRONMENT_PSYCHOTIC,

    EAX1_ENVIRONMENT_COUNT,

    // EAX30
    EAX_ENVIRONMENT_UNDEFINED = EAX1_ENVIRONMENT_COUNT,

    EAX3_ENVIRONMENT_COUNT,
};


// reverberation decay time
constexpr auto EAXREVERBFLAGS_DECAYTIMESCALE = 0x00000001UL;

// reflection level
constexpr auto EAXREVERBFLAGS_REFLECTIONSSCALE = 0x00000002UL;

// initial reflection delay time
constexpr auto EAXREVERBFLAGS_REFLECTIONSDELAYSCALE = 0x00000004UL;

// reflections level
constexpr auto EAXREVERBFLAGS_REVERBSCALE = 0x00000008UL;

// late reverberation delay time
constexpr auto EAXREVERBFLAGS_REVERBDELAYSCALE = 0x00000010UL;

// echo time
// EAX30+
constexpr auto EAXREVERBFLAGS_ECHOTIMESCALE = 0x00000040UL;

// modulation time
// EAX30+
constexpr auto EAXREVERBFLAGS_MODULATIONTIMESCALE = 0x00000080UL;

// This flag limits high-frequency decay time according to air absorption.
constexpr auto EAXREVERBFLAGS_DECAYHFLIMIT = 0x00000020UL;

constexpr auto EAXREVERBFLAGS_RESERVED = 0xFFFFFF00UL; // reserved future use


struct EAXREVERBPROPERTIES {
    unsigned long ulEnvironment; // sets all reverb properties
    float flEnvironmentSize; // environment size in meters
    float flEnvironmentDiffusion; // environment diffusion
    long lRoom; // room effect level (at mid frequencies)
    long lRoomHF; // relative room effect level at high frequencies
    long lRoomLF; // relative room effect level at low frequencies  
    float flDecayTime; // reverberation decay time at mid frequencies
    float flDecayHFRatio; // high-frequency to mid-frequency decay time ratio
    float flDecayLFRatio; // low-frequency to mid-frequency decay time ratio   
    long lReflections; // early reflections level relative to room effect
    float flReflectionsDelay; // initial reflection delay time
    EAXVECTOR vReflectionsPan; // early reflections panning vector
    long lReverb; // late reverberation level relative to room effect
    float flReverbDelay; // late reverberation delay time relative to initial reflection
    EAXVECTOR vReverbPan; // late reverberation panning vector
    float flEchoTime; // echo time
    float flEchoDepth; // echo depth
    float flModulationTime; // modulation time
    float flModulationDepth; // modulation depth
    float flAirAbsorptionHF; // change in level per meter at high frequencies
    float flHFReference; // reference high frequency
    float flLFReference; // reference low frequency 
    float flRoomRolloffFactor; // like DS3D flRolloffFactor but for room effect
    unsigned long ulFlags; // modifies the behavior of properties
    DECL_EQOP(EAXREVERBPROPERTIES)
}; // EAXREVERBPROPERTIES


constexpr auto EAXREVERB_MINENVIRONMENT = static_cast<unsigned long>(EAX_ENVIRONMENT_GENERIC);
constexpr auto EAX1REVERB_MAXENVIRONMENT = static_cast<unsigned long>(EAX_ENVIRONMENT_PSYCHOTIC);
constexpr auto EAX30REVERB_MAXENVIRONMENT = static_cast<unsigned long>(EAX_ENVIRONMENT_UNDEFINED);
constexpr auto EAXREVERB_DEFAULTENVIRONMENT = static_cast<unsigned long>(EAX_ENVIRONMENT_GENERIC);

constexpr auto EAXREVERB_MINENVIRONMENTSIZE = 1.0F;
constexpr auto EAXREVERB_MAXENVIRONMENTSIZE = 100.0F;
constexpr auto EAXREVERB_DEFAULTENVIRONMENTSIZE = 7.5F;

constexpr auto EAXREVERB_MINENVIRONMENTDIFFUSION = 0.0F;
constexpr auto EAXREVERB_MAXENVIRONMENTDIFFUSION = 1.0F;
constexpr auto EAXREVERB_DEFAULTENVIRONMENTDIFFUSION = 1.0F;

constexpr auto EAXREVERB_MINROOM = -10'000L;
constexpr auto EAXREVERB_MAXROOM = 0L;
constexpr auto EAXREVERB_DEFAULTROOM = -1'000L;

constexpr auto EAXREVERB_MINROOMHF = -10'000L;
constexpr auto EAXREVERB_MAXROOMHF = 0L;
constexpr auto EAXREVERB_DEFAULTROOMHF = -100L;

constexpr auto EAXREVERB_MINROOMLF = -10'000L;
constexpr auto EAXREVERB_MAXROOMLF = 0L;
constexpr auto EAXREVERB_DEFAULTROOMLF = 0L;

constexpr auto EAXREVERB_MINDECAYTIME = 0.1F;
constexpr auto EAXREVERB_MAXDECAYTIME = 20.0F;
constexpr auto EAXREVERB_DEFAULTDECAYTIME = 1.49F;

constexpr auto EAXREVERB_MINDECAYHFRATIO = 0.1F;
constexpr auto EAXREVERB_MAXDECAYHFRATIO = 2.0F;
constexpr auto EAXREVERB_DEFAULTDECAYHFRATIO = 0.83F;

constexpr auto EAXREVERB_MINDECAYLFRATIO = 0.1F;
constexpr auto EAXREVERB_MAXDECAYLFRATIO = 2.0F;
constexpr auto EAXREVERB_DEFAULTDECAYLFRATIO = 1.0F;

constexpr auto EAXREVERB_MINREFLECTIONS = -10'000L;
constexpr auto EAXREVERB_MAXREFLECTIONS = 1'000L;
constexpr auto EAXREVERB_DEFAULTREFLECTIONS = -2'602L;

constexpr auto EAXREVERB_MINREFLECTIONSDELAY = 0.0F;
constexpr auto EAXREVERB_MAXREFLECTIONSDELAY = 0.3F;
constexpr auto EAXREVERB_DEFAULTREFLECTIONSDELAY = 0.007F;

constexpr auto EAXREVERB_DEFAULTREFLECTIONSPAN = EAXVECTOR{0.0F, 0.0F, 0.0F};

constexpr auto EAXREVERB_MINREVERB = -10'000L;
constexpr auto EAXREVERB_MAXREVERB = 2'000L;
constexpr auto EAXREVERB_DEFAULTREVERB = 200L;

constexpr auto EAXREVERB_MINREVERBDELAY = 0.0F;
constexpr auto EAXREVERB_MAXREVERBDELAY = 0.1F;
constexpr auto EAXREVERB_DEFAULTREVERBDELAY = 0.011F;

constexpr auto EAXREVERB_DEFAULTREVERBPAN = EAXVECTOR{0.0F, 0.0F, 0.0F};

constexpr auto EAXREVERB_MINECHOTIME = 0.075F;
constexpr auto EAXREVERB_MAXECHOTIME = 0.25F;
constexpr auto EAXREVERB_DEFAULTECHOTIME = 0.25F;

constexpr auto EAXREVERB_MINECHODEPTH = 0.0F;
constexpr auto EAXREVERB_MAXECHODEPTH = 1.0F;
constexpr auto EAXREVERB_DEFAULTECHODEPTH = 0.0F;

constexpr auto EAXREVERB_MINMODULATIONTIME = 0.04F;
constexpr auto EAXREVERB_MAXMODULATIONTIME = 4.0F;
constexpr auto EAXREVERB_DEFAULTMODULATIONTIME = 0.25F;

constexpr auto EAXREVERB_MINMODULATIONDEPTH = 0.0F;
constexpr auto EAXREVERB_MAXMODULATIONDEPTH = 1.0F;
constexpr auto EAXREVERB_DEFAULTMODULATIONDEPTH = 0.0F;

constexpr auto EAXREVERB_MINAIRABSORPTIONHF = -100.0F;
constexpr auto EAXREVERB_MAXAIRABSORPTIONHF = 0.0F;
constexpr auto EAXREVERB_DEFAULTAIRABSORPTIONHF = -5.0F;

constexpr auto EAXREVERB_MINHFREFERENCE = 1'000.0F;
constexpr auto EAXREVERB_MAXHFREFERENCE = 20'000.0F;
constexpr auto EAXREVERB_DEFAULTHFREFERENCE = 5'000.0F;

constexpr auto EAXREVERB_MINLFREFERENCE = 20.0F;
constexpr auto EAXREVERB_MAXLFREFERENCE = 1'000.0F;
constexpr auto EAXREVERB_DEFAULTLFREFERENCE = 250.0F;

constexpr auto EAXREVERB_MINROOMROLLOFFFACTOR = 0.0F;
constexpr auto EAXREVERB_MAXROOMROLLOFFFACTOR = 10.0F;
constexpr auto EAXREVERB_DEFAULTROOMROLLOFFFACTOR = 0.0F;

constexpr auto EAX1REVERB_MINVOLUME = 0.0F;
constexpr auto EAX1REVERB_MAXVOLUME = 1.0F;

constexpr auto EAX1REVERB_MINDAMPING = 0.0F;
constexpr auto EAX1REVERB_MAXDAMPING = 2.0F;

constexpr auto EAXREVERB_DEFAULTFLAGS =
    EAXREVERBFLAGS_DECAYTIMESCALE |
    EAXREVERBFLAGS_REFLECTIONSSCALE |
    EAXREVERBFLAGS_REFLECTIONSDELAYSCALE |
    EAXREVERBFLAGS_REVERBSCALE |
    EAXREVERBFLAGS_REVERBDELAYSCALE |
    EAXREVERBFLAGS_DECAYHFLIMIT;


using Eax1ReverbPresets = std::array<EAX_REVERBPROPERTIES, EAX1_ENVIRONMENT_COUNT>;
extern const Eax1ReverbPresets EAX1REVERB_PRESETS;

using Eax2ReverbPresets = std::array<EAX20LISTENERPROPERTIES, EAX2_ENVIRONMENT_COUNT>;
extern const Eax2ReverbPresets EAX2REVERB_PRESETS;

using EaxReverbPresets = std::array<EAXREVERBPROPERTIES, EAX1_ENVIRONMENT_COUNT>;
extern const EaxReverbPresets EAXREVERB_PRESETS;


// AGC Compressor Effect

extern const GUID EAX_AGCCOMPRESSOR_EFFECT;

enum EAXAGCCOMPRESSOR_PROPERTY : unsigned int {
    EAXAGCCOMPRESSOR_NONE,
    EAXAGCCOMPRESSOR_ALLPARAMETERS,
    EAXAGCCOMPRESSOR_ONOFF,
}; // EAXAGCCOMPRESSOR_PROPERTY

struct EAXAGCCOMPRESSORPROPERTIES {
    unsigned long ulOnOff; // Switch Compressor on or off
    DECL_EQOP(EAXAGCCOMPRESSORPROPERTIES)
}; // EAXAGCCOMPRESSORPROPERTIES


constexpr auto EAXAGCCOMPRESSOR_MINONOFF = 0UL;
constexpr auto EAXAGCCOMPRESSOR_MAXONOFF = 1UL;
constexpr auto EAXAGCCOMPRESSOR_DEFAULTONOFF = EAXAGCCOMPRESSOR_MAXONOFF;


// Autowah Effect

extern const GUID EAX_AUTOWAH_EFFECT;

enum EAXAUTOWAH_PROPERTY : unsigned int {
    EAXAUTOWAH_NONE,
    EAXAUTOWAH_ALLPARAMETERS,
    EAXAUTOWAH_ATTACKTIME,
    EAXAUTOWAH_RELEASETIME,
    EAXAUTOWAH_RESONANCE,
    EAXAUTOWAH_PEAKLEVEL,
}; // EAXAUTOWAH_PROPERTY

struct EAXAUTOWAHPROPERTIES {
    float flAttackTime; // Attack time (seconds)
    float flReleaseTime; // Release time (seconds)
    long lResonance; // Resonance (mB)
    long lPeakLevel; // Peak level (mB)
    DECL_EQOP(EAXAUTOWAHPROPERTIES)
}; // EAXAUTOWAHPROPERTIES


constexpr auto EAXAUTOWAH_MINATTACKTIME = 0.0001F;
constexpr auto EAXAUTOWAH_MAXATTACKTIME = 1.0F;
constexpr auto EAXAUTOWAH_DEFAULTATTACKTIME = 0.06F;

constexpr auto EAXAUTOWAH_MINRELEASETIME = 0.0001F;
constexpr auto EAXAUTOWAH_MAXRELEASETIME = 1.0F;
constexpr auto EAXAUTOWAH_DEFAULTRELEASETIME = 0.06F;

constexpr auto EAXAUTOWAH_MINRESONANCE = 600L;
constexpr auto EAXAUTOWAH_MAXRESONANCE = 6000L;
constexpr auto EAXAUTOWAH_DEFAULTRESONANCE = 6000L;

constexpr auto EAXAUTOWAH_MINPEAKLEVEL = -9000L;
constexpr auto EAXAUTOWAH_MAXPEAKLEVEL = 9000L;
constexpr auto EAXAUTOWAH_DEFAULTPEAKLEVEL = 2100L;


// Chorus Effect

extern const GUID EAX_CHORUS_EFFECT;

enum EAXCHORUS_PROPERTY : unsigned int {
    EAXCHORUS_NONE,
    EAXCHORUS_ALLPARAMETERS,
    EAXCHORUS_WAVEFORM,
    EAXCHORUS_PHASE,
    EAXCHORUS_RATE,
    EAXCHORUS_DEPTH,
    EAXCHORUS_FEEDBACK,
    EAXCHORUS_DELAY,
}; // EAXCHORUS_PROPERTY

enum : unsigned long {
    EAX_CHORUS_SINUSOID,
    EAX_CHORUS_TRIANGLE,
};

struct EAXCHORUSPROPERTIES {
    unsigned long ulWaveform; // Waveform selector - see enum above
    long lPhase; // Phase (Degrees)
    float flRate; // Rate (Hz)
    float flDepth; // Depth (0 to 1)
    float flFeedback; // Feedback (-1 to 1)
    float flDelay; // Delay (seconds)
    DECL_EQOP(EAXCHORUSPROPERTIES)
}; // EAXCHORUSPROPERTIES


constexpr auto EAXCHORUS_MINWAVEFORM = 0UL;
constexpr auto EAXCHORUS_MAXWAVEFORM = 1UL;
constexpr auto EAXCHORUS_DEFAULTWAVEFORM = 1UL;

constexpr auto EAXCHORUS_MINPHASE = -180L;
constexpr auto EAXCHORUS_MAXPHASE = 180L;
constexpr auto EAXCHORUS_DEFAULTPHASE = 90L;

constexpr auto EAXCHORUS_MINRATE = 0.0F;
constexpr auto EAXCHORUS_MAXRATE = 10.0F;
constexpr auto EAXCHORUS_DEFAULTRATE = 1.1F;

constexpr auto EAXCHORUS_MINDEPTH = 0.0F;
constexpr auto EAXCHORUS_MAXDEPTH = 1.0F;
constexpr auto EAXCHORUS_DEFAULTDEPTH = 0.1F;

constexpr auto EAXCHORUS_MINFEEDBACK = -1.0F;
constexpr auto EAXCHORUS_MAXFEEDBACK = 1.0F;
constexpr auto EAXCHORUS_DEFAULTFEEDBACK = 0.25F;

constexpr auto EAXCHORUS_MINDELAY = 0.0002F;
constexpr auto EAXCHORUS_MAXDELAY = 0.016F;
constexpr auto EAXCHORUS_DEFAULTDELAY = 0.016F;


// Distortion Effect

extern const GUID EAX_DISTORTION_EFFECT;

enum EAXDISTORTION_PROPERTY : unsigned int {
    EAXDISTORTION_NONE,
    EAXDISTORTION_ALLPARAMETERS,
    EAXDISTORTION_EDGE,
    EAXDISTORTION_GAIN,
    EAXDISTORTION_LOWPASSCUTOFF,
    EAXDISTORTION_EQCENTER,
    EAXDISTORTION_EQBANDWIDTH,
}; // EAXDISTORTION_PROPERTY

struct EAXDISTORTIONPROPERTIES {
    float flEdge; // Controls the shape of the distortion (0 to 1)
    long lGain; // Controls the post distortion gain (mB)
    float flLowPassCutOff; // Controls the cut-off of the filter pre-distortion (Hz)
    float flEQCenter; // Controls the center frequency of the EQ post-distortion (Hz)
    float flEQBandwidth; // Controls the bandwidth of the EQ post-distortion (Hz)
    DECL_EQOP(EAXDISTORTIONPROPERTIES)
}; // EAXDISTORTIONPROPERTIES


constexpr auto EAXDISTORTION_MINEDGE = 0.0F;
constexpr auto EAXDISTORTION_MAXEDGE = 1.0F;
constexpr auto EAXDISTORTION_DEFAULTEDGE = 0.2F;

constexpr auto EAXDISTORTION_MINGAIN = -6000L;
constexpr auto EAXDISTORTION_MAXGAIN = 0L;
constexpr auto EAXDISTORTION_DEFAULTGAIN = -2600L;

constexpr auto EAXDISTORTION_MINLOWPASSCUTOFF = 80.0F;
constexpr auto EAXDISTORTION_MAXLOWPASSCUTOFF = 24000.0F;
constexpr auto EAXDISTORTION_DEFAULTLOWPASSCUTOFF = 8000.0F;

constexpr auto EAXDISTORTION_MINEQCENTER = 80.0F;
constexpr auto EAXDISTORTION_MAXEQCENTER = 24000.0F;
constexpr auto EAXDISTORTION_DEFAULTEQCENTER = 3600.0F;

constexpr auto EAXDISTORTION_MINEQBANDWIDTH = 80.0F;
constexpr auto EAXDISTORTION_MAXEQBANDWIDTH = 24000.0F;
constexpr auto EAXDISTORTION_DEFAULTEQBANDWIDTH = 3600.0F;


// Echo Effect

extern const GUID EAX_ECHO_EFFECT;

enum EAXECHO_PROPERTY : unsigned int {
    EAXECHO_NONE,
    EAXECHO_ALLPARAMETERS,
    EAXECHO_DELAY,
    EAXECHO_LRDELAY,
    EAXECHO_DAMPING,
    EAXECHO_FEEDBACK,
    EAXECHO_SPREAD,
}; // EAXECHO_PROPERTY

struct EAXECHOPROPERTIES {
    float flDelay; // Controls the initial delay time (seconds)
    float flLRDelay; // Controls the delay time between the first and second taps (seconds)
    float flDamping; // Controls a low-pass filter that dampens the echoes (0 to 1)
    float flFeedback; // Controls the duration of echo repetition (0 to 1)
    float flSpread; // Controls the left-right spread of the echoes
    DECL_EQOP(EAXECHOPROPERTIES)
}; // EAXECHOPROPERTIES


constexpr auto EAXECHO_MINDAMPING = 0.0F;
constexpr auto EAXECHO_MAXDAMPING = 0.99F;
constexpr auto EAXECHO_DEFAULTDAMPING = 0.5F;

constexpr auto EAXECHO_MINDELAY = 0.002F;
constexpr auto EAXECHO_MAXDELAY = 0.207F;
constexpr auto EAXECHO_DEFAULTDELAY = 0.1F;

constexpr auto EAXECHO_MINLRDELAY = 0.0F;
constexpr auto EAXECHO_MAXLRDELAY = 0.404F;
constexpr auto EAXECHO_DEFAULTLRDELAY = 0.1F;

constexpr auto EAXECHO_MINFEEDBACK = 0.0F;
constexpr auto EAXECHO_MAXFEEDBACK = 1.0F;
constexpr auto EAXECHO_DEFAULTFEEDBACK = 0.5F;

constexpr auto EAXECHO_MINSPREAD = -1.0F;
constexpr auto EAXECHO_MAXSPREAD = 1.0F;
constexpr auto EAXECHO_DEFAULTSPREAD = -1.0F;


// Equalizer Effect

extern const GUID EAX_EQUALIZER_EFFECT;

enum EAXEQUALIZER_PROPERTY : unsigned int {
    EAXEQUALIZER_NONE,
    EAXEQUALIZER_ALLPARAMETERS,
    EAXEQUALIZER_LOWGAIN,
    EAXEQUALIZER_LOWCUTOFF,
    EAXEQUALIZER_MID1GAIN,
    EAXEQUALIZER_MID1CENTER,
    EAXEQUALIZER_MID1WIDTH,
    EAXEQUALIZER_MID2GAIN,
    EAXEQUALIZER_MID2CENTER,
    EAXEQUALIZER_MID2WIDTH,
    EAXEQUALIZER_HIGHGAIN,
    EAXEQUALIZER_HIGHCUTOFF,
}; // EAXEQUALIZER_PROPERTY

struct EAXEQUALIZERPROPERTIES {
    long lLowGain; // (mB)
    float flLowCutOff; // (Hz)
    long lMid1Gain; // (mB)
    float flMid1Center; // (Hz)
    float flMid1Width; // (octaves)
    long lMid2Gain; // (mB)
    float flMid2Center; // (Hz)
    float flMid2Width; // (octaves)
    long lHighGain; // (mB)
    float flHighCutOff; // (Hz)
    DECL_EQOP(EAXEQUALIZERPROPERTIES)
}; // EAXEQUALIZERPROPERTIES


constexpr auto EAXEQUALIZER_MINLOWGAIN = -1800L;
constexpr auto EAXEQUALIZER_MAXLOWGAIN = 1800L;
constexpr auto EAXEQUALIZER_DEFAULTLOWGAIN = 0L;

constexpr auto EAXEQUALIZER_MINLOWCUTOFF = 50.0F;
constexpr auto EAXEQUALIZER_MAXLOWCUTOFF = 800.0F;
constexpr auto EAXEQUALIZER_DEFAULTLOWCUTOFF = 200.0F;

constexpr auto EAXEQUALIZER_MINMID1GAIN = -1800L;
constexpr auto EAXEQUALIZER_MAXMID1GAIN = 1800L;
constexpr auto EAXEQUALIZER_DEFAULTMID1GAIN = 0L;

constexpr auto EAXEQUALIZER_MINMID1CENTER = 200.0F;
constexpr auto EAXEQUALIZER_MAXMID1CENTER = 3000.0F;
constexpr auto EAXEQUALIZER_DEFAULTMID1CENTER = 500.0F;

constexpr auto EAXEQUALIZER_MINMID1WIDTH = 0.01F;
constexpr auto EAXEQUALIZER_MAXMID1WIDTH = 1.0F;
constexpr auto EAXEQUALIZER_DEFAULTMID1WIDTH = 1.0F;

constexpr auto EAXEQUALIZER_MINMID2GAIN = -1800L;
constexpr auto EAXEQUALIZER_MAXMID2GAIN = 1800L;
constexpr auto EAXEQUALIZER_DEFAULTMID2GAIN = 0L;

constexpr auto EAXEQUALIZER_MINMID2CENTER = 1000.0F;
constexpr auto EAXEQUALIZER_MAXMID2CENTER = 8000.0F;
constexpr auto EAXEQUALIZER_DEFAULTMID2CENTER = 3000.0F;

constexpr auto EAXEQUALIZER_MINMID2WIDTH = 0.01F;
constexpr auto EAXEQUALIZER_MAXMID2WIDTH = 1.0F;
constexpr auto EAXEQUALIZER_DEFAULTMID2WIDTH = 1.0F;

constexpr auto EAXEQUALIZER_MINHIGHGAIN = -1800L;
constexpr auto EAXEQUALIZER_MAXHIGHGAIN = 1800L;
constexpr auto EAXEQUALIZER_DEFAULTHIGHGAIN = 0L;

constexpr auto EAXEQUALIZER_MINHIGHCUTOFF = 4000.0F;
constexpr auto EAXEQUALIZER_MAXHIGHCUTOFF = 16000.0F;
constexpr auto EAXEQUALIZER_DEFAULTHIGHCUTOFF = 6000.0F;


// Flanger Effect

extern const GUID EAX_FLANGER_EFFECT;

enum EAXFLANGER_PROPERTY : unsigned int {
    EAXFLANGER_NONE,
    EAXFLANGER_ALLPARAMETERS,
    EAXFLANGER_WAVEFORM,
    EAXFLANGER_PHASE,
    EAXFLANGER_RATE,
    EAXFLANGER_DEPTH,
    EAXFLANGER_FEEDBACK,
    EAXFLANGER_DELAY,
}; // EAXFLANGER_PROPERTY

enum : unsigned long {
    EAX_FLANGER_SINUSOID,
    EAX_FLANGER_TRIANGLE,
};

struct EAXFLANGERPROPERTIES {
    unsigned long ulWaveform; // Waveform selector - see enum above
    long lPhase; // Phase (Degrees)
    float flRate; // Rate (Hz)
    float flDepth; // Depth (0 to 1)
    float flFeedback; // Feedback (0 to 1)
    float flDelay; // Delay (seconds)
    DECL_EQOP(EAXFLANGERPROPERTIES)
}; // EAXFLANGERPROPERTIES


constexpr auto EAXFLANGER_MINWAVEFORM = 0UL;
constexpr auto EAXFLANGER_MAXWAVEFORM = 1UL;
constexpr auto EAXFLANGER_DEFAULTWAVEFORM = 1UL;

constexpr auto EAXFLANGER_MINPHASE = -180L;
constexpr auto EAXFLANGER_MAXPHASE = 180L;
constexpr auto EAXFLANGER_DEFAULTPHASE = 0L;

constexpr auto EAXFLANGER_MINRATE = 0.0F;
constexpr auto EAXFLANGER_MAXRATE = 10.0F;
constexpr auto EAXFLANGER_DEFAULTRATE = 0.27F;

constexpr auto EAXFLANGER_MINDEPTH = 0.0F;
constexpr auto EAXFLANGER_MAXDEPTH = 1.0F;
constexpr auto EAXFLANGER_DEFAULTDEPTH = 1.0F;

constexpr auto EAXFLANGER_MINFEEDBACK = -1.0F;
constexpr auto EAXFLANGER_MAXFEEDBACK = 1.0F;
constexpr auto EAXFLANGER_DEFAULTFEEDBACK = -0.5F;

constexpr auto EAXFLANGER_MINDELAY = 0.0002F;
constexpr auto EAXFLANGER_MAXDELAY = 0.004F;
constexpr auto EAXFLANGER_DEFAULTDELAY = 0.002F;


// Frequency Shifter Effect

extern const GUID EAX_FREQUENCYSHIFTER_EFFECT;

enum EAXFREQUENCYSHIFTER_PROPERTY : unsigned int {
    EAXFREQUENCYSHIFTER_NONE,
    EAXFREQUENCYSHIFTER_ALLPARAMETERS,
    EAXFREQUENCYSHIFTER_FREQUENCY,
    EAXFREQUENCYSHIFTER_LEFTDIRECTION,
    EAXFREQUENCYSHIFTER_RIGHTDIRECTION,
}; // EAXFREQUENCYSHIFTER_PROPERTY

enum : unsigned long {
    EAX_FREQUENCYSHIFTER_DOWN,
    EAX_FREQUENCYSHIFTER_UP,
    EAX_FREQUENCYSHIFTER_OFF
};

struct EAXFREQUENCYSHIFTERPROPERTIES {
    float flFrequency; // (Hz)
    unsigned long ulLeftDirection; // see enum above
    unsigned long ulRightDirection; // see enum above
    DECL_EQOP(EAXFREQUENCYSHIFTERPROPERTIES)
}; // EAXFREQUENCYSHIFTERPROPERTIES


constexpr auto EAXFREQUENCYSHIFTER_MINFREQUENCY = 0.0F;
constexpr auto EAXFREQUENCYSHIFTER_MAXFREQUENCY = 24000.0F;
constexpr auto EAXFREQUENCYSHIFTER_DEFAULTFREQUENCY = EAXFREQUENCYSHIFTER_MINFREQUENCY;

constexpr auto EAXFREQUENCYSHIFTER_MINLEFTDIRECTION = 0UL;
constexpr auto EAXFREQUENCYSHIFTER_MAXLEFTDIRECTION = 2UL;
constexpr auto EAXFREQUENCYSHIFTER_DEFAULTLEFTDIRECTION = EAXFREQUENCYSHIFTER_MINLEFTDIRECTION;

constexpr auto EAXFREQUENCYSHIFTER_MINRIGHTDIRECTION = 0UL;
constexpr auto EAXFREQUENCYSHIFTER_MAXRIGHTDIRECTION = 2UL;
constexpr auto EAXFREQUENCYSHIFTER_DEFAULTRIGHTDIRECTION = EAXFREQUENCYSHIFTER_MINRIGHTDIRECTION;


// Vocal Morpher Effect

extern const GUID EAX_VOCALMORPHER_EFFECT;

enum EAXVOCALMORPHER_PROPERTY : unsigned int {
    EAXVOCALMORPHER_NONE,
    EAXVOCALMORPHER_ALLPARAMETERS,
    EAXVOCALMORPHER_PHONEMEA,
    EAXVOCALMORPHER_PHONEMEACOARSETUNING,
    EAXVOCALMORPHER_PHONEMEB,
    EAXVOCALMORPHER_PHONEMEBCOARSETUNING,
    EAXVOCALMORPHER_WAVEFORM,
    EAXVOCALMORPHER_RATE,
}; // EAXVOCALMORPHER_PROPERTY

enum : unsigned long {
    A,
    E,
    I,
    O,
    U,
    AA,
    AE,
    AH,
    AO,
    EH,
    ER,
    IH,
    IY,
    UH,
    UW,
    B,
    D,
    F,
    G,
    J,
    K,
    L,
    M,
    N,
    P,
    R,
    S,
    T,
    V,
    Z,
};

enum : unsigned long {
    EAX_VOCALMORPHER_SINUSOID,
    EAX_VOCALMORPHER_TRIANGLE,
    EAX_VOCALMORPHER_SAWTOOTH
};

// Use this structure for EAXVOCALMORPHER_ALLPARAMETERS
struct EAXVOCALMORPHERPROPERTIES {
    unsigned long ulPhonemeA; // see enum above
    long lPhonemeACoarseTuning; // (semitones)
    unsigned long ulPhonemeB; // see enum above
    long lPhonemeBCoarseTuning; // (semitones)
    unsigned long ulWaveform; // Waveform selector - see enum above
    float flRate; // (Hz)
    DECL_EQOP(EAXVOCALMORPHERPROPERTIES)
}; // EAXVOCALMORPHERPROPERTIES


constexpr auto EAXVOCALMORPHER_MINPHONEMEA = 0UL;
constexpr auto EAXVOCALMORPHER_MAXPHONEMEA = 29UL;
constexpr auto EAXVOCALMORPHER_DEFAULTPHONEMEA = EAXVOCALMORPHER_MINPHONEMEA;

constexpr auto EAXVOCALMORPHER_MINPHONEMEACOARSETUNING = -24L;
constexpr auto EAXVOCALMORPHER_MAXPHONEMEACOARSETUNING = 24L;
constexpr auto EAXVOCALMORPHER_DEFAULTPHONEMEACOARSETUNING = 0L;

constexpr auto EAXVOCALMORPHER_MINPHONEMEB = 0UL;
constexpr auto EAXVOCALMORPHER_MAXPHONEMEB = 29UL;
constexpr auto EAXVOCALMORPHER_DEFAULTPHONEMEB = 10UL;

constexpr auto EAXVOCALMORPHER_MINPHONEMEBCOARSETUNING = -24L;
constexpr auto EAXVOCALMORPHER_MAXPHONEMEBCOARSETUNING = 24L;
constexpr auto EAXVOCALMORPHER_DEFAULTPHONEMEBCOARSETUNING = 0L;

constexpr auto EAXVOCALMORPHER_MINWAVEFORM = 0UL;
constexpr auto EAXVOCALMORPHER_MAXWAVEFORM = 2UL;
constexpr auto EAXVOCALMORPHER_DEFAULTWAVEFORM = EAXVOCALMORPHER_MINWAVEFORM;

constexpr auto EAXVOCALMORPHER_MINRATE = 0.0F;
constexpr auto EAXVOCALMORPHER_MAXRATE = 10.0F;
constexpr auto EAXVOCALMORPHER_DEFAULTRATE = 1.41F;


// Pitch Shifter Effect

extern const GUID EAX_PITCHSHIFTER_EFFECT;

enum EAXPITCHSHIFTER_PROPERTY : unsigned int {
    EAXPITCHSHIFTER_NONE,
    EAXPITCHSHIFTER_ALLPARAMETERS,
    EAXPITCHSHIFTER_COARSETUNE,
    EAXPITCHSHIFTER_FINETUNE,
}; // EAXPITCHSHIFTER_PROPERTY

struct EAXPITCHSHIFTERPROPERTIES {
    long lCoarseTune; // Amount of pitch shift (semitones)
    long lFineTune; // Amount of pitch shift (cents)
    DECL_EQOP(EAXPITCHSHIFTERPROPERTIES)
}; // EAXPITCHSHIFTERPROPERTIES


constexpr auto EAXPITCHSHIFTER_MINCOARSETUNE = -12L;
constexpr auto EAXPITCHSHIFTER_MAXCOARSETUNE = 12L;
constexpr auto EAXPITCHSHIFTER_DEFAULTCOARSETUNE = 12L;

constexpr auto EAXPITCHSHIFTER_MINFINETUNE = -50L;
constexpr auto EAXPITCHSHIFTER_MAXFINETUNE = 50L;
constexpr auto EAXPITCHSHIFTER_DEFAULTFINETUNE = 0L;


// Ring Modulator Effect

extern const GUID EAX_RINGMODULATOR_EFFECT;

enum EAXRINGMODULATOR_PROPERTY : unsigned int {
    EAXRINGMODULATOR_NONE,
    EAXRINGMODULATOR_ALLPARAMETERS,
    EAXRINGMODULATOR_FREQUENCY,
    EAXRINGMODULATOR_HIGHPASSCUTOFF,
    EAXRINGMODULATOR_WAVEFORM,
}; // EAXRINGMODULATOR_PROPERTY

enum : unsigned long {
    EAX_RINGMODULATOR_SINUSOID,
    EAX_RINGMODULATOR_SAWTOOTH,
    EAX_RINGMODULATOR_SQUARE,
};

// Use this structure for EAXRINGMODULATOR_ALLPARAMETERS
struct EAXRINGMODULATORPROPERTIES {
    float flFrequency; // Frequency of modulation (Hz)
    float flHighPassCutOff; // Cut-off frequency of high-pass filter (Hz)
    unsigned long ulWaveform; // Waveform selector - see enum above
    DECL_EQOP(EAXRINGMODULATORPROPERTIES)
}; // EAXRINGMODULATORPROPERTIES


constexpr auto EAXRINGMODULATOR_MINFREQUENCY = 0.0F;
constexpr auto EAXRINGMODULATOR_MAXFREQUENCY = 8000.0F;
constexpr auto EAXRINGMODULATOR_DEFAULTFREQUENCY = 440.0F;

constexpr auto EAXRINGMODULATOR_MINHIGHPASSCUTOFF = 0.0F;
constexpr auto EAXRINGMODULATOR_MAXHIGHPASSCUTOFF = 24000.0F;
constexpr auto EAXRINGMODULATOR_DEFAULTHIGHPASSCUTOFF = 800.0F;

constexpr auto EAXRINGMODULATOR_MINWAVEFORM = 0UL;
constexpr auto EAXRINGMODULATOR_MAXWAVEFORM = 2UL;
constexpr auto EAXRINGMODULATOR_DEFAULTWAVEFORM = EAXRINGMODULATOR_MINWAVEFORM;


using LPEAXSET = ALenum(AL_APIENTRY*)(
    const GUID* property_set_id,
    ALuint property_id,
    ALuint property_source_id,
    ALvoid* property_buffer,
    ALuint property_size);

using LPEAXGET = ALenum(AL_APIENTRY*)(
    const GUID* property_set_id,
    ALuint property_id,
    ALuint property_source_id,
    ALvoid* property_buffer,
    ALuint property_size);

#undef DECL_EQOP
#endif // !EAX_API_INCLUDED