Commit Graph

672 Commits

Author SHA1 Message Date
Robbert van der Helm 162aeed661 Only set up VST3 SHM audio buffers in setActive()
This avoids doing the duplicate check (since both `setProcessing()` and
`setActive()` would be called), and this also gets rid of the assumption
added a couple commits ago that `setupProcessing()` is only ever called
once, which is not true.
2022-05-19 14:43:59 +02:00
Robbert van der Helm 8c10edf861 Add explicit virtual default destructors
We need to silence the warning about this because Steinberg doesn't
declare their base class destructors as virtual (because of Windows ABI
compatibility issues). But we can still do it inside of yabridge to have
at least a bit more safety.
2022-05-18 18:44:15 +02:00
Robbert van der Helm dedcdefebf Allow resizing shared memory buffers in setActive
REAPER apparently changes bus arrangements between
`IAudioProcessor::setupProcessing()` and `IAudioProcessor::setActive()`.
2022-05-18 18:16:14 +02:00
Robbert van der Helm 6efc69071e Fix building with -Dvst3=false #180 2022-05-14 13:19:20 +02:00
Robbert van der Helm 3970bc7f52 [yabridgectl] Set up in ~/.vst/yabridge by default
Instead of creating `.so` files next to the VST2 plugin's `.dll` files.
This behavior is still available as an option. #123
2022-04-17 20:27:47 +02:00
Robbert van der Helm b3efcf4e06 Merge yabridge-group.exe and yabridge-host.exe
They were 95% the same, so this makes a lot more sense this way. When
group host processes were introduced yabridge only did VST2 bridging,
but we already have a plugin type argument anyways so might as well
reuse that for group hosts.
2022-04-16 23:26:24 +02:00
Robbert van der Helm 4d9e865dd3 Define plugin and chainloader deps in own dir
Just like we already did for the plugin host.
2022-04-16 23:00:25 +02:00
Robbert van der Helm 470f4dfaaa Remove the with- prefix from the build options 2022-04-16 21:13:46 +02:00
Robbert van der Helm 773b101cd4 Update error messages for chainloading changes 2022-04-16 20:37:11 +02:00
Robbert van der Helm 6f16eb5c76 Print library path in the initialization message
This is useful when chainloading, since it now tells you where eactly
it's loading the library from.
2022-04-16 20:37:11 +02:00
Robbert van der Helm d73a0041eb Find the correct library file from the chainloader
Instead of using this hardcdoed path.
2022-04-16 20:37:11 +02:00
Robbert van der Helm 3cad93cb65 Move get_augmented_search_path to process library
We'll need this for the chainloader.
2022-04-16 20:37:11 +02:00
Robbert van der Helm 0487947d91 Export chainloader functions in the plugin libs
These can be called from the new chainlaoder libraries to use yabridge
without needing copies of the full fat `libyabridge-{vst2,vst3}.so`
libraries.
2022-04-16 20:37:11 +02:00
Robbert van der Helm 0ba0dab675 Add missing extern "C" to GetPluginFactory 2022-04-16 20:37:11 +02:00
Robbert van der Helm 46af07748b Move desktop notifications to its own header
We'll need to use this from the chainloader.
2022-04-16 20:37:10 +02:00
Robbert van der Helm fde90d7bc3 Pass plugin path around instead of redetecting
This is now set only once at the top level. This is needed for the
chainloading to work because we'll need to set the path when we create
the bridge.
2022-04-16 20:37:10 +02:00
Robbert van der Helm 1fec4c8860 Change the description in the GPL header 2022-04-16 20:37:10 +02:00
Robbert van der Helm 7b3afa4043 Replace Boost.Dll with our own function
Now we no longer rely on anything from Boost. Later we'll move the path
detection to the very beginning of the plugin bridge initialization so
it can be set from the coming chainloader libraries.
2022-04-16 20:37:10 +02:00
Robbert van der Helm b2ffbb8b4d Also consider empty dirs for find_dominating_file
Just in case.
2022-04-16 20:37:10 +02:00
Robbert van der Helm c2de0cce2e Use our own export macro 2022-04-16 20:37:10 +02:00
Robbert van der Helm 4e99afd53d Add a note on case sensitive extension matching 2022-04-16 20:37:10 +02:00
Robbert van der Helm b2a15620f3 Swap Boost.Container's small_vector out for LLVM's
This implementation misses a shrink to fit function, but reassigning the
vector with a fresh one should be equivalent.
2022-04-16 20:37:10 +02:00
Robbert van der Helm 037d6ad5aa Replace Boost.Process for the Wine plugin host
Now we use our own library for this, so we can drop the Boost.Filesystem
dependency after a couple more changes.
2022-04-16 20:37:10 +02:00
Robbert van der Helm 1641fb2996 Fix find_dominating_file() for ghc::filesystem
"/".parent() now is "/" instead of "" (which does make more sense)
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 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 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 92a09832d8 Fix a typo in a comment in the plugin lookup 2022-01-27 21:18:12 +01:00
Robbert van der Helm 9eb1d2af3d Change RTTIME warnings and doc for next PW release
The next release will use regular realtime scheduling with no
`RLIMIT_RTTIME` when the user has the permissions to do so by default.
2022-01-17 15:33:42 +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 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 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 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 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 3950f055ad Fix wording in new warning messages 2021-09-21 15:54:19 +02:00