Wrapping an AudioProcessor into a Tracktion Engine Plugin

As I work on some plugins, I’m trying to use the Tracktion Engine in the standalone app versions, using custom standalone windows as described here and elsewhere:

The rationale is that I want to have access to a functioning transport and the engine’s device manager etc. in the plugin’s standalone version. I can get the engine and its transport to work just fine, but I’m trying to wrap my head around how I’d wrap the project’s AudioProcessor into a tracktion engine Plugin so I can insert it into the edit/graph.

I don’t think I want the tracktion_engine::ExternalPlugin wrapper (or do I?), because I’m not wrapping a VST or an AU, just the sole juce::AudioProcessor in my plugin project. I’m thinking I should construct an internal te::Plugin from my AudioProcessor, and the two already have similar methods, if not signatures: processBlock ~ applyToBuffer, prepareToPlay ~ initialise, etc.

I guess I’m asking that if I write a wrapper to build an internal te::Plugin from a juce::AudioProcessor, does anyone have some thoughts on what I’d need to watch out for? Besides the obvious bits like extracting the audio buffer from the AudioRenderContext for the AudioProcessor’s processBlock, and converting a te::MidiMessageArray to a juce::MidiBuffer, etc. I’m particularly interested in making sure the AudioProcessor gets a playhead correctly.

As always, thanks in advance for any thoughts and suggestions.

I think what you’re describing sounds sensible.
Maybe take a look at ExternalPlugin to see how the playhead is setup.

Either that or you can make your own plugin format, register that with the PluginManager and then simply use an ExternalPlugin. We do that for SOUL plugin support in Waveform.