Generic plugin component

I’m delving into tracktion_engine and am able to create tracks, insert plugins, edit and record clips, … so the basics are there.
Now I want to create a generic plugin component that is capable of displaying/modifying/recording the different parameters of a plugin (both internal and external), both as a learning experience and as a fallback for low resolution displays or plugins without editors.
But I don’t know where to start.

Would I access and listen to the automatableParameters of a plugin manually writing the listeners, updating sliders and vice versa?
Does each plugin automatically have a valuetree state that I should access directly?
Is there something like juce’s slider attachments in tracktion_engine? (do I need to access getWrappedAudioProcessor?)

Or am I making it to difficult and/or is there already a generic plugin component I could check on github?


Parameters (and external plugins in general) are a bit tricky as they don’t directly map to ValueTree state.

You probably want to take a look at the AutomatableParameter class and the internal Listener class of it. You can get an array of those from Plugin using AutomatableEditItem::getAutomatableParameters or AutomatableEditItem:: getFlattenedParameterTree.

I hope that helps.

Thx, yes that seems doable.
I wasn’t sure where to start.

one more question:

AutomatableParameter :: listener:
/** Called when the automation curve has changed, point time, value or curve. */
virtual void curveHasChanged (AutomatableParameter&) = 0;

–> I was forced to override this method, otherwise my class would be flagged as abstract.

Is there a reason this one has ’ = 0’ whereas the other virtual methods simply have ‘{}’?

It’s really just a legacy thing. The Listener class use to have only that function so it made sense to make it pure (otherwise why would you be implementing the interface).
I added the other methods when I added modifiers and macros.

If you don’t need it then just leave the function body empty but if you’re doing a parameter list you probably want to update the parameter values when that method is called anyway.