+void
+PluginInsert::enable (bool yn)
+{
+ if (_bypass_port == UINT32_MAX) {
+ if (yn) {
+ activate ();
+ } else {
+ deactivate ();
+ }
+ } else {
+ if (!_pending_active) {
+ activate ();
+ }
+ boost::shared_ptr<AutomationControl> ac = automation_control (Evoral::Parameter (PluginAutomation, 0, _bypass_port));
+ ac->set_value (yn ? 1.0 : 0.0, Controllable::NoGroup);
+ ActiveChanged ();
+ }
+}
+
+bool
+PluginInsert::enabled () const
+{
+ if (_bypass_port == UINT32_MAX) {
+ 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);
+ }
+}
+
+bool
+PluginInsert::bypassable () const
+{
+ if (_bypass_port == UINT32_MAX) {
+ return true;
+ } else {
+ boost::shared_ptr<const AutomationControl> ac = boost::const_pointer_cast<AutomationControl> (automation_control (Evoral::Parameter (PluginAutomation, 0, _bypass_port)));
+
+ return !ac->automation_playback ();
+ }
+}
+
+void
+PluginInsert::enable_changed ()
+{
+ ActiveChanged ();
+}
+
+void
+PluginInsert::bypassable_changed ()
+{
+ BypassableChanged ();
+}
+