Hello there -- thanks for the comment.
Thread safety is an important requirement for Mixxx. We have three threads accessing the PluginLoader class.
A brief look at the PluginLoader source code showed that PluginLoader::getInstance() is not thread-safe. Moreover,
PluginLoader::loadPlugin returns a " new Vamp::PluginHostAdapter "( PluginLoader.cpp:407 ). At this point, I think that we are a bit unsafe.
You're quite right that PluginLoader is not at all thread-safe and that it would be nice if it was.
At this stage, though, I think it's unlikely that this will change in a future release. That's because (a) it would introduce a further platform dependency for thread synchronisation and (b) it would change the semantics of the library without changing the API which is itself a hazardous thing to do.
So I'm afraid you will have to synchronise your plugin load code (i.e. the code that calls PluginLoader) instead, and accept the fact that the library doesn't do it for you.
One thing I certainly should do, though, is document this!
Just for completeness -- it should be OK to load plugins in multiple threads (so long as the PluginLoader calls are synchronised and the plugins themselves are well-written!) but you should only use a single plugin instance from within a single thread (don't access the same plugin from multiple threads) and you should always delete a plugin from the same thread you loaded it from. There should be no problem loading the same plugin multiple times in different threads if necessary, PluginLoader does not share instances.
It's also perhaps worth adding that you don't have to use PluginLoader. In fact, it didn't exist in the very earliest version of the SDK: that just said you should load the shared library and look up the descriptor function, as is usual with (for example) LADSPA plugins. That method still works too.
QM beat track and 4/4 signatures
I know this post refers to host development but I would like to give feed back about beat tracking. All QM beat trackers are flexible in a sense that they are not limited to music having a 4/4 signature. However, most dance music today is written in a 4/4 signature. I personally have analysed the raw beat positions of the QM beat tracker with hundreds of songs. It was found out that the resulting beat grid was not always correct which negatively affects the BPM. QM frequently gets confused when the rhythm pattern changes within a track. Luckily, we have "invented" a method to to correct the raw beat positions. It would be great to have a native QM beat tracker for 4/4 signatures. If you are interested I can describe "invented" method and point to the implementation.
On a personal level I would certainly be interested, and I can point the beat tracking researchers behind the QM plugins at this forum too.