diff options
Diffstat (limited to 'alc/device.h')
-rw-r--r-- | alc/device.h | 31 |
1 files changed, 20 insertions, 11 deletions
diff --git a/alc/device.h b/alc/device.h index ef50f53e..66f37a7e 100644 --- a/alc/device.h +++ b/alc/device.h @@ -4,9 +4,12 @@ #include <atomic> #include <memory> #include <mutex> +#include <optional> #include <stdint.h> #include <string> +#include <unordered_map> #include <utility> +#include <vector> #include "AL/alc.h" #include "AL/alext.h" @@ -17,7 +20,6 @@ #include "core/device.h" #include "inprogext.h" #include "intrusive_ptr.h" -#include "vector.h" #ifdef ALSOFT_EAX #include "al/eax/x_ram.h" @@ -94,7 +96,7 @@ struct ALCdevice : public al::intrusive_ref<ALCdevice>, DeviceBase { uint AuxiliaryEffectSlotMax{}; std::string mHrtfName; - al::vector<std::string> mHrtfList; + std::vector<std::string> mHrtfList; ALCenum mHrtfStatus{ALC_FALSE}; enum class OutputMode1 : ALCenum { @@ -117,21 +119,25 @@ struct ALCdevice : public al::intrusive_ref<ALCdevice>, DeviceBase { // Map of Buffers for this device std::mutex BufferLock; - al::vector<BufferSubList> BufferList; + std::vector<BufferSubList> BufferList; // Map of Effects for this device std::mutex EffectLock; - al::vector<EffectSubList> EffectList; + std::vector<EffectSubList> EffectList; // Map of Filters for this device std::mutex FilterLock; - al::vector<FilterSubList> FilterList; + std::vector<FilterSubList> FilterList; #ifdef ALSOFT_EAX ALuint eax_x_ram_free_size{eax_x_ram_max_size}; #endif // ALSOFT_EAX + std::unordered_map<ALuint,std::string> mBufferNames; + std::unordered_map<ALuint,std::string> mEffectNames; + std::unordered_map<ALuint,std::string> mFilterNames; + ALCdevice(DeviceType type); ~ALCdevice(); @@ -141,25 +147,28 @@ struct ALCdevice : public al::intrusive_ref<ALCdevice>, DeviceBase { { return GetConfigValueBool(DeviceName.c_str(), block, key, def); } template<typename T> - inline al::optional<T> configValue(const char *block, const char *key) = delete; + inline std::optional<T> configValue(const char *block, const char *key) = delete; DEF_NEWDEL(ALCdevice) }; template<> -inline al::optional<std::string> ALCdevice::configValue(const char *block, const char *key) +inline std::optional<std::string> ALCdevice::configValue(const char *block, const char *key) { return ConfigValueStr(DeviceName.c_str(), block, key); } template<> -inline al::optional<int> ALCdevice::configValue(const char *block, const char *key) +inline std::optional<int> ALCdevice::configValue(const char *block, const char *key) { return ConfigValueInt(DeviceName.c_str(), block, key); } template<> -inline al::optional<uint> ALCdevice::configValue(const char *block, const char *key) +inline std::optional<uint> ALCdevice::configValue(const char *block, const char *key) { return ConfigValueUInt(DeviceName.c_str(), block, key); } template<> -inline al::optional<float> ALCdevice::configValue(const char *block, const char *key) +inline std::optional<float> ALCdevice::configValue(const char *block, const char *key) { return ConfigValueFloat(DeviceName.c_str(), block, key); } template<> -inline al::optional<bool> ALCdevice::configValue(const char *block, const char *key) +inline std::optional<bool> ALCdevice::configValue(const char *block, const char *key) { return ConfigValueBool(DeviceName.c_str(), block, key); } +/** Stores the latest ALC device error. */ +void alcSetError(ALCdevice *device, ALCenum errorCode); + #endif |