aboutsummaryrefslogtreecommitdiffstats
path: root/OpenAL32
diff options
context:
space:
mode:
authorChris Robinson <[email protected]>2014-03-23 16:11:21 -0700
committerChris Robinson <[email protected]>2014-03-23 16:11:21 -0700
commit52deb557d5466e7dd0b78dceb16f2ad5296bbcd4 (patch)
tree14bf48e2d74ce459fe37bb5feb0b556aa09d174e /OpenAL32
parent83038c0dab0727b76765a8feed5a2c3c23c9915b (diff)
Add gain stepping to the send mixers
Diffstat (limited to 'OpenAL32')
-rw-r--r--OpenAL32/Include/alu.h9
-rw-r--r--OpenAL32/alSource.c10
2 files changed, 17 insertions, 2 deletions
diff --git a/OpenAL32/Include/alu.h b/OpenAL32/Include/alu.h
index 3850875d..cfc54acc 100644
--- a/OpenAL32/Include/alu.h
+++ b/OpenAL32/Include/alu.h
@@ -87,7 +87,14 @@ typedef struct SendParams {
/* Gain control, which applies to all input channels to a single (mono)
* output buffer. */
- ALfloat Gain;
+ struct {
+ ALfloat Current;
+ ALfloat Step;
+ ALfloat Target;
+ } Gain;
+
+ ALboolean Moving;
+ ALuint Counter;
ALfilterState LpFilter[MAX_INPUT_CHANNELS];
} SendParams;
diff --git a/OpenAL32/alSource.c b/OpenAL32/alSource.c
index 082d8f54..acccd0be 100644
--- a/OpenAL32/alSource.c
+++ b/OpenAL32/alSource.c
@@ -2276,6 +2276,7 @@ ALvoid SetSourceState(ALsource *Source, ALCcontext *Context, ALenum state)
{
if(state == AL_PLAYING)
{
+ ALCdevice *device = Context->Device;
ALbufferlistitem *BufferList;
ALactivesource *src = NULL;
ALsizei j, k;
@@ -2306,7 +2307,7 @@ ALvoid SetSourceState(ALsource *Source, ALCcontext *Context, ALenum state)
/* If there's nothing to play, or device is disconnected, go right to
* stopped */
- if(!BufferList || !Context->Device->Connected)
+ if(!BufferList || !device->Connected)
{
SetSourceState(Source, Context, AL_STOPPED);
return;
@@ -2339,6 +2340,8 @@ ALvoid SetSourceState(ALsource *Source, ALCcontext *Context, ALenum state)
}
else
{
+ ALuint i;
+
src->Direct.Moving = AL_FALSE;
src->Direct.Counter = 0;
for(j = 0;j < MAX_INPUT_CHANNELS;j++)
@@ -2351,6 +2354,11 @@ ALvoid SetSourceState(ALsource *Source, ALCcontext *Context, ALenum state)
src->Direct.Mix.Hrtf.State.Values[j][k][1] = 0.0f;
}
}
+ for(i = 0;i < device->NumAuxSends;i++)
+ {
+ src->Send[i].Counter = 0;
+ src->Send[i].Moving = AL_FALSE;
+ }
}
Source->NeedsUpdate = AL_TRUE;
}