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