Call AudioPlayHead::getCurrentPosition outside processBlock


#1

Hello, 
we need the position of the audio play head in our VST plugin's GUI. We need it even when there is no processing. 

AudioPlayHead::getCurrentPosition()' documenation states: 

This method must ONLY be called from within your AudioProcessor::processBlock() method. Calling it at any other time will probably cause a nasty crash.

The problem is: On some hosts processBlock is not always called but we need timeInSamples at any point of time.
 

How dangerous is it to call AudioPlayHead::getCurrentPosition on the GUI thread? And why is it dangerous?
So far we had no crash.


#2

Unless the host is calling your process method, then there isn't necessarily any time information to be had. It'd be a mistake to write code that can't deal with a situation where timecode isn't currently available.

And just randomly calling that host method from your own threads when the host may not be expecting it is dangerous. Just because you've not had a crash yet is irrelevant - you can't possible test all hosts in all circumstances.