Rename some stuff for consistency

This commit is contained in:
Chris Robinson
2010-11-28 13:08:51 -08:00
parent c41e893361
commit 0e748d98d5
5 changed files with 47 additions and 48 deletions
+2 -2
View File
@@ -120,7 +120,7 @@ ALvoid CalcNonAttnSourceParams(ALsource *ALSource, const ALCcontext *ALContext)
ResamplerPrePadding[ALSource->Resampler] + 1;
maxstep = min(maxstep, INT_MAX>>FRACTIONBITS);
Pitch = Pitch * ALBuffer->frequency / Frequency;
Pitch = Pitch * ALBuffer->Frequency / Frequency;
if(Pitch > (ALfloat)maxstep)
ALSource->Params.Step = maxstep<<FRACTIONBITS;
else
@@ -598,7 +598,7 @@ ALvoid CalcSourceParams(ALsource *ALSource, const ALCcontext *ALContext)
ResamplerPrePadding[ALSource->Resampler] + 1;
maxstep = min(maxstep, INT_MAX>>FRACTIONBITS);
Pitch = Pitch * ALBuffer->frequency / Frequency;
Pitch = Pitch * ALBuffer->Frequency / Frequency;
if(Pitch > (ALfloat)maxstep)
ALSource->Params.Step = maxstep<<FRACTIONBITS;
else
+3 -3
View File
@@ -635,17 +635,17 @@ static void Mix_##T##_##sampler(ALsource *Source, ALCdevice *Device, \
Data, DataPosInt, DataPosFrac, \
OutPos, SamplesToDo, BufferSize); \
break; \
case Fmt51ChanWFX: \
case FmtX51: \
Mix_##T##_X51Chans_##sampler(Source, Device, \
Data, DataPosInt, DataPosFrac, \
OutPos, SamplesToDo, BufferSize); \
break; \
case Fmt61ChanWFX: \
case FmtX61: \
Mix_##T##_X61Chans_##sampler(Source, Device, \
Data, DataPosInt, DataPosFrac, \
OutPos, SamplesToDo, BufferSize); \
break; \
case Fmt71ChanWFX: \
case FmtX71: \
Mix_##T##_X71Chans_##sampler(Source, Device, \
Data, DataPosInt, DataPosFrac, \
OutPos, SamplesToDo, BufferSize); \
+8 -8
View File
@@ -77,9 +77,9 @@ enum FmtChannels {
FmtStereo,
FmtRear,
FmtQuad,
Fmt51ChanWFX,
Fmt61ChanWFX,
Fmt71ChanWFX,
FmtX51,
FmtX61,
FmtX71,
};
void DecomposeFormat(ALenum format, enum FmtType *type, enum FmtChannels *order);
@@ -103,9 +103,9 @@ static __inline ALuint ChannelsFromFmt(enum FmtChannels chans)
case FmtStereo: return 2;
case FmtRear: return 2;
case FmtQuad: return 4;
case Fmt51ChanWFX: return 6;
case Fmt61ChanWFX: return 7;
case Fmt71ChanWFX: return 8;
case FmtX51: return 6;
case FmtX61: return 7;
case FmtX71: return 8;
}
return 0;
}
@@ -120,11 +120,11 @@ typedef struct ALbuffer
ALvoid *data;
ALsizei size;
ALsizei frequency;
ALsizei Frequency;
enum FmtType FmtType;
enum FmtChannels FmtChannels;
ALenum eOriginalFormat;
ALenum OriginalFormat;
ALsizei OriginalSize;
ALsizei OriginalAlign;
+25 -26
View File
@@ -371,19 +371,19 @@ AL_API ALvoid AL_APIENTRY alBufferData(ALuint buffer,ALenum format,const ALvoid
if(temp)
{
ALBuf->data = temp;
ALBuf->size = newsize;
ConvertDataIMA4(ALBuf->data, data, Channels, newsize/(65*Channels*NewBytes));
ALBuf->eOriginalFormat = format;
ALBuf->size = newsize;
ALBuf->frequency = freq;
ALBuf->Frequency = freq;
DecomposeFormat(NewFormat, &ALBuf->FmtType, &ALBuf->FmtChannels);
ALBuf->LoopStart = 0;
ALBuf->LoopEnd = newsize / Channels / NewBytes;
DecomposeFormat(NewFormat, &ALBuf->FmtType, &ALBuf->FmtChannels);
ALBuf->OriginalSize = size;
ALBuf->OriginalAlign = 36 * Channels;
ALBuf->OriginalFormat = format;
ALBuf->OriginalSize = size;
ALBuf->OriginalAlign = 36 * Channels;
}
else
alSetError(Context, AL_OUT_OF_MEMORY);
@@ -431,7 +431,7 @@ AL_API ALvoid AL_APIENTRY alBufferSubDataSOFT(ALuint buffer,ALenum format,const
alSetError(Context, AL_INVALID_NAME);
else if(length < 0 || offset < 0 || (length > 0 && data == NULL))
alSetError(Context, AL_INVALID_VALUE);
else if(ALBuf->eOriginalFormat != format)
else if(ALBuf->OriginalFormat != format)
alSetError(Context, AL_INVALID_ENUM);
else if(offset > ALBuf->OriginalSize ||
length > ALBuf->OriginalSize-offset ||
@@ -801,7 +801,7 @@ AL_API ALvoid AL_APIENTRY alGetBufferi(ALuint buffer, ALenum eParam, ALint *plVa
switch(eParam)
{
case AL_FREQUENCY:
*plValue = pBuffer->frequency;
*plValue = pBuffer->Frequency;
break;
case AL_BITS:
@@ -1212,6 +1212,7 @@ static ALenum LoadData(ALbuffer *ALBuf, const ALvoid *data, ALsizei size, ALuint
temp = realloc(ALBuf->data, newsize);
if(!temp) return AL_OUT_OF_MEMORY;
ALBuf->data = temp;
ALBuf->size = newsize;
if(data != NULL)
{
@@ -1219,18 +1220,16 @@ static ALenum LoadData(ALbuffer *ALBuf, const ALvoid *data, ALsizei size, ALuint
ConvertData(ALBuf->data, DstType, data, SrcType, newsize/NewBytes);
}
ALBuf->eOriginalFormat = OrigFormat;
ALBuf->size = newsize;
ALBuf->frequency = freq;
ALBuf->Frequency = freq;
ALBuf->FmtType = DstType;
ALBuf->FmtChannels = DstChannels;
ALBuf->LoopStart = 0;
ALBuf->LoopEnd = newsize / NewChannels / NewBytes;
ALBuf->FmtType = DstType;
ALBuf->FmtChannels = DstChannels;
ALBuf->OriginalSize = size;
ALBuf->OriginalAlign = OrigBytes * OrigChannels;
ALBuf->OriginalFormat = OrigFormat;
ALBuf->OriginalSize = size;
ALBuf->OriginalAlign = OrigBytes * OrigChannels;
return AL_NO_ERROR;
}
@@ -1455,39 +1454,39 @@ void DecomposeFormat(ALenum format, enum FmtType *type, enum FmtChannels *order)
break;
case AL_FORMAT_51CHN8:
*type = FmtUByte;
*order = Fmt51ChanWFX;
*order = FmtX51;
break;
case AL_FORMAT_51CHN16:
*type = FmtShort;
*order = Fmt51ChanWFX;
*order = FmtX51;
break;
case AL_FORMAT_51CHN32:
*type = FmtFloat;
*order = Fmt51ChanWFX;
*order = FmtX51;
break;
case AL_FORMAT_61CHN8:
*type = FmtUByte;
*order = Fmt61ChanWFX;
*order = FmtX61;
break;
case AL_FORMAT_61CHN16:
*type = FmtShort;
*order = Fmt61ChanWFX;
*order = FmtX61;
break;
case AL_FORMAT_61CHN32:
*type = FmtFloat;
*order = Fmt61ChanWFX;
*order = FmtX61;
break;
case AL_FORMAT_71CHN8:
*type = FmtUByte;
*order = Fmt71ChanWFX;
*order = FmtX71;
break;
case AL_FORMAT_71CHN16:
*type = FmtShort;
*order = Fmt71ChanWFX;
*order = FmtX71;
break;
case AL_FORMAT_71CHN32:
*type = FmtFloat;
*order = Fmt71ChanWFX;
*order = FmtX71;
break;
default:
+9 -9
View File
@@ -1572,8 +1572,8 @@ AL_API ALvoid AL_APIENTRY alSourceQueueBuffers(ALuint source, ALsizei n, const A
{
if(BufferList->buffer)
{
Frequency = BufferList->buffer->frequency;
Format = BufferList->buffer->eOriginalFormat;
Frequency = BufferList->buffer->Frequency;
Format = BufferList->buffer->OriginalFormat;
break;
}
BufferList = BufferList->next;
@@ -1592,8 +1592,8 @@ AL_API ALvoid AL_APIENTRY alSourceQueueBuffers(ALuint source, ALsizei n, const A
if(Frequency == -1 && Format == -1)
{
Frequency = buffer->frequency;
Format = buffer->eOriginalFormat;
Frequency = buffer->Frequency;
Format = buffer->OriginalFormat;
if(buffer->FmtChannels == FmtMono)
Source->Update = CalcSourceParams;
@@ -1602,7 +1602,7 @@ AL_API ALvoid AL_APIENTRY alSourceQueueBuffers(ALuint source, ALsizei n, const A
Source->NeedsUpdate = AL_TRUE;
}
else if(Frequency != buffer->frequency || Format != buffer->eOriginalFormat)
else if(Frequency != buffer->Frequency || Format != buffer->OriginalFormat)
{
alSetError(Context, AL_INVALID_OPERATION);
goto done;
@@ -1817,8 +1817,8 @@ static ALvoid GetSourceOffset(ALsource *Source, ALenum name, ALdouble *offset, A
}
// Get Current Buffer Size and frequency (in milliseconds)
BufferFreq = (ALfloat)Buffer->frequency;
OriginalFormat = Buffer->eOriginalFormat;
BufferFreq = (ALfloat)Buffer->Frequency;
OriginalFormat = Buffer->OriginalFormat;
Channels = ChannelsFromFmt(Buffer->FmtChannels);
Bytes = BytesFromFmt(Buffer->FmtType);
@@ -1994,7 +1994,7 @@ static ALint GetByteOffset(ALsource *Source)
{
case AL_BYTE_OFFSET:
// Take into consideration the original format
ByteOffset = FramesFromBytes(Source->lOffset, Buffer->eOriginalFormat);
ByteOffset = FramesFromBytes(Source->lOffset, Buffer->OriginalFormat);
ByteOffset *= FrameSizeFromFmt(Buffer->FmtType, Buffer->FmtChannels);
break;
@@ -2004,7 +2004,7 @@ static ALint GetByteOffset(ALsource *Source)
case AL_SEC_OFFSET:
// Note - lOffset is internally stored as Milliseconds
ByteOffset = (ALint)(Source->lOffset / 1000.0 * Buffer->frequency);
ByteOffset = (ALint)(Source->lOffset / 1000.0 * Buffer->Frequency);
ByteOffset *= BytesFromFmt(Buffer->FmtType);
break;
}