2022-05-30 16:32:45 -04:00
|
|
|
#ifndef EAX_UTILS_INCLUDED
|
|
|
|
|
#define EAX_UTILS_INCLUDED
|
|
|
|
|
|
2024-06-30 14:35:57 -05:00
|
|
|
#include <string_view>
|
2022-05-30 16:32:45 -04:00
|
|
|
|
2025-09-03 11:09:27 -05:00
|
|
|
#include "fmt/core.h"
|
2024-06-30 14:35:57 -05:00
|
|
|
#include "opthelpers.h"
|
|
|
|
|
|
2022-05-30 16:32:45 -04:00
|
|
|
|
2024-03-21 17:33:47 +00:00
|
|
|
struct EaxAlLowPassParam {
|
2022-05-30 16:32:45 -04:00
|
|
|
float gain;
|
|
|
|
|
float gain_hf;
|
2024-03-21 17:33:47 +00:00
|
|
|
};
|
2022-05-30 16:32:45 -04:00
|
|
|
|
2024-06-30 14:35:57 -05:00
|
|
|
void eax_log_exception(std::string_view message) noexcept;
|
2022-05-30 16:32:45 -04:00
|
|
|
|
2024-03-21 17:33:47 +00:00
|
|
|
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,
|
2022-05-30 16:32:45 -04:00
|
|
|
const TValue& max_value)
|
|
|
|
|
{
|
2024-06-30 14:35:57 -05:00
|
|
|
if(value >= min_value && value <= max_value) LIKELY
|
2022-05-30 16:32:45 -04:00
|
|
|
return;
|
|
|
|
|
|
2025-09-03 11:09:27 -05:00
|
|
|
const auto message = fmt::format("{} out of range (value: {}; min: {}; max: {}).", value_name,
|
|
|
|
|
value, min_value, max_value);
|
2022-05-30 16:32:45 -04:00
|
|
|
throw TException{message.c_str()};
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
#endif // !EAX_UTILS_INCLUDED
|