From 2e154069c6aa3bfc9d00d420e2f508a4127dd649 Mon Sep 17 00:00:00 2001 From: Chris Robinson Date: Sat, 8 Jun 2019 23:49:15 -0700 Subject: Use a bitfield for the device flags --- OpenAL32/Include/alMain.h | 33 ++++++++++++++++++--------------- 1 file changed, 18 insertions(+), 15 deletions(-) (limited to 'OpenAL32/Include/alMain.h') diff --git a/OpenAL32/Include/alMain.h b/OpenAL32/Include/alMain.h index 5dc76552..9a5b3814 100644 --- a/OpenAL32/Include/alMain.h +++ b/OpenAL32/Include/alMain.h @@ -26,6 +26,7 @@ #include "inprogext.h" #include "atomic.h" #include "vector.h" +#include "albyte.h" #include "almalloc.h" #include "alnumeric.h" #include "alspan.h" @@ -322,6 +323,22 @@ struct RealMixParams { using POSTPROCESS = void(*)(ALCdevice *device, const ALsizei SamplesToDo); +enum { + // Frequency was requested by the app or config file + FrequencyRequest, + // Channel configuration was requested by the config file + ChannelsRequest, + // Sample type was requested by the config file + SampleTypeRequest, + + // Specifies if the DSP is paused at user request + DevicePaused, + // Specifies if the device is currently running + DeviceRunning, + + DeviceFlagsCount +}; + struct ALCdevice { RefCount ref{1u}; @@ -347,7 +364,7 @@ struct ALCdevice { std::string DeviceName; // Device flags - ALuint Flags{0u}; + al::bitfield Flags{}; std::string HrtfName; al::vector HrtfList; @@ -466,20 +483,6 @@ struct ALCdevice { DEF_NEWDEL(ALCdevice) }; -// Frequency was requested by the app or config file -#define DEVICE_FREQUENCY_REQUEST (1u<<1) -// Channel configuration was requested by the config file -#define DEVICE_CHANNELS_REQUEST (1u<<2) -// Sample type was requested by the config file -#define DEVICE_SAMPLE_TYPE_REQUEST (1u<<3) - -// Specifies if the DSP is paused at user request -#define DEVICE_PAUSED (1u<<30) - -// Specifies if the device is currently running -#define DEVICE_RUNNING (1u<<31) - - /* Must be less than 15 characters (16 including terminating null) for * compatibility with pthread_setname_np limitations. */ #define MIXER_THREAD_NAME "alsoft-mixer" -- cgit v1.2.3