aboutsummaryrefslogtreecommitdiffstats
path: root/alc/alu.cpp
diff options
context:
space:
mode:
authorChris Robinson <[email protected]>2019-12-28 11:33:19 -0800
committerChris Robinson <[email protected]>2019-12-28 11:33:19 -0800
commit701d43b41e1976f4a06622df0baa0f284aaaf022 (patch)
tree306c040364bc50b153ecc078d8b8670b3ac97eae /alc/alu.cpp
parent3b3d3d3a03c3f39e758b3b9b41649b86314eb413 (diff)
Start a new extension for a new direct_channels state
So existing behavior remains consistent for anything that needs it, and new behavior is opt-in.
Diffstat (limited to 'alc/alu.cpp')
-rw-r--r--alc/alu.cpp16
1 files changed, 9 insertions, 7 deletions
diff --git a/alc/alu.cpp b/alc/alu.cpp
index da1d72b9..adc6d435 100644
--- a/alc/alu.cpp
+++ b/alc/alu.cpp
@@ -731,7 +731,7 @@ void CalcPanningAndFilters(ALvoice *voice, const ALfloat xpos, const ALfloat ypo
const auto Frequency = static_cast<ALfloat>(Device->Frequency);
const ALuint NumSends{Device->NumAuxSends};
- bool DirectChannels{props->DirectChannels != AL_FALSE};
+ DirectMode DirectChannels{props->DirectChannels};
const ALuint num_channels{voice->mNumChannels};
const ChanMap *chans{nullptr};
ALfloat downmix_gain{1.0f};
@@ -740,11 +740,11 @@ void CalcPanningAndFilters(ALvoice *voice, const ALfloat xpos, const ALfloat ypo
case FmtMono:
chans = MonoMap;
/* Mono buffers are never played direct. */
- DirectChannels = false;
+ DirectChannels = DirectMode::Off;
break;
case FmtStereo:
- if(!DirectChannels)
+ if(DirectChannels == DirectMode::Off)
{
/* Convert counter-clockwise to clockwise. */
StereoMap[0].angle = -props->StereoPan[0];
@@ -785,7 +785,7 @@ void CalcPanningAndFilters(ALvoice *voice, const ALfloat xpos, const ALfloat ypo
case FmtBFormat2D:
case FmtBFormat3D:
- DirectChannels = false;
+ DirectChannels = DirectMode::Off;
break;
}
ASSUME(num_channels > 0);
@@ -934,7 +934,8 @@ void CalcPanningAndFilters(ALvoice *voice, const ALfloat xpos, const ALfloat ypo
}
}
}
- else if(DirectChannels && Device->FmtChans != DevFmtMono && Device->FmtChans != DevFmtAmbi3D)
+ else if(DirectChannels != DirectMode::Off && Device->FmtChans != DevFmtMono
+ && Device->FmtChans != DevFmtAmbi3D)
{
/* Direct source channels always play local. Skip the virtual channels
* and write inputs to the matching real outputs.
@@ -946,7 +947,7 @@ void CalcPanningAndFilters(ALvoice *voice, const ALfloat xpos, const ALfloat ypo
ALuint idx{GetChannelIdxByName(Device->RealOut, chans[c].channel)};
if(idx != INVALID_CHANNEL_INDEX)
voice->mChans[c].mDryParams.Gains.Target[idx] = DryGain.Base;
- else
+ else if(DirectChannels == DirectMode::RemixMismatch)
{
auto match_channel = [chans,c](const InputRemixMap &map) noexcept -> bool
{ return chans[c].channel == map.channel; };
@@ -1575,7 +1576,8 @@ void CalcSourceParams(ALvoice *voice, ALCcontext *context, bool force)
AtomicReplaceHead(context->mFreeVoiceProps, props);
}
- if(voice->mProps.DirectChannels || voice->mProps.mSpatializeMode == SpatializeOff
+ if(voice->mProps.DirectChannels != DirectMode::Off
+ || voice->mProps.mSpatializeMode == SpatializeOff
|| (voice->mProps.mSpatializeMode == SpatializeAuto && voice->mFmtChannels != FmtMono))
CalcNonAttnSourceParams(voice, &voice->mProps, context);
else