diff options
author | Chris Robinson <[email protected]> | 2012-06-28 18:49:49 -0700 |
---|---|---|
committer | Chris Robinson <[email protected]> | 2012-06-28 18:49:49 -0700 |
commit | 583dc8dbcaf8ce59678fe287b1e584c2f99b7f3c (patch) | |
tree | f71172e7731bb6711e6a4768196f76aec02e6635 /Alc | |
parent | befa4e7528f5ca1f54481bf137706de0239e98eb (diff) |
Don't use all caps for enum value names
Diffstat (limited to 'Alc')
-rw-r--r-- | Alc/ALc.c | 86 | ||||
-rw-r--r-- | Alc/ALu.c | 84 | ||||
-rw-r--r-- | Alc/alcDedicated.c | 10 | ||||
-rw-r--r-- | Alc/alcEcho.c | 10 | ||||
-rw-r--r-- | Alc/alcModulator.c | 10 | ||||
-rw-r--r-- | Alc/alcReverb.c | 20 | ||||
-rw-r--r-- | Alc/mixer.c | 38 | ||||
-rw-r--r-- | Alc/panning.c | 86 |
8 files changed, 172 insertions, 172 deletions
@@ -1225,46 +1225,46 @@ void SetDefaultWFXChannelOrder(ALCdevice *device) { switch(device->FmtChans) { - case DevFmtMono: device->DevChannels[0] = FRONT_CENTER; break; + case DevFmtMono: device->DevChannels[0] = FrontCenter; break; - case DevFmtStereo: device->DevChannels[0] = FRONT_LEFT; - device->DevChannels[1] = FRONT_RIGHT; break; + case DevFmtStereo: device->DevChannels[0] = FrontLeft; + device->DevChannels[1] = FrontRight; break; - case DevFmtQuad: device->DevChannels[0] = FRONT_LEFT; - device->DevChannels[1] = FRONT_RIGHT; - device->DevChannels[2] = BACK_LEFT; - device->DevChannels[3] = BACK_RIGHT; break; + case DevFmtQuad: device->DevChannels[0] = FrontLeft; + device->DevChannels[1] = FrontRight; + device->DevChannels[2] = BackLeft; + device->DevChannels[3] = BackRight; break; - case DevFmtX51: device->DevChannels[0] = FRONT_LEFT; - device->DevChannels[1] = FRONT_RIGHT; - device->DevChannels[2] = FRONT_CENTER; + case DevFmtX51: device->DevChannels[0] = FrontLeft; + device->DevChannels[1] = FrontRight; + device->DevChannels[2] = FrontCenter; device->DevChannels[3] = LFE; - device->DevChannels[4] = BACK_LEFT; - device->DevChannels[5] = BACK_RIGHT; break; + device->DevChannels[4] = BackLeft; + device->DevChannels[5] = BackRight; break; - case DevFmtX51Side: device->DevChannels[0] = FRONT_LEFT; - device->DevChannels[1] = FRONT_RIGHT; - device->DevChannels[2] = FRONT_CENTER; + case DevFmtX51Side: device->DevChannels[0] = FrontLeft; + device->DevChannels[1] = FrontRight; + device->DevChannels[2] = FrontCenter; device->DevChannels[3] = LFE; - device->DevChannels[4] = SIDE_LEFT; - device->DevChannels[5] = SIDE_RIGHT; break; + device->DevChannels[4] = SideLeft; + device->DevChannels[5] = SideRight; break; - case DevFmtX61: device->DevChannels[0] = FRONT_LEFT; - device->DevChannels[1] = FRONT_RIGHT; - device->DevChannels[2] = FRONT_CENTER; + case DevFmtX61: device->DevChannels[0] = FrontLeft; + device->DevChannels[1] = FrontRight; + device->DevChannels[2] = FrontCenter; device->DevChannels[3] = LFE; - device->DevChannels[4] = BACK_CENTER; - device->DevChannels[5] = SIDE_LEFT; - device->DevChannels[6] = SIDE_RIGHT; break; + device->DevChannels[4] = BackCenter; + device->DevChannels[5] = SideLeft; + device->DevChannels[6] = SideRight; break; - case DevFmtX71: device->DevChannels[0] = FRONT_LEFT; - device->DevChannels[1] = FRONT_RIGHT; - device->DevChannels[2] = FRONT_CENTER; + case DevFmtX71: device->DevChannels[0] = FrontLeft; + device->DevChannels[1] = FrontRight; + device->DevChannels[2] = FrontCenter; device->DevChannels[3] = LFE; - device->DevChannels[4] = BACK_LEFT; - device->DevChannels[5] = BACK_RIGHT; - device->DevChannels[6] = SIDE_LEFT; - device->DevChannels[7] = SIDE_RIGHT; break; + device->DevChannels[4] = BackLeft; + device->DevChannels[5] = BackRight; + device->DevChannels[6] = SideLeft; + device->DevChannels[7] = SideRight; break; } } @@ -1276,22 +1276,22 @@ void SetDefaultChannelOrder(ALCdevice *device) { switch(device->FmtChans) { - case DevFmtX51: device->DevChannels[0] = FRONT_LEFT; - device->DevChannels[1] = FRONT_RIGHT; - device->DevChannels[2] = BACK_LEFT; - device->DevChannels[3] = BACK_RIGHT; - device->DevChannels[4] = FRONT_CENTER; + case DevFmtX51: device->DevChannels[0] = FrontLeft; + device->DevChannels[1] = FrontRight; + device->DevChannels[2] = BackLeft; + device->DevChannels[3] = BackRight; + device->DevChannels[4] = FrontCenter; device->DevChannels[5] = LFE; return; - case DevFmtX71: device->DevChannels[0] = FRONT_LEFT; - device->DevChannels[1] = FRONT_RIGHT; - device->DevChannels[2] = BACK_LEFT; - device->DevChannels[3] = BACK_RIGHT; - device->DevChannels[4] = FRONT_CENTER; + case DevFmtX71: device->DevChannels[0] = FrontLeft; + device->DevChannels[1] = FrontRight; + device->DevChannels[2] = BackLeft; + device->DevChannels[3] = BackRight; + device->DevChannels[4] = FrontCenter; device->DevChannels[5] = LFE; - device->DevChannels[6] = SIDE_LEFT; - device->DevChannels[7] = SIDE_RIGHT; + device->DevChannels[6] = SideLeft; + device->DevChannels[7] = SideRight; return; /* Same as WFX order */ @@ -1533,7 +1533,7 @@ static ALCenum UpdateDeviceParams(ALCdevice *device, const ALCint *attrList) aluInitPanning(device); - for(i = 0;i < MAXCHANNELS;i++) + for(i = 0;i < MaxChannels;i++) { device->ClickRemoval[i] = 0.0f; device->PendingClicks[i] = 0.0f; @@ -63,54 +63,54 @@ static __inline ALvoid aluMatrixVector(ALfloat *vector,ALfloat w,ALfloat matrix[ ALvoid CalcNonAttnSourceParams(ALsource *ALSource, const ALCcontext *ALContext) { - static const struct ChanMap MonoMap[1] = { { FRONT_CENTER, 0.0f } }; + static const struct ChanMap MonoMap[1] = { { FrontCenter, 0.0f } }; static const struct ChanMap StereoMap[2] = { - { FRONT_LEFT, -30.0f * F_PI/180.0f }, - { FRONT_RIGHT, 30.0f * F_PI/180.0f } + { FrontLeft, -30.0f * F_PI/180.0f }, + { FrontRight, 30.0f * F_PI/180.0f } }; static const struct ChanMap RearMap[2] = { - { BACK_LEFT, -150.0f * F_PI/180.0f }, - { BACK_RIGHT, 150.0f * F_PI/180.0f } + { BackLeft, -150.0f * F_PI/180.0f }, + { BackRight, 150.0f * F_PI/180.0f } }; static const struct ChanMap QuadMap[4] = { - { FRONT_LEFT, -45.0f * F_PI/180.0f }, - { FRONT_RIGHT, 45.0f * F_PI/180.0f }, - { BACK_LEFT, -135.0f * F_PI/180.0f }, - { BACK_RIGHT, 135.0f * F_PI/180.0f } + { FrontLeft, -45.0f * F_PI/180.0f }, + { FrontRight, 45.0f * F_PI/180.0f }, + { BackLeft, -135.0f * F_PI/180.0f }, + { BackRight, 135.0f * F_PI/180.0f } }; static const struct ChanMap X51Map[6] = { - { FRONT_LEFT, -30.0f * F_PI/180.0f }, - { FRONT_RIGHT, 30.0f * F_PI/180.0f }, - { FRONT_CENTER, 0.0f * F_PI/180.0f }, + { FrontLeft, -30.0f * F_PI/180.0f }, + { FrontRight, 30.0f * F_PI/180.0f }, + { FrontCenter, 0.0f * F_PI/180.0f }, { LFE, 0.0f }, - { BACK_LEFT, -110.0f * F_PI/180.0f }, - { BACK_RIGHT, 110.0f * F_PI/180.0f } + { BackLeft, -110.0f * F_PI/180.0f }, + { BackRight, 110.0f * F_PI/180.0f } }; static const struct ChanMap X61Map[7] = { - { FRONT_LEFT, -30.0f * F_PI/180.0f }, - { FRONT_RIGHT, 30.0f * F_PI/180.0f }, - { FRONT_CENTER, 0.0f * F_PI/180.0f }, + { FrontLeft, -30.0f * F_PI/180.0f }, + { FrontRight, 30.0f * F_PI/180.0f }, + { FrontCenter, 0.0f * F_PI/180.0f }, { LFE, 0.0f }, - { BACK_CENTER, 180.0f * F_PI/180.0f }, - { SIDE_LEFT, -90.0f * F_PI/180.0f }, - { SIDE_RIGHT, 90.0f * F_PI/180.0f } + { BackCenter, 180.0f * F_PI/180.0f }, + { SideLeft, -90.0f * F_PI/180.0f }, + { SideRight, 90.0f * F_PI/180.0f } }; static const struct ChanMap X71Map[8] = { - { FRONT_LEFT, -30.0f * F_PI/180.0f }, - { FRONT_RIGHT, 30.0f * F_PI/180.0f }, - { FRONT_CENTER, 0.0f * F_PI/180.0f }, + { FrontLeft, -30.0f * F_PI/180.0f }, + { FrontRight, 30.0f * F_PI/180.0f }, + { FrontCenter, 0.0f * F_PI/180.0f }, { LFE, 0.0f }, - { BACK_LEFT, -150.0f * F_PI/180.0f }, - { BACK_RIGHT, 150.0f * F_PI/180.0f }, - { SIDE_LEFT, -90.0f * F_PI/180.0f }, - { SIDE_RIGHT, 90.0f * F_PI/180.0f } + { BackLeft, -150.0f * F_PI/180.0f }, + { BackRight, 150.0f * F_PI/180.0f }, + { SideLeft, -90.0f * F_PI/180.0f }, + { SideRight, 90.0f * F_PI/180.0f } }; ALCdevice *Device = ALContext->Device; ALfloat SourceVolume,ListenerGain,MinVolume,MaxVolume; ALbufferlistitem *BufferListItem; enum FmtChannels Channels; - ALfloat (*SrcMatrix)[MAXCHANNELS]; + ALfloat (*SrcMatrix)[MaxChannels]; ALfloat DryGain, DryGainHF; ALfloat WetGain[MAX_SENDS]; ALfloat WetGainHF[MAX_SENDS]; @@ -187,9 +187,9 @@ ALvoid CalcNonAttnSourceParams(ALsource *ALSource, const ALCcontext *ALContext) } SrcMatrix = ALSource->Params.Direct.Gains; - for(i = 0;i < MAXCHANNELS;i++) + for(i = 0;i < MaxChannels;i++) { - for(c = 0;c < MAXCHANNELS;c++) + for(c = 0;c < MaxChannels;c++) SrcMatrix[i][c] = 0.0f; } switch(Channels) @@ -721,13 +721,13 @@ ALvoid CalcSourceParams(ALsource *ALSource, const ALCcontext *ALContext) } else { - ALfloat (*Matrix)[MAXCHANNELS] = ALSource->Params.Direct.Gains; + ALfloat (*Matrix)[MaxChannels] = ALSource->Params.Direct.Gains; ALfloat DirGain = 0.0f; ALfloat AmbientGain; - for(i = 0;i < MAXCHANNELS;i++) + for(i = 0;i < MaxChannels;i++) { - for(j = 0;j < MAXCHANNELS;j++) + for(j = 0;j < MaxChannels;j++) Matrix[i][j] = 0.0f; } @@ -791,7 +791,7 @@ static __inline ALubyte aluF2UB(ALfloat val) static void Write_##T##_##N(ALCdevice *device, T *RESTRICT buffer, \ ALuint SamplesToDo) \ { \ - ALfloat (*RESTRICT DryBuffer)[MAXCHANNELS] = device->DryBuffer; \ + ALfloat (*RESTRICT DryBuffer)[MaxChannels] = device->DryBuffer; \ const enum Channel *ChanMap = device->DevChannels; \ ALuint i, j; \ \ @@ -907,7 +907,7 @@ ALvoid aluMixData(ALCdevice *device, ALvoid *buffer, ALsizei size) while(size > 0) { SamplesToDo = minu(size, BUFFERSIZE); - memset(device->DryBuffer, 0, SamplesToDo*MAXCHANNELS*sizeof(ALfloat)); + memset(device->DryBuffer, 0, SamplesToDo*MaxChannels*sizeof(ALfloat)); LockDevice(device); ctx = device->ContextList; @@ -996,15 +996,15 @@ ALvoid aluMixData(ALCdevice *device, ALvoid *buffer, ALsizei size) { for(i = 0;i < SamplesToDo;i++) { - device->DryBuffer[i][FRONT_CENTER] += device->ClickRemoval[FRONT_CENTER]; - device->ClickRemoval[FRONT_CENTER] -= device->ClickRemoval[FRONT_CENTER] * (1.0f/256.0f); + device->DryBuffer[i][FrontCenter] += device->ClickRemoval[FrontCenter]; + device->ClickRemoval[FrontCenter] -= device->ClickRemoval[FrontCenter] * (1.0f/256.0f); } - device->ClickRemoval[FRONT_CENTER] += device->PendingClicks[FRONT_CENTER]; - device->PendingClicks[FRONT_CENTER] = 0.0f; + device->ClickRemoval[FrontCenter] += device->PendingClicks[FrontCenter]; + device->PendingClicks[FrontCenter] = 0.0f; } else if(device->FmtChans == DevFmtStereo) { - /* Assumes the first two channels are FRONT_LEFT and FRONT_RIGHT */ + /* Assumes the first two channels are FrontLeft and FrontRight */ for(i = 0;i < SamplesToDo;i++) { for(c = 0;c < 2;c++) @@ -1028,13 +1028,13 @@ ALvoid aluMixData(ALCdevice *device, ALvoid *buffer, ALsizei size) { for(i = 0;i < SamplesToDo;i++) { - for(c = 0;c < MAXCHANNELS;c++) + for(c = 0;c < MaxChannels;c++) { device->DryBuffer[i][c] += device->ClickRemoval[c]; device->ClickRemoval[c] -= device->ClickRemoval[c] * (1.0f/256.0f); } } - for(c = 0;c < MAXCHANNELS;c++) + for(c = 0;c < MaxChannels;c++) { device->ClickRemoval[c] += device->PendingClicks[c]; device->PendingClicks[c] = 0.0f; diff --git a/Alc/alcDedicated.c b/Alc/alcDedicated.c index 81c7a3a4..60460962 100644 --- a/Alc/alcDedicated.c +++ b/Alc/alcDedicated.c @@ -33,7 +33,7 @@ typedef struct ALdedicatedState { // Must be first in all effects! ALeffectState state; - ALfloat gains[MAXCHANNELS]; + ALfloat gains[MaxChannels]; } ALdedicatedState; @@ -57,7 +57,7 @@ static ALvoid DedicatedUpdate(ALeffectState *effect, ALCdevice *device, const AL ALsizei s; Gain = Slot->Gain * Slot->effect.Dedicated.Gain; - for(s = 0;s < MAXCHANNELS;s++) + for(s = 0;s < MaxChannels;s++) state->gains[s] = 0.0f; if(Slot->effect.type == AL_EFFECT_DEDICATED_DIALOGUE) @@ -66,7 +66,7 @@ static ALvoid DedicatedUpdate(ALeffectState *effect, ALCdevice *device, const AL state->gains[LFE] = Gain; } -static ALvoid DedicatedProcess(ALeffectState *effect, ALuint SamplesToDo, const ALfloat *SamplesIn, ALfloat (*SamplesOut)[MAXCHANNELS]) +static ALvoid DedicatedProcess(ALeffectState *effect, ALuint SamplesToDo, const ALfloat *SamplesIn, ALfloat (*SamplesOut)[MaxChannels]) { ALdedicatedState *state = (ALdedicatedState*)effect; const ALfloat *gains = state->gains; @@ -77,7 +77,7 @@ static ALvoid DedicatedProcess(ALeffectState *effect, ALuint SamplesToDo, const ALfloat sample; sample = SamplesIn[i]; - for(s = 0;s < MAXCHANNELS;s++) + for(s = 0;s < MaxChannels;s++) SamplesOut[i][s] = sample * gains[s]; } } @@ -96,7 +96,7 @@ ALeffectState *DedicatedCreate(void) state->state.Update = DedicatedUpdate; state->state.Process = DedicatedProcess; - for(s = 0;s < MAXCHANNELS;s++) + for(s = 0;s < MaxChannels;s++) state->gains[s] = 0.0f; return &state->state; diff --git a/Alc/alcEcho.c b/Alc/alcEcho.c index 711b763c..7d050716 100644 --- a/Alc/alcEcho.c +++ b/Alc/alcEcho.c @@ -44,7 +44,7 @@ typedef struct ALechoState { } Tap[2]; ALuint Offset; /* The panning gains for the two taps */ - ALfloat Gain[2][MAXCHANNELS]; + ALfloat Gain[2][MaxChannels]; ALfloat FeedGain; @@ -111,7 +111,7 @@ static ALvoid EchoUpdate(ALeffectState *effect, ALCdevice *Device, const ALeffec state->iirFilter.coeff = lpCoeffCalc(g, cw); gain = Slot->Gain; - for(i = 0;i < MAXCHANNELS;i++) + for(i = 0;i < MaxChannels;i++) { state->Gain[0][i] = 0.0f; state->Gain[1][i] = 0.0f; @@ -126,7 +126,7 @@ static ALvoid EchoUpdate(ALeffectState *effect, ALCdevice *Device, const ALeffec ComputeAngleGains(Device, aluAtan2(+lrpan, 0.0f), (1.0f-dirGain)*F_PI, gain, state->Gain[1]); } -static ALvoid EchoProcess(ALeffectState *effect, ALuint SamplesToDo, const ALfloat *SamplesIn, ALfloat (*SamplesOut)[MAXCHANNELS]) +static ALvoid EchoProcess(ALeffectState *effect, ALuint SamplesToDo, const ALfloat *SamplesIn, ALfloat (*SamplesOut)[MaxChannels]) { ALechoState *state = (ALechoState*)effect; const ALuint mask = state->BufferLength-1; @@ -140,12 +140,12 @@ static ALvoid EchoProcess(ALeffectState *effect, ALuint SamplesToDo, const ALflo { /* First tap */ smp = state->SampleBuffer[(offset-tap1) & mask]; - for(k = 0;k < MAXCHANNELS;k++) + for(k = 0;k < MaxChannels;k++) SamplesOut[i][k] += smp * state->Gain[0][k]; /* Second tap */ smp = state->SampleBuffer[(offset-tap2) & mask]; - for(k = 0;k < MAXCHANNELS;k++) + for(k = 0;k < MaxChannels;k++) SamplesOut[i][k] += smp * state->Gain[1][k]; // Apply damping and feedback gain to the second tap, and mix in the diff --git a/Alc/alcModulator.c b/Alc/alcModulator.c index 2cdbcd0b..5bfcdb22 100644 --- a/Alc/alcModulator.c +++ b/Alc/alcModulator.c @@ -43,7 +43,7 @@ typedef struct ALmodulatorState { ALuint index; ALuint step; - ALfloat Gain[MAXCHANNELS]; + ALfloat Gain[MaxChannels]; FILTER iirFilter; ALfloat history[1]; @@ -84,7 +84,7 @@ static __inline ALfloat hpFilter1P(FILTER *iir, ALuint offset, ALfloat input) #define DECL_TEMPLATE(func) \ static void Process##func(ALmodulatorState *state, ALuint SamplesToDo, \ - const ALfloat *SamplesIn, ALfloat (*SamplesOut)[MAXCHANNELS]) \ + const ALfloat *SamplesIn, ALfloat (*SamplesOut)[MaxChannels]) \ { \ const ALuint step = state->step; \ ALuint index = state->index; \ @@ -101,7 +101,7 @@ static void Process##func(ALmodulatorState *state, ALuint SamplesToDo, \ \ samp = hpFilter1P(&state->iirFilter, 0, samp); \ \ - for(k = 0;k < MAXCHANNELS;k++) \ + for(k = 0;k < MaxChannels;k++) \ SamplesOut[i][k] += state->Gain[k] * samp; \ } \ state->index = index; \ @@ -151,7 +151,7 @@ static ALvoid ModulatorUpdate(ALeffectState *effect, ALCdevice *Device, const AL gain = aluSqrt(1.0f/Device->NumChan); gain *= Slot->Gain; - for(index = 0;index < MAXCHANNELS;index++) + for(index = 0;index < MaxChannels;index++) state->Gain[index] = 0.0f; for(index = 0;index < Device->NumChan;index++) { @@ -160,7 +160,7 @@ static ALvoid ModulatorUpdate(ALeffectState *effect, ALCdevice *Device, const AL } } -static ALvoid ModulatorProcess(ALeffectState *effect, ALuint SamplesToDo, const ALfloat *SamplesIn, ALfloat (*SamplesOut)[MAXCHANNELS]) +static ALvoid ModulatorProcess(ALeffectState *effect, ALuint SamplesToDo, const ALfloat *SamplesIn, ALfloat (*SamplesOut)[MaxChannels]) { ALmodulatorState *state = (ALmodulatorState*)effect; diff --git a/Alc/alcReverb.c b/Alc/alcReverb.c index a2230c7c..8f0b65ad 100644 --- a/Alc/alcReverb.c +++ b/Alc/alcReverb.c @@ -85,7 +85,7 @@ typedef struct ALverbState { // The gain for each output channel based on 3D panning (only for the // EAX path). - ALfloat PanGain[MAXCHANNELS]; + ALfloat PanGain[MaxChannels]; } Early; // Decorrelator delay line. @@ -124,7 +124,7 @@ typedef struct ALverbState { // The gain for each output channel based on 3D panning (only for the // EAX path). - ALfloat PanGain[MAXCHANNELS]; + ALfloat PanGain[MaxChannels]; } Late; struct { @@ -546,7 +546,7 @@ static __inline ALvoid EAXVerbPass(ALverbState *State, ALfloat in, ALfloat *earl // This processes the reverb state, given the input samples and an output // buffer. -static ALvoid VerbProcess(ALeffectState *effect, ALuint SamplesToDo, const ALfloat *SamplesIn, ALfloat (*SamplesOut)[MAXCHANNELS]) +static ALvoid VerbProcess(ALeffectState *effect, ALuint SamplesToDo, const ALfloat *SamplesIn, ALfloat (*SamplesOut)[MaxChannels]) { ALverbState *State = (ALverbState*)effect; ALuint index, c; @@ -565,14 +565,14 @@ static ALvoid VerbProcess(ALeffectState *effect, ALuint SamplesToDo, const ALflo out[3] = (early[3] + late[3]); // Output the results. - for(c = 0;c < MAXCHANNELS;c++) + for(c = 0;c < MaxChannels;c++) SamplesOut[index][c] += panGain[c] * out[c&3]; } } // This processes the EAX reverb state, given the input samples and an output // buffer. -static ALvoid EAXVerbProcess(ALeffectState *effect, ALuint SamplesToDo, const ALfloat *SamplesIn, ALfloat (*SamplesOut)[MAXCHANNELS]) +static ALvoid EAXVerbProcess(ALeffectState *effect, ALuint SamplesToDo, const ALfloat *SamplesIn, ALfloat (*SamplesOut)[MaxChannels]) { ALverbState *State = (ALverbState*)effect; ALuint index, c; @@ -583,7 +583,7 @@ static ALvoid EAXVerbProcess(ALeffectState *effect, ALuint SamplesToDo, const AL // Process reverb for this sample. EAXVerbPass(State, SamplesIn[index], early, late); - for(c = 0;c < MAXCHANNELS;c++) + for(c = 0;c < MaxChannels;c++) SamplesOut[index][c] += State->Early.PanGain[c]*early[c&3] + State->Late.PanGain[c]*late[c&3]; } @@ -1045,13 +1045,13 @@ static ALvoid Update3DPanning(const ALCdevice *Device, const ALfloat *Reflection } dirGain = aluSqrt(earlyPan[0]*earlyPan[0] + earlyPan[2]*earlyPan[2]); - for(index = 0;index < MAXCHANNELS;index++) + for(index = 0;index < MaxChannels;index++) State->Early.PanGain[index] = 0.0f; ComputeAngleGains(Device, aluAtan2(earlyPan[0], earlyPan[2]), (1.0f-dirGain)*F_PI, lerp(ambientGain, 1.0f, dirGain) * Gain, State->Early.PanGain); dirGain = aluSqrt(latePan[0]*latePan[0] + latePan[2]*latePan[2]); - for(index = 0;index < MAXCHANNELS;index++) + for(index = 0;index < MaxChannels;index++) State->Late.PanGain[index] = 0.0f; ComputeAngleGains(Device, aluAtan2(latePan[0], latePan[2]), (1.0f-dirGain)*F_PI, lerp(ambientGain, 1.0f, dirGain) * Gain, State->Late.PanGain); @@ -1142,7 +1142,7 @@ static ALvoid ReverbUpdate(ALeffectState *effect, ALCdevice *Device, const ALeff /* Update channel gains */ gain *= aluSqrt(2.0f/Device->NumChan) * ReverbBoost; - for(index = 0;index < MAXCHANNELS;index++) + for(index = 0;index < MaxChannels;index++) State->Gain[index] = 0.0f; for(index = 0;index < Device->NumChan;index++) { @@ -1236,7 +1236,7 @@ ALeffectState *ReverbCreate(void) State->Late.LpSample[index] = 0.0f; } - for(index = 0;index < MAXCHANNELS;index++) + for(index = 0;index < MaxChannels;index++) { State->Early.PanGain[index] = 0.0f; State->Late.PanGain[index] = 0.0f; diff --git a/Alc/mixer.c b/Alc/mixer.c index 75ede3dc..c4120908 100644 --- a/Alc/mixer.c +++ b/Alc/mixer.c @@ -107,7 +107,7 @@ static void MixDirect_Hrtf_##sampler(ALsource *Source, ALCdevice *Device, \ { \ const ALuint NumChannels = Source->NumChannels; \ const ALint *RESTRICT DelayStep = params->Hrtf.DelayStep; \ - ALfloat (*RESTRICT DryBuffer)[MAXCHANNELS]; \ + ALfloat (*RESTRICT DryBuffer)[MaxChannels]; \ ALfloat *RESTRICT ClickRemoval, *RESTRICT PendingClicks; \ ALfloat (*RESTRICT CoeffStep)[2] = params->Hrtf.CoeffStep; \ ALuint pos, frac; \ @@ -157,10 +157,10 @@ static void MixDirect_Hrtf_##sampler(ALsource *Source, ALCdevice *Device, \ left = History[(Offset-(Delay[0]>>16))&SRC_HISTORY_MASK]; \ right = History[(Offset-(Delay[1]>>16))&SRC_HISTORY_MASK]; \ \ - ClickRemoval[FRONT_LEFT] -= Values[(Offset+1)&HRIR_MASK][0] + \ - Coeffs[0][0] * left; \ - ClickRemoval[FRONT_RIGHT] -= Values[(Offset+1)&HRIR_MASK][1] + \ - Coeffs[0][1] * right; \ + ClickRemoval[FrontLeft] -= Values[(Offset+1)&HRIR_MASK][0] + \ + Coeffs[0][0] * left; \ + ClickRemoval[FrontRight] -= Values[(Offset+1)&HRIR_MASK][1] + \ + Coeffs[0][1] * right; \ } \ for(BufferIdx = 0;BufferIdx < BufferSize && Counter > 0;BufferIdx++) \ { \ @@ -187,8 +187,8 @@ static void MixDirect_Hrtf_##sampler(ALsource *Source, ALCdevice *Device, \ Coeffs[c][1] += CoeffStep[c][1]; \ } \ \ - DryBuffer[OutPos][FRONT_LEFT] += Values[Offset&HRIR_MASK][0]; \ - DryBuffer[OutPos][FRONT_RIGHT] += Values[Offset&HRIR_MASK][1]; \ + DryBuffer[OutPos][FrontLeft] += Values[Offset&HRIR_MASK][0]; \ + DryBuffer[OutPos][FrontRight] += Values[Offset&HRIR_MASK][1]; \ \ frac += increment; \ pos += frac>>FRACTIONBITS; \ @@ -213,8 +213,8 @@ static void MixDirect_Hrtf_##sampler(ALsource *Source, ALCdevice *Device, \ Offset++; \ \ ApplyCoeffs(Offset, Values, Coeffs, left, right); \ - DryBuffer[OutPos][FRONT_LEFT] += Values[Offset&HRIR_MASK][0]; \ - DryBuffer[OutPos][FRONT_RIGHT] += Values[Offset&HRIR_MASK][1]; \ + DryBuffer[OutPos][FrontLeft] += Values[Offset&HRIR_MASK][0]; \ + DryBuffer[OutPos][FrontRight] += Values[Offset&HRIR_MASK][1]; \ \ frac += increment; \ pos += frac>>FRACTIONBITS; \ @@ -230,10 +230,10 @@ static void MixDirect_Hrtf_##sampler(ALsource *Source, ALCdevice *Device, \ left = History[(Offset-Delay[0])&SRC_HISTORY_MASK]; \ right = History[(Offset-Delay[1])&SRC_HISTORY_MASK]; \ \ - PendingClicks[FRONT_LEFT] += Values[(Offset+1)&HRIR_MASK][0] + \ - Coeffs[0][0] * left; \ - PendingClicks[FRONT_RIGHT] += Values[(Offset+1)&HRIR_MASK][1] + \ - Coeffs[0][1] * right; \ + PendingClicks[FrontLeft] += Values[(Offset+1)&HRIR_MASK][0] + \ + Coeffs[0][0] * left; \ + PendingClicks[FrontRight] += Values[(Offset+1)&HRIR_MASK][1] + \ + Coeffs[0][1] * right; \ } \ OutPos -= BufferSize; \ } \ @@ -252,9 +252,9 @@ static void MixDirect_##sampler(ALsource *Source, ALCdevice *Device, \ ALuint OutPos, ALuint SamplesToDo, ALuint BufferSize) \ { \ const ALuint NumChannels = Source->NumChannels; \ - ALfloat (*RESTRICT DryBuffer)[MAXCHANNELS]; \ + ALfloat (*RESTRICT DryBuffer)[MaxChannels]; \ ALfloat *RESTRICT ClickRemoval, *RESTRICT PendingClicks; \ - ALfloat DrySend[MAXCHANNELS]; \ + ALfloat DrySend[MaxChannels]; \ FILTER *DryFilter; \ ALuint pos, frac; \ ALuint BufferIdx; \ @@ -271,7 +271,7 @@ static void MixDirect_##sampler(ALsource *Source, ALCdevice *Device, \ \ for(i = 0;i < NumChannels;i++) \ { \ - for(c = 0;c < MAXCHANNELS;c++) \ + for(c = 0;c < MaxChannels;c++) \ DrySend[c] = params->Gains[i][c]; \ \ pos = 0; \ @@ -282,7 +282,7 @@ static void MixDirect_##sampler(ALsource *Source, ALCdevice *Device, \ value = sampler(data + pos*NumChannels + i, NumChannels, frac); \ \ value = lpFilter2PC(DryFilter, i, value); \ - for(c = 0;c < MAXCHANNELS;c++) \ + for(c = 0;c < MaxChannels;c++) \ ClickRemoval[c] -= value*DrySend[c]; \ } \ for(BufferIdx = 0;BufferIdx < BufferSize;BufferIdx++) \ @@ -290,7 +290,7 @@ static void MixDirect_##sampler(ALsource *Source, ALCdevice *Device, \ value = sampler(data + pos*NumChannels + i, NumChannels, frac); \ \ value = lpFilter2P(DryFilter, i, value); \ - for(c = 0;c < MAXCHANNELS;c++) \ + for(c = 0;c < MaxChannels;c++) \ DryBuffer[OutPos][c] += value*DrySend[c]; \ \ frac += increment; \ @@ -303,7 +303,7 @@ static void MixDirect_##sampler(ALsource *Source, ALCdevice *Device, \ value = sampler(data + pos*NumChannels + i, NumChannels, frac); \ \ value = lpFilter2PC(DryFilter, i, value); \ - for(c = 0;c < MAXCHANNELS;c++) \ + for(c = 0;c < MaxChannels;c++) \ PendingClicks[c] += value*DrySend[c]; \ } \ OutPos -= BufferSize; \ diff --git a/Alc/panning.c b/Alc/panning.c index d6d4bc21..4bdaf6b0 100644 --- a/Alc/panning.c +++ b/Alc/panning.c @@ -31,8 +31,8 @@ #include "AL/alc.h" #include "alu.h" -static void SetSpeakerArrangement(const char *name, ALfloat SpeakerAngle[MAXCHANNELS], - enum Channel Speaker2Chan[MAXCHANNELS], ALint chans) +static void SetSpeakerArrangement(const char *name, ALfloat SpeakerAngle[MaxChannels], + enum Channel Speaker2Chan[MaxChannels], ALint chans) { char *confkey, *next; char *layout_str; @@ -71,21 +71,21 @@ static void SetSpeakerArrangement(const char *name, ALfloat SpeakerAngle[MAXCHAN *(++end) = 0; if(strcmp(confkey, "fl") == 0 || strcmp(confkey, "front-left") == 0) - val = FRONT_LEFT; + val = FrontLeft; else if(strcmp(confkey, "fr") == 0 || strcmp(confkey, "front-right") == 0) - val = FRONT_RIGHT; + val = FrontRight; else if(strcmp(confkey, "fc") == 0 || strcmp(confkey, "front-center") == 0) - val = FRONT_CENTER; + val = FrontCenter; else if(strcmp(confkey, "bl") == 0 || strcmp(confkey, "back-left") == 0) - val = BACK_LEFT; + val = BackLeft; else if(strcmp(confkey, "br") == 0 || strcmp(confkey, "back-right") == 0) - val = BACK_RIGHT; + val = BackRight; else if(strcmp(confkey, "bc") == 0 || strcmp(confkey, "back-center") == 0) - val = BACK_CENTER; + val = BackCenter; else if(strcmp(confkey, "sl") == 0 || strcmp(confkey, "side-left") == 0) - val = SIDE_LEFT; + val = SideLeft; else if(strcmp(confkey, "sr") == 0 || strcmp(confkey, "side-right") == 0) - val = SIDE_RIGHT; + val = SideRight; else { ERR("Unknown speaker for %s: \"%s\"\n", name, confkey); @@ -148,9 +148,9 @@ static void SetSpeakerArrangement(const char *name, ALfloat SpeakerAngle[MAXCHAN */ ALvoid ComputeAngleGains(const ALCdevice *device, ALfloat angle, ALfloat hwidth, ALfloat ingain, ALfloat *gains) { - ALfloat tmpgains[MAXCHANNELS] = { 0.0f, 0.0f, 0.0f, 0.0f, 0.0f, 0.0f, 0.0f, 0.0f }; - enum Channel Speaker2Chan[MAXCHANNELS]; - ALfloat SpeakerAngle[MAXCHANNELS]; + ALfloat tmpgains[MaxChannels] = { 0.0f, 0.0f, 0.0f, 0.0f, 0.0f, 0.0f, 0.0f, 0.0f }; + enum Channel Speaker2Chan[MaxChannels]; + ALfloat SpeakerAngle[MaxChannels]; ALfloat langle, rangle; ALfloat a; ALuint i; @@ -346,15 +346,15 @@ ALvoid aluInitPanning(ALCdevice *Device) { case DevFmtMono: Device->NumChan = 1; - Speaker2Chan[0] = FRONT_CENTER; + Speaker2Chan[0] = FrontCenter; SpeakerAngle[0] = F_PI/180.0f * 0.0f; layoutname = NULL; break; case DevFmtStereo: Device->NumChan = 2; - Speaker2Chan[0] = FRONT_LEFT; - Speaker2Chan[1] = FRONT_RIGHT; + Speaker2Chan[0] = FrontLeft; + Speaker2Chan[1] = FrontRight; SpeakerAngle[0] = F_PI/180.0f * -90.0f; SpeakerAngle[1] = F_PI/180.0f * 90.0f; layoutname = "layout_stereo"; @@ -362,10 +362,10 @@ ALvoid aluInitPanning(ALCdevice *Device) case DevFmtQuad: Device->NumChan = 4; - Speaker2Chan[0] = BACK_LEFT; - Speaker2Chan[1] = FRONT_LEFT; - Speaker2Chan[2] = FRONT_RIGHT; - Speaker2Chan[3] = BACK_RIGHT; + Speaker2Chan[0] = BackLeft; + Speaker2Chan[1] = FrontLeft; + Speaker2Chan[2] = FrontRight; + Speaker2Chan[3] = BackRight; SpeakerAngle[0] = F_PI/180.0f * -135.0f; SpeakerAngle[1] = F_PI/180.0f * -45.0f; SpeakerAngle[2] = F_PI/180.0f * 45.0f; @@ -375,11 +375,11 @@ ALvoid aluInitPanning(ALCdevice *Device) case DevFmtX51: Device->NumChan = 5; - Speaker2Chan[0] = BACK_LEFT; - Speaker2Chan[1] = FRONT_LEFT; - Speaker2Chan[2] = FRONT_CENTER; - Speaker2Chan[3] = FRONT_RIGHT; - Speaker2Chan[4] = BACK_RIGHT; + Speaker2Chan[0] = BackLeft; + Speaker2Chan[1] = FrontLeft; + Speaker2Chan[2] = FrontCenter; + Speaker2Chan[3] = FrontRight; + Speaker2Chan[4] = BackRight; SpeakerAngle[0] = F_PI/180.0f * -110.0f; SpeakerAngle[1] = F_PI/180.0f * -30.0f; SpeakerAngle[2] = F_PI/180.0f * 0.0f; @@ -390,11 +390,11 @@ ALvoid aluInitPanning(ALCdevice *Device) case DevFmtX51Side: Device->NumChan = 5; - Speaker2Chan[0] = SIDE_LEFT; - Speaker2Chan[1] = FRONT_LEFT; - Speaker2Chan[2] = FRONT_CENTER; - Speaker2Chan[3] = FRONT_RIGHT; - Speaker2Chan[4] = SIDE_RIGHT; + Speaker2Chan[0] = SideLeft; + Speaker2Chan[1] = FrontLeft; + Speaker2Chan[2] = FrontCenter; + Speaker2Chan[3] = FrontRight; + Speaker2Chan[4] = SideRight; SpeakerAngle[0] = F_PI/180.0f * -90.0f; SpeakerAngle[1] = F_PI/180.0f * -30.0f; SpeakerAngle[2] = F_PI/180.0f * 0.0f; @@ -405,12 +405,12 @@ ALvoid aluInitPanning(ALCdevice *Device) case DevFmtX61: Device->NumChan = 6; - Speaker2Chan[0] = SIDE_LEFT; - Speaker2Chan[1] = FRONT_LEFT; - Speaker2Chan[2] = FRONT_CENTER; - Speaker2Chan[3] = FRONT_RIGHT; - Speaker2Chan[4] = SIDE_RIGHT; - Speaker2Chan[5] = BACK_CENTER; + Speaker2Chan[0] = SideLeft; + Speaker2Chan[1] = FrontLeft; + Speaker2Chan[2] = FrontCenter; + Speaker2Chan[3] = FrontRight; + Speaker2Chan[4] = SideRight; + Speaker2Chan[5] = BackCenter; SpeakerAngle[0] = F_PI/180.0f * -90.0f; SpeakerAngle[1] = F_PI/180.0f * -30.0f; SpeakerAngle[2] = F_PI/180.0f * 0.0f; @@ -422,13 +422,13 @@ ALvoid aluInitPanning(ALCdevice *Device) case DevFmtX71: Device->NumChan = 7; - Speaker2Chan[0] = BACK_LEFT; - Speaker2Chan[1] = SIDE_LEFT; - Speaker2Chan[2] = FRONT_LEFT; - Speaker2Chan[3] = FRONT_CENTER; - Speaker2Chan[4] = FRONT_RIGHT; - Speaker2Chan[5] = SIDE_RIGHT; - Speaker2Chan[6] = BACK_RIGHT; + Speaker2Chan[0] = BackLeft; + Speaker2Chan[1] = SideLeft; + Speaker2Chan[2] = FrontLeft; + Speaker2Chan[3] = FrontCenter; + Speaker2Chan[4] = FrontRight; + Speaker2Chan[5] = SideRight; + Speaker2Chan[6] = BackRight; SpeakerAngle[0] = F_PI/180.0f * -150.0f; SpeakerAngle[1] = F_PI/180.0f * -90.0f; SpeakerAngle[2] = F_PI/180.0f * -30.0f; |