Commit Graph

1643 Commits

Author SHA1 Message Date
Robbert van der Helm 4767b758b8 Delay showing editor the window
This fixes Waves V13 VST3 plugins crashing when opening the editor. They
will likely still crash later on anyways because they're kinda broken.
Amazing.
2022-01-09 00:41:14 +01:00
Robbert van der Helm 4e78a75caa Fix the winedbg support after 0b9a16c 2022-01-04 02:29:30 +01:00
Robbert van der Helm c625deadef Proxy host context menu items for VST3 plugins
This wasn't implemented yet because no plugin tried using the interface
in this way before this, but Surge XT incorporates the host's context
menu items into their own (much more elaborate) context menu. To
accommodate this, we now copy over all of the host's prepopulated
context menu items to the Wine plugin host, and calling the targets
associated with any of those items will cause the target on the
associated context menu item on the host to be called.

This is slightly more complicated than what would otherwise be necessary
because Bitwig does not assign tags to their context menu items and
instead always uses 0.
2022-01-03 17:04:00 +01:00
Robbert van der Helm 89cd1e9ee3 Fix IContextMenuTarget::ExecuteMenuItem logging 2022-01-03 15:17:35 +01:00
Robbert van der Helm 0e3aba1870 Move the VST3 context menu target implementation
So it can also be used on the Wine side in a bit.
2022-01-03 14:12:25 +01:00
Robbert van der Helm 0b9a16cf40 Change the naming scheme for class field members
I'm not a fan of Hungarian notation, but C++ kind of needs it with its
implicit `this`. And of all the common options for this, I find
suffixing members with an underscore the least offensive one.
2022-01-01 21:07:17 +01:00
Robbert van der Helm e0ab24e645 Update copyright headers
Happy new year!
2022-01-01 18:32:10 +01:00
Robbert van der Helm dad3645156 Add a todo about backing rwlocks with a spinlock 2021-12-29 15:44:32 +01:00
Robbert van der Helm 85f05e0eab Also use rwlocks on the VST3 plugin side 2021-12-28 19:05:56 +01:00
Robbert van der Helm 1507e4f574 Use multiple reader single writer locks for VST3
This would also need to be done on the plugin side.
2021-12-28 18:51:14 +01:00
Robbert van der Helm 2137d79229 Disconnect the correct connection point proxy 2021-12-28 17:09:36 +01:00
Robbert van der Helm d48dbe71da Redundantly limit number of drag-and-drop formats
As reported in #149, the DrumCore 3 plugin would segfault when trying to
drag files from it. This happened because the plugin presumably
underflows somewhere and then reports that it supports 4294967282
different drag-and-drop formats, even though yabridge asked for a
maximum of 16.
2021-12-16 01:52:37 +01:00
Robbert van der Helm 35244d2c7f Support Wine 6.23's fixed winedbg arg handling
I was about to rebase the patch I've been resubmitting to Wine that
fixed this when I noticed that
https://github.com/wine-mirror/wine/commit/94ca4be2a62cdb05adaee524084875b04b283afb
now does the same thing.
2021-12-07 00:59:07 +01:00
Robbert van der Helm c054398965 Increase Win32 message limit for JUCE plugins
They aggressively use the message loop when parts of a plugin's UI
change, sometimes sending as many is 2300 events at once. The old 20
messages per tick limit would cause severe slowdowns in this case.
2021-11-30 03:48:08 +01:00
Robbert van der Helm ce8e4dccdf Move Win32 message limit constant 2021-11-30 03:28:05 +01:00
Robbert van der Helm 5b3210eed6 Inhibit event loop during VST3 offline processing
This prevents T-RackS 5 from causing the export in Bitwig Studio 4.1.0
beta 2 to freeze.
2021-11-10 21:29:40 +01:00
Robbert van der Helm 9682446fab Remove incorrect line feeds from log output
These were probably added here out of habit.
2021-11-10 20:41:32 +01:00
Robbert van der Helm 0382b0a475 Stop the watchdog context with the main context
Since this was never stopped, the `watchdog_handler` thread would also
keep running. Since after e3f0926aef
everything is supposed to exit cleanly, this would cause group host
processes to hang and never exit. Tying the watchdog timer to
`MainContext::run()` is cleaner anyways.
2021-10-18 15:39:25 +02:00
Robbert van der Helm 9aca27a192 Don't filter out empty environment variables
This check was only needed because `operator[]` inserts an empty entry
if the variable doesn't exist. Wine also complains when `WINEPREFIX` is
empty, so we should probably not try to have our own behavior here.
2021-10-17 16:15:48 +02:00
Robbert van der Helm 1eaee22bb9 Prevent some allocations in environment lookups
In some places we'll still use the allocating non-const `operator[]`
just because it would otherwise become pretty unreadable.
2021-10-17 16:10:13 +02:00
Robbert van der Helm 93ab5126b2 Rename YABRIDGE_TEMP_PATH to YABRIDGE_TEMP_DIR
I liked the `_PATH` version better initially, but the `_DIR` verison has
a better ring to it and it's more consistent with `$XDG_RUNTIME_DIR`. #139
2021-10-16 02:04:31 +02:00
Robbert van der Helm e3f0926aef Allow the group host to terminate cleanly
...before terminating it forcefully. Not sure why this
`TerminateProcess()` was here instead of in `group-host.cpp` in the
first place. This way we don't have to duplicate any destructor
behaviour.
2021-10-16 02:00:39 +02:00
Robbert van der Helm 1b662c07a7 Clean up group host socket endpoint files
Apparently we just left these behind. Now all yabridge related files
should be gone from the temporary directories if yabridge exits cleanly.
2021-10-16 01:58:15 +02:00
Robbert van der Helm 3257b9c32e Add an environment variable for custom temp dirs
This would be useful if you need to do some elaborate namespacing setup
and want all sockets and other temporary files in a single directory
instead of in `${XDG_RUNTIME_DIR:/tmp}`.

