aboutsummaryrefslogtreecommitdiffstats
path: root/core/mixer.h
diff options
context:
space:
mode:
authorChris Robinson <[email protected]>2023-01-04 22:02:29 -0800
committerChris Robinson <[email protected]>2023-01-04 23:03:15 -0800
commit078b50e0ed6a0b89aa2e1f84bbbebbf24b885a4e (patch)
treedb7bee5d11af40ae01d6210cfd41f6fa60a247f9 /core/mixer.h
parente38413a4fbb0b4f85950c929141856a767993f4f (diff)
Simplify handling effect output for spatial effects
Effects are given a 3D ambisonic buffer of the same order as the device, for processing surround sound. Effects that pass input channels to matching output channels as it processes them don't need to mix each input channel to all output channels. At most, an input channel may mix to a different output channel, if the target buffer uses a different channel layout, and need a gain adjustment, if it uses a different scaling. With a 2D output buffer, a number of channels can be skipped altogether.
Diffstat (limited to 'core/mixer.h')
-rw-r--r--core/mixer.h18
1 files changed, 0 insertions, 18 deletions
diff --git a/core/mixer.h b/core/mixer.h
index 8624996f..66bcb170 100644
--- a/core/mixer.h
+++ b/core/mixer.h
@@ -92,22 +92,4 @@ inline std::array<float,MaxAmbiChannels> CalcAngleCoeffs(const float azimuth,
void ComputePanGains(const MixParams *mix, const float*RESTRICT coeffs, const float ingain,
const al::span<float,MaxAmbiChannels> gains);
-
-/** Helper to set an identity/pass-through panning for ambisonic mixing (3D input). */
-template<typename T, typename I, typename F>
-auto SetAmbiPanIdentity(T iter, I count, F func) -> std::enable_if_t<std::is_integral<I>::value>
-{
- if(count < 1) return;
-
- std::array<float,MaxAmbiChannels> coeffs{{1.0f}};
- func(*iter, coeffs);
- ++iter;
- for(I i{1};i < count;++i,++iter)
- {
- coeffs[i-1] = 0.0f;
- coeffs[i ] = 1.0f;
- func(*iter, coeffs);
- }
-}
-
#endif /* CORE_MIXER_H */