Add option to work around bugs in REAPER/Renoise

This is not ideal since it requires the user to know about this option
and to create a config file, but I think it's the best we can do without
compromising on yabridge's transparency and 'zero hacks' philosophy.

See #29 and #32.
This commit is contained in:
Robbert van der Helm
2020-08-17 15:49:16 +02:00
parent ebe1a9c649
commit b452f961db
6 changed files with 87 additions and 16 deletions
+3
View File
@@ -51,6 +51,9 @@ Configuration::Configuration(const fs::path& config_path,
if (toml::table* config = value.as_table()) {
editor_double_embed =
(*config)["editor_double_embed"].value<bool>().value_or(false);
hack_reaper_update_display =
(*config)["hack_reaper_update_display"].value<bool>().value_or(
false);
group = (*config)["group"].value<std::string>();
}
+9
View File
@@ -87,6 +87,14 @@ class Configuration {
*/
bool editor_double_embed = false;
/**
* If this is set to true, then any calls to `audioMasterUpdateDisplay()`
* will automatically return 0 without being sent to the host. This is a
* HACK to work around implementations issues in REAPER and Renoise, see #29
* and #32.
*/
bool hack_reaper_update_display = false;
/**
* The name of the plugin group that should be used for the plugin this
* configuration object was created for. If not set, then the plugin should
@@ -107,6 +115,7 @@ class Configuration {
template <typename S>
void serialize(S& s) {
s.value1b(editor_double_embed);
s.value1b(hack_reaper_update_display);
s.ext(group, bitsery::ext::StdOptional(),
[](S& s, auto& v) { s.text1b(v, 4096); });
s.ext(matched_file, bitsery::ext::StdOptional(),
+10 -1
View File
@@ -625,6 +625,7 @@ void PluginBridge::log_init_message() {
init_msg << "config from: '"
<< config.matched_file.value_or("<defaults>").string() << "'"
<< std::endl;
init_msg << "hosting mode: '";
if (config.group) {
init_msg << "plugin group \"" << *config.group << "\"";
@@ -637,10 +638,18 @@ void PluginBridge::log_init_message() {
init_msg << ", 64-bit";
}
init_msg << "'" << std::endl;
bool other_options_set = false;
init_msg << "other options: '";
if (config.editor_double_embed) {
init_msg << "editor: double embed";
} else {
other_options_set = true;
}
if (config.hack_reaper_update_display) {
init_msg << "hack: REAPER 'audioMasterUpdateDisplay' workaround";
other_options_set = true;
}
if (!other_options_set) {
init_msg << "<none>";
}
init_msg << "'" << std::endl;
+10
View File
@@ -523,6 +523,16 @@ intptr_t Vst2Bridge::host_callback(AEffect* effect,
intptr_t value,
void* data,
float option) {
// HACK: Sadly this is needed to work around a timing issue with REAPER and
// Renoise. See #29 and #32.
// TODO: We don't have access to the verbosity level here, but it would be
// nice to log that this is being skipped when `YABRIDGE_DEBUG_LEVEL
// >= 2`.
if (config.hack_reaper_update_display &&
opcode == audioMasterUpdateDisplay) {
return 0;
}
HostCallbackDataConverter converter(effect, time_info);
return send_event(vst_host_callback, host_callback_mutex, converter,
std::nullopt, opcode, index, value, data, option);