Torque3D/Engine/lib/openal-soft/al/eax/utils.h

30 lines
712 B
C
Raw Normal View History

#ifndef EAX_UTILS_INCLUDED
#define EAX_UTILS_INCLUDED
2024-06-30 14:35:57 -05:00
#include <string_view>
#include "fmt/core.h"
2024-06-30 14:35:57 -05:00
#include "opthelpers.h"
struct EaxAlLowPassParam {
float gain;
float gain_hf;
};
2024-06-30 14:35:57 -05:00
void eax_log_exception(std::string_view message) noexcept;
template<typename TException, typename TValue>
2024-06-30 14:35:57 -05:00
void eax_validate_range(std::string_view value_name, const TValue& value, const TValue& min_value,
const TValue& max_value)
{
2024-06-30 14:35:57 -05:00
if(value >= min_value && value <= max_value) LIKELY
return;
const auto message = fmt::format("{} out of range (value: {}; min: {}; max: {}).", value_name,
value, min_value, max_value);
throw TException{message.c_str()};
}
#endif // !EAX_UTILS_INCLUDED