aboutsummaryrefslogtreecommitdiffstats
path: root/core/voice.h
diff options
context:
space:
mode:
authorChris Robinson <[email protected]>2021-12-23 13:43:10 -0800
committerChris Robinson <[email protected]>2021-12-23 13:43:10 -0800
commitf1aa10ff0b710d6647f7ce728de5a8d0e5b8a45f (patch)
tree018c601ddda961c41676d156b31b27b6277d9019 /core/voice.h
parent0af1b5f7218cf60e3a51f43903f3c5461cdcbdf8 (diff)
Use a bitset instead of a plain uint for flags
Diffstat (limited to 'core/voice.h')
-rw-r--r--core/voice.h21
1 files changed, 13 insertions, 8 deletions
diff --git a/core/voice.h b/core/voice.h
index d7168fb9..70b80841 100644
--- a/core/voice.h
+++ b/core/voice.h
@@ -3,6 +3,7 @@
#include <array>
#include <atomic>
+#include <bitset>
#include <memory>
#include <stddef.h>
#include <string>
@@ -164,13 +165,17 @@ struct VoicePropsItem : public VoiceProps {
DEF_NEWDEL(VoicePropsItem)
};
-constexpr uint VoiceIsStatic{ 1u<<0};
-constexpr uint VoiceIsCallback{ 1u<<1};
-constexpr uint VoiceIsAmbisonic{ 1u<<2}; /* Needs HF scaling for ambisonic upsampling. */
-constexpr uint VoiceCallbackStopped{1u<<3};
-constexpr uint VoiceIsFading{ 1u<<4}; /* Use gain stepping for smooth transitions. */
-constexpr uint VoiceHasHrtf{ 1u<<5};
-constexpr uint VoiceHasNfc{ 1u<<6};
+enum : uint {
+ VoiceIsStatic,
+ VoiceIsCallback,
+ VoiceIsAmbisonic,
+ VoiceCallbackStopped,
+ VoiceIsFading,
+ VoiceHasHrtf,
+ VoiceHasNfc,
+
+ VoiceFlagCount
+};
struct Voice {
enum State {
@@ -224,7 +229,7 @@ struct Voice {
InterpState mResampleState;
- uint mFlags{};
+ std::bitset<VoiceFlagCount> mFlags{};
uint mNumCallbackSamples{0};
struct TargetData {