summaryrefslogtreecommitdiffstats
path: root/OpenAL32/alSource.c
diff options
context:
space:
mode:
authorChris Robinson <[email protected]>2011-06-29 23:18:49 -0700
committerChris Robinson <[email protected]>2011-06-29 23:18:49 -0700
commit5736bbc3e43145aa59d3e611ad95e4e73fb836df (patch)
treebeb6f03976fa2887260493fe9ac978d2d5738611 /OpenAL32/alSource.c
parent1b773a858534693056161c90702c4cdb013e8a64 (diff)
Add a source property to skip channel virtualization for multi-channel buffers
With virtualization disabled, channels are mapped directly from input to output and any input channel that is missing an output is dropped. Any virtualization effects (such as HRTF filters) for positional cues are also skipped. The idea is to allow applications a way to play pre-filtered audio that channel vitualization effects could interfere with.
Diffstat (limited to 'OpenAL32/alSource.c')
-rw-r--r--OpenAL32/alSource.c17
1 files changed, 17 insertions, 0 deletions
diff --git a/OpenAL32/alSource.c b/OpenAL32/alSource.c
index e91206eb..a1319005 100644
--- a/OpenAL32/alSource.c
+++ b/OpenAL32/alSource.c
@@ -680,6 +680,16 @@ AL_API ALvoid AL_APIENTRY alSourcei(ALuint source,ALenum eParam,ALint lValue)
alSetError(pContext, AL_INVALID_VALUE);
break;
+ case AL_VIRTUAL_CHANNELS_SOFT:
+ if(lValue == AL_TRUE || lValue == AL_FALSE)
+ {
+ Source->VirtualChannels = lValue;
+ Source->NeedsUpdate = AL_TRUE;
+ }
+ else
+ alSetError(pContext, AL_INVALID_VALUE);
+ break;
+
case AL_DISTANCE_MODEL:
if(lValue == AL_NONE ||
lValue == AL_INVERSE_DISTANCE ||
@@ -801,6 +811,7 @@ AL_API void AL_APIENTRY alSourceiv(ALuint source, ALenum eParam, const ALint* pl
case AL_AUXILIARY_SEND_FILTER_GAIN_AUTO:
case AL_AUXILIARY_SEND_FILTER_GAINHF_AUTO:
case AL_DISTANCE_MODEL:
+ case AL_VIRTUAL_CHANNELS_SOFT:
alSourcei(source, eParam, plValues[0]);
return;
@@ -1149,6 +1160,10 @@ AL_API ALvoid AL_APIENTRY alGetSourcei(ALuint source, ALenum eParam, ALint *plVa
*plValue = (ALint)Source->DopplerFactor;
break;
+ case AL_VIRTUAL_CHANNELS_SOFT:
+ *plValue = Source->VirtualChannels;
+ break;
+
case AL_DISTANCE_MODEL:
*plValue = Source->DistanceModel;
break;
@@ -1245,6 +1260,7 @@ AL_API void AL_APIENTRY alGetSourceiv(ALuint source, ALenum eParam, ALint* plVal
case AL_AUXILIARY_SEND_FILTER_GAIN_AUTO:
case AL_AUXILIARY_SEND_FILTER_GAINHF_AUTO:
case AL_DISTANCE_MODEL:
+ case AL_VIRTUAL_CHANNELS_SOFT:
alGetSourcei(source, eParam, plValues);
return;
@@ -1807,6 +1823,7 @@ static ALvoid InitSourceParams(ALsource *Source)
Source->AirAbsorptionFactor = 0.0f;
Source->RoomRolloffFactor = 0.0f;
Source->DopplerFactor = 1.0f;
+ Source->VirtualChannels = AL_TRUE;
Source->DistanceModel = AL_INVERSE_DISTANCE_CLAMPED;