aboutsummaryrefslogtreecommitdiffstats
path: root/Alc/mixer.c
diff options
context:
space:
mode:
authorChris Robinson <[email protected]>2014-03-19 13:14:11 -0700
committerChris Robinson <[email protected]>2014-03-19 13:14:11 -0700
commit6ee54fb1f3e050c6f49e5fef379c9b9f80e4683d (patch)
tree6764b47fe9a76728b78bb22233b76e6583cd9aec /Alc/mixer.c
parentd6f7aac1bbc2c51dbe53e30a50275d550a020df6 (diff)
Store some source mixing parameters in the active source struct
Diffstat (limited to 'Alc/mixer.c')
-rw-r--r--Alc/mixer.c21
1 files changed, 11 insertions, 10 deletions
diff --git a/Alc/mixer.c b/Alc/mixer.c
index acd6c610..36a08ccd 100644
--- a/Alc/mixer.c
+++ b/Alc/mixer.c
@@ -94,8 +94,9 @@ static void DoFilter(ALfilterState *filter, ALfloat *restrict dst, const ALfloat
}
-ALvoid MixSource(ALsource *Source, ALCdevice *Device, ALuint SamplesToDo)
+ALvoid MixSource(ALactivesource *src, ALCdevice *Device, ALuint SamplesToDo)
{
+ ALsource *Source = src->Source;
ALbufferlistitem *BufferListItem;
ALuint DataPosInt, DataPosFrac;
ALuint BuffersPlayed;
@@ -115,7 +116,7 @@ ALvoid MixSource(ALsource *Source, ALCdevice *Device, ALuint SamplesToDo)
DataPosInt = Source->position;
DataPosFrac = Source->position_fraction;
Looping = Source->Looping;
- increment = Source->Params.Step;
+ increment = src->Step;
Resampler = (increment==FRACTIONONE) ? PointResampler : Source->Resampler;
NumChannels = Source->NumChannels;
SampleSize = Source->SampleSize;
@@ -322,28 +323,28 @@ ALvoid MixSource(ALsource *Source, ALCdevice *Device, ALuint SamplesToDo)
}
/* Now resample, then filter and mix to the appropriate outputs. */
- Source->Params.Resample(&SrcData[BufferPrePadding], DataPosFrac,
- increment, ResampledData, DstBufferSize);
+ src->Resample(&SrcData[BufferPrePadding], DataPosFrac,
+ increment, ResampledData, DstBufferSize);
{
- DirectParams *directparms = &Source->Params.Direct;
+ DirectParams *directparms = &src->Direct;
DoFilter(&directparms->LpFilter[chan], SrcData, ResampledData,
DstBufferSize);
- Source->Params.DryMix(directparms, SrcData, chan, OutPos,
- SamplesToDo, DstBufferSize);
+ src->DryMix(directparms, SrcData, chan, OutPos,
+ SamplesToDo, DstBufferSize);
}
for(j = 0;j < Device->NumAuxSends;j++)
{
- SendParams *sendparms = &Source->Params.Send[j];
+ SendParams *sendparms = &src->Send[j];
if(!sendparms->OutBuffer)
continue;
DoFilter(&sendparms->LpFilter[chan], SrcData, ResampledData,
DstBufferSize);
- Source->Params.WetMix(sendparms, SrcData, OutPos,
- SamplesToDo, DstBufferSize);
+ src->WetMix(sendparms, SrcData, OutPos,
+ SamplesToDo, DstBufferSize);
}
}
/* Update positions */