diff options
author | Chris Robinson <[email protected]> | 2014-11-07 02:18:24 -0800 |
---|---|---|
committer | Chris Robinson <[email protected]> | 2014-11-07 02:18:24 -0800 |
commit | 4c3f27193f7379513b3e45398711cfe1238184fd (patch) | |
tree | 93499e0af78b28be8568bd4ac689d3a40728b96f /OpenAL32 | |
parent | 6c954e71dbd99a2ceb072c08481aee92ef8461c0 (diff) |
Use a separate macro for the max output channel count
Diffstat (limited to 'OpenAL32')
-rw-r--r-- | OpenAL32/Include/alMain.h | 13 | ||||
-rw-r--r-- | OpenAL32/Include/alu.h | 10 |
2 files changed, 11 insertions, 12 deletions
diff --git a/OpenAL32/Include/alMain.h b/OpenAL32/Include/alMain.h index 6a0df589..e18a238b 100644 --- a/OpenAL32/Include/alMain.h +++ b/OpenAL32/Include/alMain.h @@ -524,10 +524,9 @@ enum Channel { SideLeft, SideRight, - MaxChannels, - InvalidChannel = MaxChannels + InvalidChannel }; - +#define MAX_OUTPUT_CHANNELS (8) /* Device formats */ enum DevFmtType { @@ -658,10 +657,10 @@ struct ALCdevice_struct // Device flags ALuint Flags; - enum Channel ChannelName[MaxChannels]; + enum Channel ChannelName[MAX_OUTPUT_CHANNELS]; /* This only counts positional speakers, i.e. not including LFE. */ - ChannelConfig Speaker[MaxChannels]; + ChannelConfig Speaker[MAX_OUTPUT_CHANNELS]; ALuint NumSpeakers; ALuint64 ClockBase; @@ -673,7 +672,7 @@ struct ALCdevice_struct alignas(16) ALfloat FilteredData[BUFFERSIZE]; // Dry path buffer mix - alignas(16) ALfloat DryBuffer[MaxChannels][BUFFERSIZE]; + alignas(16) ALfloat DryBuffer[MAX_OUTPUT_CHANNELS][BUFFERSIZE]; /* Running count of the mixer invocations, in 31.1 fixed point. This * actually increments *twice* when mixing, first at the start and then at @@ -840,7 +839,7 @@ const ALCchar *DevFmtChannelsString(enum DevFmtChannels chans) DECL_CONST; inline ALint GetChannelIdxByName(const ALCdevice *device, enum Channel chan) { ALint i = 0; - for(i = 0;i < MaxChannels;i++) + for(i = 0;i < MAX_OUTPUT_CHANNELS;i++) { if(device->ChannelName[i] == chan) return i; diff --git a/OpenAL32/Include/alu.h b/OpenAL32/Include/alu.h index 3b0ce871..6e414633 100644 --- a/OpenAL32/Include/alu.h +++ b/OpenAL32/Include/alu.h @@ -96,7 +96,7 @@ typedef struct DirectParams { ALfloat Dir[3]; } Hrtf; - MixGains Gains[MAX_INPUT_CHANNELS][MaxChannels]; + MixGains Gains[MAX_INPUT_CHANNELS][MAX_OUTPUT_CHANNELS]; } Mix; } DirectParams; @@ -207,7 +207,7 @@ ALvoid aluInitPanning(ALCdevice *Device); * Sets channel gains based on a direction. The direction must be a 3-component * vector no longer than 1 unit. */ -void ComputeDirectionalGains(const ALCdevice *device, const ALfloat dir[3], ALfloat ingain, ALfloat gains[MaxChannels]); +void ComputeDirectionalGains(const ALCdevice *device, const ALfloat dir[3], ALfloat ingain, ALfloat gains[MAX_OUTPUT_CHANNELS]); /** * ComputeAngleGains @@ -215,14 +215,14 @@ void ComputeDirectionalGains(const ALCdevice *device, const ALfloat dir[3], ALfl * Sets channel gains based on angle and elevation. The angle and elevation * parameters are in radians, going right and up respectively. */ -void ComputeAngleGains(const ALCdevice *device, ALfloat angle, ALfloat elevation, ALfloat ingain, ALfloat gains[MaxChannels]); +void ComputeAngleGains(const ALCdevice *device, ALfloat angle, ALfloat elevation, ALfloat ingain, ALfloat gains[MAX_OUTPUT_CHANNELS]); /** * ComputeAmbientGains * * Sets channel gains for ambient, omni-directional sounds. */ -void ComputeAmbientGains(const ALCdevice *device, ALfloat ingain, ALfloat gains[MaxChannels]); +void ComputeAmbientGains(const ALCdevice *device, ALfloat ingain, ALfloat gains[MAX_OUTPUT_CHANNELS]); /** * ComputeBFormatGains @@ -231,7 +231,7 @@ void ComputeAmbientGains(const ALCdevice *device, ALfloat ingain, ALfloat gains[ * a 1x4 'slice' of the rotation matrix for a given channel used to orient the * coefficients. */ -void ComputeBFormatGains(const ALCdevice *device, const ALfloat mtx[4], ALfloat ingain, ALfloat gains[MaxChannels]); +void ComputeBFormatGains(const ALCdevice *device, const ALfloat mtx[4], ALfloat ingain, ALfloat gains[MAX_OUTPUT_CHANNELS]); ALvoid CalcSourceParams(struct ALvoice *voice, const struct ALsource *source, const ALCcontext *ALContext); |