Pass RealMixParams by reference instead of pointer
This commit is contained in:
parent
9fde260df9
commit
7744e4ff72
24
Alc/alu.cpp
24
Alc/alu.cpp
@ -128,8 +128,8 @@ void ProcessHrtf(ALCdevice *device, ALsizei SamplesToDo)
|
||||
device->FOAOut.Buffer, SamplesToDo
|
||||
);
|
||||
|
||||
int lidx{GetChannelIdxByName(&device->RealOut, FrontLeft)};
|
||||
int ridx{GetChannelIdxByName(&device->RealOut, FrontRight)};
|
||||
int lidx{GetChannelIdxByName(device->RealOut, FrontLeft)};
|
||||
int ridx{GetChannelIdxByName(device->RealOut, FrontRight)};
|
||||
assert(lidx != -1 && ridx != -1);
|
||||
|
||||
DirectHrtfState *state{device->mHrtfState.get()};
|
||||
@ -163,8 +163,8 @@ void ProcessAmbiUp(ALCdevice *device, ALsizei SamplesToDo)
|
||||
|
||||
void ProcessUhj(ALCdevice *device, ALsizei SamplesToDo)
|
||||
{
|
||||
int lidx = GetChannelIdxByName(&device->RealOut, FrontLeft);
|
||||
int ridx = GetChannelIdxByName(&device->RealOut, FrontRight);
|
||||
int lidx = GetChannelIdxByName(device->RealOut, FrontLeft);
|
||||
int ridx = GetChannelIdxByName(device->RealOut, FrontRight);
|
||||
assert(lidx != -1 && ridx != -1);
|
||||
|
||||
/* Encode to stereo-compatible 2-channel UHJ output. */
|
||||
@ -176,8 +176,8 @@ void ProcessUhj(ALCdevice *device, ALsizei SamplesToDo)
|
||||
|
||||
void ProcessBs2b(ALCdevice *device, ALsizei SamplesToDo)
|
||||
{
|
||||
int lidx = GetChannelIdxByName(&device->RealOut, FrontLeft);
|
||||
int ridx = GetChannelIdxByName(&device->RealOut, FrontRight);
|
||||
int lidx = GetChannelIdxByName(device->RealOut, FrontLeft);
|
||||
int ridx = GetChannelIdxByName(device->RealOut, FrontRight);
|
||||
assert(lidx != -1 && ridx != -1);
|
||||
|
||||
/* Apply binaural/crossfeed filter */
|
||||
@ -696,7 +696,7 @@ void CalcPanningAndFilters(ALvoice *voice, const ALfloat Azi, const ALfloat Elev
|
||||
|
||||
for(ALsizei c{0};c < num_channels;c++)
|
||||
{
|
||||
int idx{GetChannelIdxByName(&Device->RealOut, chans[c].channel)};
|
||||
int idx{GetChannelIdxByName(Device->RealOut, chans[c].channel)};
|
||||
if(idx != -1) voice->Direct.Params[c].Gains.Target[idx] = DryGain;
|
||||
}
|
||||
|
||||
@ -843,7 +843,7 @@ void CalcPanningAndFilters(ALvoice *voice, const ALfloat Azi, const ALfloat Elev
|
||||
{
|
||||
if(Device->Dry.Buffer == Device->RealOut.Buffer)
|
||||
{
|
||||
int idx = GetChannelIdxByName(&Device->RealOut, chans[c].channel);
|
||||
int idx = GetChannelIdxByName(Device->RealOut, chans[c].channel);
|
||||
if(idx != -1) voice->Direct.Params[c].Gains.Target[idx] = DryGain;
|
||||
}
|
||||
continue;
|
||||
@ -894,7 +894,7 @@ void CalcPanningAndFilters(ALvoice *voice, const ALfloat Azi, const ALfloat Elev
|
||||
{
|
||||
if(Device->Dry.Buffer == Device->RealOut.Buffer)
|
||||
{
|
||||
int idx = GetChannelIdxByName(&Device->RealOut, chans[c].channel);
|
||||
int idx = GetChannelIdxByName(Device->RealOut, chans[c].channel);
|
||||
if(idx != -1) voice->Direct.Params[c].Gains.Target[idx] = DryGain;
|
||||
}
|
||||
continue;
|
||||
@ -1683,9 +1683,9 @@ void aluMixData(ALCdevice *device, ALvoid *OutBuffer, ALsizei NumSamples)
|
||||
/* Apply front image stablization for surround sound, if applicable. */
|
||||
if(device->Stablizer)
|
||||
{
|
||||
const int lidx{GetChannelIdxByName(&device->RealOut, FrontLeft)};
|
||||
const int ridx{GetChannelIdxByName(&device->RealOut, FrontRight)};
|
||||
const int cidx{GetChannelIdxByName(&device->RealOut, FrontCenter)};
|
||||
const int lidx{GetChannelIdxByName(device->RealOut, FrontLeft)};
|
||||
const int ridx{GetChannelIdxByName(device->RealOut, FrontRight)};
|
||||
const int cidx{GetChannelIdxByName(device->RealOut, FrontCenter)};
|
||||
assert(lidx >= 0 && ridx >= 0 && cidx >= 0);
|
||||
|
||||
ApplyStablizer(device->Stablizer.get(), device->RealOut.Buffer, lidx, ridx, cidx,
|
||||
|
@ -60,7 +60,7 @@ void ALdedicatedState::update(const ALCcontext *context, const ALeffectslot *slo
|
||||
if(slot->Params.EffectType == AL_EFFECT_DEDICATED_LOW_FREQUENCY_EFFECT)
|
||||
{
|
||||
int idx;
|
||||
if((idx=GetChannelIdxByName(&device->RealOut, LFE)) != -1)
|
||||
if((idx=GetChannelIdxByName(device->RealOut, LFE)) != -1)
|
||||
{
|
||||
mOutBuffer = device->RealOut.Buffer;
|
||||
mOutChannels = device->RealOut.NumChannels;
|
||||
@ -71,7 +71,7 @@ void ALdedicatedState::update(const ALCcontext *context, const ALeffectslot *slo
|
||||
{
|
||||
/* Dialog goes to the front-center speaker if it exists, otherwise it
|
||||
* plays from the front-center location. */
|
||||
int idx{GetChannelIdxByName(&device->RealOut, FrontCenter)};
|
||||
int idx{GetChannelIdxByName(device->RealOut, FrontCenter)};
|
||||
if(idx != -1)
|
||||
{
|
||||
mOutBuffer = device->RealOut.Buffer;
|
||||
|
@ -550,8 +550,8 @@ ALboolean MixSource(ALvoice *voice, ALuint SourceID, ALCcontext *Context, ALsize
|
||||
}
|
||||
else
|
||||
{
|
||||
const int lidx{GetChannelIdxByName(&Device->RealOut, FrontLeft)};
|
||||
const int ridx{GetChannelIdxByName(&Device->RealOut, FrontRight)};
|
||||
const int lidx{GetChannelIdxByName(Device->RealOut, FrontLeft)};
|
||||
const int ridx{GetChannelIdxByName(Device->RealOut, FrontRight)};
|
||||
assert(lidx != -1 && ridx != -1);
|
||||
|
||||
ALsizei fademix{0};
|
||||
|
@ -198,7 +198,7 @@ bool MakeSpeakerMap(ALCdevice *device, const AmbDecConf *conf, ALsizei (&speaker
|
||||
return -1;
|
||||
}
|
||||
}
|
||||
const int chidx{GetChannelIdxByName(&device->RealOut, ch)};
|
||||
const int chidx{GetChannelIdxByName(device->RealOut, ch)};
|
||||
if(chidx == -1)
|
||||
ERR("Failed to lookup AmbDec speaker label %s\n", speaker.Name.c_str());
|
||||
return chidx;
|
||||
|
@ -906,8 +906,8 @@ inline ALint GetChannelIndex(const Channel (&names)[MAX_OUTPUT_CHANNELS], Channe
|
||||
* Returns the index for the given channel name (e.g. FrontCenter), or -1 if it
|
||||
* doesn't exist.
|
||||
*/
|
||||
inline ALint GetChannelIdxByName(const RealMixParams *real, enum Channel chan)
|
||||
{ return GetChannelIndex(real->ChannelName, chan); }
|
||||
inline ALint GetChannelIdxByName(const RealMixParams &real, Channel chan)
|
||||
{ return GetChannelIndex(real.ChannelName, chan); }
|
||||
|
||||
|
||||
void StartEventThrd(ALCcontext *ctx);
|
||||
|
Loading…
x
Reference in New Issue
Block a user