From 484702a2e5e9cc0368a4562bc7574764a2178da8 Mon Sep 17 00:00:00 2001 From: Chris Robinson Date: Fri, 9 Apr 2010 12:27:30 -0700 Subject: Get the speaker arrangement before setting up the channel matrix --- Alc/ALu.c | 37 +++++++++++++++++++------------------ 1 file changed, 19 insertions(+), 18 deletions(-) (limited to 'Alc/ALu.c') diff --git a/Alc/ALu.c b/Alc/ALu.c index 40b5662d..3eda6edb 100644 --- a/Alc/ALu.c +++ b/Alc/ALu.c @@ -235,6 +235,25 @@ ALvoid aluInitPanning(ALCdevice *Device) ALfloat maxout; ALuint s, s2; + Device->NumChan = 8; + 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[7] = BACK_CENTER; + SpeakerAngle[0] = -150.0f * M_PI/180.0f; + SpeakerAngle[1] = -90.0f * M_PI/180.0f; + SpeakerAngle[2] = -30.0f * M_PI/180.0f; + SpeakerAngle[3] = 0.0f * M_PI/180.0f; + SpeakerAngle[4] = 30.0f * M_PI/180.0f; + SpeakerAngle[5] = 90.0f * M_PI/180.0f; + SpeakerAngle[6] = 150.0f * M_PI/180.0f; + SpeakerAngle[7] = 180.0f * M_PI/180.0f; + SetSpeakerArrangement("layout", SpeakerAngle, Speaker2Chan, Device->NumChan); + for(s = 0;s < OUTPUTCHANNELS;s++) { for(s2 = 0;s2 < OUTPUTCHANNELS;s2++) @@ -328,24 +347,6 @@ ALvoid aluInitPanning(ALCdevice *Device) Device->ChannelMatrix[s2][s] *= maxout; } - Device->NumChan = 8; - 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[7] = BACK_CENTER; - SpeakerAngle[0] = -150.0f * M_PI/180.0f; - SpeakerAngle[1] = -90.0f * M_PI/180.0f; - SpeakerAngle[2] = -30.0f * M_PI/180.0f; - SpeakerAngle[3] = 0.0f * M_PI/180.0f; - SpeakerAngle[4] = 30.0f * M_PI/180.0f; - SpeakerAngle[5] = 90.0f * M_PI/180.0f; - SpeakerAngle[6] = 150.0f * M_PI/180.0f; - SpeakerAngle[7] = 180.0f * M_PI/180.0f; - SetSpeakerArrangement("layout", SpeakerAngle, Speaker2Chan, Device->NumChan); for(pos = 0; pos < LUT_NUM; pos++) { -- cgit v1.2.3