Commit Graph

881 Commits

Author SHA1 Message Date
Robbert van der Helm a5ded46f27 Add a detach function to the process handles 2022-04-16 20:37:10 +02:00
Robbert van der Helm 75b3cf266d Add Process functions for detached spawning 2022-04-16 20:37:10 +02:00
Robbert van der Helm 1df7abfb2c Terminate handles when they get dropped 2022-04-14 23:42:12 +02:00
Robbert van der Helm a324042695 Use custom process library for notifications
Instead of using Boost.Process here. Last usage of Boost.Process is for
launching the child process.
2022-04-14 23:42:12 +02:00
Robbert van der Helm b80a30ba2a Redirect STDERR to /dev/null in process spawn 2022-04-14 23:42:12 +02:00
Robbert van der Helm 006cc6f52a Read the Wine version without Boost.Process
By spawning the process using posix_spawn and manually reading from a
pipe.
2022-04-14 23:42:12 +02:00
Robbert van der Helm 60e4619ef1 Move pid_running() to process.h 2022-04-14 23:42:12 +02:00
Robbert van der Helm 0d6738093c Add a Boost.Process-like environment builder
We can use this with the `exec*e()` family of functions.
2022-04-14 23:42:12 +02:00
Robbert van der Helm 556b0e38f9 Replace Boost.Asio with standalone Asio library
We had to add an even hackier hack now to get Boost.Process to
interoperate with Asio's IO contexts. This will be replaced later when
we replace Boost.Process.
2022-04-14 23:42:12 +02:00
Robbert van der Helm d2d4cf4ea9 Replace most uses of Boost.{Filesystem,Process}
With the `ghc::filesystem` dependency from the previous commit. If we
can replace the rest of the Boost.Filesystem dependency then we can get
rid the one nasty runtime dependency we have, and it will make
implementing the chainloading simpler since can reuse more code without
bringing in Boost.
2022-04-14 23:42:12 +02:00
Robbert van der Helm 45e5b06099 Fix Meson deprecation warning 2022-04-14 23:42:11 +02:00
Robbert van der Helm 6d02ceb277 Filter out effProcessEvents on verbosity level 1 2022-04-11 12:39:09 +02:00
Robbert van der Helm 4c4421d3e3 Don't requery the VST3 param change queues length
Since this shouldn't be able to change. Should speed up parameter
handling when many parameters are being automated.
2022-03-09 17:43:25 +01:00
Robbert van der Helm 823f6bb239 Prevent realtime scheduling for ad-hoc acceptors
I noticed that there were some realtime adhoc-acceptors running on my
system. That should of course not happen, since these only exist to
catch some sporadic (and likely as a result of a badly behaving plugin)
mutual recursion on the audio thread.
2022-02-08 02:20:18 +01:00
Robbert van der Helm 78f9b00a81 Fix missing option name in last commit 2022-01-15 14:32:51 +01:00
Robbert van der Helm 02a66cba16 Update tomlplusplus dependency to 3.0.1
Last minute update because Arch started packaging this version yesterday
and there are breaking API changes compared to version 2.5.x.
2022-01-15 14:27:34 +01:00
Robbert van der Helm 390df5c264 Add check flag to Meson run_command()
The default value will change soon, so Meson is now showing warnings if
you haven't set an explicit value.
2022-01-15 13:59:03 +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 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 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 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 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 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 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 6fab25cabf Remove unnecessary early return 2021-08-16 21:21:57 +02:00
Robbert van der Helm e6f0fe16d8 Target VST3 SDK version 3.7.3 2021-08-10 17:14:48 +02:00
Robbert van der Helm 1883888ec6 Unify exception handling style 2021-08-07 13:17:03 +02:00
Robbert van der Helm 9160de6483 Implement VST2 SysEx events
Apparently these _are_ actually used. Sometimes.
2021-08-04 21:40:09 +02:00
Robbert van der Helm 5c3491c1e1 Use exception logger for the memory locking error 2021-07-23 15:53:19 +02:00
Robbert van der Helm 1a34a80c21 Add a special exception logger
We'll need this to make sure that we can redirect caught exceptions
printed in `src/common/` to the correct file if `YABRIDGE_DEBUG_FILE` is
set.
2021-07-23 15:46:08 +02:00
Robbert van der Helm b1fc5233d1 Add missing copyright headers 2021-07-20 17:33:26 +02:00
Robbert van der Helm 640c188338 Fix duplicate timestamps in Wine log messages
Regression caused by the merging of these two functions in a1cb3b6.
2021-07-20 04:09:19 +02:00
Robbert van der Helm a1cb3b614b Add a +editor flag to YABRIDGE_DEBUG_LEVEL 2021-07-20 03:01:16 +02:00
Robbert van der Helm 9fcf91dc72 Oops. (fix inverted conditional from last commit) 2021-07-20 02:39:17 +02:00
Robbert van der Helm 138dfb3284 Fix regression in pid_running from d99f571
In some cases we would treat dead processes as not running (we could
also get EAVAIL instead of EINVAL, so it's better to just check the one
thing we should treat as a success instead).
2021-07-20 02:35:24 +02:00
Robbert van der Helm 0e57f410a9 Warn on startup if RLIMIT_MEMLOCK is set too low
This should diagnose issues like #119.
2021-07-18 23:13:51 +02:00
Robbert van der Helm fe61a28524 Print a distinct error when mmap() returns EAGAIN
As mentioned in #119.
2021-07-18 23:13:42 +02:00
Robbert van der Helm 3c14f0391b Move memory mapping setup to a function
So we don't need to repeat this twice.
2021-07-18 22:40:04 +02:00
Robbert van der Helm d99f571c05 Treat EACCES for pid_running() as alive
When the user has some sort of hardening going on, we might not be able
to read the Wine process's memory. In that case this check would return
`false` even though the process is still running. To combat this, we
should explicitly check for `EINVAL` which is returned when the file
doesn't exist at all or when it's a broken 'symlink' (even though it
isn't really a symlink).
2021-07-18 14:54:12 +02:00
Robbert van der Helm 5f5a7bbdd2 Only call ftruncate() when size > 0
Either Boost or Linux really doesn't like it if you ftruncate() shared
memory down to 0 bytes.
2021-07-17 22:01:29 +02:00
Robbert van der Helm 0c816b0046 Only ignore -Wmaybe-uninitialized on GCC
An ifdef sounds like a better approach than ignoring two additional
warnings.
2021-07-14 17:18:44 +02:00