diff options
author | Chris Robinson <[email protected]> | 2019-05-28 16:22:36 -0700 |
---|---|---|
committer | Chris Robinson <[email protected]> | 2019-05-28 16:22:36 -0700 |
commit | c80ee5b7014d12675e2c615574c9f3f3354ffd1b (patch) | |
tree | 75ac5c7197ab7d8994854455c7261a9d42a99c82 /OpenAL32/Include | |
parent | 7ce2b632f51292c26014ad2efeb4b5429c3bf04f (diff) |
Use std::array for most mixing buffer arrays
Diffstat (limited to 'OpenAL32/Include')
-rw-r--r-- | OpenAL32/Include/alAuxEffectSlot.h | 2 | ||||
-rw-r--r-- | OpenAL32/Include/alMain.h | 8 | ||||
-rw-r--r-- | OpenAL32/Include/alu.h | 4 |
3 files changed, 8 insertions, 6 deletions
diff --git a/OpenAL32/Include/alAuxEffectSlot.h b/OpenAL32/Include/alAuxEffectSlot.h index 06681276..9956c432 100644 --- a/OpenAL32/Include/alAuxEffectSlot.h +++ b/OpenAL32/Include/alAuxEffectSlot.h @@ -71,7 +71,7 @@ struct ALeffectslot { ALuint id{}; /* Mixing buffer used by the Wet mix. */ - al::vector<std::array<ALfloat,BUFFERSIZE>,16> MixBuffer; + al::vector<FloatBufferLine, 16> MixBuffer; /* Wet buffer configuration is ACN channel order with N3D scaling. * Consequently, effects that only want to work with mono input can use diff --git a/OpenAL32/Include/alMain.h b/OpenAL32/Include/alMain.h index 7019a6d4..7538ade2 100644 --- a/OpenAL32/Include/alMain.h +++ b/OpenAL32/Include/alMain.h @@ -305,6 +305,8 @@ struct BFChannelConfig { */ #define BUFFERSIZE 1024 +using FloatBufferLine = std::array<float,BUFFERSIZE>; + /* Maximum number of samples to pad on either end of a buffer for resampling. * Note that both the beginning and end need padding! */ @@ -315,14 +317,14 @@ struct MixParams { /* Coefficient channel mapping for mixing to the buffer. */ std::array<BFChannelConfig,MAX_OUTPUT_CHANNELS> AmbiMap; - ALfloat (*Buffer)[BUFFERSIZE]{nullptr}; + FloatBufferLine *Buffer{nullptr}; ALsizei NumChannels{0}; }; struct RealMixParams { std::array<ALint,MaxChannels> ChannelIndex{}; - ALfloat (*Buffer)[BUFFERSIZE]{nullptr}; + FloatBufferLine *Buffer{nullptr}; ALsizei NumChannels{0}; }; @@ -405,7 +407,7 @@ struct ALCdevice { alignas(16) float2 HrtfAccumData[BUFFERSIZE + HRIR_LENGTH]; /* Mixing buffer used by the Dry mix and Real output. */ - al::vector<std::array<ALfloat,BUFFERSIZE>, 16> MixBuffer; + al::vector<FloatBufferLine, 16> MixBuffer; /* The "dry" path corresponds to the main output. */ MixParams Dry; diff --git a/OpenAL32/Include/alu.h b/OpenAL32/Include/alu.h index 642aeddc..327adfc0 100644 --- a/OpenAL32/Include/alu.h +++ b/OpenAL32/Include/alu.h @@ -263,7 +263,7 @@ struct ALvoice { int FilterType; DirectParams Params[MAX_INPUT_CHANNELS]; - ALfloat (*Buffer)[BUFFERSIZE]; + FloatBufferLine *Buffer; ALsizei Channels; ALsizei ChannelsPerOrder[MAX_AMBI_ORDER+1]; } mDirect; @@ -272,7 +272,7 @@ struct ALvoice { int FilterType; SendParams Params[MAX_INPUT_CHANNELS]; - ALfloat (*Buffer)[BUFFERSIZE]; + FloatBufferLine *Buffer; ALsizei Channels; }; al::FlexArray<SendData> mSend; |