diff options
author | Chris Robinson <[email protected]> | 2021-04-26 20:25:24 -0700 |
---|---|---|
committer | Chris Robinson <[email protected]> | 2021-04-26 20:25:24 -0700 |
commit | 26c8c50c2605e377f74d7a73bae3bbbf4f7bad61 (patch) | |
tree | 1d66be8cc28a32e965de87e5b51012c26b6b2b95 /alc/alcontext.h | |
parent | 22a8ebff8094785ec53aadef8489dc60f6939d55 (diff) |
Partially implement an extension to hold sources on disconnect
Rather than stopping voices/sources when the device becomes disconnected, the
context can be set to leave them alone. As a consequence, their state will
remain as playing and they'll keep their last known sample offset indefinately.
For applications mindful of this behavior, it will allow resetting or reopening
the device to reconnect and automatically resume where it left off.
Diffstat (limited to 'alc/alcontext.h')
-rw-r--r-- | alc/alcontext.h | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/alc/alcontext.h b/alc/alcontext.h index b1b41e76..075e6a55 100644 --- a/alc/alcontext.h +++ b/alc/alcontext.h @@ -35,6 +35,8 @@ struct Voice; struct VoiceChange; struct VoicePropsItem; +using uint = unsigned int; + enum class DistanceModel : unsigned char { Disable, @@ -108,6 +110,7 @@ struct ContextBase { */ RefCount mUpdateCount{0u}; std::atomic<bool> mHoldUpdates{false}; + std::atomic<bool> mStopVoicesOnDisconnect{true}; float mGainBoost{1.0f}; |