Commit Graph

227 Commits

Author SHA1 Message Date
Robbert van der Helm 34e3f1a1bf Don't set WINEPREFIX for the current process
`native_environment` allows modification of the current process's
environment, so we had to use the plain `environment` class instead.
2020-06-20 13:43:54 +02:00
Robbert van der Helm 56af346277 Show Wine prefix overrides on the startup output
This might otherwise cause confusion, since otherwise the printed Wine
prefix might not actually be the prefix that will be used.
2020-06-20 01:01:48 +02:00
Robbert van der Helm 471d87bc16 Fix dumb memory error when reading buffers
Not sure how this got in, and I'm even less sure why this has not caused
any issues before this. In the particular case that was causing a crash,
the host was sending 138 sample sized buffers. This error likely only
became visible because the lack of memory alignment caused writes to
parts of the vector objects themselves.
2020-06-18 18:37:07 +02:00
Robbert van der Helm c4842ccda6 Make use-* aliases for new with-* build options
The 'use-*' variants will be marked as deprecated in a future version.
2020-06-08 16:02:53 +02:00
Robbert van der Helm 4403585a70 Use the new C++20 starts_with() and contains() 2020-06-06 13:44:26 +02:00
Robbert van der Helm 8202a6b250 Add missing const qualifiers to member functions 2020-06-06 13:44:26 +02:00
Robbert van der Helm 957da62137 Add missing type qualifiers 2020-06-06 13:44:23 +02:00
Robbert van der Helm 3aab2e9727 Fix plugin group socket name generation
I'm pretty sure you're supposed to be able to format `size_t` values,
why does this break the stringstream?
2020-06-05 22:56:52 +02:00
Robbert van der Helm 33777d2876 Use same style for optional and avoid double check
I did not know that `std::optional::value()` did checked access. And I
still prefer a more explicit .has_value() over boolean conversion, but
this seems to be the accepted way to do this.
2020-06-05 22:35:56 +02:00
Robbert van der Helm ff298f3f46 Remove redundant conditions
As mentioned in C++ Core Guidelines ES.87.
2020-06-05 22:18:40 +02:00
Robbert van der Helm b379708b21 Encapsulate individual/group handling differences
This cleans up the PluginBridge significantly by getting rid of all
fields and handling that was only needed for connecting to plugin
groups. This was also the last thing I wanted to refactor before
releasing the plugin groups feature with yabridge 1.2.
2020-05-29 18:08:44 +02:00
Robbert van der Helm 16aa1af14e Don't check for child termination with winedbg
This of course can't work since the process is spawned in a detached
state.
2020-05-28 19:00:10 +02:00
Robbert van der Helm fc35b6c9c8 Show the init message before launching VST host 2020-05-26 17:07:14 +02:00
Robbert van der Helm e546dd7b24 Change wording for individually hosted plugins 2020-05-23 16:00:44 +02:00
Robbert van der Helm 42c755cac8 Don't try to join nonexistent threads
This fixes a shutdown crash for individually hosted plugins. One more
reason to refactor the host launch behavior!
2020-05-23 15:59:04 +02:00
Robbert van der Helm 124b62bf6b Change config path wording
Since this field will only be populated if we are actually using values
from a config file.
2020-05-23 15:47:13 +02:00
Robbert van der Helm c387238b78 Change wording in group related log messages 2020-05-23 15:16:33 +02:00
Robbert van der Helm 9f544c194a Change hosting mode wording 2020-05-23 13:01:22 +02:00
Robbert van der Helm a246ddf344 Manually close sockets when not killing process
Killing the socket would otherwise cause the sockets to be closed, and
both sides to shut down.
2020-05-22 23:08:25 +02:00
Robbert van der Helm 6da1909d4b Fix interleaved group host initialization
In case two yabridge instances start at the same time and both try to
launch a group host for the same group and the second plugin connects to
the first group host, then we should of course be using that process'es
PID to check if the group host is still running.
2020-05-22 22:50:29 +02:00
Robbert van der Helm ad6199949d Fix startup errors not being logged 2020-05-22 20:15:53 +02:00
Robbert van der Helm c5c1c334d9 Add group host support to the plugin
The difference between individual hosting and group hosting will have to
be encapsulated in a class to keep the rest of the plugin bridge clean.
2020-05-22 20:15:53 +02:00
Robbert van der Helm 903d977d83 Add a function for generating group host endpoints 2020-05-22 19:06:43 +02:00
Robbert van der Helm 615d23e525 Clean up new host process launching 2020-05-22 19:06:43 +02:00
Robbert van der Helm dd843519ce Rename PluginParameters to GroupReuqest 2020-05-22 19:06:43 +02:00
Robbert van der Helm 27af0f8c11 Search for the group host when using plugin groups 2020-05-22 19:06:43 +02:00
Robbert van der Helm fea256655d Move process launching to a function
Starting and connecting to plugin group host processes is not going to
work in the intializer list.
2020-05-22 19:06:43 +02:00
Robbert van der Helm 91b0ebf38b Remove mention of plugin groups flag
Since there's no reason for this to be behind a flag.
2020-05-21 17:15:24 +02:00
Robbert van der Helm 8eb01cb519 Listen on the group socket and handle requests 2020-05-20 18:45:33 +02:00
Robbert van der Helm 6d6d928838 Move all plugin group handling boilerplate 2020-05-19 15:29:48 +02:00
Robbert van der Helm daad6f2f00 Fix empty line spam in log file when Wine crashes 2020-05-19 12:27:32 +02:00
Robbert van der Helm 53acb1f78a Move wine-bridge.h -> bridges/vst2.h
This way we can structure the group handling and a potential future VST3
bridge in the same way.
2020-05-18 16:15:07 +02:00
Robbert van der Helm 994f3c9e38 Add a plugin group host application 2020-05-18 16:15:07 +02:00
Robbert van der Helm a849927a08 Move initialization message to a function
It was starting to get a bit unwieldy.
2020-05-17 14:43:21 +02:00
Robbert van der Helm d2cd608abb Print the configuration on startup 2020-05-17 14:43:21 +02:00
Robbert van der Helm 312200f100 Make the 'this_line_location' hack more reliable
It shouldn't be done if it's not needed.
2020-05-17 14:43:21 +02:00
Robbert van der Helm e76d4b474c Rearrange fields in PluginBridge 2020-05-16 14:46:48 +02:00
Robbert van der Helm a615a66cc5 Add the group configuration parser
As described in #15.
2020-05-15 16:35:18 +02:00
Robbert van der Helm f96c08775a Use Boost.Filesystem for the configuration
I'd much rather just use std::filesystem, but since all of
Boost.Process, Boost.DLL Boost.Asio uses its own filesystem library we
need to use it anyways.
2020-05-15 16:35:18 +02:00
Robbert van der Helm d9ff98de84 Move everything configuration related to plugin
If it's tied to the .so file rather than the .dll file it wouldn't make
any sense to use it directly from the Wine host.
2020-05-15 16:35:18 +02:00
Robbert van der Helm 9a82e82c87 Factor out directory finding from prefix detection
This will also be used to locate the `yabridge.tmol` configuration file.
2020-05-15 16:35:18 +02:00
Robbert van der Helm 37a74c8f98 Get rid of the dedicated AEffect socket 2020-05-13 13:15:52 +02:00
Robbert van der Helm 901d985080 Fix potential issue with plugins reporting size
I thought this was a problem for a plugin when it was not, but I can
still see this being a source of segfaults.
2020-05-11 22:54:42 +02:00
Robbert van der Helm 686ca11ba8 Work around improperly late initializing plugins
This fixes the Roland Cloud plugins.
2020-05-10 13:42:20 +02:00
Robbert van der Helm ba91971829 Simplify object reading
No longer needs to read into an existing object after the last change,
and reusing that function here too makes it less error prone.
2020-05-10 13:10:58 +02:00
Robbert van der Helm ded12379f9 Fix typo 2020-05-10 00:48:45 +02:00
Robbert van der Helm 54295f3a27 Fix shutdown cleanup issue for Ardour and Mixbus
Instead of just detaching the threads, it's much better to terminate the
Wine process and let the threads terminate themselves.

This fixes #11 on my machine.
2020-05-09 21:31:57 +02:00
Robbert van der Helm 484032202a Stop accepting sockets if Wine crashes on startup 2020-05-09 16:31:11 +02:00
Robbert van der Helm 9c19a1d01c Move plugin bridge helper functions to utils.h 2020-05-09 15:18:32 +02:00
Robbert van der Helm d173ab9123 Clean up main plugin entry point 2020-05-09 13:57:54 +02:00