aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorChris Robinson <[email protected]>2023-01-04 23:18:17 -0800
committerChris Robinson <[email protected]>2023-01-04 23:18:17 -0800
commit58a18ab3c0126337d17939b5060fce28a39b8cf1 (patch)
tree37b4abf4525f955a18165ec059890738a56db661
parent078b50e0ed6a0b89aa2e1f84bbbebbf24b885a4e (diff)
Add a simple wrapper to call the mixer function
-rw-r--r--core/mixer.cpp2
-rw-r--r--core/mixer.h10
-rw-r--r--core/voice.cpp4
3 files changed, 11 insertions, 5 deletions
diff --git a/core/mixer.cpp b/core/mixer.cpp
index e03e06e4..b98a2532 100644
--- a/core/mixer.cpp
+++ b/core/mixer.cpp
@@ -13,7 +13,7 @@
struct CTag;
-MixerFunc MixSamples{Mix_<CTag>};
+MixerOutFunc MixSamplesOut{Mix_<CTag>};
std::array<float,MaxAmbiChannels> CalcAmbiCoeffs(const float y, const float z, const float x,
diff --git a/core/mixer.h b/core/mixer.h
index 66bcb170..9ed1f5b3 100644
--- a/core/mixer.h
+++ b/core/mixer.h
@@ -13,11 +13,17 @@
struct MixParams;
-using MixerFunc = void(*)(const al::span<const float> InSamples,
+/* Mixer functions that handle one input and multiple output channels. */
+using MixerOutFunc = void(*)(const al::span<const float> InSamples,
const al::span<FloatBufferLine> OutBuffer, float *CurrentGains, const float *TargetGains,
const size_t Counter, const size_t OutPos);
-extern MixerFunc MixSamples;
+extern MixerOutFunc MixSamplesOut;
+inline void MixSamples(const al::span<const float> InSamples,
+ const al::span<FloatBufferLine> OutBuffer, float *CurrentGains, const float *TargetGains,
+ const size_t Counter, const size_t OutPos)
+{ MixSamplesOut(InSamples, OutBuffer, CurrentGains, TargetGains, Counter, OutPos); }
+
/**
diff --git a/core/voice.cpp b/core/voice.cpp
index fc3a38cc..1b979614 100644
--- a/core/voice.cpp
+++ b/core/voice.cpp
@@ -71,7 +71,7 @@ using HrtfMixerBlendFunc = void(*)(const float *InSamples, float2 *AccumSamples,
HrtfMixerFunc MixHrtfSamples{MixHrtf_<CTag>};
HrtfMixerBlendFunc MixHrtfBlendSamples{MixHrtfBlend_<CTag>};
-inline MixerFunc SelectMixer()
+inline MixerOutFunc SelectMixer()
{
#ifdef HAVE_NEON
if((CPUCapFlags&CPU_CAP_NEON))
@@ -152,7 +152,7 @@ void Voice::InitMixer(al::optional<std::string> resampler)
ResamplerDefault = iter->resampler;
}
- MixSamples = SelectMixer();
+ MixSamplesOut = SelectMixer();
MixHrtfBlendSamples = SelectHrtfBlendMixer();
MixHrtfSamples = SelectHrtfMixer();
}