+ save_button.signal_clicked().connect(sigc::mem_fun(*this, &PlugUIBase::save_plugin_setting));
+
+ delete_button.set_name ("PluginDeleteButton");
+ delete_button.signal_clicked().connect (sigc::mem_fun (*this, &PlugUIBase::delete_plugin_setting));
+
+ insert->ActiveChanged.connect (active_connection, invalidator (*this), boost::bind (&PlugUIBase::processor_active_changed, this, boost::weak_ptr<Processor>(insert)), gui_context());
+
+ bypass_button.set_name ("plugin bypass button");
+ bypass_button.set_text (_("Bypass"));
+ bypass_button.set_active (!pi->active());
+ bypass_button.signal_button_release_event().connect (sigc::mem_fun(*this, &PlugUIBase::bypass_button_release));
+ focus_button.add_events (Gdk::ENTER_NOTIFY_MASK|Gdk::LEAVE_NOTIFY_MASK);
+
+ focus_button.signal_button_release_event().connect (sigc::mem_fun(*this, &PlugUIBase::focus_toggled));
+ focus_button.add_events (Gdk::ENTER_NOTIFY_MASK|Gdk::LEAVE_NOTIFY_MASK);
+
+ /* these images are not managed, so that we can remove them at will */
+
+ focus_out_image = new Image (get_icon (X_("computer_keyboard")));
+ focus_in_image = new Image (get_icon (X_("computer_keyboard_active")));
+
+ focus_button.add (*focus_out_image);
+
+ ARDOUR_UI::instance()->set_tip (focus_button, string_compose (_("Click to allow the plugin to receive keyboard events that %1 would normally use as a shortcut"), PROGRAM_NAME));
+ ARDOUR_UI::instance()->set_tip (bypass_button, _("Click to enable/disable this plugin"));
+
+ description_expander.property_expanded().signal_changed().connect( sigc::mem_fun(*this, &PlugUIBase::toggle_description));
+ description_expander.set_expanded(false);
+
+ plugin_analysis_expander.property_expanded().signal_changed().connect( sigc::mem_fun(*this, &PlugUIBase::toggle_plugin_analysis));
+ plugin_analysis_expander.set_expanded(false);
+
+ insert->DropReferences.connect (death_connection, invalidator (*this), boost::bind (&PlugUIBase::plugin_going_away, this), gui_context());
+
+ plugin->PresetAdded.connect (*this, invalidator (*this), boost::bind (&PlugUIBase::preset_added_or_removed, this), gui_context ());
+ plugin->PresetRemoved.connect (*this, invalidator (*this), boost::bind (&PlugUIBase::preset_added_or_removed, this), gui_context ());
+ plugin->PresetLoaded.connect (*this, invalidator (*this), boost::bind (&PlugUIBase::update_preset, this), gui_context ());
+ plugin->ParameterChanged.connect (*this, invalidator (*this), boost::bind (&PlugUIBase::parameter_changed, this, _1, _2), gui_context ());
+}
+
+PlugUIBase::~PlugUIBase()
+{
+ delete eqgui;
+ delete latency_gui;
+}
+
+void
+PlugUIBase::plugin_going_away ()
+{
+ /* drop references to the plugin/insert */
+ insert.reset ();
+ plugin.reset ();
+}
+
+void
+PlugUIBase::set_latency_label ()
+{
+ framecnt_t const l = insert->effective_latency ();
+ framecnt_t const sr = insert->session().frame_rate ();
+
+ string t;