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
This commit is contained in:
Paul Ferrand 2020-10-04 17:32:44 +02:00
parent 7933bcec8d
commit 6156022628
3 changed files with 1 additions and 12 deletions

View file

@ -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;
}

View file

@ -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())

View file

@ -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!
*