getCurrentPosition questions


Reading the documentation, we are not to call this method outside of our processBlock method. What would be the best way for a user to interact with a button and get the timecode to display in the GUI? Currently, I have getCurrentPosition(currentPositionInfo) in the processBlock, but then a pointer from the GUI class pointing to currentPositionInfo, that is dereferenced when a button on the GUI is clicked. Something about this still feels wrong. Would this still be considered dangerous?

I’m also having issues obtaining any information from AU relating to getCurrentPosition, this could be because the way I set it up might be incorrect, but I also read other forum threads who had issues with GarageBand, Logic, and other AU DAWs / sequencers when getting playhead position.


The getCurrentPosition() method seems to be returning true as well, as if the playhead is available, but just in AU, all the data members are just initialized to 0 and that’s it.


If it returns true then the host is claiming that it has provided the data. So if the values are incorrect, that’s not really something we can do anything about.

You might want to actually step into the getCurrentPosition method to see what happens inside though?


I’ll step through and look. It’s strange. GarageBand returns all zeros, as do a few others, but some return total garbage values. VST seems to work great in that all hosts I’ve tried it in return the proper information.