Is there a simple way to derive from AudioPlayHead that allows us to set the DAW’s playhead position, while still retaining the DAW’s ability to start/stop playback natively? Ideally, I would like to be able to call something like setPlaybackPosition once, and the playhead continues moving from that point automatically.
It seems like if I tell the AudioProcessor to use a custom AudioPlayHead, I have to fill out the CurrentPositionInfo myself, without the possibility to get the current playback position provided by the DAW and change it only if I need to. Is this assessment correct? Do I really need to take control of the entire Playhead, incrementing the current sample time etc. myself?
Forgive me if I’m wrong, but to me it looks like the JUCE implementations for each format use getPlayHead()->getCurrentPosition() to modify the host parameters accordingly, at least for VST and AU plugins:
Thanks for the clarification. Wouldn’t the code inside the hosting code imply that manipulating the host’s timeline position would be possible at least in VST and AU plugins?
Waves plugins (e.g. Waves Tune) pull this off using their “ReWire” technology. I’m not sure how that works, but it shows that it’s possible in one way or the other.
Edit: I just realized that ReWire is not a Waves technology. I got confused by them having a “Waves ReWire” utility plugin. I’ve researched this a bit, and according to Jules, getting it to work is a “PITA”, so I probably won’t bother with that for now.
The vstHostTime struct that is manipulated in the JUCE VST2 plugin hosting code is the struct that is passed for the hosted VST2 plugin when the plugin requests for it. The time position info is never read back from the struct, so even if the plugin tried manipulating the data, nothing would happen in the JUCE hosting code. It is theoretically possible some other host could detect the position info was changed by the plugin and then seek on its timeline but I would not expect that to happen with any commonly known host. (If that actually was something that could be expected work, JUCE probably would have added support in the AudioPlayHead class.)
I had his Vcontrol app for iPad a few years ago. To use it, you install an app on your desktop computer that acts as a virtual control surface for your DAW. The iPad app talks to this control surface, which controls the DAW. No idea if they use the HUI protocol or what. Maybe OSC protocol can be used?