From f80da93cfc4b6819e6b45b2ba64aa80e5e5fbe29 Mon Sep 17 00:00:00 2001 From: Paul Ferrand Date: Sun, 8 Dec 2019 18:48:08 +0100 Subject: [PATCH] Proper coding is better; enabling and disabling freewheeling for real. --- src/sfizz/Synth.cpp | 15 +++++++++++++++ src/sfizz/Synth.h | 4 ++-- 2 files changed, 17 insertions(+), 2 deletions(-) diff --git a/src/sfizz/Synth.cpp b/src/sfizz/Synth.cpp index 401c1610..3ad7a76c 100644 --- a/src/sfizz/Synth.cpp +++ b/src/sfizz/Synth.cpp @@ -572,3 +572,18 @@ uint32_t sfz::Synth::getPreloadSize() const noexcept { return resources.filePool.getPreloadSize(); } + +void sfz::Synth::enableFreeWheeling() noexcept +{ + if (!freeWheeling) { + freeWheeling = true; + DBG("Enabling freewheeling"); + } +} +void sfz::Synth::disableFreeWheeling() noexcept +{ + if (freeWheeling) { + freeWheeling = false; + DBG("Disabling freewheeling"); + } +} diff --git a/src/sfizz/Synth.h b/src/sfizz/Synth.h index ce181284..99da4fac 100644 --- a/src/sfizz/Synth.h +++ b/src/sfizz/Synth.h @@ -325,8 +325,8 @@ public: */ int getAllocatedBytes() const noexcept { return Buffer::counter().getTotalBytes(); } - void enableFreeWheeling() { freeWheeling = true; } - void disableFreeWheeling() { freeWheeling = true; } + void enableFreeWheeling() noexcept; + void disableFreeWheeling() noexcept; protected: /** * @brief The parser callback; this is called by the parent object each time