AudioPlayHead::CurrentPositionInfo's isPlaying only runs when Audio is playing?


I’m trying to run a method whenever the host is playing. I currently have my plugin connected to the master track in Garageband and wait for CurrentPositionInfo struct’s isPlaying attribute to be true and it looks like it is only enabled when it hits the beginning of a track. For example, I have DBG("ppq: " << cpi.timeInSeconds); run in the processBlock:

In the screenshot below I press play and the DBG message doesn’t start until the 5 second mark

In this configuration, because the main track is enabled and there’s something playing from the beginning the DBG message shows up.

I’m guessing processBlock will not be called until the host sends audio/midi data? Is there any way for a plugin to detect when the the play button is pressed in the host application?

EDIT: Just wanted to add a note that isPlaying returns true even as the playhead plays passed the end of where the Audio2 track ends (and stops when I click the Stop button in the host). In other words, isPlaying=false in the red seleciton, and true otherwise:


Logic isn’t calling processBlock / calling the AU callback when it’s not processing.
It’s behaving like that for a long time now.

If it’s a UI that you need to make aware of some state we’ve added a timestamp on the processor/processBlock. and a ::Timer on the UI. so if the Timer sees the timestamp from the processor is old enough we know it’s not being called.

This is the greatest you can do.

There’s a thread with no solution (as of today) which is related to your issue:

1 Like