Use ALsizei in more places
This commit is contained in:
parent
ba0944af9b
commit
d2e5aa79dd
@ -1310,8 +1310,8 @@ const ALCchar *DevFmtChannelsString(enum DevFmtChannels chans)
|
||||
return "(unknown channels)";
|
||||
}
|
||||
|
||||
extern inline ALuint FrameSizeFromDevFmt(enum DevFmtChannels chans, enum DevFmtType type);
|
||||
ALuint BytesFromDevFmt(enum DevFmtType type)
|
||||
extern inline ALsizei FrameSizeFromDevFmt(enum DevFmtChannels chans, enum DevFmtType type);
|
||||
ALsizei BytesFromDevFmt(enum DevFmtType type)
|
||||
{
|
||||
switch(type)
|
||||
{
|
||||
@ -1325,7 +1325,7 @@ ALuint BytesFromDevFmt(enum DevFmtType type)
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
ALuint ChannelsFromDevFmt(enum DevFmtChannels chans)
|
||||
ALsizei ChannelsFromDevFmt(enum DevFmtChannels chans)
|
||||
{
|
||||
switch(chans)
|
||||
{
|
||||
@ -2093,7 +2093,7 @@ static ALCenum UpdateDeviceParams(ALCdevice *device, const ALCint *attrList)
|
||||
device->FOAOut.Buffer = device->Dry.Buffer;
|
||||
device->FOAOut.NumChannels = device->Dry.NumChannels;
|
||||
}
|
||||
TRACE("Channel config, Dry: %u, FOA: %u, Real: %u\n", device->Dry.NumChannels,
|
||||
TRACE("Channel config, Dry: %d, FOA: %d, Real: %d\n", device->Dry.NumChannels,
|
||||
device->FOAOut.NumChannels, device->RealOut.NumChannels);
|
||||
|
||||
SetMixerFPUMode(&oldMode);
|
||||
|
@ -1400,7 +1400,7 @@ ALvoid aluMixData(ALCdevice *device, ALvoid *buffer, ALsizei size)
|
||||
ALsource *source;
|
||||
ALCcontext *ctx;
|
||||
FPUCtl oldMode;
|
||||
ALuint i, c;
|
||||
ALsizei i, c;
|
||||
|
||||
SetMixerFPUMode(&oldMode);
|
||||
|
||||
|
@ -177,8 +177,8 @@ static ALCboolean ALCsolarisBackend_reset(ALCsolarisBackend *self)
|
||||
{
|
||||
ALCdevice *device = STATIC_CAST(ALCbackend,self)->mDevice;
|
||||
audio_info_t info;
|
||||
ALuint frameSize;
|
||||
int numChannels;
|
||||
ALsizei frameSize;
|
||||
ALsizei numChannels;
|
||||
|
||||
AUDIO_INITINFO(&info);
|
||||
|
||||
@ -220,7 +220,7 @@ static ALCboolean ALCsolarisBackend_reset(ALCsolarisBackend *self)
|
||||
return ALC_FALSE;
|
||||
}
|
||||
|
||||
if(ChannelsFromDevFmt(device->FmtChans) != info.play.channels)
|
||||
if(ChannelsFromDevFmt(device->FmtChans) != (ALsizei)info.play.channels)
|
||||
{
|
||||
ERR("Could not set %d channels, got %d instead\n", ChannelsFromDevFmt(device->FmtChans), info.play.channels);
|
||||
return ALC_FALSE;
|
||||
|
66
Alc/mixer.c
66
Alc/mixer.c
@ -307,9 +307,9 @@ static inline ALfloat Sample_ALfloat(ALfloat val)
|
||||
{ return val; }
|
||||
|
||||
#define DECL_TEMPLATE(T) \
|
||||
static inline void Load_##T(ALfloat *dst, const T *src, ALuint srcstep, ALuint samples)\
|
||||
static inline void Load_##T(ALfloat *dst, const T *src, ALint srcstep, ALsizei samples)\
|
||||
{ \
|
||||
ALuint i; \
|
||||
ALsizei i; \
|
||||
for(i = 0;i < samples;i++) \
|
||||
dst[i] = Sample_##T(src[i*srcstep]); \
|
||||
}
|
||||
@ -320,7 +320,7 @@ DECL_TEMPLATE(ALfloat)
|
||||
|
||||
#undef DECL_TEMPLATE
|
||||
|
||||
static void LoadSamples(ALfloat *dst, const ALvoid *src, ALuint srcstep, enum FmtType srctype, ALuint samples)
|
||||
static void LoadSamples(ALfloat *dst, const ALvoid *src, ALint srcstep, enum FmtType srctype, ALsizei samples)
|
||||
{
|
||||
switch(srctype)
|
||||
{
|
||||
@ -336,9 +336,9 @@ static void LoadSamples(ALfloat *dst, const ALvoid *src, ALuint srcstep, enum Fm
|
||||
}
|
||||
}
|
||||
|
||||
static inline void SilenceSamples(ALfloat *dst, ALuint samples)
|
||||
static inline void SilenceSamples(ALfloat *dst, ALsizei samples)
|
||||
{
|
||||
ALuint i;
|
||||
ALsizei i;
|
||||
for(i = 0;i < samples;i++)
|
||||
dst[i] = 0.0f;
|
||||
}
|
||||
@ -346,9 +346,9 @@ static inline void SilenceSamples(ALfloat *dst, ALuint samples)
|
||||
|
||||
static const ALfloat *DoFilters(ALfilterState *lpfilter, ALfilterState *hpfilter,
|
||||
ALfloat *restrict dst, const ALfloat *restrict src,
|
||||
ALuint numsamples, enum ActiveFilters type)
|
||||
ALsizei numsamples, enum ActiveFilters type)
|
||||
{
|
||||
ALuint i;
|
||||
ALsizei i;
|
||||
switch(type)
|
||||
{
|
||||
case AF_None:
|
||||
@ -369,7 +369,7 @@ static const ALfloat *DoFilters(ALfilterState *lpfilter, ALfilterState *hpfilter
|
||||
for(i = 0;i < numsamples;)
|
||||
{
|
||||
ALfloat temp[256];
|
||||
ALuint todo = minu(256, numsamples-i);
|
||||
ALsizei todo = mini(256, numsamples-i);
|
||||
|
||||
ALfilterState_process(lpfilter, temp, src+i, todo);
|
||||
ALfilterState_process(hpfilter, dst+i, temp, todo);
|
||||
@ -381,21 +381,22 @@ static const ALfloat *DoFilters(ALfilterState *lpfilter, ALfilterState *hpfilter
|
||||
}
|
||||
|
||||
|
||||
ALvoid MixSource(ALvoice *voice, ALsource *Source, ALCdevice *Device, ALuint SamplesToDo)
|
||||
ALvoid MixSource(ALvoice *voice, ALsource *Source, ALCdevice *Device, ALsizei SamplesToDo)
|
||||
{
|
||||
ResamplerFunc Resample;
|
||||
ALbufferlistitem *BufferListItem;
|
||||
ALuint DataPosInt, DataPosFrac;
|
||||
ALboolean Looping;
|
||||
ALuint increment;
|
||||
ALint increment;
|
||||
ALenum State;
|
||||
ALuint OutPos;
|
||||
ALuint NumChannels;
|
||||
ALuint SampleSize;
|
||||
ALsizei OutPos;
|
||||
ALsizei NumChannels;
|
||||
ALsizei SampleSize;
|
||||
ALint64 DataSize64;
|
||||
ALuint Counter;
|
||||
ALuint IrSize;
|
||||
ALuint chan, send, j;
|
||||
ALsizei Counter;
|
||||
ALsizei IrSize;
|
||||
ALsizei chan, j;
|
||||
ALuint send;
|
||||
|
||||
/* Get source info */
|
||||
State = AL_PLAYING; /* Only called while playing. */
|
||||
@ -415,7 +416,7 @@ ALvoid MixSource(ALvoice *voice, ALsource *Source, ALCdevice *Device, ALuint Sam
|
||||
Counter = voice->Moving ? SamplesToDo : 0;
|
||||
OutPos = 0;
|
||||
do {
|
||||
ALuint SrcBufferSize, DstBufferSize;
|
||||
ALsizei SrcBufferSize, DstBufferSize;
|
||||
|
||||
/* Figure out how many buffer samples will be needed */
|
||||
DataSize64 = SamplesToDo-OutPos;
|
||||
@ -424,7 +425,7 @@ ALvoid MixSource(ALvoice *voice, ALsource *Source, ALCdevice *Device, ALuint Sam
|
||||
DataSize64 >>= FRACTIONBITS;
|
||||
DataSize64 += MAX_POST_SAMPLES+MAX_PRE_SAMPLES;
|
||||
|
||||
SrcBufferSize = (ALuint)mini64(DataSize64, BUFFERSIZE);
|
||||
SrcBufferSize = (ALsizei)mini64(DataSize64, BUFFERSIZE);
|
||||
|
||||
/* Figure out how many samples we can actually mix from this. */
|
||||
DataSize64 = SrcBufferSize;
|
||||
@ -432,8 +433,8 @@ ALvoid MixSource(ALvoice *voice, ALsource *Source, ALCdevice *Device, ALuint Sam
|
||||
DataSize64 <<= FRACTIONBITS;
|
||||
DataSize64 -= DataPosFrac;
|
||||
|
||||
DstBufferSize = (ALuint)((DataSize64+(increment-1)) / increment);
|
||||
DstBufferSize = minu(DstBufferSize, (SamplesToDo-OutPos));
|
||||
DstBufferSize = (ALsizei)((DataSize64+(increment-1)) / increment);
|
||||
DstBufferSize = mini(DstBufferSize, (SamplesToDo-OutPos));
|
||||
|
||||
/* Some mixers like having a multiple of 4, so try to give that unless
|
||||
* this is the last update. */
|
||||
@ -444,7 +445,7 @@ ALvoid MixSource(ALvoice *voice, ALsource *Source, ALCdevice *Device, ALuint Sam
|
||||
{
|
||||
const ALfloat *ResampledData;
|
||||
ALfloat *SrcData = Device->SourceData;
|
||||
ALuint SrcDataSize;
|
||||
ALsizei SrcDataSize;
|
||||
|
||||
/* Load the previous samples into the source data first. */
|
||||
memcpy(SrcData, voice->PrevSamples[chan], MAX_PRE_SAMPLES*sizeof(ALfloat));
|
||||
@ -454,7 +455,7 @@ ALvoid MixSource(ALvoice *voice, ALsource *Source, ALCdevice *Device, ALuint Sam
|
||||
{
|
||||
const ALbuffer *ALBuffer = BufferListItem->buffer;
|
||||
const ALubyte *Data = ALBuffer->data;
|
||||
ALuint DataSize;
|
||||
ALsizei DataSize;
|
||||
|
||||
/* Offset buffer data to current channel */
|
||||
Data += chan*SampleSize;
|
||||
@ -478,13 +479,12 @@ ALvoid MixSource(ALvoice *voice, ALsource *Source, ALCdevice *Device, ALuint Sam
|
||||
}
|
||||
else
|
||||
{
|
||||
ALuint LoopStart = ALBuffer->LoopStart;
|
||||
ALuint LoopEnd = ALBuffer->LoopEnd;
|
||||
ALsizei LoopStart = ALBuffer->LoopStart;
|
||||
ALsizei LoopEnd = ALBuffer->LoopEnd;
|
||||
|
||||
/* Load what's left of this loop iteration, then load
|
||||
* repeats of the loop section */
|
||||
DataSize = LoopEnd - DataPosInt;
|
||||
DataSize = minu(SrcBufferSize - SrcDataSize, DataSize);
|
||||
DataSize = minu(SrcBufferSize - SrcDataSize, LoopEnd - DataPosInt);
|
||||
|
||||
LoadSamples(&SrcData[SrcDataSize], &Data[DataPosInt * NumChannels*SampleSize],
|
||||
NumChannels, ALBuffer->FmtType, DataSize);
|
||||
@ -493,7 +493,7 @@ ALvoid MixSource(ALvoice *voice, ALsource *Source, ALCdevice *Device, ALuint Sam
|
||||
DataSize = LoopEnd-LoopStart;
|
||||
while(SrcBufferSize > SrcDataSize)
|
||||
{
|
||||
DataSize = minu(SrcBufferSize - SrcDataSize, DataSize);
|
||||
DataSize = mini(SrcBufferSize - SrcDataSize, DataSize);
|
||||
|
||||
LoadSamples(&SrcData[SrcDataSize], &Data[LoopStart * NumChannels*SampleSize],
|
||||
NumChannels, ALBuffer->FmtType, DataSize);
|
||||
@ -645,22 +645,22 @@ ALvoid MixSource(ALvoice *voice, ALsource *Source, ALCdevice *Device, ALuint Sam
|
||||
|
||||
OutPos += DstBufferSize;
|
||||
voice->Offset += DstBufferSize;
|
||||
Counter = maxu(DstBufferSize, Counter) - DstBufferSize;
|
||||
Counter = maxi(DstBufferSize, Counter) - DstBufferSize;
|
||||
|
||||
/* Handle looping sources */
|
||||
while(1)
|
||||
{
|
||||
const ALbuffer *ALBuffer;
|
||||
ALuint DataSize = 0;
|
||||
ALuint LoopStart = 0;
|
||||
ALuint LoopEnd = 0;
|
||||
ALsizei DataSize = 0;
|
||||
ALsizei LoopStart = 0;
|
||||
ALsizei LoopEnd = 0;
|
||||
|
||||
if((ALBuffer=BufferListItem->buffer) != NULL)
|
||||
{
|
||||
DataSize = ALBuffer->SampleLen;
|
||||
LoopStart = ALBuffer->LoopStart;
|
||||
LoopEnd = ALBuffer->LoopEnd;
|
||||
if(LoopEnd > DataPosInt)
|
||||
if((ALuint)LoopEnd > DataPosInt)
|
||||
break;
|
||||
}
|
||||
|
||||
@ -671,7 +671,7 @@ ALvoid MixSource(ALvoice *voice, ALsource *Source, ALCdevice *Device, ALuint Sam
|
||||
break;
|
||||
}
|
||||
|
||||
if(DataSize > DataPosInt)
|
||||
if((ALuint)DataSize > DataPosInt)
|
||||
break;
|
||||
|
||||
if(!(BufferListItem=BufferListItem->next))
|
||||
|
@ -209,9 +209,9 @@ void CalcAngleCoeffs(ALfloat azimuth, ALfloat elevation, ALfloat spread, ALfloat
|
||||
}
|
||||
|
||||
|
||||
void ComputeAmbientGainsMC(const ChannelConfig *chancoeffs, ALuint numchans, ALfloat ingain, ALfloat gains[MAX_OUTPUT_CHANNELS])
|
||||
void ComputeAmbientGainsMC(const ChannelConfig *chancoeffs, ALsizei numchans, ALfloat ingain, ALfloat gains[MAX_OUTPUT_CHANNELS])
|
||||
{
|
||||
ALuint i;
|
||||
ALsizei i;
|
||||
|
||||
for(i = 0;i < numchans;i++)
|
||||
{
|
||||
@ -224,10 +224,10 @@ void ComputeAmbientGainsMC(const ChannelConfig *chancoeffs, ALuint numchans, ALf
|
||||
gains[i] = 0.0f;
|
||||
}
|
||||
|
||||
void ComputeAmbientGainsBF(const BFChannelConfig *chanmap, ALuint numchans, ALfloat ingain, ALfloat gains[MAX_OUTPUT_CHANNELS])
|
||||
void ComputeAmbientGainsBF(const BFChannelConfig *chanmap, ALsizei numchans, ALfloat ingain, ALfloat gains[MAX_OUTPUT_CHANNELS])
|
||||
{
|
||||
ALfloat gain = 0.0f;
|
||||
ALuint i;
|
||||
ALsizei i;
|
||||
|
||||
for(i = 0;i < numchans;i++)
|
||||
{
|
||||
@ -239,9 +239,9 @@ void ComputeAmbientGainsBF(const BFChannelConfig *chanmap, ALuint numchans, ALfl
|
||||
gains[i] = 0.0f;
|
||||
}
|
||||
|
||||
void ComputePanningGainsMC(const ChannelConfig *chancoeffs, ALuint numchans, ALuint numcoeffs, const ALfloat coeffs[MAX_AMBI_COEFFS], ALfloat ingain, ALfloat gains[MAX_OUTPUT_CHANNELS])
|
||||
void ComputePanningGainsMC(const ChannelConfig *chancoeffs, ALsizei numchans, ALsizei numcoeffs, const ALfloat coeffs[MAX_AMBI_COEFFS], ALfloat ingain, ALfloat gains[MAX_OUTPUT_CHANNELS])
|
||||
{
|
||||
ALuint i, j;
|
||||
ALsizei i, j;
|
||||
|
||||
for(i = 0;i < numchans;i++)
|
||||
{
|
||||
@ -254,9 +254,9 @@ void ComputePanningGainsMC(const ChannelConfig *chancoeffs, ALuint numchans, ALu
|
||||
gains[i] = 0.0f;
|
||||
}
|
||||
|
||||
void ComputePanningGainsBF(const BFChannelConfig *chanmap, ALuint numchans, const ALfloat coeffs[MAX_AMBI_COEFFS], ALfloat ingain, ALfloat gains[MAX_OUTPUT_CHANNELS])
|
||||
void ComputePanningGainsBF(const BFChannelConfig *chanmap, ALsizei numchans, const ALfloat coeffs[MAX_AMBI_COEFFS], ALfloat ingain, ALfloat gains[MAX_OUTPUT_CHANNELS])
|
||||
{
|
||||
ALuint i;
|
||||
ALsizei i;
|
||||
|
||||
for(i = 0;i < numchans;i++)
|
||||
gains[i] = chanmap[i].Scale * coeffs[chanmap[i].Index] * ingain;
|
||||
@ -264,9 +264,9 @@ void ComputePanningGainsBF(const BFChannelConfig *chanmap, ALuint numchans, cons
|
||||
gains[i] = 0.0f;
|
||||
}
|
||||
|
||||
void ComputeFirstOrderGainsMC(const ChannelConfig *chancoeffs, ALuint numchans, const ALfloat mtx[4], ALfloat ingain, ALfloat gains[MAX_OUTPUT_CHANNELS])
|
||||
void ComputeFirstOrderGainsMC(const ChannelConfig *chancoeffs, ALsizei numchans, const ALfloat mtx[4], ALfloat ingain, ALfloat gains[MAX_OUTPUT_CHANNELS])
|
||||
{
|
||||
ALuint i, j;
|
||||
ALsizei i, j;
|
||||
|
||||
for(i = 0;i < numchans;i++)
|
||||
{
|
||||
@ -279,9 +279,9 @@ void ComputeFirstOrderGainsMC(const ChannelConfig *chancoeffs, ALuint numchans,
|
||||
gains[i] = 0.0f;
|
||||
}
|
||||
|
||||
void ComputeFirstOrderGainsBF(const BFChannelConfig *chanmap, ALuint numchans, const ALfloat mtx[4], ALfloat ingain, ALfloat gains[MAX_OUTPUT_CHANNELS])
|
||||
void ComputeFirstOrderGainsBF(const BFChannelConfig *chanmap, ALsizei numchans, const ALfloat mtx[4], ALfloat ingain, ALfloat gains[MAX_OUTPUT_CHANNELS])
|
||||
{
|
||||
ALuint i;
|
||||
ALsizei i;
|
||||
|
||||
for(i = 0;i < numchans;i++)
|
||||
gains[i] = chanmap[i].Scale * mtx[chanmap[i].Index] * ingain;
|
||||
@ -342,13 +342,13 @@ typedef struct ChannelMap {
|
||||
} ChannelMap;
|
||||
|
||||
static void SetChannelMap(const enum Channel *devchans, ChannelConfig *ambicoeffs,
|
||||
const ChannelMap *chanmap, size_t count, ALuint *outcount,
|
||||
const ChannelMap *chanmap, size_t count, ALsizei *outcount,
|
||||
ALboolean isfuma)
|
||||
{
|
||||
const ALsizei *acnmap = isfuma ? FuMa2ACN : ACN2ACN;
|
||||
const ALfloat *n3dscale = isfuma ? FuMa2N3DScale : UnitScale;
|
||||
size_t j, k;
|
||||
ALuint i;
|
||||
ALsizei i;
|
||||
|
||||
for(i = 0;i < MAX_OUTPUT_CHANNELS && devchans[i] != InvalidChannel;i++)
|
||||
{
|
||||
|
@ -18,7 +18,7 @@ typedef struct ALeffectState {
|
||||
const struct ALeffectStateVtable *vtbl;
|
||||
|
||||
ALfloat (*OutBuffer)[BUFFERSIZE];
|
||||
ALuint OutChannels;
|
||||
ALsizei OutChannels;
|
||||
} ALeffectState;
|
||||
|
||||
void ALeffectState_Construct(ALeffectState *state);
|
||||
@ -120,7 +120,7 @@ typedef struct ALeffectslot {
|
||||
/* Self ID */
|
||||
ALuint id;
|
||||
|
||||
ALuint NumChannels;
|
||||
ALsizei NumChannels;
|
||||
BFChannelConfig ChanMap[MAX_EFFECT_CHANNELS];
|
||||
/* Wet buffer configuration is ACN channel order with N3D scaling:
|
||||
* * Channel 0 is the unattenuated mono signal.
|
||||
|
@ -36,9 +36,9 @@ enum UserFmtChannels {
|
||||
UserFmtBFormat3D = AL_BFORMAT3D_SOFT, /* WXYZ */
|
||||
};
|
||||
|
||||
ALuint BytesFromUserFmt(enum UserFmtType type);
|
||||
ALuint ChannelsFromUserFmt(enum UserFmtChannels chans);
|
||||
inline ALuint FrameSizeFromUserFmt(enum UserFmtChannels chans, enum UserFmtType type)
|
||||
ALsizei BytesFromUserFmt(enum UserFmtType type);
|
||||
ALsizei ChannelsFromUserFmt(enum UserFmtChannels chans);
|
||||
inline ALsizei FrameSizeFromUserFmt(enum UserFmtChannels chans, enum UserFmtType type)
|
||||
{
|
||||
return ChannelsFromUserFmt(chans) * BytesFromUserFmt(type);
|
||||
}
|
||||
@ -63,9 +63,9 @@ enum FmtChannels {
|
||||
};
|
||||
#define MAX_INPUT_CHANNELS (8)
|
||||
|
||||
ALuint BytesFromFmt(enum FmtType type);
|
||||
ALuint ChannelsFromFmt(enum FmtChannels chans);
|
||||
inline ALuint FrameSizeFromFmt(enum FmtChannels chans, enum FmtType type)
|
||||
ALsizei BytesFromFmt(enum FmtType type);
|
||||
ALsizei ChannelsFromFmt(enum FmtChannels chans);
|
||||
inline ALsizei FrameSizeFromFmt(enum FmtChannels chans, enum FmtType type)
|
||||
{
|
||||
return ChannelsFromFmt(chans) * BytesFromFmt(type);
|
||||
}
|
||||
@ -87,8 +87,8 @@ typedef struct ALbuffer {
|
||||
ALsizei OriginalSize;
|
||||
ALsizei OriginalAlign;
|
||||
|
||||
ALsizei LoopStart;
|
||||
ALsizei LoopEnd;
|
||||
ALsizei LoopStart;
|
||||
ALsizei LoopEnd;
|
||||
|
||||
ATOMIC(ALsizei) UnpackAlign;
|
||||
ATOMIC(ALsizei) PackAlign;
|
||||
|
@ -499,9 +499,9 @@ enum DevFmtChannels {
|
||||
};
|
||||
#define MAX_OUTPUT_CHANNELS (16)
|
||||
|
||||
ALuint BytesFromDevFmt(enum DevFmtType type);
|
||||
ALuint ChannelsFromDevFmt(enum DevFmtChannels chans);
|
||||
inline ALuint FrameSizeFromDevFmt(enum DevFmtChannels chans, enum DevFmtType type)
|
||||
ALsizei BytesFromDevFmt(enum DevFmtType type);
|
||||
ALsizei ChannelsFromDevFmt(enum DevFmtChannels chans);
|
||||
inline ALsizei FrameSizeFromDevFmt(enum DevFmtChannels chans, enum DevFmtType type)
|
||||
{
|
||||
return ChannelsFromDevFmt(chans) * BytesFromDevFmt(type);
|
||||
}
|
||||
@ -682,20 +682,20 @@ struct ALCdevice_struct
|
||||
* first-order, 9 for second-order, etc). If the count is 0, Ambi.Map
|
||||
* is used instead to map each output to a coefficient index.
|
||||
*/
|
||||
ALuint CoeffCount;
|
||||
ALsizei CoeffCount;
|
||||
|
||||
ALfloat (*Buffer)[BUFFERSIZE];
|
||||
ALuint NumChannels;
|
||||
ALsizei NumChannels;
|
||||
} Dry;
|
||||
|
||||
/* First-order ambisonics output, to be upsampled to the dry buffer if different. */
|
||||
struct {
|
||||
AmbiConfig Ambi;
|
||||
/* Will only be 4 or 0. */
|
||||
ALuint CoeffCount;
|
||||
ALsizei CoeffCount;
|
||||
|
||||
ALfloat (*Buffer)[BUFFERSIZE];
|
||||
ALuint NumChannels;
|
||||
ALsizei NumChannels;
|
||||
} FOAOut;
|
||||
|
||||
/* "Real" output, which will be written to the device buffer. May alias the
|
||||
@ -705,7 +705,7 @@ struct ALCdevice_struct
|
||||
enum Channel ChannelName[MAX_OUTPUT_CHANNELS];
|
||||
|
||||
ALfloat (*Buffer)[BUFFERSIZE];
|
||||
ALuint NumChannels;
|
||||
ALsizei NumChannels;
|
||||
} RealOut;
|
||||
|
||||
/* Running count of the mixer invocations, in 31.1 fixed point. This
|
||||
|
@ -96,12 +96,12 @@ typedef struct ALvoice {
|
||||
|
||||
struct {
|
||||
ALfloat (*Buffer)[BUFFERSIZE];
|
||||
ALuint Channels;
|
||||
ALsizei Channels;
|
||||
} DirectOut;
|
||||
|
||||
struct {
|
||||
ALfloat (*Buffer)[BUFFERSIZE];
|
||||
ALuint Channels;
|
||||
ALsizei Channels;
|
||||
} SendOut[MAX_SENDS];
|
||||
|
||||
struct {
|
||||
@ -194,8 +194,8 @@ typedef struct ALsource {
|
||||
ATOMIC(ALboolean) looping;
|
||||
|
||||
/** Current buffer sample info. */
|
||||
ALuint NumChannels;
|
||||
ALuint SampleSize;
|
||||
ALsizei NumChannels;
|
||||
ALsizei SampleSize;
|
||||
|
||||
ALenum NeedsUpdate;
|
||||
|
||||
|
@ -313,8 +313,8 @@ void CalcAngleCoeffs(ALfloat azimuth, ALfloat elevation, ALfloat spread, ALfloat
|
||||
else \
|
||||
ComputeAmbientGainsBF((b).Ambi.Map, (b).NumChannels, g, o); \
|
||||
} while (0)
|
||||
void ComputeAmbientGainsMC(const ChannelConfig *chancoeffs, ALuint numchans, ALfloat ingain, ALfloat gains[MAX_OUTPUT_CHANNELS]);
|
||||
void ComputeAmbientGainsBF(const BFChannelConfig *chanmap, ALuint numchans, ALfloat ingain, ALfloat gains[MAX_OUTPUT_CHANNELS]);
|
||||
void ComputeAmbientGainsMC(const ChannelConfig *chancoeffs, ALsizei numchans, ALfloat ingain, ALfloat gains[MAX_OUTPUT_CHANNELS]);
|
||||
void ComputeAmbientGainsBF(const BFChannelConfig *chanmap, ALsizei numchans, ALfloat ingain, ALfloat gains[MAX_OUTPUT_CHANNELS]);
|
||||
|
||||
/**
|
||||
* ComputePanningGains
|
||||
@ -328,8 +328,8 @@ void ComputeAmbientGainsBF(const BFChannelConfig *chanmap, ALuint numchans, ALfl
|
||||
else \
|
||||
ComputePanningGainsBF((b).Ambi.Map, (b).NumChannels, c, g, o); \
|
||||
} while (0)
|
||||
void ComputePanningGainsMC(const ChannelConfig *chancoeffs, ALuint numchans, ALuint numcoeffs, const ALfloat coeffs[MAX_AMBI_COEFFS], ALfloat ingain, ALfloat gains[MAX_OUTPUT_CHANNELS]);
|
||||
void ComputePanningGainsBF(const BFChannelConfig *chanmap, ALuint numchans, const ALfloat coeffs[MAX_AMBI_COEFFS], ALfloat ingain, ALfloat gains[MAX_OUTPUT_CHANNELS]);
|
||||
void ComputePanningGainsMC(const ChannelConfig *chancoeffs, ALsizei numchans, ALsizei numcoeffs, const ALfloat coeffs[MAX_AMBI_COEFFS], ALfloat ingain, ALfloat gains[MAX_OUTPUT_CHANNELS]);
|
||||
void ComputePanningGainsBF(const BFChannelConfig *chanmap, ALsizei numchans, const ALfloat coeffs[MAX_AMBI_COEFFS], ALfloat ingain, ALfloat gains[MAX_OUTPUT_CHANNELS]);
|
||||
|
||||
/**
|
||||
* ComputeFirstOrderGains
|
||||
@ -344,11 +344,11 @@ void ComputePanningGainsBF(const BFChannelConfig *chanmap, ALuint numchans, cons
|
||||
else \
|
||||
ComputeFirstOrderGainsBF((b).Ambi.Map, (b).NumChannels, m, g, o); \
|
||||
} while (0)
|
||||
void ComputeFirstOrderGainsMC(const ChannelConfig *chancoeffs, ALuint numchans, const ALfloat mtx[4], ALfloat ingain, ALfloat gains[MAX_OUTPUT_CHANNELS]);
|
||||
void ComputeFirstOrderGainsBF(const BFChannelConfig *chanmap, ALuint numchans, const ALfloat mtx[4], ALfloat ingain, ALfloat gains[MAX_OUTPUT_CHANNELS]);
|
||||
void ComputeFirstOrderGainsMC(const ChannelConfig *chancoeffs, ALsizei numchans, const ALfloat mtx[4], ALfloat ingain, ALfloat gains[MAX_OUTPUT_CHANNELS]);
|
||||
void ComputeFirstOrderGainsBF(const BFChannelConfig *chanmap, ALsizei numchans, const ALfloat mtx[4], ALfloat ingain, ALfloat gains[MAX_OUTPUT_CHANNELS]);
|
||||
|
||||
|
||||
ALvoid MixSource(struct ALvoice *voice, struct ALsource *source, ALCdevice *Device, ALuint SamplesToDo);
|
||||
ALvoid MixSource(struct ALvoice *voice, struct ALsource *source, ALCdevice *Device, ALsizei SamplesToDo);
|
||||
|
||||
ALvoid aluMixData(ALCdevice *device, ALvoid *buffer, ALsizei size);
|
||||
/* Caller must lock the device. */
|
||||
|
@ -42,8 +42,8 @@ extern inline void LockBuffersWrite(ALCdevice *device);
|
||||
extern inline void UnlockBuffersWrite(ALCdevice *device);
|
||||
extern inline struct ALbuffer *LookupBuffer(ALCdevice *device, ALuint id);
|
||||
extern inline struct ALbuffer *RemoveBuffer(ALCdevice *device, ALuint id);
|
||||
extern inline ALuint FrameSizeFromUserFmt(enum UserFmtChannels chans, enum UserFmtType type);
|
||||
extern inline ALuint FrameSizeFromFmt(enum FmtChannels chans, enum FmtType type);
|
||||
extern inline ALsizei FrameSizeFromUserFmt(enum UserFmtChannels chans, enum UserFmtType type);
|
||||
extern inline ALsizei FrameSizeFromFmt(enum FmtChannels chans, enum FmtType type);
|
||||
|
||||
static ALboolean IsValidType(ALenum type);
|
||||
static ALboolean IsValidChannels(ALenum channels);
|
||||
@ -145,7 +145,7 @@ AL_API ALvoid AL_APIENTRY alBufferData(ALuint buffer, ALenum format, const ALvoi
|
||||
ALCcontext *context;
|
||||
ALbuffer *albuf;
|
||||
ALenum newformat = AL_NONE;
|
||||
ALuint framesize;
|
||||
ALsizei framesize;
|
||||
ALsizei align;
|
||||
ALenum err;
|
||||
|
||||
@ -293,9 +293,9 @@ AL_API ALvoid AL_APIENTRY alBufferSubDataSOFT(ALuint buffer, ALenum format, cons
|
||||
ALCdevice *device;
|
||||
ALCcontext *context;
|
||||
ALbuffer *albuf;
|
||||
ALuint byte_align;
|
||||
ALuint channels;
|
||||
ALuint bytes;
|
||||
ALsizei byte_align;
|
||||
ALsizei channels;
|
||||
ALsizei bytes;
|
||||
ALsizei align;
|
||||
|
||||
context = GetContextRef();
|
||||
@ -1074,7 +1074,7 @@ ALenum LoadData(ALbuffer *ALBuf, ALuint freq, ALenum NewFormat, ALsizei frames,
|
||||
}
|
||||
|
||||
|
||||
ALuint BytesFromUserFmt(enum UserFmtType type)
|
||||
ALsizei BytesFromUserFmt(enum UserFmtType type)
|
||||
{
|
||||
switch(type)
|
||||
{
|
||||
@ -1095,7 +1095,7 @@ ALuint BytesFromUserFmt(enum UserFmtType type)
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
ALuint ChannelsFromUserFmt(enum UserFmtChannels chans)
|
||||
ALsizei ChannelsFromUserFmt(enum UserFmtChannels chans)
|
||||
{
|
||||
switch(chans)
|
||||
{
|
||||
@ -1190,7 +1190,7 @@ static ALboolean DecomposeUserFormat(ALenum format, enum UserFmtChannels *chans,
|
||||
return AL_FALSE;
|
||||
}
|
||||
|
||||
ALuint BytesFromFmt(enum FmtType type)
|
||||
ALsizei BytesFromFmt(enum FmtType type)
|
||||
{
|
||||
switch(type)
|
||||
{
|
||||
@ -1200,7 +1200,7 @@ ALuint BytesFromFmt(enum FmtType type)
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
ALuint ChannelsFromFmt(enum FmtChannels chans)
|
||||
ALsizei ChannelsFromFmt(enum FmtChannels chans)
|
||||
{
|
||||
switch(chans)
|
||||
{
|
||||
|
Loading…
x
Reference in New Issue
Block a user