Commit Graph

194 Commits

Author SHA1 Message Date
Robbert van der Helm a495f1a67f Separate mutual recursion on GUI and other threads
I wasn't able to get this to clash, but this way we can be 100% sure
that there aren't any weird issues.
2021-04-29 12:07:11 +02:00
Robbert van der Helm 8b168b310c Fix mutual recursion with latency in Ardour/Mixbus
This would cause Ardour and Mixbus to freeze when inserting a latency
introducing (JUCE based) VST3 plugin. As mentioned in #98.
2021-04-29 03:13:53 +02:00
Robbert van der Helm 32db921b9b Move generic logger on the Wine side to common.h
We'll also need this for VST2 plugins when we start caching the time
info.
2021-04-29 00:31:11 +02:00
Robbert van der Helm 14b0ba0c62 Clarify the definition of empty_arrangement
This is the same thing of course, but it's a bitfield so just a single 0
may seem a bit odd if you don't already know that.
2021-04-28 13:41:24 +02:00
Robbert van der Helm 216c6bc4f2 Always provide at least some speaker arrangement
This works around a bug in the VST3 version of W. A. Production
Imperfect as mentioned in #97. Even if it's a synth and numInputs is 0,
the plugin will still try to read the input arrangement.
2021-04-28 13:35:15 +02:00
Robbert van der Helm 93f089eca7 Always set FTZ instead of gating it behind a flag
After a quick round of testing it seems like REAPER doesn't always
enable this on the audio thread, but Bitwig, Ardour, Carla and Renoise
do. So it should be safe to just get rid of the option and to leave this
enabled all the time.
2021-04-28 12:07:14 +02:00
Robbert van der Helm 2be41da9b6 Add compatibility option to force flushing to zero
This prevents Kush Audio REDDI from taking down the DAW when the host
passes it denormalized audio to process. I've discovered that the issue
with this plugin had to do with denormals in the issue linked below, but
I didn't realize that we can just enable the FTZ flag for plugins that
don't already do so.

https://github.com/osxmidi/LinVst/issues/174
2021-04-27 23:33:50 +02:00
Robbert van der Helm 73d9f5f9b8 Remove unnecessary include 2021-04-27 20:46:08 +02:00
Robbert van der Helm a42ee0400f Print warning explicit COM init was necessary
So far only PSPaudioware InfiniStrip needed this. but it may be a good
idea to make this visible since it's probably an issue with the
plugin (even if most Windows hosts will have COM initialized).
2021-04-26 00:42:17 +02:00
Robbert van der Helm 86bd19cd80 Fix loading plugins expecting COM to be available
The `LoadLibrary()` call for PSPaudioware InfiniStrip would fail because
the plugin would always expect COM to be initialized. Now if loading a
VST2 or VST3 module fails, we'll initialize COM and try again before
throwing an error. This may fix #94.
2021-04-25 21:54:34 +02:00
Robbert van der Helm 80f649323a Add missing const qualification
I just noticed this while looking at the diff of this commit.
2021-04-16 14:12:48 +02:00
Robbert van der Helm e0094979bf Also run {get,set}State() for VST3 on GUI thread
This fixes the same issue with the VST3 version of Algonaut Atlas as the
last commit did for the VST2 version.
2021-04-14 21:38:15 +02:00
Robbert van der Helm 4937010557 Fix some of the clang-tidy lints 2021-04-14 16:09:54 +02:00
Robbert van der Helm 42096c6f60 Add a workaround for Bluecat Audio VST3 plugins
These plugins don't expose `IPluginBase` through the query interface, so
we have to do this nasty coercion instead.
2021-04-12 14:45:12 +02:00
Robbert van der Helm c29bc59059 Hack around a regression in Wine 6.2
This would otherwise prevent building with Wine 6.2.
2021-02-15 12:13:42 +01:00
Robbert van der Helm 4f8eaaaa75 Refactor plugin factories into Vst3*Proxy format
Now every proxy object that's directly created by the host or plugin
shares the same structure.
2021-02-13 15:42:05 +01:00
Robbert van der Helm 4e4ed3a6b4 Don't serialize input output info for IComponent::getRoutingInfo
Yes, input output info.
2021-02-12 19:24:33 +01:00
Robbert van der Helm 67091bc13c Don't serialize input info for IComponent::getBusInfo 2021-02-12 19:12:49 +01:00
Robbert van der Helm e62bd603f9 Don't serialize input arrangement for IAudioProcessor::getBusArrangement 2021-02-12 19:08:51 +01:00
Robbert van der Helm 2020acfec1 Don't serialize input info for IEditController::getParameterInfo 2021-02-12 19:02:27 +01:00
Robbert van der Helm 5978247a0b Don't serialize input size for IPlugView::GetSize 2021-02-12 18:58:33 +01:00
Robbert van der Helm 3fbffa532d Move Win32 event handling to one place
Or technically, two, since the group bridge also does the same loop. We
no longer need special handling for VST2 and VST3 plugins, so we can
simplify things a bit here.
2021-02-09 23:45:33 +01:00
Robbert van der Helm 2d62347393 Update old comments 2021-02-09 23:19:13 +01:00
Robbert van der Helm 72e29d044a Add a function for temporarily blocking event loop
This can be used to prevent the Win32 message loop from running while
there are plugins in some partially initialized state.
2021-01-27 19:00:11 +01:00
Robbert van der Helm cf9ae47f99 Return kNotImplemented with vst3_no_scale
Ever since 0bed2b7bc0 REAPER will randomly
not play back one or more audio channels for plugins that support
IPlugViewContentScaleSuport. If you return `kNotImplemented` then this
bug doesn't occur. REAPER should definitely fix this soon. With
`kResultFalse` this issue still occurs, hence this change so you can use
`vst3_no_scale` to work around this REAPER bug.
2021-01-26 22:49:00 +01:00
Robbert van der Helm 21ff906bf8 Handle connection point proxy from GUI thread
FabFilter plugins will exchange messages that have to be handled from
the GUI thread, or they'll get stuck waiting on a synchronisation
object. This probably hurts GUI performance significantly but luckily it
only affects Ardour.
2021-01-24 15:42:25 +01:00
Robbert van der Helm 77414c80d6 Allow null pointers in IEditController::setComponentHandler 2021-01-24 14:51:18 +01:00
Robbert van der Helm 0044bc6b60 Allow passing null pointers to IPlugView::setFrame 2021-01-24 14:44:42 +01:00
Robbert van der Helm d5e4424463 Also sync VST3 audio thread scheduling priorities
The exact same thing as the last commit, but for VST3 plugins.
2021-01-23 15:22:10 +01:00
Robbert van der Helm 1b804bd5ea 💥 Convert between UID formats for class IDs
This is a breaking change. Old projects containing VST3 plugins running
through yabridge will no longer work without modifications. I'll write
some scripts to convert the class IDs stored in those project files soon
a migration path.

