From 6156022628f484642d4276997a6879c86ce677d6 Mon Sep 17 00:00:00 2001 From: Paul Ferrand Date: Sun, 4 Oct 2020 17:32:44 +0200 Subject: [PATCH] this use of getSourcePosition is wrong (sourcePosition is not increased if e.g. the voice is a generator for example) To avoid this I removed the API which has really no purpose --- src/sfizz/Synth.cpp | 2 +- src/sfizz/Voice.cpp | 5 ----- src/sfizz/Voice.h | 6 ------ 3 files changed, 1 insertion(+), 12 deletions(-) diff --git a/src/sfizz/Synth.cpp b/src/sfizz/Synth.cpp index b191d841..2d8b01d6 100644 --- a/src/sfizz/Synth.cpp +++ b/src/sfizz/Synth.cpp @@ -1018,7 +1018,7 @@ void sfz::Synth::checkNotePolyphony(const Region* region, int delay, const Trigg } break; case SfzSelfMask::dontMask: - if (!selfMaskCandidate || selfMaskCandidate->getSourcePosition() < voice->getSourcePosition()) + if (!selfMaskCandidate || selfMaskCandidate->getAge() < voice->getAge()) selfMaskCandidate = voice; break; } diff --git a/src/sfizz/Voice.cpp b/src/sfizz/Voice.cpp index 4a0fc5b0..4afc7bc2 100644 --- a/src/sfizz/Voice.cpp +++ b/src/sfizz/Voice.cpp @@ -856,11 +856,6 @@ bool sfz::Voice::releasedOrFree() const noexcept return state != State::playing || egAmplitude.isReleased(); } -uint32_t sfz::Voice::getSourcePosition() const noexcept -{ - return sourcePosition; -} - void sfz::Voice::setMaxFiltersPerVoice(size_t numFilters) { if (numFilters == filters.size()) diff --git a/src/sfizz/Voice.h b/src/sfizz/Voice.h index 9d5bfceb..70e5fb74 100644 --- a/src/sfizz/Voice.h +++ b/src/sfizz/Voice.h @@ -248,12 +248,6 @@ public: * @return float */ float getAveragePower() const noexcept; - /** - * @brief Get the position of the voice in the source, in samples - * - * @return uint32_t - */ - uint32_t getSourcePosition() const noexcept; /** * Returns the region that is currently playing. May be null if the voice is not active! *