mirror of
https://github.com/love2d/megasource.git
synced 2026-08-20 04:30:45 +02:00
update OpenAL-Soft to 1.24.3.
This commit is contained in:
@@ -1,34 +1,29 @@
|
||||
#ifndef ALC_DEVICE_H
|
||||
#define ALC_DEVICE_H
|
||||
|
||||
#include <array>
|
||||
#include "config.h"
|
||||
|
||||
#include <atomic>
|
||||
#include <memory>
|
||||
#include <mutex>
|
||||
#include <optional>
|
||||
#include <stdint.h>
|
||||
#include <string>
|
||||
#include <unordered_map>
|
||||
#include <utility>
|
||||
#include <string_view>
|
||||
#include <vector>
|
||||
|
||||
#include "AL/al.h"
|
||||
#include "AL/alc.h"
|
||||
#include "AL/alext.h"
|
||||
|
||||
#include "alconfig.h"
|
||||
#include "almalloc.h"
|
||||
#include "alnumeric.h"
|
||||
#include "core/device.h"
|
||||
#include "inprogext.h"
|
||||
#include "intrusive_ptr.h"
|
||||
|
||||
#ifdef ALSOFT_EAX
|
||||
#if ALSOFT_EAX
|
||||
#include "al/eax/x_ram.h"
|
||||
#endif // ALSOFT_EAX
|
||||
|
||||
struct ALbuffer;
|
||||
struct ALeffect;
|
||||
struct ALfilter;
|
||||
struct BackendBase;
|
||||
struct BufferSubList;
|
||||
struct EffectSubList;
|
||||
@@ -37,7 +32,11 @@ struct FilterSubList;
|
||||
using uint = unsigned int;
|
||||
|
||||
|
||||
struct ALCdevice : public al::intrusive_ref<ALCdevice>, DeviceBase {
|
||||
struct ALCdevice { virtual ~ALCdevice() = default; };
|
||||
|
||||
namespace al {
|
||||
|
||||
struct Device final : public ALCdevice, al::intrusive_ref<al::Device>, DeviceBase {
|
||||
/* This lock protects the device state (format, update size, etc) from
|
||||
* being from being changed in multiple threads, or being accessed while
|
||||
* being changed. It's also used to serialize calls to the backend.
|
||||
@@ -87,7 +86,7 @@ struct ALCdevice : public al::intrusive_ref<ALCdevice>, DeviceBase {
|
||||
std::mutex FilterLock;
|
||||
std::vector<FilterSubList> FilterList;
|
||||
|
||||
#ifdef ALSOFT_EAX
|
||||
#if ALSOFT_EAX
|
||||
ALuint eax_x_ram_free_size{eax_x_ram_max_size};
|
||||
#endif // ALSOFT_EAX
|
||||
|
||||
@@ -96,35 +95,41 @@ struct ALCdevice : public al::intrusive_ref<ALCdevice>, DeviceBase {
|
||||
std::unordered_map<ALuint,std::string> mEffectNames;
|
||||
std::unordered_map<ALuint,std::string> mFilterNames;
|
||||
|
||||
ALCdevice(DeviceType type);
|
||||
~ALCdevice();
|
||||
std::string mVendorOverride;
|
||||
std::string mVersionOverride;
|
||||
std::string mRendererOverride;
|
||||
|
||||
explicit Device(DeviceType type);
|
||||
~Device() final;
|
||||
|
||||
void enumerateHrtfs();
|
||||
|
||||
bool getConfigValueBool(const std::string_view block, const std::string_view key, bool def)
|
||||
{ return GetConfigValueBool(DeviceName, block, key, def); }
|
||||
{ return GetConfigValueBool(mDeviceName, block, key, def); }
|
||||
|
||||
template<typename T>
|
||||
inline std::optional<T> configValue(const std::string_view block, const std::string_view key) = delete;
|
||||
auto configValue(const std::string_view block, const std::string_view key) -> std::optional<T> = delete;
|
||||
};
|
||||
|
||||
template<>
|
||||
inline std::optional<std::string> ALCdevice::configValue(const std::string_view block, const std::string_view key)
|
||||
{ return ConfigValueStr(DeviceName, block, key); }
|
||||
template<>
|
||||
inline std::optional<int> ALCdevice::configValue(const std::string_view block, const std::string_view key)
|
||||
{ return ConfigValueInt(DeviceName, block, key); }
|
||||
template<>
|
||||
inline std::optional<uint> ALCdevice::configValue(const std::string_view block, const std::string_view key)
|
||||
{ return ConfigValueUInt(DeviceName, block, key); }
|
||||
template<>
|
||||
inline std::optional<float> ALCdevice::configValue(const std::string_view block, const std::string_view key)
|
||||
{ return ConfigValueFloat(DeviceName, block, key); }
|
||||
template<>
|
||||
inline std::optional<bool> ALCdevice::configValue(const std::string_view block, const std::string_view key)
|
||||
{ return ConfigValueBool(DeviceName, block, key); }
|
||||
template<> inline
|
||||
auto Device::configValue(const std::string_view block, const std::string_view key) -> std::optional<std::string>
|
||||
{ return ConfigValueStr(mDeviceName, block, key); }
|
||||
template<> inline
|
||||
auto Device::configValue(const std::string_view block, const std::string_view key) -> std::optional<int>
|
||||
{ return ConfigValueInt(mDeviceName, block, key); }
|
||||
template<> inline
|
||||
auto Device::configValue(const std::string_view block, const std::string_view key) -> std::optional<uint>
|
||||
{ return ConfigValueUInt(mDeviceName, block, key); }
|
||||
template<> inline
|
||||
auto Device::configValue(const std::string_view block, const std::string_view key) -> std::optional<float>
|
||||
{ return ConfigValueFloat(mDeviceName, block, key); }
|
||||
template<> inline
|
||||
auto Device::configValue(const std::string_view block, const std::string_view key) -> std::optional<bool>
|
||||
{ return ConfigValueBool(mDeviceName, block, key); }
|
||||
|
||||
} // namespace al
|
||||
|
||||
/** Stores the latest ALC device error. */
|
||||
void alcSetError(ALCdevice *device, ALCenum errorCode);
|
||||
void alcSetError(al::Device *device, ALCenum errorCode);
|
||||
|
||||
#endif
|
||||
|
||||
Reference in New Issue
Block a user