The UIDs reported by the plugin were apparently wrong, which meant that
the native Linux VST3 version of plugin X and the normal Windows VST3
version of plugin X used different class ideas than the Windows VST3
version of plugin X running through yabridge. Those things are supposed
to be compatible, so we sadly needed to make this change at some point.
2021-01-22 14:24:40 +01:00
Robbert van der Helm d3d57a3fe0 Use UID conversion for GetControllerClassId 2021-01-22 14:13:27 +01:00
Robbert van der Helm 2ca1d5b8ca Greatly increase reliability of deferred closing
It's pretty hard to find a solution that checks all of the boxes. I want
something that:

- Closes instantly when you close the editor, and in REAPER you should
  be able to instantly switch between docked and floating modes
- Where there should not be a delay in user interaction when quickly
  reopening the editor (or doing that switching thing in REAPER since that's
  the same thing)
- Where the window manager should not try to reparent the window during
  the losing process as that can cause some jarring flickering
- And, of course, there should be no weird Wine X11Drv crashes

And it should do all of that in Bitwig, REAPER, Carla, Ardour and
Renoise. Apparently it's quite the task to find an approach that checks
all the boxes there.
2021-01-21 16:47:35 +01:00
Robbert van der Helm de8559caea Get rid of some old todos 2021-01-19 15:20:22 +01:00
Robbert van der Helm 1c6d3f8fd9 Fully implement IParameterFunctionName
We now support all VST 3.7.1 interfaces! At least, in theory we do.
2021-01-17 14:17:46 +01:00
Robbert van der Helm 9ddf4b2ae1 Fully implement IProcessContextRequirements 2021-01-16 16:29:21 +01:00
Robbert van der Helm 6c40cd5ad1 Add stubs for IPlugInterfaceSupport 2021-01-16 14:47:40 +01:00
Robbert van der Helm 7fdf646270 Fully implement IMidiLearn 2021-01-16 14:25:00 +01:00
Robbert van der Helm 6e8d56923c Fully implement INoteExpressionPhysicalUIMapping
With this we support all VST 3.6.11 features.
2021-01-15 19:33:05 +01:00
Robbert van der Helm 5dcedbace5 Add an option to disable VST3 content scaling
This might be necessary when using a HiDPI screen as plugin GUIs often
don't scale correctly under Wine.
2021-01-14 17:36:00 +01:00
Robbert van der Helm 0bed2b7bc0 Fully implement IPlugViewContentScaleSupport
With this we're at VST 3.6.6 level support.
2021-01-14 14:52:39 +01:00
Robbert van der Helm 561aee4963 Pass channel context data from the GUI thread
This fixes Melodyne crashing as it presumably immediately wants to
redraw upon receiving this.
2021-01-12 18:44:43 +01:00
Robbert van der Helm 631166d0bf Fully implement IInfoListener 2021-01-12 17:04:07 +01:00
Robbert van der Helm 87b270273f Fully implement IPrefetchableSupport 2021-01-12 15:37:58 +01:00
Robbert van der Helm bf3a4e7296 Allow changing the event loop tick rate
This also changes the refresh rate for most plugins. You can now lower
this setting if your computer is struggling to keep up with rendering a
certain heavy plugin.
2021-01-11 23:38:21 +01:00
Robbert van der Helm b86df213fb Change to SCHED_OTHER on IPlugView init/destruct
Instead of only on `IPlugView::attached`/`IPlugView::removed` like in
the previous commit. I forgot to also do this when creating and
destroying IPlugViews (since I can assume lots of plugins will then
already start loading resources).
2021-01-11 19:04:46 +01:00
Robbert van der Helm f015739942 Open and close editors without realtime priority 2021-01-11 18:50:53 +01:00
Robbert van der Helm a2d1a97309 Fully implement IAutomationState 2021-01-10 23:38:40 +01:00
Robbert van der Helm 8971a65825 Pass through host provided IBStream objects
So if the host supports IStreamAttributes, we can also provide objects
that support the same itnerface to the plugin.
2021-01-10 16:57:36 +01:00
Robbert van der Helm 9b62386099 Move VectorStream to a new YaBStream
We'll have to extend this with `IStreamAttributes` for VST 3.6.0 preset
meta data.
2021-01-10 15:12:47 +01:00
Robbert van der Helm 2fc7621aee Fully implement XmlRepresentationController 2021-01-08 18:02:43 +01:00