From f845763af09c1e121f48f855f55e6acf5313fd9b Mon Sep 17 00:00:00 2001 From: Robbert van der Helm Date: Thu, 3 Dec 2020 12:08:24 +0100 Subject: [PATCH] Print the plugin type during initialisation --- src/plugin/bridges/vst2.cpp | 7 ++++--- src/plugin/bridges/vst2.h | 6 ++++++ 2 files changed, 10 insertions(+), 3 deletions(-) diff --git a/src/plugin/bridges/vst2.cpp b/src/plugin/bridges/vst2.cpp index 4bc237f4..c716d8ed 100644 --- a/src/plugin/bridges/vst2.cpp +++ b/src/plugin/bridges/vst2.cpp @@ -66,7 +66,7 @@ Vst2PluginBridge::Vst2PluginBridge(audioMasterCallback host_callback) ? std::unique_ptr(std::make_unique( io_context, logger, - HostRequest{.plugin_type = PluginType::vst2, + HostRequest{.plugin_type = plugin_type, .plugin_path = vst_plugin_path.string(), .endpoint_base_dir = sockets.base_dir.string()}, sockets, @@ -75,7 +75,7 @@ Vst2PluginBridge::Vst2PluginBridge(audioMasterCallback host_callback) io_context, logger, HostRequest{ - .plugin_type = PluginType::vst2, + .plugin_type = plugin_type, .plugin_path = vst_plugin_path.string(), .endpoint_base_dir = sockets.base_dir.string()}))), has_realtime_priority(set_realtime_priority()), @@ -622,13 +622,14 @@ void Vst2PluginBridge::set_parameter(AEffect* /*plugin*/, void Vst2PluginBridge::log_init_message() { std::stringstream init_msg; - // TODO: This should also list the plugin type init_msg << "Initializing yabridge version " << yabridge_git_version << std::endl; init_msg << "host: '" << vst_host->path().string() << "'" << std::endl; init_msg << "plugin: '" << vst_plugin_path.string() << "'" << std::endl; + init_msg << "plugin type: '" << plugin_type_to_string(plugin_type) << "'" + << std::endl; init_msg << "realtime: '" << (has_realtime_priority ? "yes" : "no") << "'" << std::endl; init_msg << "sockets: '" << sockets.base_dir.string() << "'" diff --git a/src/plugin/bridges/vst2.h b/src/plugin/bridges/vst2.h index 967cd7a7..6a2fcd1a 100644 --- a/src/plugin/bridges/vst2.h +++ b/src/plugin/bridges/vst2.h @@ -50,6 +50,12 @@ class Vst2PluginBridge { */ Vst2PluginBridge(audioMasterCallback host_callback); + /** + * The type of the plugin we're dealing with. Passed to the host process and + * printed in the initialisation message. + */ + static constexpr PluginType plugin_type = PluginType::vst2; + // The four below functions are the handlers from the VST2 API. They are // called through proxy functions in `plugin.cpp`.