From c45843964bc461cbf5f99ec651bd8c07fbb14b35 Mon Sep 17 00:00:00 2001 From: Chris Robinson <chris.kcat@gmail.com> Date: Sun, 13 Nov 2022 14:10:15 -0800 Subject: Change a function to a static method --- core/converter.cpp | 2 +- core/converter.h | 7 +++---- 2 files changed, 4 insertions(+), 5 deletions(-) (limited to 'core') diff --git a/core/converter.cpp b/core/converter.cpp index 69e0d8dd..75c37149 100644 --- a/core/converter.cpp +++ b/core/converter.cpp @@ -156,7 +156,7 @@ void Multi2Mono(uint chanmask, const size_t step, const float scale, float *REST } // namespace -SampleConverterPtr CreateSampleConverter(DevFmtType srcType, DevFmtType dstType, size_t numchans, +SampleConverterPtr SampleConverter::Create(DevFmtType srcType, DevFmtType dstType, size_t numchans, uint srcRate, uint dstRate, Resampler resampler) { if(numchans < 1 || srcRate < 1 || dstRate < 1) diff --git a/core/converter.h b/core/converter.h index d3a4da08..b6ff3ba5 100644 --- a/core/converter.h +++ b/core/converter.h @@ -45,14 +45,13 @@ struct SampleConverter { return SampleOffset{(prep<<MixerFracBits) + mFracOffset}; } + static std::unique_ptr<SampleConverter> Create(DevFmtType srcType, DevFmtType dstType, + size_t numchans, uint srcRate, uint dstRate, Resampler resampler); + DEF_FAM_NEWDEL(SampleConverter, mChan) }; using SampleConverterPtr = std::unique_ptr<SampleConverter>; -SampleConverterPtr CreateSampleConverter(DevFmtType srcType, DevFmtType dstType, size_t numchans, - uint srcRate, uint dstRate, Resampler resampler); - - struct ChannelConverter { DevFmtType mSrcType{}; uint mSrcStep{}; -- cgit v1.2.3