This resolves #139.
2021-10-16 01:41:48 +02:00
Robbert van der Helm 9a48b5ec8a Print something when hot patching someone's locale 2021-10-12 23:39:36 +02:00
Robbert van der Helm c18332f7d4 Revert back to the detached Konsole window winedbg
This works again, and it's a bit less of a pain than connecting to
gdbserver.
2021-10-02 15:05:59 +02:00
Robbert van der Helm f4a5754eae Quote winedbg arguments instead of using start dir
Apparently these arguments are all passed as a space separated Win32
command line, so we need to do our own quoting. I was about to submit a
patch for this to Wine, but escaping escaped quotes sounds like a pain.
2021-10-02 15:04:34 +02:00
Robbert van der Helm 46b4dc0341 Add missing includes for Boost 1.77 2021-09-27 17:45:59 +02:00
Robbert van der Helm fc19bf74da Comment about performance in bus cache lookups 2021-09-27 17:45:58 +02:00
Robbert van der Helm 9d9eac85ef Store context menu items in unordered maps
The difference in performance won't be noticable, but both lookups and
modifications in these things are much faster once you have more than
one or two elements.
2021-09-27 17:36:48 +02:00
Robbert van der Helm 4bf7e8a5a2 Remove unnecessary iostream import
I was going to add a warning to the last commit, but I ended up not
doing it because we should be printing those to the logger instead.
2021-09-26 19:54:56 +02:00
Robbert van der Helm 5aa25109b8 Work around Boost.Process invalid locale bug/crash
This should not be causing any issues, but it seems like some people
skip the locale setup step in the Arch installation guide and then end
up with a distro without any locales, with invalid locales, or with a
non-generated locale. glibc and libstd++ fall back to the C locale when
this happens, but Boost.Process triggers one of the edge cases where
this doesn't happen. https://github.com/boostorg/process/pull/179 fixes
this in Boost.Process, but it will be a while until this is in every
distro's copy of Boost.

