diff options
author | Chris Robinson <[email protected]> | 2020-01-15 10:33:56 -0800 |
---|---|---|
committer | Chris Robinson <[email protected]> | 2020-01-15 10:33:56 -0800 |
commit | 6a8c6eae6f72a31bca2a04e94bc3bc16e10a83be (patch) | |
tree | 1dddfcc426a5ee357901d02a27bc8f788d64d1a4 /alc/bformatdec.h | |
parent | fcfcb88b28af65fa6a26257e2e5346ed31abb858 (diff) |
Make a couple helper methods to create BFormatDec
Diffstat (limited to 'alc/bformatdec.h')
-rw-r--r-- | alc/bformatdec.h | 15 |
1 files changed, 14 insertions, 1 deletions
diff --git a/alc/bformatdec.h b/alc/bformatdec.h index d3380616..980c907a 100644 --- a/alc/bformatdec.h +++ b/alc/bformatdec.h @@ -3,6 +3,7 @@ #include <array> #include <cstddef> +#include <memory> #include "AL/al.h" @@ -12,7 +13,6 @@ #include "ambidefs.h" #include "devformat.h" #include "filters/splitter.h" -#include "vector.h" struct AmbDecConf; @@ -54,6 +54,19 @@ public: static std::array<float,MAX_AMBI_ORDER+1> GetHFOrderScales(const ALuint in_order, const ALuint out_order) noexcept; + static std::unique_ptr<BFormatDec> Create(const AmbDecConf *conf, const bool allow_2band, + const ALuint inchans, const ALuint srate, const ALuint (&chanmap)[MAX_OUTPUT_CHANNELS]) + { + return std::unique_ptr<BFormatDec>{new(FamCount{inchans}) + BFormatDec{conf, allow_2band, inchans, srate, chanmap}}; + } + static std::unique_ptr<BFormatDec> Create(const ALuint inchans, + const ChannelDec (&chancoeffs)[MAX_OUTPUT_CHANNELS], const al::span<const ALuint> chanmap) + { + return std::unique_ptr<BFormatDec>{new(FamCount{inchans}) + BFormatDec{inchans, chancoeffs, chanmap}}; + } + DEF_FAM_NEWDEL(BFormatDec, mChannelDec) }; |