From 353dfa397367f129dbc4695d7b6fb72b7d2e126f Mon Sep 17 00:00:00 2001 From: Paul Ferrand Date: Sat, 30 May 2020 10:41:50 +0200 Subject: [PATCH] Moved defaultAlignment to config --- src/sfizz/AudioBuffer.h | 4 ++-- src/sfizz/Buffer.h | 4 ++-- src/sfizz/Config.h | 2 +- src/sfizz/FilePool.h | 2 +- tests/BufferT.cpp | 4 ++-- 5 files changed, 8 insertions(+), 8 deletions(-) diff --git a/src/sfizz/AudioBuffer.h b/src/sfizz/AudioBuffer.h index 4c104e35..9488243e 100644 --- a/src/sfizz/AudioBuffer.h +++ b/src/sfizz/AudioBuffer.h @@ -26,8 +26,8 @@ namespace sfz * @tparam MaxChannels the maximum number of channels in the buffer * @tparam Alignment the alignment for the buffers */ -template class AudioBuffer { public: diff --git a/src/sfizz/Buffer.h b/src/sfizz/Buffer.h index 89acfa36..9644f17d 100644 --- a/src/sfizz/Buffer.h +++ b/src/sfizz/Buffer.h @@ -119,9 +119,9 @@ private: * * @tparam Type The buffer type * @tparam Alignment the required alignment in bytes (defaults to - * SIMDConfig::defaultAlignment) + * config::defaultAlignment) */ -template +template class Buffer { public: using value_type = typename std::remove_cv::type; diff --git a/src/sfizz/Config.h b/src/sfizz/Config.h index 9ed09c8b..7e1eaa42 100644 --- a/src/sfizz/Config.h +++ b/src/sfizz/Config.h @@ -58,6 +58,7 @@ namespace config { constexpr uint16_t numCCs { 512 }; constexpr int maxCurves { 256 }; constexpr int chunkSize { 1024 }; + constexpr unsigned int defaultAlignment { 16 }; constexpr int filtersInPool { maxVoices * 2 }; constexpr int excessFileFrames { 8 }; /** @@ -98,7 +99,6 @@ namespace config { // Enable or disable SIMD accelerators by default namespace SIMDConfig { - constexpr unsigned int defaultAlignment { 16 }; constexpr bool writeInterleaved { true }; constexpr bool readInterleaved { true }; constexpr bool fill { true }; diff --git a/src/sfizz/FilePool.h b/src/sfizz/FilePool.h index b542e8bb..25eaf068 100644 --- a/src/sfizz/FilePool.h +++ b/src/sfizz/FilePool.h @@ -43,7 +43,7 @@ #include namespace sfz { -using FileAudioBuffer = AudioBuffer; using FileAudioBufferPtr = std::shared_ptr; diff --git a/tests/BufferT.cpp b/tests/BufferT.cpp index 8d43291d..ed5f986f 100644 --- a/tests/BufferT.cpp +++ b/tests/BufferT.cpp @@ -41,8 +41,8 @@ template void checkBoundaries(sfz::Buffer& buffer, int expectedSize) { REQUIRE((int)buffer.size() == expectedSize); - REQUIRE(((size_t)buffer.data() & (sfz::SIMDConfig::defaultAlignment - 1)) == 0); - REQUIRE(((size_t)buffer.alignedEnd() & (sfz::SIMDConfig::defaultAlignment - 1)) == 0); + REQUIRE(((size_t)buffer.data() & (sfz::config::defaultAlignment - 1)) == 0); + REQUIRE(((size_t)buffer.alignedEnd() & (sfz::config::defaultAlignment - 1)) == 0); REQUIRE(std::distance(buffer.begin(), buffer.end()) == expectedSize); REQUIRE(std::distance(buffer.begin(), buffer.alignedEnd()) >= expectedSize); }