https://svn.boost.org/trac10/changeset/72855
2021-09-26 19:25:35 +02:00
Robbert van der Helm 3dd5859799 Always print version information in plugin hosts
When the plugin host applications are invoked without arguments. Seems a
bit weird when they only print this when invoked with arguments.
2021-09-26 18:20:20 +02:00
Robbert van der Helm 0c9c4686f1 Use the small buffer optimization for VST3 SysEx
We apparently didn't do that yet. SysEx should be super rare (outside of
octave switching on Arturia keyboards), but there's still no reason not
to do it.
2021-09-23 14:29:12 +02:00
Robbert van der Helm 3950f055ad Fix wording in new warning messages 2021-09-21 15:54:19 +02:00
Robbert van der Helm 7760c4bb6c Show desktop notification for low RLIMIT_RTTIME
For the same reason as the last commit, since people otherwise just miss
this.
2021-09-21 15:40:32 +02:00
Robbert van der Helm e347944e38 Show desktop notification for the memlock warning
Since most people don't try running things in a terminal.
2021-09-21 15:32:47 +02:00
Robbert van der Helm f26a2a2689 Set VST2 SR and block sizes from main thread
This apparently fixes New Sonic Arts' Vice plugin freezing while
loading. Hopefully this doesn't cause issues with other plugins. Spotted
in https://www.kvraudio.com/forum/viewtopic.php?p=8217647#p8217647.
2021-09-21 14:11:15 +02:00
Robbert van der Helm ec41ec1c81 Add a warmup phase to the XDND implementation
This fixes short drops being ignored. Bitwig does this, and I've also
seen some Qt applications do this.
2021-08-22 16:43:02 +02:00
Robbert van der Helm 64f0cbcd41 Fix property reply errors being coerced to 0
During a refactor this changed from a boolean to an option, guess I
missed this.
2021-08-22 16:41:40 +02:00
Robbert van der Helm c12c1459bb Fix drag-and-drop skipping the first tick
This check is of course not supposed to be here.
2021-08-22 15:56:23 +02:00
Robbert van der Helm 5bf3b97118 Hide symbols in VST3 static libraries
I noticed a couple of UID/string conversion related symbols showing up
in the text section.
2021-08-17 15:50:08 +02:00
Robbert van der Helm c1b4410e6b Don't include angular brackets for concrete types
In the VST2 log output. I just use this syntax as a more descriptive
handwavy substitute for the actual data.
2021-08-17 15:15:33 +02:00
Robbert van der Helm f55a04a1fc Fix VST2 logging message for effEditGetRect() 2021-08-17 15:12:08 +02:00
Robbert van der Helm 5613248cda Gate the new resizing behavior behind new option
This interferes with resizing plugins using resize handles, and since it
only helps with two buggy plugins this seems like the best solution
here.
2021-08-16 22:39:13 +02:00
Robbert van der Helm b84aa18ecf Only reset coordinates when resizing
This was the original idea. I though that to be extra safe, maybe we can
do this all the time. And while that does work fine, most of the time,
it does cause a lot of other fun issues especially when plugins fully
redraw themselves that way.
2021-08-16 21:31:57 +02:00
Robbert van der Helm cc9226a3fc Remove editor_double_embed
It's no longer needed after the `fix_local_coordinates()` change from a
fa12c64866a8b79e862bc5db4c4b092a4b762689.
2021-08-16 21:21:57 +02:00
Robbert van der Helm 9ac597a6fd Make the resize function not-noexcept
Since technically the string allocations within the logging for
`fix_local_coordinates()` can throw.
2021-08-16 21:21:57 +02:00
Robbert van der Helm d46f7882bd Reposition to (0, 0) while fixing coordinates
The goal is to have the window be at (0, 0), while Wine's X11 event
layer thinks it is at the actual screen coordinates. This is needed to
prevent drawing issues with buggy plugins that rely on absolute screen
coordinates to draw their GUI.
2021-08-16 21:21:57 +02:00
Robbert van der Helm 6fab25cabf Remove unnecessary early return 2021-08-16 21:21:57 +02:00