We cannot integrate this into our event loop like we planned, because
Wine a) grabs the mouse pointer so we cannot do that, and b) blocks the
GUI thread. So instead we will spawn our own thread and do polling based
XDND. When Wine's tracker window gets destroyed, we know that the left
mouse button has been released.
JUCE incorrectly calls `IComponentHandler::performEdit()` from the audio
thread instead of using the output parameter changes queue, so this
would also cause GUI resizes to be handled from the audio thread if they
come in at the same time as such a parameter change.
Apparently X11 connections are a scarce resource, so it seems like a
good idea to not hang on to them for too long. Now this is sort of a
hybrid between COM-style memory management and a singleton.
This doesn't do anything useful yet, but it will print the names of
files that are being dragged and dropped on the Wine server (using the
OLE API) while the plugin is open.
This is needed as a workaround to support Waves VST3 plugins.
Right now does does not actually fix the issue because the arguments are
not updated in the subclasses. The next commit will fix this.
Seems weird to need this specifically so we can use the map overload
that creates a new instance when the key doesn't exist in the map. This
seems safer.
We should probably get rid of the Ardour/Mixbus warning, since this is
also how native plugins would function in the Windows version of Ardour.
The warnings were here from when yabridge didn't properly serialize the
bus type, since Ardour specifically only supports a single main input
and output and optionally an auxiliary input.
If pruning results in a directory becoming empty, then we should remove
that directory. This approach won't touch any directories that we aren't
pruning from.
This commit does a couple of things since the refactoring made it
difficult to split these things up:
- The counts for managed and new plugins are now always correct, even
when plugin directory A contains a symlink to plugin directory B.
- Orphan files will now be pruned from managed VST3 directories, making
switching between different architectures easier. (the previous
approach involved nuking the entire bundle, which of course has a
bunch of downsides)
We should be a bit more clever about this. This approach would mean that
the plugin would be rescanned every time, since the whole 'don't
reinstall plugins if that wouldn't change anything' thing no longer
works with this approach.
Letting `std::unique_ptr<T>` do the thinking for us makes a lot more
sense. We only need manual memory management for the error because we
need to pass a pointer to that pointer to xcb, but at least we have the
macro there so it still stays nice and readable.
We sadly cannot call `shared_library()` and `executable()` in these
subdirectories while still maintaining the same `build/` directory
structure, but this is still much cleaner. All of the other build
artifacts are now also gone from the root of `build/` so it's cleaner
overall.