aboutsummaryrefslogtreecommitdiffstats
path: root/Alc/mixer.c
diff options
context:
space:
mode:
authorChris Robinson <[email protected]>2014-06-29 02:04:05 -0700
committerChris Robinson <[email protected]>2014-06-29 02:04:05 -0700
commit8176d2c058d1744c25a2a520ec9b6882decb4f3f (patch)
treef287f5298208999e2f9ef32dea96608a83e20847 /Alc/mixer.c
parent389a2f7b4bcffa5cfbe17e8057c8541b0e442bf8 (diff)
Load soundfont samples into an ALbuffer
Also remove ALsoundfont's now-unneeded sample storage functions and struct fields.
Diffstat (limited to 'Alc/mixer.c')
-rw-r--r--Alc/mixer.c30
1 files changed, 15 insertions, 15 deletions
diff --git a/Alc/mixer.c b/Alc/mixer.c
index a1502488..7141a8ae 100644
--- a/Alc/mixer.c
+++ b/Alc/mixer.c
@@ -121,7 +121,7 @@ DECL_TEMPLATE(ALfloat)
#undef DECL_TEMPLATE
-static void LoadData(ALfloat *dst, const ALvoid *src, ALuint srcstep, enum FmtType srctype, ALuint samples)
+static void LoadSamples(ALfloat *dst, const ALvoid *src, ALuint srcstep, enum FmtType srctype, ALuint samples)
{
switch(srctype)
{
@@ -137,7 +137,7 @@ static void LoadData(ALfloat *dst, const ALvoid *src, ALuint srcstep, enum FmtTy
}
}
-static void SilenceData(ALfloat *dst, ALuint samples)
+static void SilenceSamples(ALfloat *dst, ALuint samples)
{
ALuint i;
for(i = 0;i < samples;i++)
@@ -265,7 +265,7 @@ ALvoid MixSource(ALactivesource *src, ALCdevice *Device, ALuint SamplesToDo)
DataSize = BufferPrePadding - DataPosInt;
DataSize = minu(SrcBufferSize - SrcDataSize, DataSize);
- SilenceData(&SrcData[SrcDataSize], DataSize);
+ SilenceSamples(&SrcData[SrcDataSize], DataSize);
SrcDataSize += DataSize;
pos = 0;
@@ -275,11 +275,11 @@ ALvoid MixSource(ALactivesource *src, ALCdevice *Device, ALuint SamplesToDo)
* rest of the temp buffer */
DataSize = minu(SrcBufferSize - SrcDataSize, ALBuffer->SampleLen - pos);
- LoadData(&SrcData[SrcDataSize], &Data[(pos*NumChannels + chan)*SampleSize],
- NumChannels, ALBuffer->FmtType, DataSize);
+ LoadSamples(&SrcData[SrcDataSize], &Data[(pos*NumChannels + chan)*SampleSize],
+ NumChannels, ALBuffer->FmtType, DataSize);
SrcDataSize += DataSize;
- SilenceData(&SrcData[SrcDataSize], SrcBufferSize - SrcDataSize);
+ SilenceSamples(&SrcData[SrcDataSize], SrcBufferSize - SrcDataSize);
SrcDataSize += SrcBufferSize - SrcDataSize;
}
else
@@ -302,7 +302,7 @@ ALvoid MixSource(ALactivesource *src, ALCdevice *Device, ALuint SamplesToDo)
DataSize = BufferPrePadding - DataPosInt;
DataSize = minu(SrcBufferSize - SrcDataSize, DataSize);
- SilenceData(&SrcData[SrcDataSize], DataSize);
+ SilenceSamples(&SrcData[SrcDataSize], DataSize);
SrcDataSize += DataSize;
pos = 0;
@@ -313,8 +313,8 @@ ALvoid MixSource(ALactivesource *src, ALCdevice *Device, ALuint SamplesToDo)
DataSize = LoopEnd - pos;
DataSize = minu(SrcBufferSize - SrcDataSize, DataSize);
- LoadData(&SrcData[SrcDataSize], &Data[(pos*NumChannels + chan)*SampleSize],
- NumChannels, ALBuffer->FmtType, DataSize);
+ LoadSamples(&SrcData[SrcDataSize], &Data[(pos*NumChannels + chan)*SampleSize],
+ NumChannels, ALBuffer->FmtType, DataSize);
SrcDataSize += DataSize;
DataSize = LoopEnd-LoopStart;
@@ -322,8 +322,8 @@ ALvoid MixSource(ALactivesource *src, ALCdevice *Device, ALuint SamplesToDo)
{
DataSize = minu(SrcBufferSize - SrcDataSize, DataSize);
- LoadData(&SrcData[SrcDataSize], &Data[(LoopStart*NumChannels + chan)*SampleSize],
- NumChannels, ALBuffer->FmtType, DataSize);
+ LoadSamples(&SrcData[SrcDataSize], &Data[(LoopStart*NumChannels + chan)*SampleSize],
+ NumChannels, ALBuffer->FmtType, DataSize);
SrcDataSize += DataSize;
}
}
@@ -353,7 +353,7 @@ ALvoid MixSource(ALactivesource *src, ALCdevice *Device, ALuint SamplesToDo)
{
ALuint DataSize = minu(SrcBufferSize - SrcDataSize, pos);
- SilenceData(&SrcData[SrcDataSize], DataSize);
+ SilenceSamples(&SrcData[SrcDataSize], DataSize);
SrcDataSize += DataSize;
pos = 0;
@@ -390,8 +390,8 @@ ALvoid MixSource(ALactivesource *src, ALCdevice *Device, ALuint SamplesToDo)
pos -= pos;
DataSize = minu(SrcBufferSize - SrcDataSize, DataSize);
- LoadData(&SrcData[SrcDataSize], Data, NumChannels,
- ALBuffer->FmtType, DataSize);
+ LoadSamples(&SrcData[SrcDataSize], Data, NumChannels,
+ ALBuffer->FmtType, DataSize);
SrcDataSize += DataSize;
}
}
@@ -400,7 +400,7 @@ ALvoid MixSource(ALactivesource *src, ALCdevice *Device, ALuint SamplesToDo)
tmpiter = Source->queue;
else if(!tmpiter)
{
- SilenceData(&SrcData[SrcDataSize], SrcBufferSize - SrcDataSize);
+ SilenceSamples(&SrcData[SrcDataSize], SrcBufferSize - SrcDataSize);
SrcDataSize += SrcBufferSize - SrcDataSize;
}
}