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:
parent
697643c0b6
commit
a9a4fae783
1 changed files with 5 additions and 2 deletions
|
|
@ -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,
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue