diff options
author | Robin Gareus <robin@gareus.org> | 2019-11-07 04:21:21 +0100 |
---|---|---|
committer | Robin Gareus <robin@gareus.org> | 2020-04-16 16:47:13 +0200 |
commit | bb62f7eaecebe078533eea2b53ec65ad509f74b2 (patch) | |
tree | 8e281c9b460da60333b0ec0d22793aa1f1629b0e /libs/ardour/plugin_insert.cc | |
parent | 2d4e125802039a824dc6d295d76fe0e558b3960e (diff) |
Plugin: bypass <> enabled mapping
LV2 uses "enabled": -1: inactive, 0: bypassed, 1:enabled
VST3 has "bypass: 0:active, 1: bypassed
Diffstat (limited to 'libs/ardour/plugin_insert.cc')
-rw-r--r-- | libs/ardour/plugin_insert.cc | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/libs/ardour/plugin_insert.cc b/libs/ardour/plugin_insert.cc index 430fc181aa..556a5f6cee 100644 --- a/libs/ardour/plugin_insert.cc +++ b/libs/ardour/plugin_insert.cc @@ -88,6 +88,7 @@ PluginInsert::PluginInsert (Session& s, boost::shared_ptr<Plugin> plug) , _maps_from_state (false) , _latency_changed (false) , _bypass_port (UINT32_MAX) + , _inverted_bypass_enable (false) , _stat_reset (0) { /* the first is the master */ @@ -716,7 +717,7 @@ PluginInsert::enable (bool yn) activate (); } boost::shared_ptr<AutomationControl> ac = automation_control (Evoral::Parameter (PluginAutomation, 0, _bypass_port)); - const double val = yn ? 1.0 : 0.0; + const double val = yn ^ _inverted_bypass_enable ? 1.0 : 0.0; ac->set_value (val, Controllable::NoGroup); #ifdef ALLOW_VST_BYPASS_TO_FAIL // yet unused, see also vst_plugin.cc @@ -748,7 +749,7 @@ PluginInsert::enabled () const return Processor::enabled (); } else { boost::shared_ptr<const AutomationControl> ac = boost::const_pointer_cast<AutomationControl> (automation_control (Evoral::Parameter (PluginAutomation, 0, _bypass_port))); - return (ac->get_value () > 0 && _pending_active); + return ((ac->get_value () > 0) ^ _inverted_bypass_enable) && _pending_active; } } |