aboutsummaryrefslogtreecommitdiffstats
path: root/OpenAL32/Include/alu.h
diff options
context:
space:
mode:
authorChris Robinson <[email protected]>2019-03-09 16:48:07 -0800
committerChris Robinson <[email protected]>2019-03-09 16:48:07 -0800
commitef0f3351321a7488e60faa838a4628cfecf230b8 (patch)
treea28d31d1eb4fdf785a6f2fceeaa7cface4a02973 /OpenAL32/Include/alu.h
parentcde4500e24a8f5067d87711bf778cde99f26d990 (diff)
Add a Stopping state for voices
This currently doesn't do much, except have the mixer progress it to Stopped. It's valid to have without a source or buffers, and in the future will allow fading out when a source is paused or stopped.
Diffstat (limited to 'OpenAL32/Include/alu.h')
-rw-r--r--OpenAL32/Include/alu.h10
1 files changed, 8 insertions, 2 deletions
diff --git a/OpenAL32/Include/alu.h b/OpenAL32/Include/alu.h
index 13362dea..fbf21c47 100644
--- a/OpenAL32/Include/alu.h
+++ b/OpenAL32/Include/alu.h
@@ -207,10 +207,16 @@ struct ALvoiceProps : public ALvoicePropsBase {
#define VOICE_HAS_NFC (1u<<4)
struct ALvoice {
+ enum State {
+ Stopped = 0,
+ Playing = 1,
+ Stopping = 2
+ };
+
std::atomic<ALvoiceProps*> Update{nullptr};
std::atomic<ALuint> SourceID{0u};
- std::atomic<bool> Playing{false};
+ std::atomic<State> PlayState{Stopped};
ALvoicePropsBase Props;
@@ -440,7 +446,7 @@ inline std::array<ALfloat,MAX_AMBI_CHANNELS> GetAmbiIdentityRow(size_t i) noexce
}
-ALboolean MixSource(ALvoice *voice, const ALuint SourceID, ALCcontext *Context, const ALsizei SamplesToDo);
+void MixSource(ALvoice *voice, const ALuint SourceID, ALCcontext *Context, const ALsizei SamplesToDo);
void aluMixData(ALCdevice *device, ALvoid *OutBuffer, ALsizei NumSamples);
/* Caller must lock the device state, and the mixer must not be running. */