aboutsummaryrefslogtreecommitdiffstats
path: root/al/effects/effects.h
diff options
context:
space:
mode:
authorChris Robinson <[email protected]>2020-11-25 13:55:29 -0800
committerChris Robinson <[email protected]>2020-11-25 13:55:29 -0800
commit32b9a46b39e3bfb3ccf1e05c520ce40232efa5d9 (patch)
tree9fbf486aca18ac198bb7827661d9ac60c394b645 /al/effects/effects.h
parent3970252da9d3148ea0b45990bb2476ee3b99fb0c (diff)
Move AL EffectProp handling to separate sources
Diffstat (limited to 'al/effects/effects.h')
-rw-r--r--al/effects/effects.h75
1 files changed, 75 insertions, 0 deletions
diff --git a/al/effects/effects.h b/al/effects/effects.h
new file mode 100644
index 00000000..1850271b
--- /dev/null
+++ b/al/effects/effects.h
@@ -0,0 +1,75 @@
+#ifndef AL_EFFECTS_EFFECTS_H
+#define AL_EFFECTS_EFFECTS_H
+
+#include "AL/al.h"
+
+#include "alexcpt.h"
+
+union EffectProps;
+
+
+class effect_exception final : public al::base_exception {
+public:
+ [[gnu::format(printf, 3, 4)]]
+ effect_exception(ALenum code, const char *msg, ...);
+};
+
+
+struct EffectVtable {
+ void (*const setParami)(EffectProps *props, ALenum param, int val);
+ void (*const setParamiv)(EffectProps *props, ALenum param, const int *vals);
+ void (*const setParamf)(EffectProps *props, ALenum param, float val);
+ void (*const setParamfv)(EffectProps *props, ALenum param, const float *vals);
+
+ void (*const getParami)(const EffectProps *props, ALenum param, int *val);
+ void (*const getParamiv)(const EffectProps *props, ALenum param, int *vals);
+ void (*const getParamf)(const EffectProps *props, ALenum param, float *val);
+ void (*const getParamfv)(const EffectProps *props, ALenum param, float *vals);
+};
+
+#define DEFINE_ALEFFECT_VTABLE(T) \
+const EffectVtable T##EffectVtable = { \
+ T##_setParami, T##_setParamiv, \
+ T##_setParamf, T##_setParamfv, \
+ T##_getParami, T##_getParamiv, \
+ T##_getParamf, T##_getParamfv, \
+}
+
+
+/* Default properties for the given effect types. */
+extern const EffectProps NullEffectProps;
+extern const EffectProps ReverbEffectProps;
+extern const EffectProps StdReverbEffectProps;
+extern const EffectProps AutowahEffectProps;
+extern const EffectProps ChorusEffectProps;
+extern const EffectProps CompressorEffectProps;
+extern const EffectProps DistortionEffectProps;
+extern const EffectProps EchoEffectProps;
+extern const EffectProps EqualizerEffectProps;
+extern const EffectProps FlangerEffectProps;
+extern const EffectProps FshifterEffectProps;
+extern const EffectProps ModulatorEffectProps;
+extern const EffectProps PshifterEffectProps;
+extern const EffectProps VmorpherEffectProps;
+extern const EffectProps DedicatedEffectProps;
+extern const EffectProps ConvolutionEffectProps;
+
+/* Vtables to get/set properties for the given effect types. */
+extern const EffectVtable NullEffectVtable;
+extern const EffectVtable ReverbEffectVtable;
+extern const EffectVtable StdReverbEffectVtable;
+extern const EffectVtable AutowahEffectVtable;
+extern const EffectVtable ChorusEffectVtable;
+extern const EffectVtable CompressorEffectVtable;
+extern const EffectVtable DistortionEffectVtable;
+extern const EffectVtable EchoEffectVtable;
+extern const EffectVtable EqualizerEffectVtable;
+extern const EffectVtable FlangerEffectVtable;
+extern const EffectVtable FshifterEffectVtable;
+extern const EffectVtable ModulatorEffectVtable;
+extern const EffectVtable PshifterEffectVtable;
+extern const EffectVtable VmorpherEffectVtable;
+extern const EffectVtable DedicatedEffectVtable;
+extern const EffectVtable ConvolutionEffectVtable;
+
+#endif /* AL_EFFECTS_EFFECTS_H */