summaryrefslogtreecommitdiff
path: root/libs
diff options
context:
space:
mode:
authorRobin Gareus <robin@gareus.org>2019-11-07 04:21:21 +0100
committerRobin Gareus <robin@gareus.org>2020-04-16 16:47:13 +0200
commitbb62f7eaecebe078533eea2b53ec65ad509f74b2 (patch)
tree8e281c9b460da60333b0ec0d22793aa1f1629b0e /libs
parent2d4e125802039a824dc6d295d76fe0e558b3960e (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')
-rw-r--r--libs/ardour/ardour/plugin_insert.h1
-rw-r--r--libs/ardour/plugin_insert.cc5
2 files changed, 4 insertions, 2 deletions
diff --git a/libs/ardour/ardour/plugin_insert.h b/libs/ardour/ardour/plugin_insert.h
index 3beaef9a15..5c7f9b724e 100644
--- a/libs/ardour/ardour/plugin_insert.h
+++ b/libs/ardour/ardour/plugin_insert.h
@@ -426,6 +426,7 @@ private:
void latency_changed ();
bool _latency_changed;
uint32_t _bypass_port;
+ bool _inverted_bypass_enable;
typedef std::map<uint32_t, boost::shared_ptr<ReadOnlyControl> >CtrlOutMap;
CtrlOutMap _control_outputs;
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;
}
}