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:
parent
6f4a2f6b6a
commit
b7d0364e69
2 changed files with 26 additions and 3 deletions
|
|
@ -2,6 +2,25 @@
|
||||||
|
|
||||||
# Version 8.0.4
|
# Version 8.0.4
|
||||||
|
|
||||||
|
|
||||||
|
## Change
|
||||||
|
|
||||||
|
The behavior of AudioTransportSource::hasStreamFinished has been updated to correctly return true when the stream has finished.
|
||||||
|
|
||||||
|
**Possible Issues**
|
||||||
|
|
||||||
|
This change may affect any code that relied on the previous behavior, where the method never returned true.
|
||||||
|
|
||||||
|
**Workaround**
|
||||||
|
|
||||||
|
Review and update any code that depends on hasStreamFinished or any registered ChangeListeners that respond to stream completion.
|
||||||
|
|
||||||
|
**Rationale**
|
||||||
|
|
||||||
|
The previous behavior, where hasStreamFinished never returned true, was incorrect.
|
||||||
|
This update ensures the method works as intended.
|
||||||
|
|
||||||
|
|
||||||
## Change
|
## Change
|
||||||
|
|
||||||
Support for Arm32 in Projucer has been removed for Windows targets.
|
Support for Arm32 in Projucer has been removed for Windows targets.
|
||||||
|
|
|
||||||
|
|
@ -168,9 +168,13 @@ double AudioTransportSource::getLengthInSeconds() const
|
||||||
|
|
||||||
bool AudioTransportSource::hasStreamFinished() const noexcept
|
bool AudioTransportSource::hasStreamFinished() const noexcept
|
||||||
{
|
{
|
||||||
return positionableSource == nullptr
|
if (positionableSource == nullptr)
|
||||||
|| (positionableSource->getNextReadPosition() > positionableSource->getTotalLength() + 1
|
return true;
|
||||||
&& ! positionableSource->isLooping());
|
|
||||||
|
if (positionableSource->isLooping())
|
||||||
|
return false;
|
||||||
|
|
||||||
|
return positionableSource->getNextReadPosition() >= positionableSource->getTotalLength();
|
||||||
}
|
}
|
||||||
|
|
||||||
void AudioTransportSource::setNextReadPosition (int64 newPosition)
|
void AudioTransportSource::setNextReadPosition (int64 newPosition)
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue