aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--Alc/ALc.c79
-rw-r--r--OpenAL32/Include/alMain.h82
2 files changed, 82 insertions, 79 deletions
diff --git a/Alc/ALc.c b/Alc/ALc.c
index 970b98c9..383e2c47 100644
--- a/Alc/ALc.c
+++ b/Alc/ALc.c
@@ -1537,6 +1537,85 @@ ALCboolean ALCAPIENTRY alcMakeCurrent(ALCcontext *context)
}
+// Sets the default channel order used by most non-WaveFormatEx-based APIs
+void SetDefaultChannelOrder(ALCdevice *device)
+{
+ switch(aluChannelsFromFormat(device->Format))
+ {
+ case 1: /* Mono is rendered as stereo; fall-through... */
+ 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;
+ }
+}
+// Sets the default order used by WaveFormatEx
+void SetDefaultWFXChannelOrder(ALCdevice *device)
+{
+ switch(aluChannelsFromFormat(device->Format))
+ {
+ case 1: /* Mono is rendered as stereo; fall-through... */
+ 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;
+ }
+}
+
static ALenum GetFormatFromString(const char *str)
{
if(strcasecmp(str, "AL_FORMAT_MONO32") == 0) return AL_FORMAT_MONO_FLOAT32;
diff --git a/OpenAL32/Include/alMain.h b/OpenAL32/Include/alMain.h
index 9217f227..324c18fa 100644
--- a/OpenAL32/Include/alMain.h
+++ b/OpenAL32/Include/alMain.h
@@ -363,88 +363,12 @@ int GetConfigValueBool(const char *blockName, const char *keyName, float def);
void EnableRTPrio(ALint level);
+void SetDefaultChannelOrder(ALCdevice *device);
+void SetDefaultWFXChannelOrder(ALCdevice *device);
+
ALCboolean ALCAPIENTRY alcMakeCurrent(ALCcontext *context);
ALCcontext* ALCAPIENTRY alcGetThreadContext(void);
-// Sets the default channel order used by most non-WaveFormatEx-based APIs
-static __inline void SetDefaultChannelOrder(ALCdevice *device)
-{
- switch(aluChannelsFromFormat(device->Format))
- {
- case 1: /* Mono is rendered as stereo; fall-through... */
- 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;
- }
-}
-// Sets the default order used by WaveFormatEx
-static __inline void SetDefaultWFXChannelOrder(ALCdevice *device)
-{
- switch(aluChannelsFromFormat(device->Format))
- {
- case 1: /* Mono is rendered as stereo; fall-through... */
- 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;
- }
-}
-
#ifdef __cplusplus
}
#endif