diff options
| author | bunnei <bunneidev@gmail.com> | 2020-11-25 10:50:52 -0800 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2020-11-25 10:50:52 -0800 |
| commit | b7f1095980d614842f6264667d9ddd38186d57ff (patch) | |
| tree | 980eba01298d420dad312534e93f8fbd82e3ba76 /src/audio_core/sink_context.h | |
| parent | 9aeada734d4e1793ce2e7c57678e83501f292afc (diff) | |
| parent | 908d3c56793ee67dccd0d370b175c4937420053f (diff) | |
Merge pull request #4932 from ogniK5377/misc-audio
audren: Make use of nodiscard, rework downmixing, release all buffers
Diffstat (limited to 'src/audio_core/sink_context.h')
| -rw-r--r-- | src/audio_core/sink_context.h | 17 |
1 files changed, 12 insertions, 5 deletions
diff --git a/src/audio_core/sink_context.h b/src/audio_core/sink_context.h index d7aa72ba7..e2e7880b7 100644 --- a/src/audio_core/sink_context.h +++ b/src/audio_core/sink_context.h @@ -11,6 +11,8 @@ namespace AudioCore { +using DownmixCoefficients = std::array<float_le, 4>; + enum class SinkTypes : u8 { Invalid = 0, Device = 1, @@ -50,7 +52,7 @@ public: std::array<u8, AudioCommon::MAX_CHANNEL_COUNT> input; INSERT_UNION_PADDING_BYTES(1); bool down_matrix_enabled; - std::array<float_le, 4> down_matrix_coef; + DownmixCoefficients down_matrix_coef; }; static_assert(sizeof(SinkInfo::DeviceIn) == 0x11c, "SinkInfo::DeviceIn is an invalid size"); @@ -74,16 +76,21 @@ public: explicit SinkContext(std::size_t sink_count); ~SinkContext(); - std::size_t GetCount() const; + [[nodiscard]] std::size_t GetCount() const; + + void UpdateMainSink(const SinkInfo::InParams& in); + [[nodiscard]] bool InUse() const; + [[nodiscard]] std::vector<u8> OutputBuffers() const; - void UpdateMainSink(SinkInfo::InParams& in); - bool InUse() const; - std::vector<u8> OutputBuffers() const; + [[nodiscard]] bool HasDownMixingCoefficients() const; + [[nodiscard]] const DownmixCoefficients& GetDownmixCoefficients() const; private: bool in_use{false}; s32 use_count{}; std::array<u8, AudioCommon::MAX_CHANNEL_COUNT> buffers{}; std::size_t sink_count{}; + bool has_downmix_coefs{false}; + DownmixCoefficients downmix_coefficients{}; }; } // namespace AudioCore |
