Update OpenAL-soft to 1.23.1-bc7cb17.

This commit is contained in:
Miku AuahDark
2024-03-20 11:06:03 +08:00
parent 4a512be715
commit 73a6fc9196
294 changed files with 44342 additions and 40077 deletions
+42 -61
View File
@@ -1,51 +1,54 @@
#ifndef AL_EFFECTS_EFFECTS_H
#define AL_EFFECTS_EFFECTS_H
#include <variant>
#include "AL/al.h"
#include "core/except.h"
#ifdef ALSOFT_EAX
#include "al/eax_effect.h"
#endif // ALSOFT_EAX
union EffectProps;
#include "al/error.h"
#include "core/effects/base.h"
class effect_exception final : public al::base_exception {
ALenum mErrorCode;
struct EffectHandler {
#define DECL_HANDLER(T) \
static void SetParami(T &props, ALenum param, int val); \
static void SetParamiv(T &props, ALenum param, const int *vals); \
static void SetParamf(T &props, ALenum param, float val); \
static void SetParamfv(T &props, ALenum param, const float *vals); \
static void GetParami(const T &props, ALenum param, int *val); \
static void GetParamiv(const T &props, ALenum param, int *vals); \
static void GetParamf(const T &props, ALenum param, float *val); \
static void GetParamfv(const T &props, ALenum param, float *vals);
public:
#ifdef __USE_MINGW_ANSI_STDIO
[[gnu::format(gnu_printf, 3, 4)]]
#else
[[gnu::format(printf, 3, 4)]]
#endif
effect_exception(ALenum code, const char *msg, ...);
DECL_HANDLER(std::monostate)
DECL_HANDLER(ReverbProps)
DECL_HANDLER(ChorusProps)
DECL_HANDLER(AutowahProps)
DECL_HANDLER(CompressorProps)
DECL_HANDLER(ConvolutionProps)
DECL_HANDLER(DedicatedDialogProps)
DECL_HANDLER(DedicatedLfeProps)
DECL_HANDLER(DistortionProps)
DECL_HANDLER(EchoProps)
DECL_HANDLER(EqualizerProps)
DECL_HANDLER(FlangerProps)
DECL_HANDLER(FshifterProps)
DECL_HANDLER(ModulatorProps)
DECL_HANDLER(PshifterProps)
DECL_HANDLER(VmorpherProps)
#undef DECL_HANDLER
ALenum errorCode() const noexcept { return mErrorCode; }
static void StdReverbSetParami(ReverbProps &props, ALenum param, int val);
static void StdReverbSetParamiv(ReverbProps &props, ALenum param, const int *vals);
static void StdReverbSetParamf(ReverbProps &props, ALenum param, float val);
static void StdReverbSetParamfv(ReverbProps &props, ALenum param, const float *vals);
static void StdReverbGetParami(const ReverbProps &props, ALenum param, int *val);
static void StdReverbGetParamiv(const ReverbProps &props, ALenum param, int *vals);
static void StdReverbGetParamf(const ReverbProps &props, ALenum param, float *val);
static void StdReverbGetParamfv(const ReverbProps &props, ALenum param, float *vals);
};
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, \
}
using effect_exception = al::context_error;
/* Default properties for the given effect types. */
@@ -63,30 +66,8 @@ extern const EffectProps FshifterEffectProps;
extern const EffectProps ModulatorEffectProps;
extern const EffectProps PshifterEffectProps;
extern const EffectProps VmorpherEffectProps;
extern const EffectProps DedicatedEffectProps;
extern const EffectProps DedicatedDialogEffectProps;
extern const EffectProps DedicatedLfeEffectProps;
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;
#ifdef ALSOFT_EAX
EaxEffectUPtr eax_create_eax_effect(ALenum al_effect_type);
#endif // ALSOFT_EAX
#endif /* AL_EFFECTS_EFFECTS_H */