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.
This commit is contained in:
Robbert van der Helm
2022-04-16 23:26:24 +02:00
parent 4d9e865dd3
commit b3efcf4e06
14 changed files with 54 additions and 390 deletions
+4 -6
View File
@@ -110,8 +110,7 @@ IndividualHost::IndividualHost(asio::io_context& io_context,
: HostProcess(io_context, sockets),
plugin_info_(plugin_info),
host_path_(find_vst_host(plugin_info.native_library_path_,
plugin_info.plugin_arch_,
false)),
plugin_info.plugin_arch_)),
handle_(launch_host(
host_path_,
{
@@ -172,8 +171,7 @@ GroupHost::GroupHost(asio::io_context& io_context,
: HostProcess(io_context, sockets),
plugin_info_(plugin_info),
host_path_(find_vst_host(plugin_info.native_library_path_,
plugin_info.plugin_arch_,
true)) {
plugin_info.plugin_arch_)) {
// When using plugin groups, we'll first try to connect to an existing group
// host process and ask it to host our plugin. If no such process exists,
// then we'll start a new process. In the event that multiple yabridge
@@ -205,8 +203,8 @@ GroupHost::GroupHost(asio::io_context& io_context,
// because it should run independently of this yabridge instance as
// it will likely outlive it.
Process::Handle group_host =
launch_host(host_path_, {group_socket_path.string()}, logger,
config, plugin_info);
launch_host(host_path_, {"group", group_socket_path.string()},
logger, config, plugin_info);
group_host.detach();
group_host_connect_handler_ =
+3 -6
View File
@@ -304,13 +304,10 @@ std::string create_logger_prefix(const fs::path& endpoint_base_dir) {
}
fs::path find_vst_host(const ghc::filesystem::path& this_plugin_path,
LibArchitecture plugin_arch,
bool use_plugin_groups) {
auto host_name = use_plugin_groups ? yabridge_group_host_name
: yabridge_individual_host_name;
LibArchitecture plugin_arch) {
auto host_name = yabridge_host_name;
if (plugin_arch == LibArchitecture::dll_32) {
host_name = use_plugin_groups ? yabridge_group_host_name_32bit
: yabridge_individual_host_name_32bit;
host_name = yabridge_host_name_32bit;
}
// If our `.so` file is a symlink, then search for the host in the directory
+2 -5
View File
@@ -181,7 +181,7 @@ std::string create_logger_prefix(
const ghc::filesystem::path& endpoint_base_dir);
/**
* Finds the Wine VST host (either `yabridge-host.exe` or `yabridge-host.exe`
* Finds the Wine VST host (either `yabridge-host.exe` or `yabridge-host-32.exe`
* depending on the plugin). For this we will search in two places:
*
* 1. Alongside libyabridge-{vst2,vst3}.so if the file got symlinked. This is
@@ -195,16 +195,13 @@ std::string create_logger_prefix(
* from.
* @param plugin_arch The architecture of the plugin, either 64-bit or 32-bit.
* Used to determine which host application to use, if available.
* @param use_plugin_groups Whether the plugin is using plugin groups and we
* should be looking for the group host instead of the individual plugin host.
*
* @return The a path to the VST host, if found.
* @throw std::runtime_error If the Wine VST host could not be found.
*/
ghc::filesystem::path find_vst_host(
const ghc::filesystem::path& this_plugin_path,
LibArchitecture plugin_arch,
bool use_plugin_groups);
LibArchitecture plugin_arch);
/**
* Generate the group socket endpoint name used based on the name of the group,