aboutsummaryrefslogtreecommitdiffstats
path: root/OpenAL32/alSource.c
diff options
context:
space:
mode:
authorChris Robinson <[email protected]>2017-03-23 01:16:13 -0700
committerChris Robinson <[email protected]>2017-03-23 01:16:13 -0700
commit5404b2225aca57407f2f3704e2e2616a281d85ae (patch)
tree56e38f8de4254e834c67067b3f1bf34d4ff86504 /OpenAL32/alSource.c
parent85042a74eefdf02397530b19248a789a4fcb49f8 (diff)
Add some comments for ALsource functions
Diffstat (limited to 'OpenAL32/alSource.c')
-rw-r--r--OpenAL32/alSource.c14
1 files changed, 13 insertions, 1 deletions
diff --git a/OpenAL32/alSource.c b/OpenAL32/alSource.c
index e32bb5c8..a882cb83 100644
--- a/OpenAL32/alSource.c
+++ b/OpenAL32/alSource.c
@@ -139,13 +139,21 @@ static inline ALvoice *GetSourceVoice(const ALsource *source, const ALCcontext *
return NULL;
}
+/**
+ * Returns if the last known state for the source was playing or paused. Does
+ * not sync with the mixer voice.
+ */
static inline bool IsPlayingOrPaused(ALsource *source)
{
ALenum state = ATOMIC_LOAD(&source->state, almemory_order_acquire);
return state == AL_PLAYING || state == AL_PAUSED;
}
-static ALenum GetSourceState(ALsource *source, ALvoice *voice)
+/**
+ * Returns an updated source state using the matching voice's status (or lack
+ * thereof).
+ */
+static inline ALenum GetSourceState(ALsource *source, ALvoice *voice)
{
if(!voice)
{
@@ -158,6 +166,10 @@ static ALenum GetSourceState(ALsource *source, ALvoice *voice)
return ATOMIC_LOAD(&source->state, almemory_order_acquire);
}
+/**
+ * Returns if the source should specify an update, given the context's
+ * deferring state and the source's last known state.
+ */
static inline bool SourceShouldUpdate(ALsource *source, ALCcontext *context)
{
return !ATOMIC_LOAD(&context->DeferUpdates, almemory_order_acquire) &&