diff --git a/src/sfizz/Logger.cpp b/src/sfizz/Logger.cpp index d69671c1..73b07e86 100644 --- a/src/sfizz/Logger.cpp +++ b/src/sfizz/Logger.cpp @@ -70,7 +70,8 @@ sfz::Logger::~Logger() loadLogFile << time.waitDuration.count() << ',' << time.loadDuration.count() << ',' << time.fileSize << ',' - << time.filename << '\n'; + << "disabled" << '\n'; + // << time.filename << '\n'; } if (!callbackTimes.empty()) { diff --git a/src/sfizz/Modifiers.h b/src/sfizz/Modifiers.h index 1de3405e..bdf4508a 100644 --- a/src/sfizz/Modifiers.h +++ b/src/sfizz/Modifiers.h @@ -31,10 +31,25 @@ public: }; template -class ModifierArray : public std::array { +class ModifierArray { public: - T& operator[](sfz::Mod idx) { return this->std::array::operator[](static_cast(idx)); } - const T& operator[](sfz::Mod idx) const { return this->std::array::operator[](static_cast(idx)); } + using ContainerType = typename std::array; + using iterator = typename ContainerType::iterator; + using const_iterator = typename ContainerType::const_iterator; + ModifierArray() = default; + ModifierArray(T val) + { + std::fill(underlying.begin(), underlying.end(), val); + } + ModifierArray(std::array&& array) : underlying(array) {} + T& operator[](sfz::Mod idx) { return underlying.operator[](static_cast(idx)); } + const T& operator[](sfz::Mod idx) const { return underlying.operator[](static_cast(idx)); } + iterator begin() { return underlying.begin(); } + iterator end() { return underlying.end(); } + const_iterator begin() const { return underlying.begin(); } + const_iterator end() const { return underlying.end(); } +private: + ContainerType underlying {}; }; /** @@ -42,7 +57,7 @@ public: * Should fail at compile time if you update the modifiers but not this. * */ -static const ModifierArray allModifiers = {{ +static const ModifierArray allModifiers {{ Mod::amplitude, Mod::pan, Mod::width, diff --git a/src/sfizz/Voice.cpp b/src/sfizz/Voice.cpp index d6033dd1..204615d6 100644 --- a/src/sfizz/Voice.cpp +++ b/src/sfizz/Voice.cpp @@ -845,8 +845,7 @@ void sfz::Voice::resetSmoothers() noexcept for (auto& mod : allModifiers) { const auto resetValue = [mod] { switch (mod) { - case Mod::volume: - return 1.0f; + case Mod::volume: // fallthrough case Mod::pitch: return 1.0f; default: