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

AudioProcessorPlayer: Avoid unconditionally replacing playhead

This commit is contained in:
reuk 2022-10-25 13:51:51 +01:00
parent 697643c0b6
commit a9a4fae783
No known key found for this signature in database
GPG key ID: 9ADCD339CFC98A11

View file

@ -281,12 +281,14 @@ void AudioProcessorPlayer::audioDeviceIOCallbackWithContext (const float* const*
sampleCount (sampleCountIn),
seconds ((double) sampleCountIn / sampleRateIn)
{
processor.setPlayHead (this);
if (useThisPlayhead)
processor.setPlayHead (this);
}
~PlayHead() override
{
processor.setPlayHead (nullptr);
if (useThisPlayhead)
processor.setPlayHead (nullptr);
}
private:
@ -303,6 +305,7 @@ void AudioProcessorPlayer::audioDeviceIOCallbackWithContext (const float* const*
Optional<uint64_t> hostTimeNs;
uint64_t sampleCount;
double seconds;
bool useThisPlayhead = processor.getPlayHead() == nullptr;
};
PlayHead playHead { *processor,