freesurround_wrapper.hpp (949B)
1 #ifndef GUARD_CLOAKEDLY_AVERAGE_SUMMER_GRAYS_OUT_2241 2 #define GUARD_CLOAKEDLY_AVERAGE_SUMMER_GRAYS_OUT_2241 3 #pragma once 4 5 #include "channel.hpp" 6 #include "freesurround/freesurround_decoder.h" 7 #include "options.hpp" 8 9 #include <cstdint> 10 #include <span> 11 12 class FreesurroundWrapper 13 { 14 public: 15 FreesurroundWrapper(); 16 17 [[nodiscard]] unsigned GetBlockSize() const noexcept { return block_size; } 18 [[nodiscard]] std::vector<Option> GetOptions(); 19 20 void Init(float rate); 21 [[nodiscard]] std::span<const float> Decode(std::span<const float> in); 22 23 [[nodiscard]] std::vector<Channel::E> GetChannels() const; 24 [[nodiscard]] std::uint32_t GetDelay() const noexcept { return block_size / 2; } 25 26 private: 27 float rate = -1; 28 freesurround_decoder dec; 29 30 channel_setup channel_setup; 31 unsigned block_size; 32 float circular_wrap, shift, depth, focus; 33 float front_separation, rear_separation; 34 bool enable_lfe; 35 float low_cutoff, high_cutoff; 36 }; 37 38 #endif