From 3e923470576d2867062d2b62291064cccc4dfe0f Mon Sep 17 00:00:00 2001 From: Robin Gareus Date: Sun, 12 Mar 2017 01:24:40 +0100 Subject: Prepare for graceful case-by-case fallback of VST Bypass VST's effSetBypass may fail even though a plugin CanDo "bypass", and it can be case-by-case (depending on plugin-settings). This codepath is not yet active, pending testing. --- libs/ardour/plugin_insert.cc | 22 +++++++++++++++++++++- 1 file changed, 21 insertions(+), 1 deletion(-) (limited to 'libs/ardour/plugin_insert.cc') diff --git a/libs/ardour/plugin_insert.cc b/libs/ardour/plugin_insert.cc index 8e3e138201..25b0e7e46a 100644 --- a/libs/ardour/plugin_insert.cc +++ b/libs/ardour/plugin_insert.cc @@ -633,7 +633,27 @@ PluginInsert::enable (bool yn) activate (); } boost::shared_ptr ac = automation_control (Evoral::Parameter (PluginAutomation, 0, _bypass_port)); - ac->set_value (yn ? 1.0 : 0.0, Controllable::NoGroup); + const double val = yn ? 1.0 : 0.0; + ac->set_value (val, Controllable::NoGroup); + +#ifdef ALLOW_VST_BYPASS_TO_FAIL // yet unused, see also vst_plugin.cc + /* special case VST.. bypass may fail */ + if (_bypass_port == UINT32_MAX - 1) { + /* check if bypass worked */ + if (ac->get_value () != val) { + warning << _("PluginInsert: VST Bypass failed, falling back to host bypass.") << endmsg; + // set plugin to enabled (not-byassed) + ac->set_value (1.0, Controllable::NoGroup); + // ..and use host-provided hard-bypass + if (yn) { + activate (); + } else { + deactivate (); + } + return; + } + } +#endif ActiveChanged (); } } -- cgit v1.2.3