From 3dd58597998edddfbdc35967931fa04e8213e728 Mon Sep 17 00:00:00 2001 From: Robbert van der Helm Date: Sun, 26 Sep 2021 18:20:20 +0200 Subject: [PATCH] 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. --- CHANGELOG.md | 2 ++ src/wine-host/group-host.cpp | 15 +++++++++------ src/wine-host/individual-host.cpp | 14 +++++++++----- 3 files changed, 20 insertions(+), 11 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 79b4df57..95cdcf7c 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -35,6 +35,8 @@ Versioning](https://semver.org/spec/v2.0.0.html). ### Changed +- The Wine plugin host applications now print their version information before + the `Usage: ` string when invoked without command line argument. - VST3 Data (SysEx) events now use the same small buffer optimization we use for VST2 SysEx events. This avoids allocations when a VST3 plugin sends or receives a SysEx event. diff --git a/src/wine-host/group-host.cpp b/src/wine-host/group-host.cpp index 566dfb17..463595f4 100644 --- a/src/wine-host/group-host.cpp +++ b/src/wine-host/group-host.cpp @@ -24,6 +24,13 @@ #include "bridges/group.h" #include "bridges/vst2.h" +static const std::string host_name = "yabridge group host version " + + std::string(yabridge_git_version) +#ifdef __i386__ + + " (32-bit compatibility mode)" +#endif + ; + /** * This works very similar to the host application defined in * `individual-host.cpp`, but instead of just loading a single plugin this will @@ -43,6 +50,7 @@ __cdecl // domain socket endpoint path that it should listen on to allow yabridge // instances to spawn plugins in this process. if (argc < 2) { + std::cerr << host_name << std::endl; std::cerr << "Usage: " #ifdef __i386__ << yabridge_group_host_name_32bit @@ -56,12 +64,7 @@ __cdecl const std::string group_socket_endpoint_path(argv[1]); - std::cerr << "Initializing yabridge group host version " - << yabridge_git_version -#ifdef __i386__ - << " (32-bit compatibility mode)" -#endif - << std::endl; + std::cerr << "Initializing " << host_name << std::endl; // NOTE: Some plugins use Microsoft COM, but don't initialize it first and // just pray the host does it for them. Examples of this are diff --git a/src/wine-host/individual-host.cpp b/src/wine-host/individual-host.cpp index 9c6d312a..c852a809 100644 --- a/src/wine-host/individual-host.cpp +++ b/src/wine-host/individual-host.cpp @@ -27,6 +27,13 @@ #include "bridges/vst3.h" #endif +static const std::string host_name = "yabridge host version " + + std::string(yabridge_git_version) +#ifdef __i386__ + + " (32-bit compatibility mode)" +#endif + ; + /** * This is the default plugin host application. It will load the specified * plugin plugin, and then connect back to the `libyabridge-{vst2,vst3}.so` @@ -42,6 +49,7 @@ __cdecl // to connect to and the process ID of the process the native plugin is // being hosted in as arguments for yabridge-host.exe if (argc < 5) { + std::cerr << host_name << std::endl; std::cerr << "Usage: " #ifdef __i386__ << yabridge_individual_host_name_32bit @@ -61,11 +69,7 @@ __cdecl const std::string socket_endpoint_path(argv[3]); const pid_t parent_pid = std::stoi(argv[4]); - std::cerr << "Initializing yabridge host version " << yabridge_git_version -#ifdef __i386__ - << " (32-bit compatibility mode)" -#endif - << std::endl; + std::cerr << "Initializing " << host_name << std::endl; std::cerr << "Preparing to load " << plugin_type_to_string(plugin_type) << " plugin at '" << plugin_location << "'" << std::endl;