Allow hiding the DAW name for VST2 plugins

This can be useful when plugins have (broken) host-specific behaviour
that you want to avoid. I'll later add a list of host/plugin
combinations where this may be useful to the readme.
This commit is contained in:
Robbert van der Helm
2021-04-27 18:41:24 +02:00
parent 38abdbee50
commit 3a73fb9689
7 changed files with 93 additions and 11 deletions
+3
View File
@@ -193,6 +193,9 @@ class PluginBridge {
<< *config.frame_rate << " fps";
other_options.push_back(option.str());
}
if (config.hide_daw) {
other_options.push_back("hack: hide DAW name");
}
if (config.vst3_no_scaling) {
other_options.push_back("vst3: no GUI scaling");
}
+44 -11
View File
@@ -90,11 +90,10 @@ Vst2PluginBridge::Vst2PluginBridge(audioMasterCallback host_callback)
incoming_midi_events.push_back(
std::get<DynamicVstEvents>(event.payload));
EventResult response{.return_value = 1,
.payload = nullptr,
.value_payload = std::nullopt};
return response;
return EventResult{.return_value = 1,
.payload = nullptr,
.value_payload = std::nullopt};
} break;
// REAPER requires that `audioMasterSizeWindow()` calls are
// handled from the GUI thread, which is the thread that
@@ -105,16 +104,50 @@ Vst2PluginBridge::Vst2PluginBridge(audioMasterCallback host_callback)
std::lock_guard lock(incoming_resize_mutex);
incoming_resize = std::pair(event.index, event.value);
EventResult response{.return_value = 1,
.payload = nullptr,
.value_payload = std::nullopt};
return response;
return EventResult{.return_value = 1,
.payload = nullptr,
.value_payload = std::nullopt};
} break;
// HACK: Certain plugins may have undesirable DAW-specific
// behaviour. Chromaphone 3 for instance has broken
// text input dialogs when using Bitwig. We can work
// around these issues by reporting we're running
// under some other host. We need to do this on the
// plugin side instead of one the Wine side because
// the plugin will likely do this callback during
// initialization, and at that point we will not yet
// have sent the configuration to the plugin.
case audioMasterGetProductString: {
if (config.hide_daw) {
logger.log("The plugin asked for the host's name.");
logger.log("Reporting \"" +
std::string(product_name_override) +
"\" instead of the actual host's name.");
return EventResult{.return_value = 1,
.payload = product_name_override,
.value_payload = std::nullopt};
}
} break;
case audioMasterGetVendorString: {
if (config.hide_daw) {
logger.log(
"The plugin asked for the host's vendor.");
logger.log(
"Reporting \"" +
std::string(vendor_name_override) +
"\" instead of the actual host's vendor.");
return EventResult{.return_value = 1,
.payload = vendor_name_override,
.value_payload = std::nullopt};
}
} break;
default:
return passthrough_event(&plugin,
host_callback_function, event);
}
return passthrough_event(&plugin, host_callback_function,
event);
});
});