aboutsummaryrefslogtreecommitdiffstats
path: root/al/source.h
diff options
context:
space:
mode:
authorSven Gothel <sgothel@jausoft.com>2023-11-28 12:51:46 +0100
committerSven Gothel <sgothel@jausoft.com>2023-11-28 12:51:46 +0100
commit1aaf4f070011490bcece50394b9b32dfa593fd9e (patch)
tree17d68284e401a35eea3d3a574d986d446a60763a /al/source.h
parent6e7cee4fa9a8af03f28ca26cd89f8357390dfc90 (diff)
parent571b546f35eead77ce109f8d4dd6c3de3199d573 (diff)
Merge remote-tracking branch 'upstream/master'
Diffstat (limited to 'al/source.h')
-rw-r--r--al/source.h14
1 files changed, 8 insertions, 6 deletions
diff --git a/al/source.h b/al/source.h
index ac97c8a7..c7694f83 100644
--- a/al/source.h
+++ b/al/source.h
@@ -4,9 +4,10 @@
#include <array>
#include <atomic>
#include <cstddef>
+#include <deque>
#include <iterator>
#include <limits>
-#include <deque>
+#include <string_view>
#include "AL/al.h"
#include "AL/alc.h"
@@ -14,7 +15,6 @@
#include "alc/alu.h"
#include "alc/context.h"
#include "alc/inprogext.h"
-#include "aldeque.h"
#include "almalloc.h"
#include "alnumeric.h"
#include "atomic.h"
@@ -39,9 +39,9 @@ enum class SourceStereo : bool {
#define DEFAULT_SENDS 2
-#define INVALID_VOICE_IDX static_cast<ALuint>(-1)
+inline constexpr ALuint InvalidVoiceIndex{std::numeric_limits<ALuint>::max()};
-extern bool sBufferSubDataCompat;
+inline bool sBufferSubDataCompat{false};
struct ALbufferQueueItem : public VoiceBufferItem {
ALbuffer *mBuffer{nullptr};
@@ -138,14 +138,14 @@ struct ALsource {
ALenum state{AL_INITIAL};
/** Source Buffer Queue head. */
- al::deque<ALbufferQueueItem> mQueue;
+ std::deque<ALbufferQueueItem> mQueue;
bool mPropsDirty{true};
/* Index into the context's Voices array. Lazily updated, only checked and
* reset when looking up the voice.
*/
- ALuint VoiceIdx{INVALID_VOICE_IDX};
+ ALuint VoiceIdx{InvalidVoiceIndex};
/** Self ID */
ALuint id{0};
@@ -157,6 +157,8 @@ struct ALsource {
ALsource(const ALsource&) = delete;
ALsource& operator=(const ALsource&) = delete;
+ static void SetName(ALCcontext *context, ALuint id, std::string_view name);
+
DISABLE_ALLOC()
#ifdef ALSOFT_EAX