Define the CoreAudio default name only when needed
[openal-soft.git] / al / effects / effects.h
blob830e7191c01b169a684466a93501bfba1c4d38b3
1 #ifndef AL_EFFECTS_EFFECTS_H
2 #define AL_EFFECTS_EFFECTS_H
4 #include "AL/al.h"
6 #include "core/except.h"
8 #ifdef ALSOFT_EAX
9 #include "al/eax_effect.h"
10 #endif // ALSOFT_EAX
12 union EffectProps;
15 class effect_exception final : public al::base_exception {
16 ALenum mErrorCode;
18 public:
19 #ifdef __USE_MINGW_ANSI_STDIO
20 [[gnu::format(gnu_printf, 3, 4)]]
21 #else
22 [[gnu::format(printf, 3, 4)]]
23 #endif
24 effect_exception(ALenum code, const char *msg, ...);
26 ALenum errorCode() const noexcept { return mErrorCode; }
30 struct EffectVtable {
31 void (*const setParami)(EffectProps *props, ALenum param, int val);
32 void (*const setParamiv)(EffectProps *props, ALenum param, const int *vals);
33 void (*const setParamf)(EffectProps *props, ALenum param, float val);
34 void (*const setParamfv)(EffectProps *props, ALenum param, const float *vals);
36 void (*const getParami)(const EffectProps *props, ALenum param, int *val);
37 void (*const getParamiv)(const EffectProps *props, ALenum param, int *vals);
38 void (*const getParamf)(const EffectProps *props, ALenum param, float *val);
39 void (*const getParamfv)(const EffectProps *props, ALenum param, float *vals);
42 #define DEFINE_ALEFFECT_VTABLE(T) \
43 const EffectVtable T##EffectVtable = { \
44 T##_setParami, T##_setParamiv, \
45 T##_setParamf, T##_setParamfv, \
46 T##_getParami, T##_getParamiv, \
47 T##_getParamf, T##_getParamfv, \
51 /* Default properties for the given effect types. */
52 extern const EffectProps NullEffectProps;
53 extern const EffectProps ReverbEffectProps;
54 extern const EffectProps StdReverbEffectProps;
55 extern const EffectProps AutowahEffectProps;
56 extern const EffectProps ChorusEffectProps;
57 extern const EffectProps CompressorEffectProps;
58 extern const EffectProps DistortionEffectProps;
59 extern const EffectProps EchoEffectProps;
60 extern const EffectProps EqualizerEffectProps;
61 extern const EffectProps FlangerEffectProps;
62 extern const EffectProps FshifterEffectProps;
63 extern const EffectProps ModulatorEffectProps;
64 extern const EffectProps PshifterEffectProps;
65 extern const EffectProps VmorpherEffectProps;
66 extern const EffectProps DedicatedEffectProps;
67 extern const EffectProps ConvolutionEffectProps;
69 /* Vtables to get/set properties for the given effect types. */
70 extern const EffectVtable NullEffectVtable;
71 extern const EffectVtable ReverbEffectVtable;
72 extern const EffectVtable StdReverbEffectVtable;
73 extern const EffectVtable AutowahEffectVtable;
74 extern const EffectVtable ChorusEffectVtable;
75 extern const EffectVtable CompressorEffectVtable;
76 extern const EffectVtable DistortionEffectVtable;
77 extern const EffectVtable EchoEffectVtable;
78 extern const EffectVtable EqualizerEffectVtable;
79 extern const EffectVtable FlangerEffectVtable;
80 extern const EffectVtable FshifterEffectVtable;
81 extern const EffectVtable ModulatorEffectVtable;
82 extern const EffectVtable PshifterEffectVtable;
83 extern const EffectVtable VmorpherEffectVtable;
84 extern const EffectVtable DedicatedEffectVtable;
85 extern const EffectVtable ConvolutionEffectVtable;
88 #ifdef ALSOFT_EAX
89 EaxEffectUPtr eax_create_eax_effect(ALenum al_effect_type);
90 #endif // ALSOFT_EAX
92 #endif /* AL_EFFECTS_EFFECTS_H */