1
0
Fork 0
mirror of https://github.com/juce-framework/JUCE.git synced 2026-01-10 23:44:24 +00:00

AudioTransportSource: hasStreamFinished returns true when stream finished

This commit is contained in:
Oliver James 2024-12-10 15:05:15 +00:00
parent 6f4a2f6b6a
commit b7d0364e69
2 changed files with 26 additions and 3 deletions

View file

@ -168,9 +168,13 @@ double AudioTransportSource::getLengthInSeconds() const
bool AudioTransportSource::hasStreamFinished() const noexcept
{
return positionableSource == nullptr
|| (positionableSource->getNextReadPosition() > positionableSource->getTotalLength() + 1
&& ! positionableSource->isLooping());
if (positionableSource == nullptr)
return true;
if (positionableSource->isLooping())
return false;
return positionableSource->getNextReadPosition() >= positionableSource->getTotalLength();
}
void AudioTransportSource::setNextReadPosition (int64 newPosition)