Browse Source

AudioProcessorPlayer: Avoid unconditionally replacing playhead

v7.0.9
reuk 3 years ago
parent
commit
a9a4fae783
No known key found for this signature in database GPG Key ID: 9ADCD339CFC98A11
1 changed files with 5 additions and 2 deletions
  1. +5
    -2
      modules/juce_audio_utils/players/juce_AudioProcessorPlayer.cpp

+ 5
- 2
modules/juce_audio_utils/players/juce_AudioProcessorPlayer.cpp 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,


Loading…
Cancel
Save