Thanks for the reply.
AUBase::CallHostMusicalTimeLocation
AUBase::CallHostBeatAndTempo
AUBase::CallHostTransportState
What I meant in my question however - is there a way to get callbacks/notifications invoked in my Audio Unit every time when beat/bar changes, or when the host playback starts/stops (for instance, when the user clicks the Play button in MainStage). Or do I have to implement tracking of these events manually in my render function by checking if and how the beat value changed?
Manual tracking sounds like a tedious work though. For instance, I would like to have a function called every time a metronome ticks (i.e., a beat changes).
CallHostBeatAndTempo returns fractional value, so what I can do - is in the AU's Render() function trunc the Float64 beat value and compare it with a trunced previous value, if it changed, then beat happened and I ought to invoke my Beat() function. However host's (int)beat value can change not only when the metronome ticks, but when the user presses the play button (it was 0 before Play was pressed, then it jumps to 21.768750 (why?), then jumps again to 0 and starts increasing normally every metronome tick by 1). So when the user presses play, the Beat() function is invoked twice, even though the metronome ticked only once. Weird.