diff options
-rw-r--r-- | al/auxeffectslot.cpp | 8 | ||||
-rw-r--r-- | al/buffer.cpp | 5 | ||||
-rw-r--r-- | al/effect.cpp | 4 | ||||
-rw-r--r-- | al/error.cpp | 4 | ||||
-rw-r--r-- | al/filter.cpp | 4 | ||||
-rw-r--r-- | al/source.cpp | 13 | ||||
-rw-r--r-- | alc/alc.cpp | 12 | ||||
-rw-r--r-- | alc/backends/alsa.cpp | 16 | ||||
-rw-r--r-- | alc/backends/coreaudio.cpp | 4 | ||||
-rw-r--r-- | alc/backends/dsound.cpp | 9 | ||||
-rw-r--r-- | alc/backends/jack.cpp | 5 | ||||
-rw-r--r-- | alc/backends/oss.cpp | 14 | ||||
-rw-r--r-- | alc/backends/pulseaudio.cpp | 6 | ||||
-rw-r--r-- | alc/backends/solaris.cpp | 4 | ||||
-rw-r--r-- | alc/backends/wasapi.cpp | 18 | ||||
-rw-r--r-- | alc/backends/wave.cpp | 4 | ||||
-rw-r--r-- | alc/backends/winmm.cpp | 2 | ||||
-rw-r--r-- | alc/context.h | 6 | ||||
-rw-r--r-- | alc/device.h | 10 | ||||
-rw-r--r-- | alc/effects/chorus.cpp | 4 | ||||
-rw-r--r-- | alc/effects/echo.cpp | 6 | ||||
-rw-r--r-- | alc/panning.cpp | 3 | ||||
-rw-r--r-- | core/bformatdec.h | 4 | ||||
-rw-r--r-- | core/hrtf.cpp | 52 | ||||
-rw-r--r-- | core/hrtf.h | 4 | ||||
-rw-r--r-- | core/logging.cpp | 4 |
26 files changed, 115 insertions, 110 deletions
diff --git a/al/auxeffectslot.cpp b/al/auxeffectslot.cpp index c69990fe..3a3222b8 100644 --- a/al/auxeffectslot.cpp +++ b/al/auxeffectslot.cpp @@ -341,7 +341,7 @@ START_API_FUNC } else { - al::vector<ALuint> ids; + std::vector<ALuint> ids; ALsizei count{n}; ids.reserve(static_cast<ALuint>(count)); do { @@ -383,7 +383,7 @@ START_API_FUNC } else { - auto slots = al::vector<ALeffectslot*>(static_cast<ALuint>(n)); + auto slots = std::vector<ALeffectslot*>(static_cast<ALuint>(n)); for(size_t i{0};i < slots.size();++i) { ALeffectslot *slot{LookupEffectSlot(context.get(), effectslots[i])}; @@ -466,7 +466,7 @@ START_API_FUNC context->setError(AL_INVALID_VALUE, "Playing %d effect slots", n); if(n <= 0) UNLIKELY return; - auto slots = al::vector<ALeffectslot*>(static_cast<ALuint>(n)); + auto slots = std::vector<ALeffectslot*>(static_cast<ALuint>(n)); std::lock_guard<std::mutex> _{context->mEffectSlotLock}; for(size_t i{0};i < slots.size();++i) { @@ -520,7 +520,7 @@ START_API_FUNC context->setError(AL_INVALID_VALUE, "Stopping %d effect slots", n); if(n <= 0) UNLIKELY return; - auto slots = al::vector<ALeffectslot*>(static_cast<ALuint>(n)); + auto slots = std::vector<ALeffectslot*>(static_cast<ALuint>(n)); std::lock_guard<std::mutex> _{context->mEffectSlotLock}; for(size_t i{0};i < slots.size();++i) { diff --git a/al/buffer.cpp b/al/buffer.cpp index 1f008c8e..bfc10906 100644 --- a/al/buffer.cpp +++ b/al/buffer.cpp @@ -39,6 +39,7 @@ #include <optional> #include <stdexcept> #include <utility> +#include <vector> #include "AL/al.h" #include "AL/alc.h" @@ -345,7 +346,7 @@ void LoadData(ALCcontext *context, ALbuffer *ALBuf, ALsizei freq, ALuint size, */ if(newsize != ALBuf->mDataStorage.size()) { - auto newdata = al::vector<std::byte,16>(newsize, std::byte{}); + auto newdata = decltype(ALBuf->mDataStorage)(newsize, std::byte{}); if((access&AL_PRESERVE_DATA_BIT_SOFT)) { const size_t tocopy{minz(newdata.size(), ALBuf->mDataStorage.size())}; @@ -663,7 +664,7 @@ START_API_FUNC /* Store the allocated buffer IDs in a separate local list, to avoid * modifying the user storage in case of failure. */ - al::vector<ALuint> ids; + std::vector<ALuint> ids; ids.reserve(static_cast<ALuint>(n)); do { ALbuffer *buffer{AllocBuffer(device)}; diff --git a/al/effect.cpp b/al/effect.cpp index 3d91139a..3ca7c37e 100644 --- a/al/effect.cpp +++ b/al/effect.cpp @@ -31,6 +31,7 @@ #include <new> #include <numeric> #include <utility> +#include <vector> #include "AL/al.h" #include "AL/alc.h" @@ -49,7 +50,6 @@ #include "core/except.h" #include "core/logging.h" #include "opthelpers.h" -#include "vector.h" #ifdef ALSOFT_EAX #include <cassert> @@ -259,7 +259,7 @@ START_API_FUNC /* Store the allocated buffer IDs in a separate local list, to avoid * modifying the user storage in case of failure. */ - al::vector<ALuint> ids; + std::vector<ALuint> ids; ids.reserve(static_cast<ALuint>(n)); do { ALeffect *effect{AllocEffect(device)}; diff --git a/al/error.cpp b/al/error.cpp index 39fd9f0a..b0607d66 100644 --- a/al/error.cpp +++ b/al/error.cpp @@ -31,6 +31,7 @@ #include <cstdio> #include <cstring> #include <mutex> +#include <vector> #include "AL/al.h" #include "AL/alc.h" @@ -41,14 +42,13 @@ #include "core/except.h" #include "core/logging.h" #include "opthelpers.h" -#include "vector.h" bool TrapALError{false}; void ALCcontext::setError(ALenum errorCode, const char *msg, ...) { - auto message = al::vector<char>(256); + auto message = std::vector<char>(256); va_list args, args2; va_start(args, msg); diff --git a/al/filter.cpp b/al/filter.cpp index 0fd8eaa8..11d71179 100644 --- a/al/filter.cpp +++ b/al/filter.cpp @@ -31,6 +31,7 @@ #include <mutex> #include <new> #include <numeric> +#include <vector> #include "AL/al.h" #include "AL/alc.h" @@ -43,7 +44,6 @@ #include "alnumeric.h" #include "core/except.h" #include "opthelpers.h" -#include "vector.h" namespace { @@ -430,7 +430,7 @@ START_API_FUNC /* Store the allocated buffer IDs in a separate local list, to avoid * modifying the user storage in case of failure. */ - al::vector<ALuint> ids; + std::vector<ALuint> ids; ids.reserve(static_cast<ALuint>(n)); do { ALfilter *filter{AllocFilter(device)}; diff --git a/al/source.cpp b/al/source.cpp index efe65332..1bfd5a94 100644 --- a/al/source.cpp +++ b/al/source.cpp @@ -42,6 +42,7 @@ #include <stdexcept> #include <thread> #include <utility> +#include <vector> #include "AL/al.h" #include "AL/alc.h" @@ -2659,7 +2660,7 @@ START_API_FUNC } else { - al::vector<ALuint> ids; + std::vector<ALuint> ids; ids.reserve(static_cast<ALuint>(n)); do { ALsource *source{AllocSource(context.get())}; @@ -3223,7 +3224,7 @@ START_API_FUNC context->setError(AL_INVALID_VALUE, "Playing %d sources", n); if(n <= 0) UNLIKELY return; - al::vector<ALsource*> extra_sources; + std::vector<ALsource*> extra_sources; std::array<ALsource*,8> source_storage; al::span<ALsource*> srchandles; if(static_cast<ALuint>(n) <= source_storage.size()) LIKELY @@ -3261,7 +3262,7 @@ START_API_FUNC if(start_time < 0) UNLIKELY return context->setError(AL_INVALID_VALUE, "Invalid time point %" PRId64, start_time); - al::vector<ALsource*> extra_sources; + std::vector<ALsource*> extra_sources; std::array<ALsource*,8> source_storage; al::span<ALsource*> srchandles; if(static_cast<ALuint>(n) <= source_storage.size()) LIKELY @@ -3301,7 +3302,7 @@ START_API_FUNC context->setError(AL_INVALID_VALUE, "Pausing %d sources", n); if(n <= 0) UNLIKELY return; - al::vector<ALsource*> extra_sources; + std::vector<ALsource*> extra_sources; std::array<ALsource*,8> source_storage; al::span<ALsource*> srchandles; if(static_cast<ALuint>(n) <= source_storage.size()) LIKELY @@ -3377,7 +3378,7 @@ START_API_FUNC context->setError(AL_INVALID_VALUE, "Stopping %d sources", n); if(n <= 0) UNLIKELY return; - al::vector<ALsource*> extra_sources; + std::vector<ALsource*> extra_sources; std::array<ALsource*,8> source_storage; al::span<ALsource*> srchandles; if(static_cast<ALuint>(n) <= source_storage.size()) LIKELY @@ -3440,7 +3441,7 @@ START_API_FUNC context->setError(AL_INVALID_VALUE, "Rewinding %d sources", n); if(n <= 0) UNLIKELY return; - al::vector<ALsource*> extra_sources; + std::vector<ALsource*> extra_sources; std::array<ALsource*,8> source_storage; al::span<ALsource*> srchandles; if(static_cast<ALuint>(n) <= source_storage.size()) LIKELY diff --git a/alc/alc.cpp b/alc/alc.cpp index 290cc3d1..9fedee0b 100644 --- a/alc/alc.cpp +++ b/alc/alc.cpp @@ -55,6 +55,7 @@ #include <string> #include <type_traits> #include <utility> +#include <vector> #include "AL/al.h" #include "AL/alc.h" @@ -102,7 +103,6 @@ #include "opthelpers.h" #include "strutils.h" #include "threads.h" -#include "vector.h" #include "backends/base.h" #include "backends/null.h" @@ -1050,8 +1050,8 @@ using DeviceRef = al::intrusive_ptr<ALCdevice>; /************************************************ * Device lists ************************************************/ -al::vector<ALCdevice*> DeviceList; -al::vector<ALCcontext*> ContextList; +std::vector<ALCdevice*> DeviceList; +std::vector<ALCcontext*> ContextList; std::recursive_mutex ListLock; @@ -3130,7 +3130,7 @@ START_API_FUNC } if(!dev || dev->Type == DeviceType::Capture) { - auto ivals = al::vector<int>(static_cast<uint>(size)); + auto ivals = std::vector<int>(static_cast<uint>(size)); if(size_t got{GetIntegerv(dev.get(), pname, ivals)}) std::copy_n(ivals.begin(), got, values); return; @@ -3249,7 +3249,7 @@ START_API_FUNC break; default: - auto ivals = al::vector<int>(static_cast<uint>(size)); + auto ivals = std::vector<int>(static_cast<uint>(size)); if(size_t got{GetIntegerv(dev.get(), pname, ivals)}) std::copy_n(ivals.begin(), got, values); break; @@ -3676,7 +3676,7 @@ START_API_FUNC DeviceList.erase(iter); std::unique_lock<std::mutex> statelock{dev->StateLock}; - al::vector<ContextRef> orphanctxs; + std::vector<ContextRef> orphanctxs; for(ContextBase *ctx : *dev->mContexts.load()) { auto ctxiter = std::lower_bound(ContextList.begin(), ContextList.end(), ctx); diff --git a/alc/backends/alsa.cpp b/alc/backends/alsa.cpp index c1690867..ce368f5e 100644 --- a/alc/backends/alsa.cpp +++ b/alc/backends/alsa.cpp @@ -35,6 +35,7 @@ #include <string> #include <thread> #include <utility> +#include <vector> #include "albit.h" #include "alc/alconfig.h" @@ -46,7 +47,6 @@ #include "dynload.h" #include "ringbuffer.h" #include "threads.h" -#include "vector.h" #include <alsa/asoundlib.h> @@ -248,8 +248,8 @@ struct DevMap { { } }; -al::vector<DevMap> PlaybackDevices; -al::vector<DevMap> CaptureDevices; +std::vector<DevMap> PlaybackDevices; +std::vector<DevMap> CaptureDevices; const char *prefix_name(snd_pcm_stream_t stream) @@ -258,9 +258,9 @@ const char *prefix_name(snd_pcm_stream_t stream) return (stream==SND_PCM_STREAM_PLAYBACK) ? "device-prefix" : "capture-prefix"; } -al::vector<DevMap> probe_devices(snd_pcm_stream_t stream) +std::vector<DevMap> probe_devices(snd_pcm_stream_t stream) { - al::vector<DevMap> devlist; + std::vector<DevMap> devlist; snd_ctl_card_info_t *info; snd_ctl_card_info_malloc(&info); @@ -439,7 +439,7 @@ struct AlsaPlayback final : public BackendBase { std::mutex mMutex; uint mFrameStep{}; - al::vector<std::byte> mBuffer; + std::vector<std::byte> mBuffer; std::atomic<bool> mKillNow{true}; std::thread mThread; @@ -880,7 +880,7 @@ struct AlsaCapture final : public BackendBase { snd_pcm_t *mPcmHandle{nullptr}; - al::vector<std::byte> mBuffer; + std::vector<std::byte> mBuffer; bool mDoCapture{false}; RingBufferPtr mRing{nullptr}; @@ -1024,7 +1024,7 @@ void AlsaCapture::stop() /* The ring buffer implicitly captures when checking availability. * Direct access needs to explicitly capture it into temp storage. */ - auto temp = al::vector<std::byte>( + auto temp = std::vector<std::byte>( static_cast<size_t>(snd_pcm_frames_to_bytes(mPcmHandle, avail))); captureSamples(temp.data(), avail); mBuffer = std::move(temp); diff --git a/alc/backends/coreaudio.cpp b/alc/backends/coreaudio.cpp index c2a79815..521f085d 100644 --- a/alc/backends/coreaudio.cpp +++ b/alc/backends/coreaudio.cpp @@ -25,13 +25,13 @@ #include <cmath> #include <inttypes.h> #include <memory> -#include <mutex> #include <stdint.h> #include <stdio.h> #include <stdlib.h> #include <string> #include <string.h> #include <unistd.h> +#include <vector> #include "alnumeric.h" #include "core/converter.h" @@ -578,7 +578,7 @@ struct CoreAudioCapture final : public BackendBase { SampleConverterPtr mConverter; - al::vector<char> mCaptureData; + std::vector<char> mCaptureData; RingBufferPtr mRing{nullptr}; diff --git a/alc/backends/dsound.cpp b/alc/backends/dsound.cpp index ffcd8430..5fc8a1c7 100644 --- a/alc/backends/dsound.cpp +++ b/alc/backends/dsound.cpp @@ -46,6 +46,7 @@ #include "albit.h" #include "alnumeric.h" +#include "alspan.h" #include "comptr.h" #include "core/device.h" #include "core/helpers.h" @@ -130,10 +131,10 @@ struct DevMap { { } }; -al::vector<DevMap> PlaybackDevices; -al::vector<DevMap> CaptureDevices; +std::vector<DevMap> PlaybackDevices; +std::vector<DevMap> CaptureDevices; -bool checkName(const al::vector<DevMap> &list, const std::string &name) +bool checkName(const al::span<DevMap> list, const std::string &name) { auto match_name = [&name](const DevMap &entry) -> bool { return entry.name == name; }; @@ -145,7 +146,7 @@ BOOL CALLBACK DSoundEnumDevices(GUID *guid, const WCHAR *desc, const WCHAR*, voi if(!guid) return TRUE; - auto& devices = *static_cast<al::vector<DevMap>*>(data); + auto& devices = *static_cast<std::vector<DevMap>*>(data); const std::string basename{DEVNAME_HEAD + wstr_to_utf8(desc)}; int count{1}; diff --git a/alc/backends/jack.cpp b/alc/backends/jack.cpp index b12edf9f..9e023e21 100644 --- a/alc/backends/jack.cpp +++ b/alc/backends/jack.cpp @@ -30,6 +30,7 @@ #include <mutex> #include <thread> #include <functional> +#include <vector> #include "albit.h" #include "alc/alconfig.h" @@ -168,10 +169,10 @@ struct DeviceEntry { { } }; -al::vector<DeviceEntry> PlaybackList; +std::vector<DeviceEntry> PlaybackList; -void EnumerateDevices(jack_client_t *client, al::vector<DeviceEntry> &list) +void EnumerateDevices(jack_client_t *client, std::vector<DeviceEntry> &list) { std::remove_reference_t<decltype(list)>{}.swap(list); diff --git a/alc/backends/oss.cpp b/alc/backends/oss.cpp index 1fdee701..dc18c4c3 100644 --- a/alc/backends/oss.cpp +++ b/alc/backends/oss.cpp @@ -38,6 +38,7 @@ #include <string> #include <thread> #include <utility> +#include <vector> #include "alc/alconfig.h" #include "almalloc.h" @@ -47,7 +48,6 @@ #include "core/logging.h" #include "ringbuffer.h" #include "threads.h" -#include "vector.h" #include <sys/soundcard.h> @@ -88,22 +88,22 @@ struct DevMap { std::string device_name; }; -al::vector<DevMap> PlaybackDevices; -al::vector<DevMap> CaptureDevices; +std::vector<DevMap> PlaybackDevices; +std::vector<DevMap> CaptureDevices; #ifdef ALC_OSS_COMPAT #define DSP_CAP_OUTPUT 0x00020000 #define DSP_CAP_INPUT 0x00010000 -void ALCossListPopulate(al::vector<DevMap> &devlist, int type) +void ALCossListPopulate(std::vector<DevMap> &devlist, int type) { devlist.emplace_back(DevMap{DefaultName, (type==DSP_CAP_INPUT) ? DefaultCapture : DefaultPlayback}); } #else -void ALCossListAppend(al::vector<DevMap> &list, al::span<const char> handle, al::span<const char> path) +void ALCossListAppend(std::vector<DevMap> &list, al::span<const char> handle, al::span<const char> path) { #ifdef ALC_OSS_DEVNODE_TRUC for(size_t i{0};i < path.size();++i) @@ -148,7 +148,7 @@ void ALCossListAppend(al::vector<DevMap> &list, al::span<const char> handle, al: TRACE("Got device \"%s\", \"%s\"\n", entry.name.c_str(), entry.device_name.c_str()); } -void ALCossListPopulate(al::vector<DevMap> &devlist, int type_flag) +void ALCossListPopulate(std::vector<DevMap> &devlist, int type_flag) { int fd{open("/dev/mixer", O_RDONLY)}; if(fd < 0) @@ -234,7 +234,7 @@ struct OSSPlayback final : public BackendBase { int mFd{-1}; - al::vector<std::byte> mMixData; + std::vector<std::byte> mMixData; std::atomic<bool> mKillNow{true}; std::thread mThread; diff --git a/alc/backends/pulseaudio.cpp b/alc/backends/pulseaudio.cpp index e5696817..d2883f5c 100644 --- a/alc/backends/pulseaudio.cpp +++ b/alc/backends/pulseaudio.cpp @@ -37,6 +37,7 @@ #include <string> #include <sys/types.h> #include <utility> +#include <vector> #include "albit.h" #include "alc/alconfig.h" @@ -49,7 +50,6 @@ #include "dynload.h" #include "opthelpers.h" #include "strutils.h" -#include "vector.h" #include <pulse/pulseaudio.h> @@ -282,8 +282,8 @@ bool checkName(const al::span<const DevMap> list, const std::string &name) return std::find_if(list.cbegin(), list.cend(), match_name) != list.cend(); } -al::vector<DevMap> PlaybackDevices; -al::vector<DevMap> CaptureDevices; +std::vector<DevMap> PlaybackDevices; +std::vector<DevMap> CaptureDevices; /* Global flags and properties */ diff --git a/alc/backends/solaris.cpp b/alc/backends/solaris.cpp index 4eeeafac..ae87e7eb 100644 --- a/alc/backends/solaris.cpp +++ b/alc/backends/solaris.cpp @@ -35,6 +35,7 @@ #include <poll.h> #include <math.h> #include <string.h> +#include <vector> #include <thread> #include <functional> @@ -44,7 +45,6 @@ #include "core/helpers.h" #include "core/logging.h" #include "threads.h" -#include "vector.h" #include <sys/audioio.h> @@ -70,7 +70,7 @@ struct SolarisBackend final : public BackendBase { int mFd{-1}; uint mFrameStep{}; - al::vector<std::byte> mBuffer; + std::vector<std::byte> mBuffer; std::atomic<bool> mKillNow{true}; std::thread mThread; diff --git a/alc/backends/wasapi.cpp b/alc/backends/wasapi.cpp index 97f0a291..d4ad38e2 100644 --- a/alc/backends/wasapi.cpp +++ b/alc/backends/wasapi.cpp @@ -59,6 +59,7 @@ #include "albit.h" #include "alc/alconfig.h" #include "alnumeric.h" +#include "alspan.h" #include "comptr.h" #include "core/converter.h" #include "core/device.h" @@ -180,15 +181,14 @@ struct DevMap { { } }; -bool checkName(const al::vector<DevMap> &list, const std::string &name) +bool checkName(const al::span<DevMap> list, const std::string &name) { - auto match_name = [&name](const DevMap &entry) -> bool - { return entry.name == name; }; + auto match_name = [&name](const DevMap &entry) -> bool { return entry.name == name; }; return std::find_if(list.cbegin(), list.cend(), match_name) != list.cend(); } -al::vector<DevMap> PlaybackDevices; -al::vector<DevMap> CaptureDevices; +std::vector<DevMap> PlaybackDevices; +std::vector<DevMap> CaptureDevices; using NameGUIDPair = std::pair<std::string,std::string>; @@ -262,7 +262,7 @@ EndpointFormFactor get_device_formfactor(IMMDevice *device) } -void add_device(IMMDevice *device, const WCHAR *devid, al::vector<DevMap> &list) +void add_device(IMMDevice *device, const WCHAR *devid, std::vector<DevMap> &list) { for(auto &entry : list) { @@ -301,9 +301,9 @@ WCHAR *get_device_id(IMMDevice *device) return devid; } -void probe_devices(IMMDeviceEnumerator *devenum, EDataFlow flowdir, al::vector<DevMap> &list) +void probe_devices(IMMDeviceEnumerator *devenum, EDataFlow flowdir, std::vector<DevMap> &list) { - al::vector<DevMap>{}.swap(list); + std::vector<DevMap>{}.swap(list); ComPtr<IMMDeviceCollection> coll; HRESULT hr{devenum->EnumAudioEndpoints(flowdir, DEVICE_STATE_ACTIVE, al::out_ptr(coll))}; @@ -1355,7 +1355,7 @@ FORCE_ALIGN int WasapiCapture::recordProc() althrd_setname(RECORD_THREAD_NAME); - al::vector<float> samples; + std::vector<float> samples; while(!mKillNow.load(std::memory_order_relaxed)) { UINT32 avail; diff --git a/alc/backends/wave.cpp b/alc/backends/wave.cpp index f8302f1e..1ee2fe51 100644 --- a/alc/backends/wave.cpp +++ b/alc/backends/wave.cpp @@ -32,6 +32,7 @@ #include <exception> #include <functional> #include <thread> +#include <vector> #include "albit.h" #include "alc/alconfig.h" @@ -43,7 +44,6 @@ #include "opthelpers.h" #include "strutils.h" #include "threads.h" -#include "vector.h" namespace { @@ -104,7 +104,7 @@ struct WaveBackend final : public BackendBase { FILE *mFile{nullptr}; long mDataStart{-1}; - al::vector<std::byte> mBuffer; + std::vector<std::byte> mBuffer; std::atomic<bool> mKillNow{true}; std::thread mThread; diff --git a/alc/backends/winmm.cpp b/alc/backends/winmm.cpp index edb875a0..0345fe10 100644 --- a/alc/backends/winmm.cpp +++ b/alc/backends/winmm.cpp @@ -58,7 +58,7 @@ namespace { std::vector<std::string> PlaybackDevices; std::vector<std::string> CaptureDevices; -bool checkName(const al::vector<std::string> &list, const std::string &name) +bool checkName(const std::vector<std::string> &list, const std::string &name) { return std::find(list.cbegin(), list.cend(), name) != list.cend(); } void ProbePlaybackDevices(void) diff --git a/alc/context.h b/alc/context.h index acbb3788..779be113 100644 --- a/alc/context.h +++ b/alc/context.h @@ -9,6 +9,7 @@ #include <string> #include <string_view> #include <utility> +#include <vector> #include "AL/al.h" #include "AL/alc.h" @@ -21,7 +22,6 @@ #include "core/context.h" #include "inprogext.h" #include "intrusive_ptr.h" -#include "vector.h" #ifdef ALSOFT_EAX #include "al/eax/call.h" @@ -132,11 +132,11 @@ struct ALCcontext : public al::intrusive_ref<ALCcontext>, ContextBase { ALlistener mListener{}; - al::vector<SourceSubList> mSourceList; + std::vector<SourceSubList> mSourceList; ALuint mNumSources{0}; std::mutex mSourceLock; - al::vector<EffectSlotSubList> mEffectSlotList; + std::vector<EffectSlotSubList> mEffectSlotList; ALuint mNumEffectSlots{0u}; std::mutex mEffectSlotLock; diff --git a/alc/device.h b/alc/device.h index d5e82ce3..1274e287 100644 --- a/alc/device.h +++ b/alc/device.h @@ -8,6 +8,7 @@ #include <stdint.h> #include <string> #include <utility> +#include <vector> #include "AL/alc.h" #include "AL/alext.h" @@ -18,7 +19,6 @@ #include "core/device.h" #include "inprogext.h" #include "intrusive_ptr.h" -#include "vector.h" #ifdef ALSOFT_EAX #include "al/eax/x_ram.h" @@ -95,7 +95,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 { @@ -118,15 +118,15 @@ 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}; diff --git a/alc/effects/chorus.cpp b/alc/effects/chorus.cpp index 10ccf9f6..7c281aa5 100644 --- a/alc/effects/chorus.cpp +++ b/alc/effects/chorus.cpp @@ -25,6 +25,7 @@ #include <climits> #include <cstdlib> #include <iterator> +#include <vector> #include "alc/effects/base.h" #include "almalloc.h" @@ -41,7 +42,6 @@ #include "core/resampler_limits.h" #include "intrusive_ptr.h" #include "opthelpers.h" -#include "vector.h" namespace { @@ -49,7 +49,7 @@ namespace { using uint = unsigned int; struct ChorusState final : public EffectState { - al::vector<float,16> mDelayBuffer; + std::vector<float> mDelayBuffer; uint mOffset{0}; uint mLfoOffset{0}; diff --git a/alc/effects/echo.cpp b/alc/effects/echo.cpp index a69529dc..7824c246 100644 --- a/alc/effects/echo.cpp +++ b/alc/effects/echo.cpp @@ -25,6 +25,7 @@ #include <cstdlib> #include <iterator> #include <tuple> +#include <vector> #include "alc/effects/base.h" #include "almalloc.h" @@ -39,7 +40,6 @@ #include "core/mixer.h" #include "intrusive_ptr.h" #include "opthelpers.h" -#include "vector.h" namespace { @@ -49,7 +49,7 @@ using uint = unsigned int; constexpr float LowpassFreqRef{5000.0f}; struct EchoState final : public EffectState { - al::vector<float,16> mSampleBuffer; + std::vector<float> mSampleBuffer; // The echo is two tap. The delay is the number of samples from before the // current offset @@ -87,7 +87,7 @@ void EchoState::deviceUpdate(const DeviceBase *Device, const BufferStorage*) const uint maxlen{NextPowerOf2(float2uint(EchoMaxDelay*frequency + 0.5f) + float2uint(EchoMaxLRDelay*frequency + 0.5f))}; if(maxlen != mSampleBuffer.size()) - al::vector<float,16>(maxlen).swap(mSampleBuffer); + decltype(mSampleBuffer)(maxlen).swap(mSampleBuffer); std::fill(mSampleBuffer.begin(), mSampleBuffer.end(), 0.0f); for(auto &e : mGains) diff --git a/alc/panning.cpp b/alc/panning.cpp index 60ce7ca4..6fc955ee 100644 --- a/alc/panning.cpp +++ b/alc/panning.cpp @@ -34,6 +34,7 @@ #include <numeric> #include <optional> #include <string> +#include <vector> #include "AL/al.h" #include "AL/alc.h" @@ -628,7 +629,7 @@ void InitPanning(ALCdevice *device, const bool hqdec=false, const bool stablize= const size_t ambicount{decoder.mIs3D ? AmbiChannelsFromOrder(decoder.mOrder) : Ambi2DChannelsFromOrder(decoder.mOrder)}; const bool dual_band{hqdec && !decoder.mCoeffsLF.empty()}; - al::vector<ChannelDec> chancoeffs, chancoeffslf; + std::vector<ChannelDec> chancoeffs, chancoeffslf; for(size_t i{0u};i < decoder.mChannels.size();++i) { const uint idx{device->channelIdxByName(decoder.mChannels[i])}; diff --git a/core/bformatdec.h b/core/bformatdec.h index 7a27a5a4..42024bd9 100644 --- a/core/bformatdec.h +++ b/core/bformatdec.h @@ -4,6 +4,7 @@ #include <array> #include <cstddef> #include <memory> +#include <vector> #include "almalloc.h" #include "alspan.h" @@ -11,7 +12,6 @@ #include "bufferline.h" #include "devformat.h" #include "filters/splitter.h" -#include "vector.h" struct FrontStablizer; @@ -43,7 +43,7 @@ class BFormatDec { * only be used in a standard layout struct, and a std::unique_ptr member * (mStablizer) causes GCC and Clang to warn it's not. */ - al::vector<ChannelDecoder> mChannelDec; + std::vector<ChannelDecoder> mChannelDec; public: BFormatDec(const size_t inchans, const al::span<const ChannelDec> coeffs, diff --git a/core/hrtf.cpp b/core/hrtf.cpp index 607e3d3d..7d11ee19 100644 --- a/core/hrtf.cpp +++ b/core/hrtf.cpp @@ -20,6 +20,7 @@ #include <optional> #include <type_traits> #include <utility> +#include <vector> #include "albit.h" #include "alfstream.h" @@ -34,7 +35,6 @@ #include "mixer/hrtfdefs.h" #include "opthelpers.h" #include "polyphase_resampler.h" -#include "vector.h" namespace { @@ -98,10 +98,10 @@ constexpr char magicMarker03[8]{'M','i','n','P','H','R','0','3'}; constexpr auto PassthruCoeff = static_cast<float>(1.0/al::numbers::sqrt2); std::mutex LoadedHrtfLock; -al::vector<LoadedHrtf> LoadedHrtfs; +std::vector<LoadedHrtf> LoadedHrtfs; std::mutex EnumeratedHrtfLock; -al::vector<HrtfEntry> EnumeratedHrtfs; +std::vector<HrtfEntry> EnumeratedHrtfs; class databuf final : public std::streambuf { @@ -295,7 +295,7 @@ void DirectHrtfState::build(const HrtfStore *Hrtf, const uint irSize, const bool } uint min_delay{HrtfHistoryLength*HrirDelayFracOne}, max_delay{0}; - al::vector<ImpulseResponse> impres; impres.reserve(AmbiPoints.size()); + std::vector<ImpulseResponse> impres; impres.reserve(AmbiPoints.size()); auto calc_res = [Hrtf,&max_delay,&min_delay](const AngularPoint &pt) -> ImpulseResponse { auto &field = Hrtf->mFields[0]; @@ -331,7 +331,7 @@ void DirectHrtfState::build(const HrtfStore *Hrtf, const uint irSize, const bool TRACE("Min delay: %.2f, max delay: %.2f, FIR length: %u\n", min_delay/double{HrirDelayFracOne}, max_delay/double{HrirDelayFracOne}, irSize); - auto tmpres = al::vector<std::array<double2,HrirLength>>(mChannels.size()); + auto tmpres = std::vector<std::array<double2,HrirLength>>(mChannels.size()); max_delay = 0; for(size_t c{0u};c < AmbiPoints.size();++c) { @@ -529,7 +529,7 @@ std::unique_ptr<HrtfStore> LoadHrtf00(std::istream &data, const char *filename) return nullptr; } - auto elevs = al::vector<HrtfStore::Elevation>(evCount); + auto elevs = std::vector<HrtfStore::Elevation>(evCount); for(auto &elev : elevs) elev.irOffset = readle<uint16_t>(data); if(!data || data.eof()) @@ -571,8 +571,8 @@ std::unique_ptr<HrtfStore> LoadHrtf00(std::istream &data, const char *filename) return nullptr; } - auto coeffs = al::vector<HrirArray>(irCount, HrirArray{}); - auto delays = al::vector<ubyte2>(irCount); + auto coeffs = std::vector<HrirArray>(irCount, HrirArray{}); + auto delays = std::vector<ubyte2>(irCount); for(auto &hrir : coeffs) { for(auto &val : al::span<float2>{hrir.data(), irSize}) @@ -626,7 +626,7 @@ std::unique_ptr<HrtfStore> LoadHrtf01(std::istream &data, const char *filename) return nullptr; } - auto elevs = al::vector<HrtfStore::Elevation>(evCount); + auto elevs = std::vector<HrtfStore::Elevation>(evCount); for(auto &elev : elevs) elev.azCount = readle<uint8_t>(data); if(!data || data.eof()) @@ -649,8 +649,8 @@ std::unique_ptr<HrtfStore> LoadHrtf01(std::istream &data, const char *filename) elevs[i].irOffset = static_cast<ushort>(elevs[i-1].irOffset + elevs[i-1].azCount); const ushort irCount{static_cast<ushort>(elevs.back().irOffset + elevs.back().azCount)}; - auto coeffs = al::vector<HrirArray>(irCount, HrirArray{}); - auto delays = al::vector<ubyte2>(irCount); + auto coeffs = std::vector<HrirArray>(irCount, HrirArray{}); + auto delays = std::vector<ubyte2>(irCount); for(auto &hrir : coeffs) { for(auto &val : al::span<float2>{hrir.data(), irSize}) @@ -722,8 +722,8 @@ std::unique_ptr<HrtfStore> LoadHrtf02(std::istream &data, const char *filename) return nullptr; } - auto fields = al::vector<HrtfStore::Field>(fdCount); - auto elevs = al::vector<HrtfStore::Elevation>{}; + auto fields = std::vector<HrtfStore::Field>(fdCount); + auto elevs = std::vector<HrtfStore::Elevation>{}; for(size_t f{0};f < fdCount;f++) { const ushort distance{readle<uint16_t>(data)}; @@ -787,8 +787,8 @@ std::unique_ptr<HrtfStore> LoadHrtf02(std::istream &data, const char *filename) }); const auto irTotal = static_cast<ushort>(elevs.back().azCount + elevs.back().irOffset); - auto coeffs = al::vector<HrirArray>(irTotal, HrirArray{}); - auto delays = al::vector<ubyte2>(irTotal); + auto coeffs = std::vector<HrirArray>(irTotal, HrirArray{}); + auto delays = std::vector<ubyte2>(irTotal); if(channelType == ChanType_LeftOnly) { if(sampleType == SampleType_S16) @@ -881,10 +881,10 @@ std::unique_ptr<HrtfStore> LoadHrtf02(std::istream &data, const char *filename) if(fdCount > 1) { - auto fields_ = al::vector<HrtfStore::Field>(fields.size()); - auto elevs_ = al::vector<HrtfStore::Elevation>(elevs.size()); - auto coeffs_ = al::vector<HrirArray>(coeffs.size()); - auto delays_ = al::vector<ubyte2>(delays.size()); + auto fields_ = std::vector<HrtfStore::Field>(fields.size()); + auto elevs_ = std::vector<HrtfStore::Elevation>(elevs.size()); + auto coeffs_ = std::vector<HrirArray>(coeffs.size()); + auto delays_ = std::vector<ubyte2>(delays.size()); /* Simple reverse for the per-field elements. */ std::reverse_copy(fields.cbegin(), fields.cend(), fields_.begin()); @@ -983,8 +983,8 @@ std::unique_ptr<HrtfStore> LoadHrtf03(std::istream &data, const char *filename) return nullptr; } - auto fields = al::vector<HrtfStore::Field>(fdCount); - auto elevs = al::vector<HrtfStore::Elevation>{}; + auto fields = std::vector<HrtfStore::Field>(fdCount); + auto elevs = std::vector<HrtfStore::Elevation>{}; for(size_t f{0};f < fdCount;f++) { const ushort distance{readle<uint16_t>(data)}; @@ -1048,8 +1048,8 @@ std::unique_ptr<HrtfStore> LoadHrtf03(std::istream &data, const char *filename) }); const auto irTotal = static_cast<ushort>(elevs.back().azCount + elevs.back().irOffset); - auto coeffs = al::vector<HrirArray>(irTotal, HrirArray{}); - auto delays = al::vector<ubyte2>(irTotal); + auto coeffs = std::vector<HrirArray>(irTotal, HrirArray{}); + auto delays = std::vector<ubyte2>(irTotal); if(channelType == ChanType_LeftOnly) { for(auto &hrir : coeffs) @@ -1221,7 +1221,7 @@ al::span<const char> GetResource(int name) } // namespace -al::vector<std::string> EnumerateHrtf(std::optional<std::string> pathopt) +std::vector<std::string> EnumerateHrtf(std::optional<std::string> pathopt) { std::lock_guard<std::mutex> _{EnumeratedHrtfLock}; EnumeratedHrtfs.clear(); @@ -1270,7 +1270,7 @@ al::vector<std::string> EnumerateHrtf(std::optional<std::string> pathopt) AddBuiltInEntry("Built-In HRTF", IDR_DEFAULT_HRTF_MHR); } - al::vector<std::string> list; + std::vector<std::string> list; list.reserve(EnumeratedHrtfs.size()); for(auto &entry : EnumeratedHrtfs) list.emplace_back(entry.mDispName); @@ -1394,7 +1394,7 @@ HrtfStorePtr GetLoadedHrtf(const std::string &name, const uint devrate) /* Scale the delays for the new sample rate. */ float max_delay{0.0f}; - auto new_delays = al::vector<float2>(irCount); + auto new_delays = std::vector<float2>(irCount); const float rate_scale{static_cast<float>(devrate)/static_cast<float>(hrtf->mSampleRate)}; for(size_t i{0};i < irCount;++i) { diff --git a/core/hrtf.h b/core/hrtf.h index 7215711b..5e6e09a8 100644 --- a/core/hrtf.h +++ b/core/hrtf.h @@ -6,6 +6,7 @@ #include <memory> #include <optional> #include <string> +#include <vector> #include "almalloc.h" #include "alspan.h" @@ -14,7 +15,6 @@ #include "bufferline.h" #include "mixer/hrtfdefs.h" #include "intrusive_ptr.h" -#include "vector.h" struct HrtfStore { @@ -83,7 +83,7 @@ struct DirectHrtfState { }; -al::vector<std::string> EnumerateHrtf(std::optional<std::string> pathopt); +std::vector<std::string> EnumerateHrtf(std::optional<std::string> pathopt); HrtfStorePtr GetLoadedHrtf(const std::string &name, const uint devrate); #endif /* CORE_HRTF_H */ diff --git a/core/logging.cpp b/core/logging.cpp index 8e0116ea..34385cf4 100644 --- a/core/logging.cpp +++ b/core/logging.cpp @@ -6,10 +6,10 @@ #include <cstdarg> #include <cstdio> #include <string> +#include <vector> #include "alspan.h" #include "strutils.h" -#include "vector.h" #if defined(_WIN32) @@ -34,7 +34,7 @@ void al_print(LogLevel level, FILE *logfile, const char *fmt, ...) case LogLevel::Trace: prefix = al::span{"[ALSOFT] (II) "}.first<14>(); break; } - al::vector<char> dynmsg; + std::vector<char> dynmsg; std::array<char,256> stcmsg{}; char *str{stcmsg.data()}; |