diff options
Diffstat (limited to 'Alc')
-rw-r--r-- | Alc/ALc.c | 132 | ||||
-rw-r--r-- | Alc/ALu.c | 89 |
2 files changed, 123 insertions, 98 deletions
@@ -1567,39 +1567,39 @@ void SetDefaultChannelOrder(ALCdevice *device) { switch(aluChannelsFromFormat(device->Format)) { - case 1: device->DevChannels[0] = FRONT_CENTER; break; - - case 2: device->DevChannels[0] = FRONT_LEFT; - device->DevChannels[1] = FRONT_RIGHT; break; - - case 4: device->DevChannels[0] = FRONT_LEFT; - device->DevChannels[1] = FRONT_RIGHT; - device->DevChannels[2] = BACK_LEFT; - device->DevChannels[3] = BACK_RIGHT; break; - - case 6: 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; - device->DevChannels[5] = LFE; break; - - case 7: device->DevChannels[0] = FRONT_LEFT; - device->DevChannels[1] = FRONT_RIGHT; - device->DevChannels[2] = FRONT_CENTER; - device->DevChannels[3] = LFE; - device->DevChannels[4] = BACK_CENTER; - device->DevChannels[5] = SIDE_LEFT; - device->DevChannels[6] = SIDE_RIGHT; break; - - case 8: 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; - device->DevChannels[5] = LFE; - device->DevChannels[6] = SIDE_LEFT; - device->DevChannels[7] = SIDE_RIGHT; break; + case 1: device->DevChannels[FRONT_CENTER] = 0; break; + + case 2: device->DevChannels[FRONT_LEFT] = 0; + device->DevChannels[FRONT_RIGHT] = 1; break; + + case 4: device->DevChannels[FRONT_LEFT] = 0; + device->DevChannels[FRONT_RIGHT] = 1; + device->DevChannels[BACK_LEFT] = 2; + device->DevChannels[BACK_RIGHT] = 3; break; + + case 6: device->DevChannels[FRONT_LEFT] = 0; + device->DevChannels[FRONT_RIGHT] = 1; + device->DevChannels[BACK_LEFT] = 2; + device->DevChannels[BACK_RIGHT] = 3; + device->DevChannels[FRONT_CENTER] = 4; + device->DevChannels[LFE] = 5; break; + + case 7: device->DevChannels[FRONT_LEFT] = 0; + device->DevChannels[FRONT_RIGHT] = 1; + device->DevChannels[FRONT_CENTER] = 2; + device->DevChannels[LFE] = 3; + device->DevChannels[BACK_CENTER] = 4; + device->DevChannels[SIDE_LEFT] = 5; + device->DevChannels[SIDE_RIGHT] = 6; break; + + case 8: device->DevChannels[FRONT_LEFT] = 0; + device->DevChannels[FRONT_RIGHT] = 1; + device->DevChannels[BACK_LEFT] = 2; + device->DevChannels[BACK_RIGHT] = 3; + device->DevChannels[FRONT_CENTER] = 4; + device->DevChannels[LFE] = 5; + device->DevChannels[SIDE_LEFT] = 6; + device->DevChannels[SIDE_RIGHT] = 7; break; } } // Sets the default order used by WaveFormatEx @@ -1607,39 +1607,39 @@ void SetDefaultWFXChannelOrder(ALCdevice *device) { switch(aluChannelsFromFormat(device->Format)) { - case 1: device->DevChannels[0] = FRONT_CENTER; break; - - case 2: device->DevChannels[0] = FRONT_LEFT; - device->DevChannels[1] = FRONT_RIGHT; break; - - case 4: device->DevChannels[0] = FRONT_LEFT; - device->DevChannels[1] = FRONT_RIGHT; - device->DevChannels[2] = BACK_LEFT; - device->DevChannels[3] = BACK_RIGHT; break; - - case 6: device->DevChannels[0] = FRONT_LEFT; - device->DevChannels[1] = FRONT_RIGHT; - device->DevChannels[2] = FRONT_CENTER; - device->DevChannels[3] = LFE; - device->DevChannels[4] = BACK_LEFT; - device->DevChannels[5] = BACK_RIGHT; break; - - case 7: device->DevChannels[0] = FRONT_LEFT; - device->DevChannels[1] = FRONT_RIGHT; - device->DevChannels[2] = FRONT_CENTER; - device->DevChannels[3] = LFE; - device->DevChannels[4] = BACK_CENTER; - device->DevChannels[5] = SIDE_LEFT; - device->DevChannels[6] = SIDE_RIGHT; break; - - case 8: device->DevChannels[0] = FRONT_LEFT; - device->DevChannels[1] = FRONT_RIGHT; - device->DevChannels[2] = FRONT_CENTER; - 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; + case 1: device->DevChannels[FRONT_CENTER] = 0; break; + + case 2: device->DevChannels[FRONT_LEFT] = 0; + device->DevChannels[FRONT_RIGHT] = 1; break; + + case 4: device->DevChannels[FRONT_LEFT] = 0; + device->DevChannels[FRONT_RIGHT] = 1; + device->DevChannels[BACK_LEFT] = 2; + device->DevChannels[BACK_RIGHT] = 3; break; + + case 6: device->DevChannels[FRONT_LEFT] = 0; + device->DevChannels[FRONT_RIGHT] = 1; + device->DevChannels[FRONT_CENTER] = 2; + device->DevChannels[LFE] = 3; + device->DevChannels[BACK_LEFT] = 4; + device->DevChannels[BACK_RIGHT] = 5; break; + + case 7: device->DevChannels[FRONT_LEFT] = 0; + device->DevChannels[FRONT_RIGHT] = 1; + device->DevChannels[FRONT_CENTER] = 2; + device->DevChannels[LFE] = 3; + device->DevChannels[BACK_CENTER] = 4; + device->DevChannels[SIDE_LEFT] = 5; + device->DevChannels[SIDE_RIGHT] = 6; break; + + case 8: device->DevChannels[FRONT_LEFT] = 0; + device->DevChannels[FRONT_RIGHT] = 1; + device->DevChannels[FRONT_CENTER] = 2; + device->DevChannels[LFE] = 3; + device->DevChannels[BACK_LEFT] = 4; + device->DevChannels[BACK_RIGHT] = 5; + device->DevChannels[SIDE_LEFT] = 6; + device->DevChannels[SIDE_RIGHT] = 7; break; } } @@ -1395,7 +1395,8 @@ ALvoid aluMixData(ALCdevice *device, ALvoid *buffer, ALsizei size) case AL_FORMAT_MONO##bits: \ for(i = 0;i < SamplesToDo;i++) \ { \ - ((type*)buffer)[0] = (func)(DryBuffer[i][ChanMap[0]]); \ + ((type*)buffer)[ChanMap[FRONT_CENTER]] = \ + (func)(DryBuffer[i][FRONT_CENTER]);\ buffer = ((type*)buffer) + 1; \ } \ break; \ @@ -1405,11 +1406,11 @@ ALvoid aluMixData(ALCdevice *device, ALvoid *buffer, ALsizei size) for(i = 0;i < SamplesToDo;i++) \ { \ float samples[2]; \ - samples[0] = DryBuffer[i][ChanMap[0]]; \ - samples[1] = DryBuffer[i][ChanMap[1]]; \ + samples[0] = DryBuffer[i][FRONT_LEFT]; \ + samples[1] = DryBuffer[i][FRONT_RIGHT]; \ bs2b_cross_feed(device->Bs2b, samples); \ - ((type*)buffer)[0] = (func)(samples[0]); \ - ((type*)buffer)[1] = (func)(samples[1]); \ + ((type*)buffer)[ChanMap[FRONT_LEFT]] = (func)(samples[0]);\ + ((type*)buffer)[ChanMap[FRONT_RIGHT]] =(func)(samples[1]);\ buffer = ((type*)buffer) + 2; \ } \ } \ @@ -1417,8 +1418,10 @@ ALvoid aluMixData(ALCdevice *device, ALvoid *buffer, ALsizei size) { \ for(i = 0;i < SamplesToDo;i++) \ { \ - ((type*)buffer)[0] = (func)(DryBuffer[i][ChanMap[0]]); \ - ((type*)buffer)[1] = (func)(DryBuffer[i][ChanMap[1]]); \ + ((type*)buffer)[ChanMap[FRONT_LEFT]] = \ + (func)(DryBuffer[i][FRONT_LEFT]);\ + ((type*)buffer)[ChanMap[FRONT_RIGHT]] = \ + (func)(DryBuffer[i][FRONT_RIGHT]);\ buffer = ((type*)buffer) + 2; \ } \ } \ @@ -1426,49 +1429,71 @@ ALvoid aluMixData(ALCdevice *device, ALvoid *buffer, ALsizei size) case AL_FORMAT_QUAD##bits: \ for(i = 0;i < SamplesToDo;i++) \ { \ - ((type*)buffer)[0] = (func)(DryBuffer[i][ChanMap[0]]); \ - ((type*)buffer)[1] = (func)(DryBuffer[i][ChanMap[1]]); \ - ((type*)buffer)[2] = (func)(DryBuffer[i][ChanMap[2]]); \ - ((type*)buffer)[3] = (func)(DryBuffer[i][ChanMap[3]]); \ + ((type*)buffer)[ChanMap[FRONT_LEFT]] = \ + (func)(DryBuffer[i][FRONT_LEFT]);\ + ((type*)buffer)[ChanMap[FRONT_RIGHT]] = \ + (func)(DryBuffer[i][FRONT_RIGHT]);\ + ((type*)buffer)[ChanMap[BACK_LEFT]] = \ + (func)(DryBuffer[i][BACK_LEFT]);\ + ((type*)buffer)[ChanMap[BACK_RIGHT]] = \ + (func)(DryBuffer[i][BACK_RIGHT]);\ buffer = ((type*)buffer) + 4; \ } \ break; \ case AL_FORMAT_51CHN##bits: \ for(i = 0;i < SamplesToDo;i++) \ { \ - ((type*)buffer)[0] = (func)(DryBuffer[i][ChanMap[0]]); \ - ((type*)buffer)[1] = (func)(DryBuffer[i][ChanMap[1]]); \ - ((type*)buffer)[2] = (func)(DryBuffer[i][ChanMap[2]]); \ - ((type*)buffer)[3] = (func)(DryBuffer[i][ChanMap[3]]); \ - ((type*)buffer)[4] = (func)(DryBuffer[i][ChanMap[4]]); \ - ((type*)buffer)[5] = (func)(DryBuffer[i][ChanMap[5]]); \ + ((type*)buffer)[ChanMap[FRONT_LEFT]] = \ + (func)(DryBuffer[i][FRONT_LEFT]);\ + ((type*)buffer)[ChanMap[FRONT_RIGHT]] = \ + (func)(DryBuffer[i][FRONT_RIGHT]);\ + ((type*)buffer)[ChanMap[FRONT_CENTER]] = \ + (func)(DryBuffer[i][FRONT_CENTER]);\ + ((type*)buffer)[ChanMap[LFE]] = (func)(DryBuffer[i][LFE]); \ + ((type*)buffer)[ChanMap[BACK_LEFT]] = \ + (func)(DryBuffer[i][BACK_LEFT]);\ + ((type*)buffer)[ChanMap[BACK_RIGHT]] = \ + (func)(DryBuffer[i][BACK_RIGHT]);\ buffer = ((type*)buffer) + 6; \ } \ break; \ case AL_FORMAT_61CHN##bits: \ for(i = 0;i < SamplesToDo;i++) \ { \ - ((type*)buffer)[0] = (func)(DryBuffer[i][ChanMap[0]]); \ - ((type*)buffer)[1] = (func)(DryBuffer[i][ChanMap[1]]); \ - ((type*)buffer)[2] = (func)(DryBuffer[i][ChanMap[2]]); \ - ((type*)buffer)[3] = (func)(DryBuffer[i][ChanMap[3]]); \ - ((type*)buffer)[4] = (func)(DryBuffer[i][ChanMap[4]]); \ - ((type*)buffer)[5] = (func)(DryBuffer[i][ChanMap[5]]); \ - ((type*)buffer)[6] = (func)(DryBuffer[i][ChanMap[6]]); \ + ((type*)buffer)[ChanMap[FRONT_LEFT]] = \ + (func)(DryBuffer[i][FRONT_LEFT]);\ + ((type*)buffer)[ChanMap[FRONT_RIGHT]] = \ + (func)(DryBuffer[i][FRONT_RIGHT]);\ + ((type*)buffer)[ChanMap[FRONT_CENTER]] = \ + (func)(DryBuffer[i][FRONT_CENTER]);\ + ((type*)buffer)[ChanMap[LFE]] = (func)(DryBuffer[i][LFE]); \ + ((type*)buffer)[ChanMap[BACK_CENTER]] = \ + (func)(DryBuffer[i][BACK_CENTER]);\ + ((type*)buffer)[ChanMap[SIDE_LEFT]] = \ + (func)(DryBuffer[i][SIDE_LEFT]);\ + ((type*)buffer)[ChanMap[SIDE_RIGHT]] = \ + (func)(DryBuffer[i][SIDE_RIGHT]);\ buffer = ((type*)buffer) + 7; \ } \ break; \ case AL_FORMAT_71CHN##bits: \ for(i = 0;i < SamplesToDo;i++) \ { \ - ((type*)buffer)[0] = (func)(DryBuffer[i][ChanMap[0]]); \ - ((type*)buffer)[1] = (func)(DryBuffer[i][ChanMap[1]]); \ - ((type*)buffer)[2] = (func)(DryBuffer[i][ChanMap[2]]); \ - ((type*)buffer)[3] = (func)(DryBuffer[i][ChanMap[3]]); \ - ((type*)buffer)[4] = (func)(DryBuffer[i][ChanMap[4]]); \ - ((type*)buffer)[5] = (func)(DryBuffer[i][ChanMap[5]]); \ - ((type*)buffer)[6] = (func)(DryBuffer[i][ChanMap[6]]); \ - ((type*)buffer)[7] = (func)(DryBuffer[i][ChanMap[7]]); \ + ((type*)buffer)[ChanMap[FRONT_LEFT]] = \ + (func)(DryBuffer[i][FRONT_LEFT]);\ + ((type*)buffer)[ChanMap[FRONT_RIGHT]] = \ + (func)(DryBuffer[i][FRONT_RIGHT]);\ + ((type*)buffer)[ChanMap[FRONT_CENTER]] = \ + (func)(DryBuffer[i][FRONT_CENTER]);\ + ((type*)buffer)[ChanMap[LFE]] = (func)(DryBuffer[i][LFE]); \ + ((type*)buffer)[ChanMap[BACK_LEFT]] = \ + (func)(DryBuffer[i][BACK_LEFT]);\ + ((type*)buffer)[ChanMap[BACK_RIGHT]] = \ + (func)(DryBuffer[i][BACK_RIGHT]);\ + ((type*)buffer)[ChanMap[SIDE_LEFT]] = \ + (func)(DryBuffer[i][SIDE_LEFT]);\ + ((type*)buffer)[ChanMap[SIDE_RIGHT]] = \ + (func)(DryBuffer[i][SIDE_RIGHT]);\ buffer = ((type*)buffer) + 8; \ } \ break; |