diff options
Diffstat (limited to 'src/3rdparty/resonance-audio')
9 files changed, 88 insertions, 20 deletions
diff --git a/src/3rdparty/resonance-audio/patches/0001-resonance_audio-fix-C-20-build.patch b/src/3rdparty/resonance-audio/patches/0001-resonance_audio-fix-C-20-build.patch new file mode 100644 index 000000000..2de42ad26 --- /dev/null +++ b/src/3rdparty/resonance-audio/patches/0001-resonance_audio-fix-C-20-build.patch @@ -0,0 +1,36 @@ +From f8c9ec7cfabb59977629f303edf7cf90ca8521d3 Mon Sep 17 00:00:00 2001 +From: Marc Mutz <marc.mutz@qt.io> +Date: Tue, 28 Jun 2022 19:38:13 +0200 +Subject: [PATCH] AlignedAllocator: fix C++20 build + +C++17 deprecated, and C++20 removed, the nested pointer, size_type +etc. typedefs in std::allocator. Since C++11, the way to get these +types is to go via allocator_traits, so do that. + +This breaks compatibility with C++ < 11. + +Fixes #61 +--- + .../resonance_audio/base/aligned_allocator.h | 6 +++--- + 1 file changed, 3 insertions(+), 3 deletions(-) + +diff --git a/resonance_audio/base/aligned_allocator.h b/resonance_audio/base/aligned_allocator.h +index ac60e8292..628ccaa02 100644 +--- a/resonance_audio/base/aligned_allocator.h ++++ b/resonance_audio/base/aligned_allocator.h +@@ -72,9 +72,9 @@ void AllignedFree(PointerType mem_block_aligned) { + template <typename Type, size_t Alignment> + class AlignedAllocator : public std::allocator<Type> { + public: +- typedef typename std::allocator<Type>::pointer Pointer; +- typedef typename std::allocator<Type>::const_pointer ConstPointer; +- typedef typename std::allocator<Type>::size_type SizeType; ++ using Pointer = typename std::allocator_traits<std::allocator<Type>>::pointer; ++ using ConstPointer = typename std::allocator_traits<std::allocator<Type>>::const_pointer; ++ using SizeType = typename std::allocator_traits<std::allocator<Type>>::size_type; + + AlignedAllocator() { StaticAlignmentCheck<sizeof(Type), Alignment>(); } + +-- +2.25.1 + diff --git a/src/3rdparty/resonance-audio/qt_attribution.json b/src/3rdparty/resonance-audio/qt_attribution.json index df0907b01..6f56457cb 100644 --- a/src/3rdparty/resonance-audio/qt_attribution.json +++ b/src/3rdparty/resonance-audio/qt_attribution.json @@ -1,16 +1,18 @@ -[ - { - "Id": "resonance-audio", - "Name": "Resonance Audio", - "QDocModule": "qtmultimedia", - "Description": "3D audio support.", - "QtUsage": "Used to implement spatial audio.", +{ + "Id": "resonance-audio", + "Name": "Resonance Audio", + "QDocModule": "qtspatialaudio", + "Description": "3D audio support.", + "QtUsage": "Used to implement spatial audio.", + "SecurityCritical": true, - "Homepage": "https://resonance-audio.github.io/resonance-audio/", - "Version": "e225aedb5ec76ca6a0fe7079c0b84dbcbb490553", - "CopyrightFile": "COPYRIGHTS", - "License": "Apache License 2.0", - "LicenseId": "Apache-2.0", - "LicenseFile": "LICENSE" - } -] + "Homepage": "https://resonance-audio.github.io/resonance-audio/", + "Version": "e225aedb5ec7", + "DownloadLocation": + "https://github.com/resonance-audio/resonance-audio/tree/e225aedb5ec76ca6a0fe7079c0b84dbcbb490553", + + "CopyrightFile": "COPYRIGHTS", + "License": "Apache License 2.0", + "LicenseId": "Apache-2.0", + "LicenseFile": "LICENSE" +} diff --git a/src/3rdparty/resonance-audio/resonance_audio/base/aligned_allocator.h b/src/3rdparty/resonance-audio/resonance_audio/base/aligned_allocator.h index ac60e8292..628ccaa02 100644 --- a/src/3rdparty/resonance-audio/resonance_audio/base/aligned_allocator.h +++ b/src/3rdparty/resonance-audio/resonance_audio/base/aligned_allocator.h @@ -72,9 +72,9 @@ void AllignedFree(PointerType mem_block_aligned) { template <typename Type, size_t Alignment> class AlignedAllocator : public std::allocator<Type> { public: - typedef typename std::allocator<Type>::pointer Pointer; - typedef typename std::allocator<Type>::const_pointer ConstPointer; - typedef typename std::allocator<Type>::size_type SizeType; + using Pointer = typename std::allocator_traits<std::allocator<Type>>::pointer; + using ConstPointer = typename std::allocator_traits<std::allocator<Type>>::const_pointer; + using SizeType = typename std::allocator_traits<std::allocator<Type>>::size_type; AlignedAllocator() { StaticAlignmentCheck<sizeof(Type), Alignment>(); } diff --git a/src/3rdparty/resonance-audio/resonance_audio/graph/graph_manager.cc b/src/3rdparty/resonance-audio/resonance_audio/graph/graph_manager.cc index 2046699f8..cb5b85590 100644 --- a/src/3rdparty/resonance-audio/resonance_audio/graph/graph_manager.cc +++ b/src/3rdparty/resonance-audio/resonance_audio/graph/graph_manager.cc @@ -164,7 +164,12 @@ const AudioBuffer* GraphManager::GetAmbisonicBuffer() const { } const AudioBuffer* GraphManager::GetStereoBuffer() const { - return stereo_mixer_node_->GetOutputBuffer(); + return stereo_mixer_node_->GetOutputBuffer(); +} + +const AudioBuffer *GraphManager::GetReverbBuffer() const +{ + return reverb_node_->GetOutputBuffer(); } size_t GraphManager::GetNumMaxAmbisonicChannels() const { diff --git a/src/3rdparty/resonance-audio/resonance_audio/graph/graph_manager.h b/src/3rdparty/resonance-audio/resonance_audio/graph/graph_manager.h index ab797ff54..818b6fa01 100644 --- a/src/3rdparty/resonance-audio/resonance_audio/graph/graph_manager.h +++ b/src/3rdparty/resonance-audio/resonance_audio/graph/graph_manager.h @@ -227,6 +227,15 @@ class GraphManager { // @return Output audio buffer of the stereo mix, or nullptr if no output. const AudioBuffer* GetStereoBuffer() const; + // Returns the last processed buffer containing the reverb data for the room. + // The buffer contains stereo data. + // Note that, this method will *not* trigger the processing of the audio + // graph. |GraphManager::Process| must be called prior to this method call to + // ensure that the buffer is up-to-date. + // + // @return Room reverb audio buffer, or nullptr if no output. + const AudioBuffer* GetReverbBuffer() const; + // Returns the maximum allowed number of ambisonic channels. // // @return Number of channels based on Ambisonic order in the global config. diff --git a/src/3rdparty/resonance-audio/resonance_audio/graph/resonance_audio_api_impl.cc b/src/3rdparty/resonance-audio/resonance_audio/graph/resonance_audio_api_impl.cc index ec508144a..f8cc6731b 100644 --- a/src/3rdparty/resonance-audio/resonance_audio/graph/resonance_audio_api_impl.cc +++ b/src/3rdparty/resonance-audio/resonance_audio/graph/resonance_audio_api_impl.cc @@ -448,7 +448,11 @@ const AudioBuffer* ResonanceAudioApiImpl::GetAmbisonicOutputBuffer() const { } const AudioBuffer* ResonanceAudioApiImpl::GetStereoOutputBuffer() const { - return graph_manager_->GetStereoBuffer(); + return graph_manager_->GetStereoBuffer(); +} + +const AudioBuffer *ResonanceAudioApiImpl::GetReverbBuffer() const { + return graph_manager_->GetReverbBuffer(); } void ResonanceAudioApiImpl::ProcessNextBuffer() { diff --git a/src/3rdparty/resonance-audio/resonance_audio/graph/resonance_audio_api_impl.h b/src/3rdparty/resonance-audio/resonance_audio/graph/resonance_audio_api_impl.h index cac118387..0adbc1c67 100644 --- a/src/3rdparty/resonance-audio/resonance_audio/graph/resonance_audio_api_impl.h +++ b/src/3rdparty/resonance-audio/resonance_audio/graph/resonance_audio_api_impl.h @@ -124,6 +124,11 @@ class ResonanceAudioApiImpl : public ResonanceAudioApi { // @return Pointer to stereo output buffer. const AudioBuffer* GetStereoOutputBuffer() const; + // Returns the last processed buffer containing stereo data for the room reverb + // + // @return Pointer to room reverb stereo buffer. + const AudioBuffer* GetReverbBuffer() const; + // Triggers processing of the audio graph with the updated system properties. void ProcessNextBuffer(); diff --git a/src/3rdparty/resonance-audio/resonance_audio/graph/reverb_node.cc b/src/3rdparty/resonance-audio/resonance_audio/graph/reverb_node.cc index 36b7042bd..6a9999881 100644 --- a/src/3rdparty/resonance-audio/resonance_audio/graph/reverb_node.cc +++ b/src/3rdparty/resonance-audio/resonance_audio/graph/reverb_node.cc @@ -95,6 +95,11 @@ void ReverbNode::Update() { } } +const AudioBuffer* ReverbNode::GetOutputBuffer() const +{ + return &output_buffer_; +} + const AudioBuffer* ReverbNode::AudioProcess(const NodeInput& input) { if (rt60_updating_) { for (size_t i = 0; i < kNumReverbOctaveBands; ++i) { diff --git a/src/3rdparty/resonance-audio/resonance_audio/graph/reverb_node.h b/src/3rdparty/resonance-audio/resonance_audio/graph/reverb_node.h index e25d0a577..f9921fa66 100644 --- a/src/3rdparty/resonance-audio/resonance_audio/graph/reverb_node.h +++ b/src/3rdparty/resonance-audio/resonance_audio/graph/reverb_node.h @@ -41,6 +41,8 @@ class ReverbNode : public ProcessingNode { // values depending on the system settings. void Update(); + const AudioBuffer *GetOutputBuffer() const; + protected: // Implements ProcessingNode. const AudioBuffer* AudioProcess(const NodeInput& input) override; |