Hi there,
I’m struggling to find a way to listen for plugins being added (and removed) from a track. I am adding a plugin as follows:
auto newPlugin = track->edit.getPluginCache().createNewPlugin(
tracktion_engine::LowPassPlugin::xmlTypeName,
{}
);
track->pluginList.insertPlugin(newPlugin, -1, nullptr);
I noticed that Track
exposes the state
value tree and I thought I could listen for this and reload the plugins for the track from there.
I am successfully getting into valueTreeChildAdded
when the plugin is added, but when I reload the plugins:
for(auto p : track->pluginList.getPlugins()) {
DBG(p->getName());
}
The new one is not there.
I can’t see another listener for Track
or AudioTrack
so I was wondering if I’ve either missed something, or whether my approach is wrong.
Any help greatly appreciated!
Thanks
p.s. I have noticed there is PluginCache.newPluginAddedCallback
but that seems to be only called when adding a plugin (not removing/deleting one) and at the point it is called, the plugin would not yet have been added to the track.